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.

Referenced by engine_update_zones(), and tools_output().

## 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 | ) |

extern

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 dnshandler_create(), and engine_cleanup().

## dnshandler_create()

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

extern

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_cleanup(), dnshandler_struct::engine, netio_handler_struct::event_handler, netio_handler_struct::event_types, netio_handler_struct::fd, dnshandler_struct::interfaces, dnshandler_struct::need_to_exit, dnshandler_struct::netio, netio_create(), NETIO_EVENT_READ, dnshandler_struct::query, query_create(), dnshandler_struct::socklist, dnshandler_struct::tcp_accept_handlers, netio_handler_struct::timeout, netio_handler_struct::user_data, and dnshandler_struct::xfrhandler.

## dnshandler_fwd_notify()

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

extern

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.

Referenced by engine_update_zones(), and tools_output().

## dnshandler_listen()

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

extern

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(), dnshandler_struct::socklist, and dnshandler_struct::thread_id.

## dnshandler_signal()

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

extern

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 | ) |

extern

Start dns handler.

Parameters

  [in] | dnshandler_type* | dns handler

Start dns handler.

Definition at line 125 of file dnshandler.c.

References listener_struct::count, dnshandler_struct::engine, tcp_accept_data::engine, udp_data::engine, netio_handler_struct::event_handler, netio_handler_struct::event_types, netio_handler_struct::fd, netio_handler_struct::free_handler, dnshandler_struct::interfaces, dnshandler_struct::need_to_exit, dnshandler_struct::netio, netio_add_handler(), netio_dispatch(), NETIO_EVENT_READ, dnshandler_struct::query, udp_data::query, sock_struct::s, sock_handle_tcp_accept(), sock_handle_udp(), tcp_accept_data::socket, udp_data::socket, dnshandler_struct::socklist, socklist_struct::tcp, tcp_accept_data::tcp_accept_handler_count, dnshandler_struct::tcp_accept_handlers, tcp_accept_data::tcp_accept_handlers, dnshandler_struct::thread_id, netio_handler_struct::timeout, socklist_struct::udp, and netio_handler_struct::user_data.