X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=dns.h;h=492b2e8875546df57bbc6236d504183b8c3844c7;hb=891447c1a9db8a55f769241c94f4400e16f43dd9;hp=6edf1de569ce420c203a3af282ba1db532a8ffef;hpb=70ec71015a42e6e4e04b0281b80ec80e5f5f959a;p=project%2Fmdnsd.git diff --git a/dns.h b/dns.h index 6edf1de..492b2e8 100644 --- a/dns.h +++ b/dns.h @@ -14,6 +14,8 @@ #ifndef _DNS_H__ #define _DNS_H__ +#include + #define FLAG_RESPONSE 0x8000 #define FLAG_AUTHORATIVE 0x0400 @@ -27,6 +29,7 @@ #define IS_COMPRESSED(x) ((x & 0xc0) == 0xc0) #define MCAST_ADDR "224.0.0.251" +#define MCAST_ADDR6 "ff02::fb" #define MCAST_PORT 5353 #define CLASS_FLUSH 0x8000 @@ -65,17 +68,13 @@ struct dns_question { } __attribute__((packed, aligned(2))); struct interface; - -extern char rdata_buffer[MAX_DATA_LEN + 1]; - -extern void dns_send_question(struct interface *iface, const char *question, int type); -extern void dns_init_answer(void); -extern void dns_add_answer(int type, const uint8_t *rdata, uint16_t rdlength); -extern void dns_send_answer(struct interface *iface, const char *answer); -extern char* dns_consume_name(const uint8_t *base, int blen, uint8_t **data, int *len); -extern struct dns_answer* dns_consume_answer(uint8_t **data, int *len); -extern struct dns_question* dns_consume_question(uint8_t **data, int *len); -extern struct dns_header* dns_consume_header(uint8_t **data, int *len); -extern const char* dns_type_string(uint16_t type); +extern int cfg_proto; + +void dns_send_question(struct interface *iface, const char *question, int type); +void dns_init_answer(void); +void dns_add_answer(int type, const uint8_t *rdata, uint16_t rdlength, int ttl); +void dns_send_answer(struct interface *iface, const char *answer); +const char* dns_type_string(uint16_t type); +void dns_handle_packet(struct interface *iface, uint8_t *buf, int len, int unicast); #endif