listener.h File Reference
`#include "config.h"`
`#include "status.h"`
`#include <arpa/inet.h>`
`#include <netdb.h>`
`#include <netinet/in.h>`
`#include <stdio.h>`
`#include <stdint.h>`
`#include <string.h>`
`#include <sys/time.h>`
`#include <sys/types.h>`
`#include <sys/param.h>`
`#include <sys/select.h>`
`#include <sys/socket.h>`
`#include <unistd.h>`

Go to the source code of this file.

## Data Structures

union | acl_addr_storage
struct | interface_struct
struct | listener_struct

## Macros

#define | DNS_PORT_STRING "53"
#define | INBUF_SIZE 4096 /* max size for incoming queries */
#define | MAX_INTERFACES 32

## Typedefs

typedef struct interface_struct | interface_type
typedef struct listener_struct | listener_type

## Functions

listener_type * | listener_create (void)
interface_type * | listener_push (listener_type *list, char *address, int family, const char *port)
void | interface_cleanup (interface_type *i)
void | listener_cleanup (listener_type *listener)

## Macro Definition Documentation

## DNS_PORT_STRING

#define DNS_PORT_STRING "53"

Listener.

Definition at line 51 of file listener.h.

Referenced by sock_listen(), and xfrd_acl_sockaddr_to().

## INBUF_SIZE

#define INBUF_SIZE 4096 /* max size for incoming queries */

Definition at line 52 of file listener.h.

## MAX_INTERFACES

#define MAX_INTERFACES 32

Definition at line 53 of file listener.h.

Referenced by sock_listen().

## Typedef Documentation

## interface_type

typedef struct interface_struct interface_type

Interface.

Definition at line 68 of file listener.h.

## listener_type

typedef struct listener_struct listener_type

Listener.

Definition at line 80 of file listener.h.

## Function Documentation

## interface_cleanup()

void interface_cleanup | ( | interface_type * | i | ) |

Clean up interface.

Parameters

  [in] | i | interface

Clean up interface.

Definition at line 111 of file listener.c.

References interface_struct::address, and interface_struct::port.

Referenced by listener_cleanup().

## listener_cleanup()

void listener_cleanup | ( | listener_type * | listener | ) |

Clean up listener.

Parameters

  [in] | listener | listener to clean up

Clean up listener.

Definition at line 126 of file listener.c.

References listener_struct::count, interface_cleanup(), and listener_struct::interfaces.

Referenced by engine_config_cleanup().

## listener_create()

listener_type* listener_create | ( | void |  | ) |

Create listener.

Parameters

  [in] | allocator | memory allocator

Returns
  listener_type* listener

Create listener.

Definition at line 45 of file listener.c.

References listener_struct::count, and listener_struct::interfaces.

## listener_push()

interface_type* listener_push | ( | listener_type * | listener,
|  | char * | address,
|  | int | family,
|  | const char * | port
| ) |  |

Push an interface to the listener.

Parameters

  [in] | listener | listener
  [in] | address | IP address
  [in] | family | address family
  [in] | port | port or NULL

Returns
  interface_type* added interface

Push an interface to the listener.

Definition at line 60 of file listener.c.

References interface_struct::addr, acl_addr_storage::addr6, interface_struct::address, listener_struct::count, interface_struct::family, listener_struct::interfaces, and interface_struct::port.