dnshandler.h File Reference
`#include "config.h"`
`#include <stdint.h>`
`#include "status.h"`
`#include "locks.h"`
`#include "wire/listener.h"`
`#include "wire/netio.h"`
`#include "wire/query.h"`
`#include "wire/sock.h"`

Go to the source code of this file.

## Data Structures

struct | dnshandler_struct

## Macros

#define | ODS_SE_NOTIFY_CMD "NOTIFY"
#define | ODS_SE_MAX_HANDLERS 5

## Typedefs

typedef struct dnshandler_struct | dnshandler_type

## Functions

dnshandler_type * | dnshandler_create (listener_type *interfaces)
ods_status | dnshandler_listen (dnshandler_type *dnshandler)
void | dnshandler_start (dnshandler_type *dnshandler)
void | dnshandler_signal (dnshandler_type *dnshandler)
void | dnshandler_fwd_notify (dnshandler_type *dnshandler, uint8_t *pkt, size_t len)
void | dnshandler_cleanup (dnshandler_type *dnshandler)

## Macro Definition Documentation

## ODS_SE_MAX_HANDLERS

#define ODS_SE_MAX_HANDLERS 5

Definition at line 49 of file dnshandler.h.

## ODS_SE_NOTIFY_CMD

#define ODS_SE_NOTIFY_CMD "NOTIFY"

Definition at line 48 of file dnshandler.h.

## Typedef Documentation

## dnshandler_type

typedef struct dnshandler_struct dnshandler_type

DNS handler.

Definition at line 38 of file dnshandler.h.

## Function Documentation

## dnshandler_cleanup()

void dnshandler_cleanup | ( | dnshandler_type * | dnshandler | ) |

Cleanup dns handler.

Parameters

  [in] | dnshandler_type* | dns handler

Cleanup dns handler.

Definition at line 277 of file dnshandler.c.

References sock_struct::addr, listener_struct::count, dnshandler_struct::interfaces, dnshandler_struct::netio, netio_cleanup(), dnshandler_struct::query, query_cleanup(), sock_struct::s, dnshandler_struct::socklist, socklist_struct::tcp, dnshandler_struct::tcp_accept_handlers, socklist_struct::udp, and netio_handler_struct::user_data.

Referenced by engine_cleanup().

## dnshandler_create()

dnshandler_type* dnshandler_create | ( | listener_type * | interfaces | ) |

Create dns handler.

Parameters

  [in] | allocator | memory allocator
  [in] | interfaces | list of interfaces

Returns
  dnshandler_type* created dns handler

Create dns handler.

Definition at line 51 of file dnshandler.c.

References listener_struct::count.

## dnshandler_fwd_notify()

void dnshandler_fwd_notify | ( | dnshandler_type * | dnshandler,
|  | uint8_t * | pkt,
|  | size_t | len
| ) |  |

Forward notify to zone transfer handler.

Parameters

  [in] | dnshandler_type* | dns handler
  [in] | pkt | notify packet
  [in] | len | packet length

Forward notify to zone transfer handler.

Definition at line 231 of file dnshandler.c.

References netio_handler_struct::fd, and dnshandler_struct::xfrhandler.

## dnshandler_listen()

ods_status dnshandler_listen | ( | dnshandler_type * | dnshandler | ) |

Start dns handler listener.

Parameters

  [in] | dnshandler_type* | dns handler

Returns
  ods_status status

Start dns handler listener.

Definition at line 106 of file dnshandler.c.

References dnshandler_struct::interfaces, sock_listen(), and dnshandler_struct::socklist.

## dnshandler_signal()

void dnshandler_signal | ( | dnshandler_type * | dnshandler | ) |

Signal dns handler.

Parameters

  [in] | dnshandler_type* | dns handler

Signal dns handler.

Definition at line 218 of file dnshandler.c.

References dnshandler_struct::thread_id.

## dnshandler_start()

void dnshandler_start | ( | dnshandler_type * | dnshandler | ) |

Start dns handler.

Parameters

  [in] | dnshandler_type* | dns handler

Start dns handler.

Definition at line 125 of file dnshandler.c.