## page was renamed from DNS/実装/djbdns/dnscache/query.c ## page was renamed from DNS/dnscache/query.c = DNS/dnscache/query.c = について、ここに記述してください。 <> [[DNS/query_type/any]] [[/any_type]] http://cr.yp.to/djbdns/dns_transmit.html {{{ #ifndef QUERY_H #define QUERY_H #include "dns.h" #include "uint32.h" #define QUERY_MAXLEVEL 5 #define QUERY_MAXALIAS 16 #define QUERY_MAXNS 16 struct query { unsigned int loop; unsigned int level; char *name[QUERY_MAXLEVEL]; char *control[QUERY_MAXLEVEL]; /* pointing inside name */ char *ns[QUERY_MAXLEVEL][QUERY_MAXNS]; char servers[QUERY_MAXLEVEL][64]; char *alias[QUERY_MAXALIAS]; uint32 aliasttl[QUERY_MAXALIAS]; char localip[4]; char type[2]; char class[2]; struct dns_transmit dt; } ; extern int query_start(struct query *,char *,char *,char *,char *); extern void query_io(struct query *,iopause_fd *,struct taia *); extern int query_get(struct query *,iopause_fd *,struct taia *); extern void query_forwardonly(void); #endif }}} {{{ static int flagforwardonly = 0; static void cachegeneric(const char type[2],const char *d,const char *data,unsigned int datalen,uint32 ttl) static char save_buf[8192]; static unsigned int save_len; static unsigned int save_ok; static void save_start(void) static void save_data(const char *buf,unsigned int len) static void save_finish(const char type[2],const char *d,uint32 ttl) static int typematch(const char rtype[2],const char qtype[2]) static uint32 ttlget(char buf[4]) static void cleanup(struct query *z) static int rqa(struct query *z) static int globalip(char *d,char ip[4]) static char *t1 = 0; static char *t2 = 0; static char *t3 = 0; static char *cname = 0; static char *referral = 0; static unsigned int *records = 0; static int smaller(char *buf,unsigned int len,unsigned int pos1,unsigned int pos2) static int doit(struct query *z,int state) }}}