Electroneum
Loading...
Searching...
No Matches
listen_dnsport.h
Go to the documentation of this file.
1/*
2 * services/listen_dnsport.h - listen on port 53 for incoming DNS queries.
3 *
4 * Copyright (c) 2007, NLnet Labs. All rights reserved.
5 *
6 * This software is open source.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 *
19 * Neither the name of the NLNET LABS nor the names of its contributors may
20 * be used to endorse or promote products derived from this software without
21 * specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
29 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 */
35
41
42#ifndef LISTEN_DNSPORT_H
43#define LISTEN_DNSPORT_H
44
45#include "util/netevent.h"
46struct listen_list;
47struct config_file;
48struct addrinfo;
49struct sldns_buffer;
50
57 struct comm_base* base;
58
62#ifdef USE_DNSCRYPT
63 struct sldns_buffer* dnscrypt_udp_buff;
64#endif
67};
68
76 struct comm_point* com;
77};
78
99
108 int fd;
111};
112
125 int* reuseport);
126
131
148 struct listen_port* ports, size_t bufsize, int tcp_accept_count,
149 void* sslctx, struct dt_env *dtenv, comm_point_callback_type* cb,
150 void* cb_arg);
151
156void listen_delete(struct listen_dnsport* listen);
157
164
170size_t listen_get_mem(struct listen_dnsport* listen);
171
177
183
206int create_udp_sock(int family, int socktype, struct sockaddr* addr,
207 socklen_t addrlen, int v6only, int* inuse, int* noproto, int rcv,
208 int snd, int listen, int* reuseport, int transparent, int freebind, int use_systemd);
209
223int create_tcp_accept_sock(struct addrinfo *addr, int v6only, int* noproto,
224 int* reuseport, int transparent, int mss, int freebind, int use_systemd);
225
234int create_local_accept_sock(const char* path, int* noproto, int use_systemd);
235
236#endif /* LISTEN_DNSPORT_H */
void listen_stop_accept(struct listen_dnsport *listen)
int create_udp_sock(int family, int socktype, struct sockaddr *addr, socklen_t addrlen, int v6only, int *inuse, int *noproto, int rcv, int snd, int listen, int *reuseport, int transparent, int freebind, int use_systemd)
listen_type
@ listen_type_tcp_dnscrypt
@ listen_type_udpancil
@ listen_type_udpancil_dnscrypt
@ listen_type_udp
@ listen_type_udp_dnscrypt
@ listen_type_tcp
@ listen_type_ssl
void listen_start_accept(struct listen_dnsport *listen)
void listen_list_delete(struct listen_list *list)
void listen_delete(struct listen_dnsport *listen)
void listening_ports_free(struct listen_port *list)
int create_tcp_accept_sock(struct addrinfo *addr, int v6only, int *noproto, int *reuseport, int transparent, int mss, int freebind, int use_systemd)
struct listen_dnsport * listen_create(struct comm_base *base, struct listen_port *ports, size_t bufsize, int tcp_accept_count, void *sslctx, struct dt_env *dtenv, comm_point_callback_type *cb, void *cb_arg)
struct listen_port * listening_ports_open(struct config_file *cfg, int *reuseport)
int create_local_accept_sock(const char *path, int *noproto, int use_systemd)
size_t listen_get_mem(struct listen_dnsport *listen)
int comm_point_callback_type(struct comm_point *, void *, int, struct comm_reply *)
Definition netevent.h:76
struct sldns_buffer * udp_buff
struct listen_list * cps
struct comm_base * base
struct comm_point * com
struct listen_list * next
struct listen_port * next
enum listen_type ftype