X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fmdnsd.git;a=blobdiff_plain;f=dns.h;h=ba34a8589bc2f57d1f68c2fd73dc1ceaa7df98c0;hp=45901231847984724a1262ab931107bd2fe4ad4c;hb=571cc214415f40ea52a98eed6b450b74be69c6f9;hpb=6585bb9209c56d1653c0527ed5b7de4a6279b7bb diff --git a/dns.h b/dns.h index 4590123..ba34a85 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 @@ -64,16 +66,13 @@ struct dns_question { uint16_t class; } __attribute__((packed, aligned(2))); -extern char rdata_buffer[MAX_DATA_LEN + 1]; - -extern void dns_send_question(struct uloop_fd *u, char *question, int type); -extern void dns_init_answer(void); -extern void dns_add_answer(int type, uint8_t *rdata, uint16_t rdlength); -extern void dns_send_answer(struct uloop_fd *u, char *answer); -extern char* dns_consume_name(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); +struct interface; + +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); +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); #endif