version 1.1.1.3, 2016/11/02 09:57:01
|
version 1.1.1.4, 2021/03/17 00:56:46
|
Line 1
|
Line 1
|
/* dnsmasq is Copyright (c) 2000-2016 Simon Kelley | /* dnsmasq is Copyright (c) 2000-2021 Simon Kelley |
|
|
This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
Line 14
|
Line 14
|
along with this program. If not, see <http://www.gnu.org/licenses/>. |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
*/ |
*/ |
|
|
#define COPYRIGHT "Copyright (c) 2000-2016 Simon Kelley" | #define COPYRIGHT "Copyright (c) 2000-2021 Simon Kelley" |
|
|
|
/* We do defines that influence behavior of stdio.h, so complain |
|
if included too early. */ |
|
#ifdef _STDIO_H |
|
# error "Header file stdio.h included too early!" |
|
#endif |
|
|
#ifndef NO_LARGEFILE |
#ifndef NO_LARGEFILE |
/* Ensure we can use files >2GB (log files may grow this big) */ |
/* Ensure we can use files >2GB (log files may grow this big) */ |
# define _LARGEFILE_SOURCE 1 |
# define _LARGEFILE_SOURCE 1 |
Line 36
|
Line 42
|
# define __EXTENSIONS__ |
# define __EXTENSIONS__ |
#endif |
#endif |
|
|
|
#if (defined(__GNUC__) && __GNUC__ >= 3) || defined(__clang__) |
|
#define ATTRIBUTE_NORETURN __attribute__ ((noreturn)) |
|
#else |
|
#define ATTRIBUTE_NORETURN |
|
#endif |
|
|
/* get these before config.h for IPv6 stuff... */ |
/* get these before config.h for IPv6 stuff... */ |
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/socket.h> |
#include <sys/socket.h> |
Line 51
|
Line 63
|
|
|
#include "config.h" |
#include "config.h" |
#include "ip6addr.h" |
#include "ip6addr.h" |
|
#include "metrics.h" |
|
|
typedef unsigned char u8; |
typedef unsigned char u8; |
typedef unsigned short u16; |
typedef unsigned short u16; |
Line 82 typedef unsigned long long u64;
|
Line 95 typedef unsigned long long u64;
|
#if defined(HAVE_SOLARIS_NETWORK) |
#if defined(HAVE_SOLARIS_NETWORK) |
# include <sys/sockio.h> |
# include <sys/sockio.h> |
#endif |
#endif |
#include <sys/poll.h> | #if defined(HAVE_POLL_H) |
| # include <poll.h> |
| #else |
| # include <sys/poll.h> |
| #endif |
#include <sys/wait.h> |
#include <sys/wait.h> |
#include <sys/time.h> |
#include <sys/time.h> |
#include <sys/un.h> |
#include <sys/un.h> |
Line 113 typedef unsigned long long u64;
|
Line 130 typedef unsigned long long u64;
|
#include <net/if_arp.h> |
#include <net/if_arp.h> |
#include <netinet/in_systm.h> |
#include <netinet/in_systm.h> |
#include <netinet/ip.h> |
#include <netinet/ip.h> |
|
#include <netinet/ip6.h> |
#include <netinet/ip_icmp.h> |
#include <netinet/ip_icmp.h> |
|
#include <netinet/tcp.h> |
#include <sys/uio.h> |
#include <sys/uio.h> |
#include <syslog.h> |
#include <syslog.h> |
#include <dirent.h> |
#include <dirent.h> |
#include <utime.h> |
|
#ifndef HAVE_LINUX_NETWORK |
#ifndef HAVE_LINUX_NETWORK |
# include <net/if_dl.h> |
# include <net/if_dl.h> |
#endif |
#endif |
|
|
#if defined(HAVE_LINUX_NETWORK) |
#if defined(HAVE_LINUX_NETWORK) |
|
#include <linux/version.h> |
|
#include <linux/sockios.h> |
#include <linux/capability.h> |
#include <linux/capability.h> |
/* There doesn't seem to be a universally-available |
/* There doesn't seem to be a universally-available |
userpace header for these. */ | userspace header for these. */ |
extern int capset(cap_user_header_t header, cap_user_data_t data); |
extern int capset(cap_user_header_t header, cap_user_data_t data); |
extern int capget(cap_user_header_t header, cap_user_data_t data); |
extern int capget(cap_user_header_t header, cap_user_data_t data); |
#define LINUX_CAPABILITY_VERSION_1 0x19980330 |
#define LINUX_CAPABILITY_VERSION_1 0x19980330 |
Line 137 extern int capget(cap_user_header_t header, cap_user_d
|
Line 157 extern int capget(cap_user_header_t header, cap_user_d
|
#include <priv.h> |
#include <priv.h> |
#endif |
#endif |
|
|
|
/* Backwards compat with 2.83 */ |
|
#if defined(HAVE_NETTLEHASH) |
|
# define HAVE_CRYPTOHASH |
|
#endif |
|
#if defined(HAVE_DNSSEC) || defined(HAVE_CRYPTOHASH) |
|
# include <nettle/nettle-meta.h> |
|
#endif |
|
|
/* daemon is function in the C library.... */ |
/* daemon is function in the C library.... */ |
#define daemon dnsmasq_daemon |
#define daemon dnsmasq_daemon |
|
|
|
#define ADDRSTRLEN INET6_ADDRSTRLEN |
|
|
/* Async event queue */ |
/* Async event queue */ |
struct event_desc { |
struct event_desc { |
int event, data, msg_sz; |
int event, data, msg_sz; |
}; |
}; |
|
|
#define EVENT_RELOAD 1 | #define EVENT_RELOAD 1 |
#define EVENT_DUMP 2 | #define EVENT_DUMP 2 |
#define EVENT_ALARM 3 | #define EVENT_ALARM 3 |
#define EVENT_TERM 4 | #define EVENT_TERM 4 |
#define EVENT_CHILD 5 | #define EVENT_CHILD 5 |
#define EVENT_REOPEN 6 | #define EVENT_REOPEN 6 |
#define EVENT_EXITED 7 | #define EVENT_EXITED 7 |
#define EVENT_KILLED 8 | #define EVENT_KILLED 8 |
#define EVENT_EXEC_ERR 9 | #define EVENT_EXEC_ERR 9 |
#define EVENT_PIPE_ERR 10 | #define EVENT_PIPE_ERR 10 |
#define EVENT_USER_ERR 11 | #define EVENT_USER_ERR 11 |
#define EVENT_CAP_ERR 12 | #define EVENT_CAP_ERR 12 |
#define EVENT_PIDFILE 13 | #define EVENT_PIDFILE 13 |
#define EVENT_HUSER_ERR 14 | #define EVENT_HUSER_ERR 14 |
#define EVENT_GROUP_ERR 15 | #define EVENT_GROUP_ERR 15 |
#define EVENT_DIE 16 | #define EVENT_DIE 16 |
#define EVENT_LOG_ERR 17 | #define EVENT_LOG_ERR 17 |
#define EVENT_FORK_ERR 18 | #define EVENT_FORK_ERR 18 |
#define EVENT_LUA_ERR 19 | #define EVENT_LUA_ERR 19 |
#define EVENT_TFTP_ERR 20 | #define EVENT_TFTP_ERR 20 |
#define EVENT_INIT 21 | #define EVENT_INIT 21 |
#define EVENT_NEWADDR 22 | #define EVENT_NEWADDR 22 |
#define EVENT_NEWROUTE 23 | #define EVENT_NEWROUTE 23 |
#define EVENT_TIME_ERR 24 | #define EVENT_TIME_ERR 24 |
| #define EVENT_SCRIPT_LOG 25 |
| #define EVENT_TIME 26 |
|
|
/* Exit codes. */ |
/* Exit codes. */ |
#define EC_GOOD 0 |
#define EC_GOOD 0 |
Line 179 struct event_desc {
|
Line 211 struct event_desc {
|
#define EC_MISC 5 |
#define EC_MISC 5 |
#define EC_INIT_OFFSET 10 |
#define EC_INIT_OFFSET 10 |
|
|
/* Trust the compiler dead-code eliminator.... */ |
|
#define option_bool(x) (((x) < 32) ? daemon->options & (1u << (x)) : daemon->options2 & (1u << ((x) - 32))) |
|
|
|
#define OPT_BOGUSPRIV 0 |
#define OPT_BOGUSPRIV 0 |
#define OPT_FILTER 1 |
#define OPT_FILTER 1 |
#define OPT_LOG 2 |
#define OPT_LOG 2 |
Line 211 struct event_desc {
|
Line 240 struct event_desc {
|
#define OPT_TFTP_SECURE 26 |
#define OPT_TFTP_SECURE 26 |
#define OPT_TFTP_NOBLOCK 27 |
#define OPT_TFTP_NOBLOCK 27 |
#define OPT_LOG_OPTS 28 |
#define OPT_LOG_OPTS 28 |
#define OPT_TFTP_APREF 29 | #define OPT_TFTP_APREF_IP 29 |
#define OPT_NO_OVERRIDE 30 |
#define OPT_NO_OVERRIDE 30 |
#define OPT_NO_REBIND 31 |
#define OPT_NO_REBIND 31 |
#define OPT_ADD_MAC 32 |
#define OPT_ADD_MAC 32 |
Line 230 struct event_desc {
|
Line 259 struct event_desc {
|
#define OPT_DNSSEC_VALID 45 |
#define OPT_DNSSEC_VALID 45 |
#define OPT_DNSSEC_TIME 46 |
#define OPT_DNSSEC_TIME 46 |
#define OPT_DNSSEC_DEBUG 47 |
#define OPT_DNSSEC_DEBUG 47 |
#define OPT_DNSSEC_NO_SIGN 48 | #define OPT_DNSSEC_IGN_NS 48 |
#define OPT_LOCAL_SERVICE 49 |
#define OPT_LOCAL_SERVICE 49 |
#define OPT_LOOP_DETECT 50 |
#define OPT_LOOP_DETECT 50 |
#define OPT_EXTRALOG 51 |
#define OPT_EXTRALOG 51 |
Line 238 struct event_desc {
|
Line 267 struct event_desc {
|
#define OPT_SCRIPT_ARP 53 |
#define OPT_SCRIPT_ARP 53 |
#define OPT_MAC_B64 54 |
#define OPT_MAC_B64 54 |
#define OPT_MAC_HEX 55 |
#define OPT_MAC_HEX 55 |
#define OPT_LAST 56 | #define OPT_TFTP_APREF_MAC 56 |
| #define OPT_RAPID_COMMIT 57 |
| #define OPT_UBUS 58 |
| #define OPT_IGNORE_CLID 59 |
| #define OPT_SINGLE_PORT 60 |
| #define OPT_LEASE_RENEW 61 |
| #define OPT_LAST 62 |
|
|
|
#define OPTION_BITS (sizeof(unsigned int)*8) |
|
#define OPTION_SIZE ( (OPT_LAST/OPTION_BITS)+((OPT_LAST%OPTION_BITS)!=0) ) |
|
#define option_var(x) (daemon->options[(x) / OPTION_BITS]) |
|
#define option_val(x) ((1u) << ((x) % OPTION_BITS)) |
|
#define option_bool(x) (option_var(x) & option_val(x)) |
|
|
/* extra flags for my_syslog, we use a couple of facilities since they are known |
/* extra flags for my_syslog, we use a couple of facilities since they are known |
not to occupy the same bits as priorities, no matter how syslog.h is set up. */ |
not to occupy the same bits as priorities, no matter how syslog.h is set up. */ |
#define MS_TFTP LOG_USER | #define MS_TFTP LOG_USER |
#define MS_DHCP LOG_DAEMON | #define MS_DHCP LOG_DAEMON |
| #define MS_SCRIPT LOG_MAIL |
|
|
struct all_addr { | /* Note that this is used widely as a container for IPv4/IPv6 addresses, |
union { | so for that reason, was well as to avoid wasting memory in almost every |
struct in_addr addr4; | cache entry, the other variants should not be larger than |
#ifdef HAVE_IPV6 | sizeof(struct in6_addr) - 16 bytes. |
struct in6_addr addr6; | */ |
#endif | union all_addr { |
/* for log_query */ | struct in_addr addr4; |
struct { | struct in6_addr addr6; |
unsigned short keytag, algo, digest; | struct { |
} log; | union { |
/* for cache_insert of DNSKEY, DS */ | struct crec *cache; |
struct { | char *name; |
unsigned short class, type; | } target; |
} dnssec; | unsigned int uid; |
} addr; | int is_name_ptr; /* disciminates target union */ |
| } cname; |
| struct { |
| struct blockdata *keydata; |
| unsigned short keylen, flags, keytag; |
| unsigned char algo; |
| } key; |
| struct { |
| struct blockdata *keydata; |
| unsigned short keylen, keytag; |
| unsigned char algo; |
| unsigned char digest; |
| } ds; |
| struct { |
| struct blockdata *target; |
| unsigned short targetlen, srvport, priority, weight; |
| } srv; |
| /* for log_query */ |
| struct { |
| unsigned short keytag, algo, digest, rcode; |
| } log; |
}; |
}; |
|
|
|
|
struct bogus_addr { |
struct bogus_addr { |
struct in_addr addr; |
struct in_addr addr; |
struct bogus_addr *next; |
struct bogus_addr *next; |
Line 286 struct naptr {
|
Line 349 struct naptr {
|
struct naptr *next; |
struct naptr *next; |
}; |
}; |
|
|
|
#ifndef NO_ID |
#define TXT_STAT_CACHESIZE 1 |
#define TXT_STAT_CACHESIZE 1 |
#define TXT_STAT_INSERTS 2 |
#define TXT_STAT_INSERTS 2 |
#define TXT_STAT_EVICTIONS 3 |
#define TXT_STAT_EVICTIONS 3 |
Line 293 struct naptr {
|
Line 357 struct naptr {
|
#define TXT_STAT_HITS 5 |
#define TXT_STAT_HITS 5 |
#define TXT_STAT_AUTH 6 |
#define TXT_STAT_AUTH 6 |
#define TXT_STAT_SERVERS 7 |
#define TXT_STAT_SERVERS 7 |
|
#endif |
|
|
struct txt_record { |
struct txt_record { |
char *name; |
char *name; |
Line 308 struct ptr_record {
|
Line 373 struct ptr_record {
|
}; |
}; |
|
|
struct cname { |
struct cname { |
int ttl; | int ttl, flag; |
char *alias, *target; |
char *alias, *target; |
struct cname *next; | struct cname *next, *targetp; |
}; |
}; |
|
|
struct ds_config { |
struct ds_config { |
Line 319 struct ds_config {
|
Line 384 struct ds_config {
|
struct ds_config *next; |
struct ds_config *next; |
}; |
}; |
|
|
#define ADDRLIST_LITERAL 1 | #define ADDRLIST_LITERAL 1 |
#define ADDRLIST_IPV6 2 | #define ADDRLIST_IPV6 2 |
#define ADDRLIST_REVONLY 4 | #define ADDRLIST_REVONLY 4 |
| #define ADDRLIST_PREFIX 8 |
| #define ADDRLIST_WILDCARD 16 |
| #define ADDRLIST_DECLINED 32 |
|
|
struct addrlist { |
struct addrlist { |
struct all_addr addr; | union all_addr addr; |
int flags, prefixlen; | int flags, prefixlen; |
| time_t decline_time; |
struct addrlist *next; |
struct addrlist *next; |
}; |
}; |
|
|
Line 340 struct auth_zone {
|
Line 409 struct auth_zone {
|
struct auth_name_list *next; |
struct auth_name_list *next; |
} *interface_names; |
} *interface_names; |
struct addrlist *subnet; |
struct addrlist *subnet; |
|
struct addrlist *exclude; |
struct auth_zone *next; |
struct auth_zone *next; |
}; |
}; |
|
|
|
#define HR_6 1 |
|
#define HR_4 2 |
|
|
struct host_record { |
struct host_record { |
int ttl; | int ttl, flags; |
struct name_list { |
struct name_list { |
char *name; |
char *name; |
struct name_list *next; |
struct name_list *next; |
} *names; |
} *names; |
struct in_addr addr; |
struct in_addr addr; |
#ifdef HAVE_IPV6 |
|
struct in6_addr addr6; |
struct in6_addr addr6; |
#endif |
|
struct host_record *next; |
struct host_record *next; |
}; |
}; |
|
|
Line 377 struct blockdata {
|
Line 447 struct blockdata {
|
|
|
struct crec { |
struct crec { |
struct crec *next, *prev, *hash_next; |
struct crec *next, *prev, *hash_next; |
/* union is 16 bytes when doing IPv6, 8 bytes on 32 bit machines without IPv6 */ | union all_addr addr; |
union { | |
struct all_addr addr; | |
struct { | |
union { | |
struct crec *cache; | |
struct interface_name *int_name; | |
} target; | |
unsigned int uid; /* 0 if union is interface-name */ | |
} cname; | |
struct { | |
struct blockdata *keydata; | |
unsigned short keylen, flags, keytag; | |
unsigned char algo; | |
} key; | |
struct { | |
struct blockdata *keydata; | |
unsigned short keylen, keytag; | |
unsigned char algo; | |
unsigned char digest; | |
} ds; | |
} addr; | |
time_t ttd; /* time to die */ |
time_t ttd; /* time to die */ |
/* used as class if DNSKEY/DS, index to source for F_HOSTS */ |
/* used as class if DNSKEY/DS, index to source for F_HOSTS */ |
unsigned int uid; |
unsigned int uid; |
unsigned short flags; | unsigned int flags; |
union { |
union { |
char sname[SMALLDNAME]; |
char sname[SMALLDNAME]; |
union bigname *bname; |
union bigname *bname; |
Line 410 struct crec {
|
Line 459 struct crec {
|
} name; |
} name; |
}; |
}; |
|
|
|
#define SIZEOF_BARE_CREC (sizeof(struct crec) - SMALLDNAME) |
|
#define SIZEOF_POINTER_CREC (sizeof(struct crec) + sizeof(char *) - SMALLDNAME) |
|
|
#define F_IMMORTAL (1u<<0) |
#define F_IMMORTAL (1u<<0) |
#define F_NAMEP (1u<<1) |
#define F_NAMEP (1u<<1) |
#define F_REVERSE (1u<<2) |
#define F_REVERSE (1u<<2) |
Line 426 struct crec {
|
Line 478 struct crec {
|
#define F_CONFIG (1u<<13) |
#define F_CONFIG (1u<<13) |
#define F_DS (1u<<14) |
#define F_DS (1u<<14) |
#define F_DNSSECOK (1u<<15) |
#define F_DNSSECOK (1u<<15) |
|
|
/* below here are only valid as args to log_query: cache |
|
entries are limited to 16 bits */ |
|
#define F_UPSTREAM (1u<<16) |
#define F_UPSTREAM (1u<<16) |
#define F_RRNAME (1u<<17) |
#define F_RRNAME (1u<<17) |
#define F_SERVER (1u<<18) |
#define F_SERVER (1u<<18) |
Line 441 struct crec {
|
Line 490 struct crec {
|
#define F_NO_RR (1u<<25) |
#define F_NO_RR (1u<<25) |
#define F_IPSET (1u<<26) |
#define F_IPSET (1u<<26) |
#define F_NOEXTRA (1u<<27) |
#define F_NOEXTRA (1u<<27) |
|
#define F_SERVFAIL (1u<<28) /* currently unused. */ |
|
#define F_RCODE (1u<<29) |
|
#define F_SRV (1u<<30) |
|
|
|
#define UID_NONE 0 |
/* Values of uid in crecs with F_CONFIG bit set. */ |
/* Values of uid in crecs with F_CONFIG bit set. */ |
#define SRC_INTERFACE 0 |
|
#define SRC_CONFIG 1 |
#define SRC_CONFIG 1 |
#define SRC_HOSTS 2 |
#define SRC_HOSTS 2 |
#define SRC_AH 3 |
#define SRC_AH 3 |
Line 455 struct crec {
|
Line 507 struct crec {
|
union mysockaddr { |
union mysockaddr { |
struct sockaddr sa; |
struct sockaddr sa; |
struct sockaddr_in in; |
struct sockaddr_in in; |
#if defined(HAVE_IPV6) |
|
struct sockaddr_in6 in6; |
struct sockaddr_in6 in6; |
#endif |
|
}; |
}; |
|
|
/* bits in flag param to IPv6 callbacks from iface_enumerate() */ |
/* bits in flag param to IPv6 callbacks from iface_enumerate() */ |
Line 482 union mysockaddr {
|
Line 532 union mysockaddr {
|
#define SERV_FROM_FILE 4096 /* read from --servers-file */ |
#define SERV_FROM_FILE 4096 /* read from --servers-file */ |
#define SERV_LOOP 8192 /* server causes forwarding loop */ |
#define SERV_LOOP 8192 /* server causes forwarding loop */ |
#define SERV_DO_DNSSEC 16384 /* Validate DNSSEC when using this server */ |
#define SERV_DO_DNSSEC 16384 /* Validate DNSSEC when using this server */ |
|
#define SERV_GOT_TCP 32768 /* Got some data from the TCP connection */ |
|
|
struct serverfd { |
struct serverfd { |
int fd; |
int fd; |
union mysockaddr source_addr; |
union mysockaddr source_addr; |
char interface[IF_NAMESIZE+1]; |
char interface[IF_NAMESIZE+1]; |
|
unsigned int ifindex, used, preallocated; |
struct serverfd *next; |
struct serverfd *next; |
}; |
}; |
|
|
Line 501 struct server {
|
Line 553 struct server {
|
struct serverfd *sfd; |
struct serverfd *sfd; |
char *domain; /* set if this server only handles a domain. */ |
char *domain; /* set if this server only handles a domain. */ |
int flags, tcpfd, edns_pktsz; |
int flags, tcpfd, edns_pktsz; |
|
time_t pktsz_reduced; |
unsigned int queries, failed_queries; |
unsigned int queries, failed_queries; |
#ifdef HAVE_LOOP |
#ifdef HAVE_LOOP |
u32 uid; |
u32 uid; |
Line 517 struct ipsets {
|
Line 570 struct ipsets {
|
struct irec { |
struct irec { |
union mysockaddr addr; |
union mysockaddr addr; |
struct in_addr netmask; /* only valid for IPv4 */ |
struct in_addr netmask; /* only valid for IPv4 */ |
int tftp_ok, dhcp_ok, mtu, done, warned, dad, dns_auth, index, multicast_done, found; | int tftp_ok, dhcp_ok, mtu, done, warned, dad, dns_auth, index, multicast_done, found, label; |
char *name; |
char *name; |
struct irec *next; |
struct irec *next; |
}; |
}; |
|
|
struct listener { |
struct listener { |
int fd, tcpfd, tftpfd, family; | int fd, tcpfd, tftpfd, used; |
| union mysockaddr addr; |
struct irec *iface; /* only sometimes valid for non-wildcard */ |
struct irec *iface; /* only sometimes valid for non-wildcard */ |
struct listener *next; |
struct listener *next; |
}; |
}; |
Line 572 struct hostsfile {
|
Line 626 struct hostsfile {
|
unsigned int index; /* matches to cache entries for logging */ |
unsigned int index; /* matches to cache entries for logging */ |
}; |
}; |
|
|
|
/* packet-dump flags */ |
|
#define DUMP_QUERY 0x0001 |
|
#define DUMP_REPLY 0x0002 |
|
#define DUMP_UP_QUERY 0x0004 |
|
#define DUMP_UP_REPLY 0x0008 |
|
#define DUMP_SEC_QUERY 0x0010 |
|
#define DUMP_SEC_REPLY 0x0020 |
|
#define DUMP_BOGUS 0x0040 |
|
#define DUMP_SEC_BOGUS 0x0080 |
|
|
|
|
/* DNSSEC status values. */ |
/* DNSSEC status values. */ |
#define STAT_SECURE 1 |
#define STAT_SECURE 1 |
#define STAT_INSECURE 2 |
#define STAT_INSECURE 2 |
Line 593 struct hostsfile {
|
Line 657 struct hostsfile {
|
#define FREC_DO_QUESTION 64 |
#define FREC_DO_QUESTION 64 |
#define FREC_ADDED_PHEADER 128 |
#define FREC_ADDED_PHEADER 128 |
#define FREC_TEST_PKTSZ 256 |
#define FREC_TEST_PKTSZ 256 |
#define FREC_HAS_EXTRADATA 512 | #define FREC_HAS_EXTRADATA 512 |
| #define FREC_HAS_PHEADER 1024 |
| #define FREC_NO_CACHE 2048 |
|
|
#ifdef HAVE_DNSSEC | #define HASH_SIZE 32 /* SHA-256 digest size */ |
#define HASH_SIZE 20 /* SHA-1 digest size */ | |
#else | |
#define HASH_SIZE sizeof(int) | |
#endif | |
|
|
struct frec { |
struct frec { |
union mysockaddr source; | struct frec_src { |
struct all_addr dest; | union mysockaddr source; |
| union all_addr dest; |
| unsigned int iface, log_id; |
| int fd; |
| unsigned short orig_id; |
| struct frec_src *next; |
| } frec_src; |
struct server *sentto; /* NULL means free */ |
struct server *sentto; /* NULL means free */ |
struct randfd *rfd4; |
struct randfd *rfd4; |
#ifdef HAVE_IPV6 |
|
struct randfd *rfd6; |
struct randfd *rfd6; |
#endif | unsigned short new_id; |
unsigned int iface; | int forwardall, flags; |
unsigned short orig_id, new_id; | |
int log_id, fd, forwardall, flags; | |
time_t time; |
time_t time; |
unsigned char *hash[HASH_SIZE]; |
unsigned char *hash[HASH_SIZE]; |
#ifdef HAVE_DNSSEC |
#ifdef HAVE_DNSSEC |
Line 650 struct frec {
|
Line 715 struct frec {
|
#define LEASE_NA 32 /* IPv6 no-temporary lease */ |
#define LEASE_NA 32 /* IPv6 no-temporary lease */ |
#define LEASE_TA 64 /* IPv6 temporary lease */ |
#define LEASE_TA 64 /* IPv6 temporary lease */ |
#define LEASE_HAVE_HWADDR 128 /* Have set hwaddress */ |
#define LEASE_HAVE_HWADDR 128 /* Have set hwaddress */ |
|
#define LEASE_EXP_CHANGED 256 /* Lease expiry time changed */ |
|
|
struct dhcp_lease { |
struct dhcp_lease { |
int clid_len; /* length of client identifier */ |
int clid_len; /* length of client identifier */ |
Line 671 struct dhcp_lease {
|
Line 737 struct dhcp_lease {
|
int new_prefixlen; /* and its prefix length */ |
int new_prefixlen; /* and its prefix length */ |
#ifdef HAVE_DHCP6 |
#ifdef HAVE_DHCP6 |
struct in6_addr addr6; |
struct in6_addr addr6; |
int iaid; | unsigned int iaid; |
struct slaac_address { |
struct slaac_address { |
struct in6_addr addr; |
struct in6_addr addr; |
time_t ping_time; |
time_t ping_time; |
Line 699 struct tag_if {
|
Line 765 struct tag_if {
|
struct tag_if *next; |
struct tag_if *next; |
}; |
}; |
|
|
|
struct delay_config { |
|
int delay; |
|
struct dhcp_netid *netid; |
|
struct delay_config *next; |
|
}; |
|
|
struct hwaddr_config { |
struct hwaddr_config { |
int hwaddr_len, hwaddr_type; |
int hwaddr_len, hwaddr_type; |
unsigned char hwaddr[DHCP_CHADDR_MAX]; |
unsigned char hwaddr[DHCP_CHADDR_MAX]; |
Line 712 struct dhcp_config {
|
Line 784 struct dhcp_config {
|
unsigned char *clid; /* clientid */ |
unsigned char *clid; /* clientid */ |
char *hostname, *domain; |
char *hostname, *domain; |
struct dhcp_netid_list *netid; |
struct dhcp_netid_list *netid; |
|
struct dhcp_netid *filter; |
#ifdef HAVE_DHCP6 |
#ifdef HAVE_DHCP6 |
struct in6_addr addr6; | struct addrlist *addr6; |
#endif |
#endif |
struct in_addr addr; |
struct in_addr addr; |
time_t decline_time; |
time_t decline_time; |
Line 735 struct dhcp_config {
|
Line 808 struct dhcp_config {
|
#define CONFIG_DECLINED 1024 /* address declined by client */ |
#define CONFIG_DECLINED 1024 /* address declined by client */ |
#define CONFIG_BANK 2048 /* from dhcp hosts file */ |
#define CONFIG_BANK 2048 /* from dhcp hosts file */ |
#define CONFIG_ADDR6 4096 |
#define CONFIG_ADDR6 4096 |
#define CONFIG_WILDCARD 8192 | #define CONFIG_ADDR6_HOSTS 16384 /* address added by from /etc/hosts */ |
|
|
struct dhcp_opt { |
struct dhcp_opt { |
int opt, len, flags; |
int opt, len, flags; |
Line 763 struct dhcp_opt {
|
Line 836 struct dhcp_opt {
|
#define DHOPT_RFC3925 2048 |
#define DHOPT_RFC3925 2048 |
#define DHOPT_TAGOK 4096 |
#define DHOPT_TAGOK 4096 |
#define DHOPT_ADDR6 8192 |
#define DHOPT_ADDR6 8192 |
|
#define DHOPT_VENDOR_PXE 16384 |
|
|
struct dhcp_boot { |
struct dhcp_boot { |
char *file, *sname, *tftp_sname; |
char *file, *sname, *tftp_sname; |
Line 771 struct dhcp_boot {
|
Line 845 struct dhcp_boot {
|
struct dhcp_boot *next; |
struct dhcp_boot *next; |
}; |
}; |
|
|
|
struct dhcp_match_name { |
|
char *name; |
|
int wildcard; |
|
struct dhcp_netid *netid; |
|
struct dhcp_match_name *next; |
|
}; |
|
|
struct pxe_service { |
struct pxe_service { |
unsigned short CSA, type; |
unsigned short CSA, type; |
char *menu, *basename, *sname; |
char *menu, *basename, *sname; |
Line 779 struct pxe_service {
|
Line 860 struct pxe_service {
|
struct pxe_service *next; |
struct pxe_service *next; |
}; |
}; |
|
|
|
#define DHCP_PXE_DEF_VENDOR "PXEClient" |
|
|
#define MATCH_VENDOR 1 |
#define MATCH_VENDOR 1 |
#define MATCH_USER 2 |
#define MATCH_USER 2 |
#define MATCH_CIRCUIT 3 |
#define MATCH_CIRCUIT 3 |
#define MATCH_REMOTE 4 |
#define MATCH_REMOTE 4 |
#define MATCH_SUBSCRIBER 5 |
#define MATCH_SUBSCRIBER 5 |
|
|
/* vendorclass, userclass, remote-id or cicuit-id */ | /* vendorclass, userclass, remote-id or circuit-id */ |
struct dhcp_vendor { |
struct dhcp_vendor { |
int len, match_type; |
int len, match_type; |
unsigned int enterprise; |
unsigned int enterprise; |
Line 794 struct dhcp_vendor {
|
Line 877 struct dhcp_vendor {
|
struct dhcp_vendor *next; |
struct dhcp_vendor *next; |
}; |
}; |
|
|
|
struct dhcp_pxe_vendor { |
|
char *data; |
|
struct dhcp_pxe_vendor *next; |
|
}; |
|
|
struct dhcp_mac { |
struct dhcp_mac { |
unsigned int mask; |
unsigned int mask; |
int hwaddr_len, hwaddr_type; |
int hwaddr_len, hwaddr_type; |
Line 810 struct dhcp_bridge {
|
Line 898 struct dhcp_bridge {
|
struct cond_domain { |
struct cond_domain { |
char *domain, *prefix; |
char *domain, *prefix; |
struct in_addr start, end; |
struct in_addr start, end; |
#ifdef HAVE_IPV6 |
|
struct in6_addr start6, end6; |
struct in6_addr start6, end6; |
#endif | int is6, indexed; |
int is6; | |
struct cond_domain *next; |
struct cond_domain *next; |
}; |
}; |
|
|
#ifdef OPTION6_PREFIX_CLASS |
|
struct prefix_class { |
|
int class; |
|
struct dhcp_netid tag; |
|
struct prefix_class *next; |
|
}; |
|
#endif |
|
|
|
struct ra_interface { |
struct ra_interface { |
char *name; |
char *name; |
int interval, lifetime, prio; | char *mtu_name; |
| int interval, lifetime, prio, mtu; |
struct ra_interface *next; |
struct ra_interface *next; |
}; |
}; |
|
|
Line 849 struct dhcp_context {
|
Line 928 struct dhcp_context {
|
struct dhcp_context *next, *current; |
struct dhcp_context *next, *current; |
}; |
}; |
|
|
|
struct shared_network { |
|
int if_index; |
|
struct in_addr match_addr, shared_addr; |
|
#ifdef HAVE_DHCP6 |
|
/* shared_addr == 0 for IP6 entries. */ |
|
struct in6_addr match_addr6, shared_addr6; |
|
#endif |
|
struct shared_network *next; |
|
}; |
|
|
#define CONTEXT_STATIC (1u<<0) |
#define CONTEXT_STATIC (1u<<0) |
#define CONTEXT_NETMASK (1u<<1) |
#define CONTEXT_NETMASK (1u<<1) |
#define CONTEXT_BRDCAST (1u<<2) |
#define CONTEXT_BRDCAST (1u<<2) |
Line 868 struct dhcp_context {
|
Line 957 struct dhcp_context {
|
#define CONTEXT_OLD (1u<<16) |
#define CONTEXT_OLD (1u<<16) |
#define CONTEXT_V6 (1u<<17) |
#define CONTEXT_V6 (1u<<17) |
#define CONTEXT_RA_OFF_LINK (1u<<18) |
#define CONTEXT_RA_OFF_LINK (1u<<18) |
|
#define CONTEXT_SETLEASE (1u<<19) |
|
|
struct ping_result { |
struct ping_result { |
struct in_addr addr; |
struct in_addr addr; |
Line 891 struct tftp_transfer {
|
Line 981 struct tftp_transfer {
|
unsigned int block, blocksize, expansion; |
unsigned int block, blocksize, expansion; |
off_t offset; |
off_t offset; |
union mysockaddr peer; |
union mysockaddr peer; |
|
union all_addr source; |
|
int if_index; |
char opt_blocksize, opt_transize, netascii, carrylf; |
char opt_blocksize, opt_transize, netascii, carrylf; |
struct tftp_file *file; |
struct tftp_file *file; |
struct tftp_transfer *next; |
struct tftp_transfer *next; |
Line 909 struct tftp_prefix {
|
Line 1001 struct tftp_prefix {
|
}; |
}; |
|
|
struct dhcp_relay { |
struct dhcp_relay { |
struct all_addr local, server; | union all_addr local, server; |
char *interface; /* Allowable interface for replies from server, and dest for IPv6 multicast */ |
char *interface; /* Allowable interface for replies from server, and dest for IPv6 multicast */ |
int iface_index; /* working - interface in which requests arrived, for return */ |
int iface_index; /* working - interface in which requests arrived, for return */ |
struct dhcp_relay *current, *next; |
struct dhcp_relay *current, *next; |
Line 920 extern struct daemon {
|
Line 1012 extern struct daemon {
|
config file arguments. All set (including defaults) |
config file arguments. All set (including defaults) |
in option.c */ |
in option.c */ |
|
|
unsigned int options, options2; | unsigned int options[OPTION_SIZE]; |
struct resolvc default_resolv, *resolv_files; |
struct resolvc default_resolv, *resolv_files; |
time_t last_resolv; |
time_t last_resolv; |
char *servers_file; |
char *servers_file; |
Line 962 extern struct daemon {
|
Line 1054 extern struct daemon {
|
struct ra_interface *ra_interfaces; |
struct ra_interface *ra_interfaces; |
struct dhcp_config *dhcp_conf; |
struct dhcp_config *dhcp_conf; |
struct dhcp_opt *dhcp_opts, *dhcp_match, *dhcp_opts6, *dhcp_match6; |
struct dhcp_opt *dhcp_opts, *dhcp_match, *dhcp_opts6, *dhcp_match6; |
|
struct dhcp_match_name *dhcp_name_match; |
|
struct dhcp_pxe_vendor *dhcp_pxe_vendors; |
struct dhcp_vendor *dhcp_vendors; |
struct dhcp_vendor *dhcp_vendors; |
struct dhcp_mac *dhcp_macs; |
struct dhcp_mac *dhcp_macs; |
struct dhcp_boot *boot_config; |
struct dhcp_boot *boot_config; |
Line 969 extern struct daemon {
|
Line 1063 extern struct daemon {
|
struct tag_if *tag_if; |
struct tag_if *tag_if; |
struct addr_list *override_relays; |
struct addr_list *override_relays; |
struct dhcp_relay *relay4, *relay6; |
struct dhcp_relay *relay4, *relay6; |
|
struct delay_config *delay_conf; |
int override; |
int override; |
int enable_pxe; |
int enable_pxe; |
int doing_ra, doing_dhcp6; |
int doing_ra, doing_dhcp6; |
Line 986 extern struct daemon {
|
Line 1081 extern struct daemon {
|
unsigned int duid_enterprise, duid_config_len; |
unsigned int duid_enterprise, duid_config_len; |
unsigned char *duid_config; |
unsigned char *duid_config; |
char *dbus_name; |
char *dbus_name; |
|
char *ubus_name; |
|
char *dump_file; |
|
int dump_mask; |
unsigned long soa_sn, soa_refresh, soa_retry, soa_expiry; |
unsigned long soa_sn, soa_refresh, soa_retry, soa_expiry; |
#ifdef OPTION6_PREFIX_CLASS | u32 metrics[__METRIC_MAX]; |
struct prefix_class *prefix_classes; | |
#endif | |
#ifdef HAVE_DNSSEC |
#ifdef HAVE_DNSSEC |
struct ds_config *ds; |
struct ds_config *ds; |
int back_to_the_future; |
|
char *timestamp_file; |
char *timestamp_file; |
#endif |
#endif |
|
|
Line 1003 extern struct daemon {
|
Line 1098 extern struct daemon {
|
#ifdef HAVE_DNSSEC |
#ifdef HAVE_DNSSEC |
char *keyname; /* MAXDNAME size buffer */ |
char *keyname; /* MAXDNAME size buffer */ |
char *workspacename; /* ditto */ |
char *workspacename; /* ditto */ |
|
unsigned long *rr_status; /* ceiling in TTL from DNSSEC or zero for insecure */ |
|
int rr_status_sz; |
|
int dnssec_no_time_check; |
|
int back_to_the_future; |
#endif |
#endif |
unsigned int local_answer, queries_forwarded, auth_answer; |
|
struct frec *frec_list; |
struct frec *frec_list; |
|
struct frec_src *free_frec_src; |
|
int frec_src_count; |
struct serverfd *sfds; |
struct serverfd *sfds; |
struct irec *interfaces; |
struct irec *interfaces; |
struct listener *listeners; |
struct listener *listeners; |
Line 1016 extern struct daemon {
|
Line 1116 extern struct daemon {
|
size_t packet_len; /* " " */ |
size_t packet_len; /* " " */ |
struct randfd *rfd_save; /* " " */ |
struct randfd *rfd_save; /* " " */ |
pid_t tcp_pids[MAX_PROCS]; |
pid_t tcp_pids[MAX_PROCS]; |
|
int tcp_pipes[MAX_PROCS]; |
|
int pipe_to_parent; |
struct randfd randomsocks[RANDOM_SOCKS]; |
struct randfd randomsocks[RANDOM_SOCKS]; |
int v6pktinfo; |
int v6pktinfo; |
struct addrlist *interface_addrs; /* list of all addresses/prefix lengths associated with all local interfaces */ |
struct addrlist *interface_addrs; /* list of all addresses/prefix lengths associated with all local interfaces */ |
Line 1028 extern struct daemon {
|
Line 1130 extern struct daemon {
|
int inotifyfd; |
int inotifyfd; |
#endif |
#endif |
#if defined(HAVE_LINUX_NETWORK) |
#if defined(HAVE_LINUX_NETWORK) |
int netlinkfd; | int netlinkfd, kernel_version; |
#elif defined(HAVE_BSD_NETWORK) |
#elif defined(HAVE_BSD_NETWORK) |
int dhcp_raw_fd, dhcp_icmp_fd, routefd; |
int dhcp_raw_fd, dhcp_icmp_fd, routefd; |
#endif |
#endif |
Line 1037 extern struct daemon {
|
Line 1139 extern struct daemon {
|
struct ping_result *ping_results; |
struct ping_result *ping_results; |
FILE *lease_stream; |
FILE *lease_stream; |
struct dhcp_bridge *bridges; |
struct dhcp_bridge *bridges; |
|
struct shared_network *shared_networks; |
#ifdef HAVE_DHCP6 |
#ifdef HAVE_DHCP6 |
int duid_len; |
int duid_len; |
unsigned char *duid; |
unsigned char *duid; |
Line 1049 extern struct daemon {
|
Line 1152 extern struct daemon {
|
#ifdef HAVE_DBUS |
#ifdef HAVE_DBUS |
struct watch *watches; |
struct watch *watches; |
#endif |
#endif |
|
/* UBus stuff */ |
|
#ifdef HAVE_UBUS |
|
/* void * here to avoid depending on ubus headers outside ubus.c */ |
|
void *ubus; |
|
#endif |
|
|
/* TFTP stuff */ |
/* TFTP stuff */ |
struct tftp_transfer *tftp_trans, *tftp_done_trans; |
struct tftp_transfer *tftp_trans, *tftp_done_trans; |
Line 1057 extern struct daemon {
|
Line 1165 extern struct daemon {
|
char *addrbuff; |
char *addrbuff; |
char *addrbuff2; /* only allocated when OPT_EXTRALOG */ |
char *addrbuff2; /* only allocated when OPT_EXTRALOG */ |
|
|
|
#ifdef HAVE_DUMPFILE |
|
/* file for packet dumps. */ |
|
int dumpfd; |
|
#endif |
} *daemon; |
} *daemon; |
|
|
/* cache.c */ |
/* cache.c */ |
void cache_init(void); |
void cache_init(void); |
void log_query(unsigned int flags, char *name, struct all_addr *addr, char *arg); | void next_uid(struct crec *crecp); |
| void log_query(unsigned int flags, char *name, union all_addr *addr, char *arg); |
char *record_source(unsigned int index); |
char *record_source(unsigned int index); |
char *querystr(char *desc, unsigned short type); |
char *querystr(char *desc, unsigned short type); |
|
int cache_find_non_terminal(char *name, time_t now); |
struct crec *cache_find_by_addr(struct crec *crecp, |
struct crec *cache_find_by_addr(struct crec *crecp, |
struct all_addr *addr, time_t now, | union all_addr *addr, time_t now, |
unsigned int prot); |
unsigned int prot); |
struct crec *cache_find_by_name(struct crec *crecp, |
struct crec *cache_find_by_name(struct crec *crecp, |
char *name, time_t now, unsigned int prot); |
char *name, time_t now, unsigned int prot); |
void cache_end_insert(void); |
void cache_end_insert(void); |
void cache_start_insert(void); |
void cache_start_insert(void); |
struct crec *cache_insert(char *name, struct all_addr *addr, | int cache_recv_insert(time_t now, int fd); |
time_t now, unsigned long ttl, unsigned short flags); | struct crec *cache_insert(char *name, union all_addr *addr, unsigned short class, |
| time_t now, unsigned long ttl, unsigned int flags); |
void cache_reload(void); |
void cache_reload(void); |
void cache_add_dhcp_entry(char *host_name, int prot, struct all_addr *host_address, time_t ttd); | void cache_add_dhcp_entry(char *host_name, int prot, union all_addr *host_address, time_t ttd); |
struct in_addr a_record_from_hosts(char *name, time_t now); |
struct in_addr a_record_from_hosts(char *name, time_t now); |
void cache_unhash_dhcp(void); |
void cache_unhash_dhcp(void); |
void dump_cache(time_t now); |
void dump_cache(time_t now); |
|
#ifndef NO_ID |
int cache_make_stat(struct txt_record *t); |
int cache_make_stat(struct txt_record *t); |
|
#endif |
char *cache_get_name(struct crec *crecp); |
char *cache_get_name(struct crec *crecp); |
char *cache_get_cname_target(struct crec *crecp); |
char *cache_get_cname_target(struct crec *crecp); |
struct crec *cache_enumerate(int init); |
struct crec *cache_enumerate(int init); |
Line 1086 int read_hostsfile(char *filename, unsigned int index,
|
Line 1203 int read_hostsfile(char *filename, unsigned int index,
|
struct crec **rhash, int hashsz); |
struct crec **rhash, int hashsz); |
|
|
/* blockdata.c */ |
/* blockdata.c */ |
#ifdef HAVE_DNSSEC |
|
void blockdata_init(void); |
void blockdata_init(void); |
void blockdata_report(void); |
void blockdata_report(void); |
struct blockdata *blockdata_alloc(char *data, size_t len); |
struct blockdata *blockdata_alloc(char *data, size_t len); |
void *blockdata_retrieve(struct blockdata *block, size_t len, void *data); |
void *blockdata_retrieve(struct blockdata *block, size_t len, void *data); |
|
struct blockdata *blockdata_read(int fd, size_t len); |
|
void blockdata_write(struct blockdata *block, size_t len, int fd); |
void blockdata_free(struct blockdata *blocks); |
void blockdata_free(struct blockdata *blocks); |
#endif |
|
|
|
/* domain.c */ |
/* domain.c */ |
char *get_domain(struct in_addr addr); |
char *get_domain(struct in_addr addr); |
#ifdef HAVE_IPV6 |
|
char *get_domain6(struct in6_addr *addr); |
char *get_domain6(struct in6_addr *addr); |
#endif | int is_name_synthetic(int flags, char *name, union all_addr *addr); |
int is_name_synthetic(int flags, char *name, struct all_addr *addr); | int is_rev_synth(int flag, union all_addr *addr, char *name); |
int is_rev_synth(int flag, struct all_addr *addr, char *name); | |
|
|
/* rfc1035.c */ |
/* rfc1035.c */ |
int extract_name(struct dns_header *header, size_t plen, unsigned char **pp, |
int extract_name(struct dns_header *header, size_t plen, unsigned char **pp, |
Line 1111 unsigned char *skip_section(unsigned char *ansp, int c
|
Line 1226 unsigned char *skip_section(unsigned char *ansp, int c
|
unsigned int extract_request(struct dns_header *header, size_t qlen, |
unsigned int extract_request(struct dns_header *header, size_t qlen, |
char *name, unsigned short *typep); |
char *name, unsigned short *typep); |
size_t setup_reply(struct dns_header *header, size_t qlen, |
size_t setup_reply(struct dns_header *header, size_t qlen, |
struct all_addr *addrp, unsigned int flags, | union all_addr *addrp, unsigned int flags, |
unsigned long local_ttl); | unsigned long ttl); |
int extract_addresses(struct dns_header *header, size_t qlen, char *namebuff, | int extract_addresses(struct dns_header *header, size_t qlen, char *name, |
time_t now, char **ipsets, int is_sign, int checkrebind, | time_t now, char **ipsets, int is_sign, int check_rebind, |
int no_cache, int secure, int *doctored); | int no_cache_dnssec, int secure, int *doctored); |
size_t answer_request(struct dns_header *header, char *limit, size_t qlen, |
size_t answer_request(struct dns_header *header, char *limit, size_t qlen, |
struct in_addr local_addr, struct in_addr local_netmask, |
struct in_addr local_addr, struct in_addr local_netmask, |
time_t now, int ad_reqd, int do_bit, int have_pseudoheader); |
time_t now, int ad_reqd, int do_bit, int have_pseudoheader); |
int check_for_bogus_wildcard(struct dns_header *header, size_t qlen, char *name, |
int check_for_bogus_wildcard(struct dns_header *header, size_t qlen, char *name, |
struct bogus_addr *addr, time_t now); | struct bogus_addr *baddr, time_t now); |
int check_for_ignored_address(struct dns_header *header, size_t qlen, struct bogus_addr *baddr); |
int check_for_ignored_address(struct dns_header *header, size_t qlen, struct bogus_addr *baddr); |
int check_for_local_domain(char *name, time_t now); |
int check_for_local_domain(char *name, time_t now); |
unsigned int questions_crc(struct dns_header *header, size_t plen, char *buff); |
|
size_t resize_packet(struct dns_header *header, size_t plen, |
size_t resize_packet(struct dns_header *header, size_t plen, |
unsigned char *pheader, size_t hlen); |
unsigned char *pheader, size_t hlen); |
int add_resource_record(struct dns_header *header, char *limit, int *truncp, |
int add_resource_record(struct dns_header *header, char *limit, int *truncp, |
int nameoffset, unsigned char **pp, unsigned long ttl, |
int nameoffset, unsigned char **pp, unsigned long ttl, |
int *offset, unsigned short type, unsigned short class, char *format, ...); |
int *offset, unsigned short type, unsigned short class, char *format, ...); |
unsigned char *skip_questions(struct dns_header *header, size_t plen); | int in_arpa_name_2_addr(char *namein, union all_addr *addrp); |
int extract_name(struct dns_header *header, size_t plen, unsigned char **pp, | |
char *name, int isExtract, int extrabytes); | |
int in_arpa_name_2_addr(char *namein, struct all_addr *addrp); | |
int private_net(struct in_addr addr, int ban_localhost); |
int private_net(struct in_addr addr, int ban_localhost); |
|
|
/* auth.c */ |
/* auth.c */ |
Line 1144 int in_zone(struct auth_zone *zone, char *name, char *
|
Line 1255 int in_zone(struct auth_zone *zone, char *name, char *
|
#endif |
#endif |
|
|
/* dnssec.c */ |
/* dnssec.c */ |
size_t dnssec_generate_query(struct dns_header *header, unsigned char *end, char *name, int class, int type, union mysockaddr *addr, int edns_pktsz); | size_t dnssec_generate_query(struct dns_header *header, unsigned char *end, char *name, int class, int type, int edns_pktsz); |
int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t n, char *name, char *keyname, int class); | int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname, int class); |
int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname, int class); |
int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname, int class); |
int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname, int *class, |
int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname, int *class, |
int check_unsigned, int *neganswer, int *nons); | int check_unsigned, int *neganswer, int *nons, int *nsec_ttl); |
int dnskey_keytag(int alg, int flags, unsigned char *rdata, int rdlen); | int dnskey_keytag(int alg, int flags, unsigned char *key, int keylen); |
size_t filter_rrsigs(struct dns_header *header, size_t plen); |
size_t filter_rrsigs(struct dns_header *header, size_t plen); |
unsigned char* hash_questions(struct dns_header *header, size_t plen, char *name); |
|
int setup_timestamp(void); |
int setup_timestamp(void); |
|
|
|
/* hash_questions.c */ |
|
void hash_questions_init(void); |
|
unsigned char *hash_questions(struct dns_header *header, size_t plen, char *name); |
|
|
|
/* crypto.c */ |
|
const struct nettle_hash *hash_find(char *name); |
|
int hash_init(const struct nettle_hash *hash, void **ctxp, unsigned char **digestp); |
|
int verify(struct blockdata *key_data, unsigned int key_len, unsigned char *sig, size_t sig_len, |
|
unsigned char *digest, size_t digest_len, int algo); |
|
char *ds_digest_name(int digest); |
|
char *algo_digest_name(int algo); |
|
char *nsec3_digest_name(int digest); |
|
|
/* util.c */ |
/* util.c */ |
void rand_init(void); |
void rand_init(void); |
unsigned short rand16(void); |
unsigned short rand16(void); |
u32 rand32(void); |
u32 rand32(void); |
u64 rand64(void); |
u64 rand64(void); |
int legal_hostname(char *c); | int legal_hostname(char *name); |
char *canonicalise(char *s, int *nomem); | char *canonicalise(char *in, int *nomem); |
unsigned char *do_rfc1035_name(unsigned char *p, char *sval); | unsigned char *do_rfc1035_name(unsigned char *p, char *sval, char *limit); |
void *safe_malloc(size_t size); |
void *safe_malloc(size_t size); |
|
void safe_strncpy(char *dest, const char *src, size_t size); |
void safe_pipe(int *fd, int read_noblock); |
void safe_pipe(int *fd, int read_noblock); |
void *whine_malloc(size_t size); |
void *whine_malloc(size_t size); |
int sa_len(union mysockaddr *addr); |
int sa_len(union mysockaddr *addr); |
int sockaddr_isequal(union mysockaddr *s1, union mysockaddr *s2); |
int sockaddr_isequal(union mysockaddr *s1, union mysockaddr *s2); |
int hostname_isequal(const char *a, const char *b); |
int hostname_isequal(const char *a, const char *b); |
|
int hostname_issubdomain(char *a, char *b); |
time_t dnsmasq_time(void); |
time_t dnsmasq_time(void); |
int netmask_length(struct in_addr mask); |
int netmask_length(struct in_addr mask); |
int is_same_net(struct in_addr a, struct in_addr b, struct in_addr mask); |
int is_same_net(struct in_addr a, struct in_addr b, struct in_addr mask); |
#ifdef HAVE_IPV6 |
|
int is_same_net6(struct in6_addr *a, struct in6_addr *b, int prefixlen); |
int is_same_net6(struct in6_addr *a, struct in6_addr *b, int prefixlen); |
u64 addr6part(struct in6_addr *addr); |
u64 addr6part(struct in6_addr *addr); |
void setaddr6part(struct in6_addr *addr, u64 host); |
void setaddr6part(struct in6_addr *addr, u64 host); |
#endif |
|
int retry_send(ssize_t rc); |
int retry_send(ssize_t rc); |
void prettyprint_time(char *buf, unsigned int t); |
void prettyprint_time(char *buf, unsigned int t); |
int prettyprint_addr(union mysockaddr *addr, char *buf); |
int prettyprint_addr(union mysockaddr *addr, char *buf); |
Line 1186 int memcmp_masked(unsigned char *a, unsigned char *b,
|
Line 1309 int memcmp_masked(unsigned char *a, unsigned char *b,
|
int expand_buf(struct iovec *iov, size_t size); |
int expand_buf(struct iovec *iov, size_t size); |
char *print_mac(char *buff, unsigned char *mac, int len); |
char *print_mac(char *buff, unsigned char *mac, int len); |
int read_write(int fd, unsigned char *packet, int size, int rw); |
int read_write(int fd, unsigned char *packet, int size, int rw); |
| void close_fds(long max_fd, int spare1, int spare2, int spare3); |
int wildcard_match(const char* wildcard, const char* match); |
int wildcard_match(const char* wildcard, const char* match); |
int wildcard_matchn(const char* wildcard, const char* match, int num); |
int wildcard_matchn(const char* wildcard, const char* match, int num); |
|
#ifdef HAVE_LINUX_NETWORK |
|
int kernel_version(void); |
|
#endif |
|
|
/* log.c */ |
/* log.c */ |
void die(char *message, char *arg1, int exit_code); | void die(char *message, char *arg1, int exit_code) ATTRIBUTE_NORETURN; |
int log_start(struct passwd *ent_pw, int errfd); |
int log_start(struct passwd *ent_pw, int errfd); |
int log_reopen(char *log_file); |
int log_reopen(char *log_file); |
|
|
void my_syslog(int priority, const char *format, ...); |
void my_syslog(int priority, const char *format, ...); |
|
|
void set_log_writer(void); |
void set_log_writer(void); |
void check_log_writer(int force); |
void check_log_writer(int force); |
void flush_log(void); |
void flush_log(void); |
Line 1218 void receive_query(struct listener *listen, time_t now
|
Line 1346 void receive_query(struct listener *listen, time_t now
|
unsigned char *tcp_request(int confd, time_t now, |
unsigned char *tcp_request(int confd, time_t now, |
union mysockaddr *local_addr, struct in_addr netmask, int auth_dns); |
union mysockaddr *local_addr, struct in_addr netmask, int auth_dns); |
void server_gone(struct server *server); |
void server_gone(struct server *server); |
struct frec *get_new_frec(time_t now, int *wait, int force); | struct frec *get_new_frec(time_t now, int *wait, struct frec *force); |
int send_from(int fd, int nowild, char *packet, size_t len, |
int send_from(int fd, int nowild, char *packet, size_t len, |
union mysockaddr *to, struct all_addr *source, | union mysockaddr *to, union all_addr *source, |
unsigned int iface); |
unsigned int iface); |
void resend_query(); | void resend_query(void); |
struct randfd *allocate_rfd(int family); |
struct randfd *allocate_rfd(int family); |
void free_rfd(struct randfd *rfd); |
void free_rfd(struct randfd *rfd); |
|
|
/* network.c */ |
/* network.c */ |
int indextoname(int fd, int index, char *name); |
int indextoname(int fd, int index, char *name); |
int local_bind(int fd, union mysockaddr *addr, char *intname, int is_tcp); | int local_bind(int fd, union mysockaddr *addr, char *intname, unsigned int ifindex, int is_tcp); |
int random_sock(int family); |
int random_sock(int family); |
void pre_allocate_sfds(void); |
void pre_allocate_sfds(void); |
int reload_servers(char *fname); |
int reload_servers(char *fname); |
Line 1242 void add_update_server(int flags,
|
Line 1370 void add_update_server(int flags,
|
void check_servers(void); |
void check_servers(void); |
int enumerate_interfaces(int reset); |
int enumerate_interfaces(int reset); |
void create_wildcard_listeners(void); |
void create_wildcard_listeners(void); |
void create_bound_listeners(int die); | void create_bound_listeners(int dienow); |
void warn_bound_listeners(void); |
void warn_bound_listeners(void); |
|
void warn_wild_labels(void); |
void warn_int_names(void); |
void warn_int_names(void); |
int is_dad_listeners(void); |
int is_dad_listeners(void); |
int iface_check(int family, struct all_addr *addr, char *name, int *auth_dns); | int iface_check(int family, union all_addr *addr, char *name, int *auth); |
int loopback_exception(int fd, int family, struct all_addr *addr, char *name); | int loopback_exception(int fd, int family, union all_addr *addr, char *name); |
int label_exception(int index, int family, struct all_addr *addr); | int label_exception(int index, int family, union all_addr *addr); |
int fix_fd(int fd); |
int fix_fd(int fd); |
int tcp_interface(int fd, int af); |
int tcp_interface(int fd, int af); |
#ifdef HAVE_IPV6 |
|
int set_ipv6pktinfo(int fd); |
int set_ipv6pktinfo(int fd); |
#endif |
|
#ifdef HAVE_DHCP6 |
#ifdef HAVE_DHCP6 |
void join_multicast(int dienow); |
void join_multicast(int dienow); |
#endif |
#endif |
Line 1267 void newaddress(time_t now);
|
Line 1394 void newaddress(time_t now);
|
void dhcp_init(void); |
void dhcp_init(void); |
void dhcp_packet(time_t now, int pxe_fd); |
void dhcp_packet(time_t now, int pxe_fd); |
struct dhcp_context *address_available(struct dhcp_context *context, |
struct dhcp_context *address_available(struct dhcp_context *context, |
struct in_addr addr, | struct in_addr taddr, |
struct dhcp_netid *netids); |
struct dhcp_netid *netids); |
struct dhcp_context *narrow_context(struct dhcp_context *context, |
struct dhcp_context *narrow_context(struct dhcp_context *context, |
struct in_addr taddr, |
struct in_addr taddr, |
struct dhcp_netid *netids); |
struct dhcp_netid *netids); |
|
struct ping_result *do_icmp_ping(time_t now, struct in_addr addr, |
|
unsigned int hash, int loopback); |
int address_allocate(struct dhcp_context *context, |
int address_allocate(struct dhcp_context *context, |
struct in_addr *addrp, unsigned char *hwaddr, int hw_len, |
struct in_addr *addrp, unsigned char *hwaddr, int hw_len, |
struct dhcp_netid *netids, time_t now); | struct dhcp_netid *netids, time_t now, int loopback); |
void dhcp_read_ethers(void); |
void dhcp_read_ethers(void); |
struct dhcp_config *config_find_by_address(struct dhcp_config *configs, struct in_addr addr); |
struct dhcp_config *config_find_by_address(struct dhcp_config *configs, struct in_addr addr); |
char *host_from_dns(struct in_addr addr); |
char *host_from_dns(struct in_addr addr); |
Line 1289 struct dhcp_lease *lease4_allocate(struct in_addr addr
|
Line 1418 struct dhcp_lease *lease4_allocate(struct in_addr addr
|
#ifdef HAVE_DHCP6 |
#ifdef HAVE_DHCP6 |
struct dhcp_lease *lease6_allocate(struct in6_addr *addrp, int lease_type); |
struct dhcp_lease *lease6_allocate(struct in6_addr *addrp, int lease_type); |
struct dhcp_lease *lease6_find(unsigned char *clid, int clid_len, |
struct dhcp_lease *lease6_find(unsigned char *clid, int clid_len, |
int lease_type, int iaid, struct in6_addr *addr); | int lease_type, unsigned int iaid, struct in6_addr *addr); |
void lease6_reset(void); |
void lease6_reset(void); |
struct dhcp_lease *lease6_find_by_client(struct dhcp_lease *first, int lease_type, unsigned char *clid, int clid_len, int iaid); | struct dhcp_lease *lease6_find_by_client(struct dhcp_lease *first, int lease_type, |
| unsigned char *clid, int clid_len, unsigned int iaid); |
struct dhcp_lease *lease6_find_by_addr(struct in6_addr *net, int prefix, u64 addr); |
struct dhcp_lease *lease6_find_by_addr(struct in6_addr *net, int prefix, u64 addr); |
u64 lease_find_max_addr6(struct dhcp_context *context); |
u64 lease_find_max_addr6(struct dhcp_context *context); |
void lease_ping_reply(struct in6_addr *sender, unsigned char *packet, char *interface); |
void lease_ping_reply(struct in6_addr *sender, unsigned char *packet, char *interface); |
void lease_update_slaac(time_t now); |
void lease_update_slaac(time_t now); |
void lease_set_iaid(struct dhcp_lease *lease, int iaid); | void lease_set_iaid(struct dhcp_lease *lease, unsigned int iaid); |
void lease_make_duid(time_t now); |
void lease_make_duid(time_t now); |
#endif |
#endif |
void lease_set_hwaddr(struct dhcp_lease *lease, const unsigned char *hwaddr, |
void lease_set_hwaddr(struct dhcp_lease *lease, const unsigned char *hwaddr, |
Line 1323 void lease_add_extradata(struct dhcp_lease *lease, uns
|
Line 1453 void lease_add_extradata(struct dhcp_lease *lease, uns
|
/* rfc2131.c */ |
/* rfc2131.c */ |
#ifdef HAVE_DHCP |
#ifdef HAVE_DHCP |
size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index, |
size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index, |
size_t sz, time_t now, int unicast_dest, int *is_inform, int pxe_fd, struct in_addr fallback); | size_t sz, time_t now, int unicast_dest, int loopback, |
| int *is_inform, int pxe, struct in_addr fallback, time_t recvtime); |
unsigned char *extended_hwaddr(int hwtype, int hwlen, unsigned char *hwaddr, |
unsigned char *extended_hwaddr(int hwtype, int hwlen, unsigned char *hwaddr, |
int clid_len, unsigned char *clid, int *len_out); |
int clid_len, unsigned char *clid, int *len_out); |
#endif |
#endif |
Line 1332 unsigned char *extended_hwaddr(int hwtype, int hwlen,
|
Line 1463 unsigned char *extended_hwaddr(int hwtype, int hwlen,
|
#ifdef HAVE_DHCP |
#ifdef HAVE_DHCP |
int make_icmp_sock(void); |
int make_icmp_sock(void); |
int icmp_ping(struct in_addr addr); |
int icmp_ping(struct in_addr addr); |
|
int delay_dhcp(time_t start, int sec, int fd, uint32_t addr, unsigned short id); |
#endif |
#endif |
void queue_event(int event); |
void queue_event(int event); |
void send_alarm(time_t event, time_t now); |
void send_alarm(time_t event, time_t now); |
Line 1340 void clear_cache_and_reload(time_t now);
|
Line 1472 void clear_cache_and_reload(time_t now);
|
|
|
/* netlink.c */ |
/* netlink.c */ |
#ifdef HAVE_LINUX_NETWORK |
#ifdef HAVE_LINUX_NETWORK |
void netlink_init(void); | char *netlink_init(void); |
void netlink_multicast(void); |
void netlink_multicast(void); |
#endif |
#endif |
|
|
Line 1366 void emit_dbus_signal(int action, struct dhcp_lease *l
|
Line 1498 void emit_dbus_signal(int action, struct dhcp_lease *l
|
# endif |
# endif |
#endif |
#endif |
|
|
|
/* ubus.c */ |
|
#ifdef HAVE_UBUS |
|
void ubus_init(void); |
|
void set_ubus_listeners(void); |
|
void check_ubus_listeners(void); |
|
void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name, const char *interface); |
|
#endif |
|
|
/* ipset.c */ |
/* ipset.c */ |
#ifdef HAVE_IPSET |
#ifdef HAVE_IPSET |
void ipset_init(void); |
void ipset_init(void); |
int add_to_ipset(const char *setname, const struct all_addr *ipaddr, int flags, int remove); | int add_to_ipset(const char *setname, const union all_addr *ipaddr, int flags, int remove); |
#endif |
#endif |
|
|
/* helper.c */ |
/* helper.c */ |
Line 1382 void queue_script(int action, struct dhcp_lease *lease
|
Line 1522 void queue_script(int action, struct dhcp_lease *lease
|
void queue_tftp(off_t file_len, char *filename, union mysockaddr *peer); |
void queue_tftp(off_t file_len, char *filename, union mysockaddr *peer); |
#endif |
#endif |
void queue_arp(int action, unsigned char *mac, int maclen, |
void queue_arp(int action, unsigned char *mac, int maclen, |
int family, struct all_addr *addr); | int family, union all_addr *addr); |
int helper_buf_empty(void); |
int helper_buf_empty(void); |
#endif |
#endif |
|
|
Line 1395 int do_tftp_script_run(void);
|
Line 1535 int do_tftp_script_run(void);
|
|
|
/* conntrack.c */ |
/* conntrack.c */ |
#ifdef HAVE_CONNTRACK |
#ifdef HAVE_CONNTRACK |
int get_incoming_mark(union mysockaddr *peer_addr, struct all_addr *local_addr, | int get_incoming_mark(union mysockaddr *peer_addr, union all_addr *local_addr, |
int istcp, unsigned int *markp); |
int istcp, unsigned int *markp); |
#endif |
#endif |
|
|
Line 1404 int get_incoming_mark(union mysockaddr *peer_addr, str
|
Line 1544 int get_incoming_mark(union mysockaddr *peer_addr, str
|
void dhcp6_init(void); |
void dhcp6_init(void); |
void dhcp6_packet(time_t now); |
void dhcp6_packet(time_t now); |
struct dhcp_context *address6_allocate(struct dhcp_context *context, unsigned char *clid, int clid_len, int temp_addr, |
struct dhcp_context *address6_allocate(struct dhcp_context *context, unsigned char *clid, int clid_len, int temp_addr, |
int iaid, int serial, struct dhcp_netid *netids, int plain_range, struct in6_addr *ans); | unsigned int iaid, int serial, struct dhcp_netid *netids, int plain_range, struct in6_addr *ans); |
int config_valid(struct dhcp_config *config, struct dhcp_context *context, struct in6_addr *addr); | |
struct dhcp_context *address6_available(struct dhcp_context *context, |
struct dhcp_context *address6_available(struct dhcp_context *context, |
struct in6_addr *taddr, |
struct in6_addr *taddr, |
struct dhcp_netid *netids, |
struct dhcp_netid *netids, |
Line 1415 struct dhcp_context *address6_valid(struct dhcp_contex
|
Line 1554 struct dhcp_context *address6_valid(struct dhcp_contex
|
struct dhcp_netid *netids, |
struct dhcp_netid *netids, |
int plain_range); |
int plain_range); |
struct dhcp_config *config_find_by_address6(struct dhcp_config *configs, struct in6_addr *net, |
struct dhcp_config *config_find_by_address6(struct dhcp_config *configs, struct in6_addr *net, |
int prefix, u64 addr); | int prefix, struct in6_addr *addr); |
void make_duid(time_t now); |
void make_duid(time_t now); |
void dhcp_construct_contexts(time_t now); |
void dhcp_construct_contexts(time_t now); |
void get_client_mac(struct in6_addr *client, int iface, unsigned char *mac, |
void get_client_mac(struct in6_addr *client, int iface, unsigned char *mac, |
Line 1437 unsigned short relay_reply6( struct sockaddr_in6 *peer
|
Line 1576 unsigned short relay_reply6( struct sockaddr_in6 *peer
|
#ifdef HAVE_DHCP |
#ifdef HAVE_DHCP |
void dhcp_common_init(void); |
void dhcp_common_init(void); |
ssize_t recv_dhcp_packet(int fd, struct msghdr *msg); |
ssize_t recv_dhcp_packet(int fd, struct msghdr *msg); |
struct dhcp_netid *run_tag_if(struct dhcp_netid *input); | struct dhcp_netid *run_tag_if(struct dhcp_netid *tags); |
struct dhcp_netid *option_filter(struct dhcp_netid *tags, struct dhcp_netid *context_tags, |
struct dhcp_netid *option_filter(struct dhcp_netid *tags, struct dhcp_netid *context_tags, |
struct dhcp_opt *opts); |
struct dhcp_opt *opts); |
int match_netid(struct dhcp_netid *check, struct dhcp_netid *pool, int negonly); | int match_netid(struct dhcp_netid *check, struct dhcp_netid *pool, int tagnotneeded); |
char *strip_hostname(char *hostname); |
char *strip_hostname(char *hostname); |
void log_tags(struct dhcp_netid *netid, u32 xid); |
void log_tags(struct dhcp_netid *netid, u32 xid); |
int match_bytes(struct dhcp_opt *o, unsigned char *p, int len); |
int match_bytes(struct dhcp_opt *o, unsigned char *p, int len); |
Line 1448 void dhcp_update_configs(struct dhcp_config *configs);
|
Line 1587 void dhcp_update_configs(struct dhcp_config *configs);
|
void display_opts(void); |
void display_opts(void); |
int lookup_dhcp_opt(int prot, char *name); |
int lookup_dhcp_opt(int prot, char *name); |
int lookup_dhcp_len(int prot, int val); |
int lookup_dhcp_len(int prot, int val); |
char *option_string(int prot, unsigned int opt, unsigned char *val, |
|
int opt_len, char *buf, int buf_len); |
|
struct dhcp_config *find_config(struct dhcp_config *configs, |
struct dhcp_config *find_config(struct dhcp_config *configs, |
struct dhcp_context *context, |
struct dhcp_context *context, |
unsigned char *clid, int clid_len, |
unsigned char *clid, int clid_len, |
unsigned char *hwaddr, int hw_len, |
unsigned char *hwaddr, int hw_len, |
int hw_type, char *hostname); | int hw_type, char *hostname, |
| struct dhcp_netid *filter); |
int config_has_mac(struct dhcp_config *config, unsigned char *hwaddr, int len, int type); |
int config_has_mac(struct dhcp_config *config, unsigned char *hwaddr, int len, int type); |
#ifdef HAVE_LINUX_NETWORK |
#ifdef HAVE_LINUX_NETWORK |
char *whichdevice(void); |
char *whichdevice(void); |
Line 1470 void log_relay(int family, struct dhcp_relay *relay);
|
Line 1608 void log_relay(int family, struct dhcp_relay *relay);
|
/* outpacket.c */ |
/* outpacket.c */ |
#ifdef HAVE_DHCP6 |
#ifdef HAVE_DHCP6 |
void end_opt6(int container); |
void end_opt6(int container); |
|
void reset_counter(void); |
int save_counter(int newval); |
int save_counter(int newval); |
void *expand(size_t headroom); |
void *expand(size_t headroom); |
int new_opt6(int opt); |
int new_opt6(int opt); |
Line 1485 void put_opt6_string(char *s);
|
Line 1624 void put_opt6_string(char *s);
|
void ra_init(time_t now); |
void ra_init(time_t now); |
void icmp6_packet(time_t now); |
void icmp6_packet(time_t now); |
time_t periodic_ra(time_t now); |
time_t periodic_ra(time_t now); |
void ra_start_unsolicted(time_t now, struct dhcp_context *context); | void ra_start_unsolicited(time_t now, struct dhcp_context *context); |
#endif |
#endif |
|
|
/* slaac.c */ |
/* slaac.c */ |
Line 1497 void slaac_ping_reply(struct in6_addr *sender, unsigne
|
Line 1636 void slaac_ping_reply(struct in6_addr *sender, unsigne
|
|
|
/* loop.c */ |
/* loop.c */ |
#ifdef HAVE_LOOP |
#ifdef HAVE_LOOP |
void loop_send_probes(); | void loop_send_probes(void); |
int detect_loop(char *query, int type); |
int detect_loop(char *query, int type); |
#endif |
#endif |
|
|
/* inotify.c */ |
/* inotify.c */ |
#ifdef HAVE_INOTIFY |
#ifdef HAVE_INOTIFY |
void inotify_dnsmasq_init(); | void inotify_dnsmasq_init(void); |
int inotify_check(time_t now); |
int inotify_check(time_t now); |
void set_dynamic_inotify(int flag, int total_size, struct crec **rhash, int revhashsz); |
void set_dynamic_inotify(int flag, int total_size, struct crec **rhash, int revhashsz); |
#endif |
#endif |
Line 1526 size_t add_pseudoheader(struct dns_header *header, siz
|
Line 1665 size_t add_pseudoheader(struct dns_header *header, siz
|
unsigned short udp_sz, int optno, unsigned char *opt, size_t optlen, int set_do, int replace); |
unsigned short udp_sz, int optno, unsigned char *opt, size_t optlen, int set_do, int replace); |
size_t add_do_bit(struct dns_header *header, size_t plen, unsigned char *limit); |
size_t add_do_bit(struct dns_header *header, size_t plen, unsigned char *limit); |
size_t add_edns0_config(struct dns_header *header, size_t plen, unsigned char *limit, |
size_t add_edns0_config(struct dns_header *header, size_t plen, unsigned char *limit, |
union mysockaddr *source, time_t now, int *check_subnet); | union mysockaddr *source, time_t now, int *check_subnet, int *cacheable); |
int check_source(struct dns_header *header, size_t plen, unsigned char *pseudoheader, union mysockaddr *peer); |
int check_source(struct dns_header *header, size_t plen, unsigned char *pseudoheader, union mysockaddr *peer); |
|
|
/* arp.c */ |
/* arp.c */ |
int find_mac(union mysockaddr *addr, unsigned char *mac, int lazy, time_t now); |
int find_mac(union mysockaddr *addr, unsigned char *mac, int lazy, time_t now); |
int do_arp_script_run(void); |
int do_arp_script_run(void); |
|
|
|
/* dump.c */ |
|
#ifdef HAVE_DUMPFILE |
|
void dump_init(void); |
|
void dump_packet(int mask, void *packet, size_t len, union mysockaddr *src, union mysockaddr *dst); |
|
#endif |