djbdnscurve6 45
djbdnscurve6
Loading...
Searching...
No Matches
query.h
Go to the documentation of this file.
1#ifndef QUERY_H
2#define QUERY_H
3
4#include "dns.h"
5#include "uint_t.h"
6
7/* the following constants can be changed on own risk; defaults Y2018 with partial IPv6 support at provider */
8
9#define QUERY_MAXLEVEL 5 /* search depth */
10#define QUERY_MAXALIAS 16 /* glue depth */
11#define QUERY_MAXLOOP 100 /* queries per NS */
12#
13#define QUERY_MAXUDP 400 /* used by dnscache */
14#define QUERY_MAXTCP 40
15
16/* byte patterns for well-known IP addresses and names in DNS messages */
17
18#define IP6_LOOPBACK_ARPA \
19"\0011\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\003ip6\004arpa\0"
20#define IP6_LOCALNET_ARPA \
21"\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\003ip6\004arpa\0"
22#define IP6_MULTICAST_ARPA \
23"\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\001f\001f\003ip6\004arpa\0"
24#define IP6_ALLNODESMULTICAST_ARPA \
25"\0011\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0012\0010\001f\001f\003ip6\004arpa\0"
26#define IP6_ALLROUTERSMULTICAST_ARPA \
27"\0012\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0010\0012\0010\001f\001f\003ip6\004arpa\0"
28
29#define IP6_LOOPBACK_OCTAL \
30"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001"
31#define IP6_UNSPECIFIED_OCTAL \
32"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
33#define IP6_MULTICASTPFX_OCTAL \
34"\377\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
35#define IP6_ALLNODES_OCTAL \
36"\377\002\000\000\000\000\000\000\000\000\000\000\000\000\000\001"
37#define IP6_ALLROUTERS_OCTAL \
38"\377\002\000\000\000\000\000\000\000\000\000\000\000\000\000\002"
39
40#define IP4_LOCALHOST_ARPA \
41"\0010\0010\0010\0010\7in-addr\4arpa\0"
42#define IP4_LOOPBACK_ARPA \
43"\0011\0010\0010\003127\7in-addr\4arpa\0"
44
45#define IP4_LOOPBACK_OCTAL \
46"\177\0\0\1"
47#define IP4_LOCALHOST_OCTAL \
48"\0\0\0\0"
49
50// #define LOCALHOST IP4_LOOPBACK_OCTAL /* RFC 2606: .localhost (sec 2) */
51#define IP4_LOCALNET IP4_LOCALHOST_OCTAL
52#define IP6_LOCALNET IP6_UNSPECIFIED_OCTAL
53#define IP6_LOCALHOST IP6_LOOPBACK_OCTAL
54#define IP6_LOCALHOST_ARPA IP6_LOOPBACK_ARPA
55
56struct query {
57 unsigned int loop;
58 unsigned int level;
60 char *control[QUERY_MAXLEVEL]; /* pointing inside name; flagusetxtformat */
63 char keys[QUERY_MAXLEVEL][QUERY_MAXNS * 32]; /* each NS has a 32 byte pubkey */
68 char localip[16];
69 uint32 scope_id;
70 char type[2];
71 char class[2];
72 uint32 byzg;
74 } ;
75
76extern int query_start(struct query *,char *,char *,char *,char *,uint32);
77extern int query_get(struct query *,iopause_fd *,struct taia *);
78extern void query_io(struct query *,iopause_fd *,struct taia *);
79
80extern void query_init(void);
81extern void query_forwardonly(void);
82
83#endif
#define QUERY_MAXIPLEN
Definition: dns.h:45
#define QUERY_MAXNS
Definition: dns.h:44
#define QUERY_MAXALIAS
Definition: query.h:10
void query_init(void)
Definition: query.c:23
int query_start(struct query *, char *, char *, char *, char *, uint32)
void query_io(struct query *, iopause_fd *, struct taia *)
Definition: query.c:1203
#define QUERY_MAXLEVEL
Definition: query.h:9
int query_get(struct query *, iopause_fd *, struct taia *)
Definition: query.c:1192
void query_forwardonly(void)
Definition: query.c:36
Definition: query.h:56
uint32 scope_id
Definition: query.h:69
char * name[QUERY_MAXLEVEL]
Definition: query.h:59
uint32 byzg
Definition: query.h:72
char keys[QUERY_MAXLEVEL][QUERY_MAXNS *32]
Definition: query.h:63
char localip[16]
Definition: query.h:68
char ipv6[QUERY_MAXLEVEL]
Definition: query.h:67
char * alias[QUERY_MAXALIAS]
Definition: query.h:65
char type[2]
Definition: query.h:70
unsigned int level
Definition: query.h:58
int flagnskeys[QUERY_MAXLEVEL]
Definition: query.h:64
char * control[QUERY_MAXLEVEL]
Definition: query.h:60
unsigned int loop
Definition: query.h:57
char servers[QUERY_MAXLEVEL][QUERY_MAXIPLEN]
Definition: query.h:62
char * ns[QUERY_MAXLEVEL][QUERY_MAXNS]
Definition: query.h:61
struct dns_transmit dt
Definition: query.h:73
uint32 aliasttl[QUERY_MAXALIAS]
Definition: query.h:66