diff options
Diffstat (limited to 'src/dnsmasq.h')
-rw-r--r-- | src/dnsmasq.h | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/src/dnsmasq.h b/src/dnsmasq.h index 4220798..914f469 100644 --- a/src/dnsmasq.h +++ b/src/dnsmasq.h @@ -157,7 +157,7 @@ extern int capget(cap_user_header_t header, cap_user_data_t data); #include <priv.h> #endif -#ifdef HAVE_DNSSEC +#if defined(HAVE_DNSSEC) || defined(HAVE_NETTLEHASH) # include <nettle/nettle-meta.h> #endif @@ -653,23 +653,25 @@ struct hostsfile { #define FREC_DO_QUESTION 64 #define FREC_ADDED_PHEADER 128 #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 20 /* SHA-1 digest size */ -#else -#define HASH_SIZE sizeof(int) -#endif +#define HASH_SIZE 32 /* SHA-256 digest size */ struct frec { - union mysockaddr source; - union all_addr dest; + struct frec_src { + union mysockaddr source; + union all_addr dest; + unsigned int iface, log_id; + unsigned short orig_id; + struct frec_src *next; + } frec_src; struct server *sentto; /* NULL means free */ struct randfd *rfd4; struct randfd *rfd6; - unsigned int iface; - unsigned short orig_id, new_id; - int log_id, fd, forwardall, flags; + unsigned short new_id; + int fd, forwardall, flags; time_t time; unsigned char *hash[HASH_SIZE]; #ifdef HAVE_DNSSEC @@ -829,6 +831,7 @@ struct dhcp_opt { #define DHOPT_RFC3925 2048 #define DHOPT_TAGOK 4096 #define DHOPT_ADDR6 8192 +#define DHOPT_VENDOR_PXE 16384 struct dhcp_boot { char *file, *sname, *tftp_sname; @@ -852,6 +855,8 @@ struct pxe_service { struct pxe_service *next; }; +#define DHCP_PXE_DEF_VENDOR "PXEClient" + #define MATCH_VENDOR 1 #define MATCH_USER 2 #define MATCH_CIRCUIT 3 @@ -867,6 +872,11 @@ struct dhcp_vendor { struct dhcp_vendor *next; }; +struct dhcp_pxe_vendor { + char *data; + struct dhcp_pxe_vendor *next; +}; + struct dhcp_mac { unsigned int mask; int hwaddr_len, hwaddr_type; @@ -1040,6 +1050,7 @@ extern struct daemon { struct dhcp_config *dhcp_conf; 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_mac *dhcp_macs; struct dhcp_boot *boot_config; @@ -1088,6 +1099,8 @@ extern struct daemon { int back_to_the_future; #endif struct frec *frec_list; + struct frec_src *free_frec_src; + int frec_src_count; struct serverfd *sfds; struct irec *interfaces; struct listener *listeners; @@ -1220,7 +1233,6 @@ int check_for_bogus_wildcard(struct dns_header *header, size_t qlen, char *name, 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_local_domain(char *name, time_t now); -unsigned int questions_crc(struct dns_header *header, size_t plen, char *name); size_t resize_packet(struct dns_header *header, size_t plen, unsigned char *pheader, size_t hlen); int add_resource_record(struct dns_header *header, char *limit, int *truncp, @@ -1245,9 +1257,11 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch int check_unsigned, int *neganswer, int *nons, int *nsec_ttl); int dnskey_keytag(int alg, int flags, unsigned char *key, int keylen); 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); +/* hash_questions.c */ +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); @@ -1645,7 +1659,7 @@ size_t add_pseudoheader(struct dns_header *header, size_t plen, unsigned char *l 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_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); /* arp.c */ |