version 1.1.1.1, 2013/07/29 19:37:40
|
version 1.1.1.2, 2014/06/15 16:31:38
|
Line 1
|
Line 1
|
/* dnsmasq is Copyright (c) 2000-2013 Simon Kelley | /* dnsmasq is Copyright (c) 2000-2014 Simon Kelley |
|
|
This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
Line 36
|
Line 36
|
|
|
#define C_IN 1 /* the arpa internet */ |
#define C_IN 1 /* the arpa internet */ |
#define C_CHAOS 3 /* for chaos net (MIT) */ |
#define C_CHAOS 3 /* for chaos net (MIT) */ |
|
#define C_HESIOD 4 /* hesiod */ |
#define C_ANY 255 /* wildcard match */ |
#define C_ANY 255 /* wildcard match */ |
|
|
#define T_A 1 |
#define T_A 1 |
#define T_NS 2 | #define T_NS 2 |
| #define T_MD 3 |
| #define T_MF 4 |
#define T_CNAME 5 |
#define T_CNAME 5 |
#define T_SOA 6 |
#define T_SOA 6 |
|
#define T_MB 7 |
|
#define T_MG 8 |
|
#define T_MR 9 |
#define T_PTR 12 |
#define T_PTR 12 |
|
#define T_MINFO 14 |
#define T_MX 15 |
#define T_MX 15 |
#define T_TXT 16 |
#define T_TXT 16 |
|
#define T_RP 17 |
|
#define T_AFSDB 18 |
|
#define T_RT 21 |
#define T_SIG 24 |
#define T_SIG 24 |
|
#define T_PX 26 |
#define T_AAAA 28 |
#define T_AAAA 28 |
|
#define T_NXT 30 |
#define T_SRV 33 |
#define T_SRV 33 |
#define T_NAPTR 35 |
#define T_NAPTR 35 |
|
#define T_KX 36 |
|
#define T_DNAME 39 |
#define T_OPT 41 |
#define T_OPT 41 |
|
#define T_DS 43 |
|
#define T_RRSIG 46 |
|
#define T_NSEC 47 |
|
#define T_DNSKEY 48 |
|
#define T_NSEC3 50 |
#define T_TKEY 249 |
#define T_TKEY 249 |
#define T_TSIG 250 |
#define T_TSIG 250 |
#define T_AXFR 252 |
#define T_AXFR 252 |
#define T_MAILB 253 |
#define T_MAILB 253 |
#define T_ANY 255 |
#define T_ANY 255 |
|
|
|
#define EDNS0_OPTION_MAC 65001 /* dyndns.org temporary assignment */ |
|
#define EDNS0_OPTION_CLIENT_SUBNET 8 /* IANA */ |
|
|
struct dns_header { |
struct dns_header { |
u16 id; |
u16 id; |
u8 hb3,hb4; |
u8 hb3,hb4; |
Line 74 struct dns_header {
|
Line 96 struct dns_header {
|
#define HB4_RCODE 0x0f |
#define HB4_RCODE 0x0f |
|
|
#define OPCODE(x) (((x)->hb3 & HB3_OPCODE) >> 3) |
#define OPCODE(x) (((x)->hb3 & HB3_OPCODE) >> 3) |
|
#define SET_OPCODE(x, code) (x)->hb3 = ((x)->hb3 & ~HB3_OPCODE) | code |
|
|
#define RCODE(x) ((x)->hb4 & HB4_RCODE) |
#define RCODE(x) ((x)->hb4 & HB4_RCODE) |
#define SET_RCODE(x, code) (x)->hb4 = ((x)->hb4 & ~HB4_RCODE) | code |
#define SET_RCODE(x, code) (x)->hb4 = ((x)->hb4 & ~HB4_RCODE) | code |
|
|
Line 113 struct dns_header {
|
Line 137 struct dns_header {
|
(cp) += 4; \ |
(cp) += 4; \ |
} |
} |
|
|
|
#define CHECK_LEN(header, pp, plen, len) \ |
|
((size_t)((pp) - (unsigned char *)(header) + (len)) <= (plen)) |
|
|
|
#define ADD_RDLEN(header, pp, plen, len) \ |
|
(!CHECK_LEN(header, pp, plen, len) ? 0 : (((pp) += (len)), 1)) |