59 #ifndef LWIP_HDR_PROT_DNS_H 60 #define LWIP_HDR_PROT_DNS_H 69 #ifndef DNS_SERVER_PORT 70 #define DNS_SERVER_PORT 53 74 #define DNS_RRTYPE_A 1 75 #define DNS_RRTYPE_NS 2 76 #define DNS_RRTYPE_MD 3 77 #define DNS_RRTYPE_MF 4 78 #define DNS_RRTYPE_CNAME 5 79 #define DNS_RRTYPE_SOA 6 80 #define DNS_RRTYPE_MB 7 81 #define DNS_RRTYPE_MG 8 82 #define DNS_RRTYPE_MR 9 83 #define DNS_RRTYPE_NULL 10 84 #define DNS_RRTYPE_WKS 11 85 #define DNS_RRTYPE_PTR 12 86 #define DNS_RRTYPE_HINFO 13 87 #define DNS_RRTYPE_MINFO 14 88 #define DNS_RRTYPE_MX 15 89 #define DNS_RRTYPE_TXT 16 90 #define DNS_RRTYPE_AAAA 28 91 #define DNS_RRTYPE_SRV 33 92 #define DNS_RRTYPE_ANY 255 95 #define DNS_RRCLASS_IN 1 96 #define DNS_RRCLASS_CS 2 97 #define DNS_RRCLASS_CH 3 98 #define DNS_RRCLASS_HS 4 99 #define DNS_RRCLASS_ANY 255 100 #define DNS_RRCLASS_FLUSH 0x800 103 #define DNS_FLAG1_RESPONSE 0x80 104 #define DNS_FLAG1_OPCODE_STATUS 0x10 105 #define DNS_FLAG1_OPCODE_INVERSE 0x08 106 #define DNS_FLAG1_OPCODE_STANDARD 0x00 107 #define DNS_FLAG1_AUTHORATIVE 0x04 108 #define DNS_FLAG1_TRUNC 0x02 109 #define DNS_FLAG1_RD 0x01 110 #define DNS_FLAG2_RA 0x80 111 #define DNS_FLAG2_ERR_MASK 0x0f 112 #define DNS_FLAG2_ERR_NONE 0x00 113 #define DNS_FLAG2_ERR_NAME 0x03 115 #define DNS_HDR_GET_OPCODE(hdr) ((((hdr)->flags1) >> 3) & 0xF) 117 #ifdef PACK_STRUCT_USE_INCLUDES 118 # include "arch/bpstruct.h" 123 PACK_STRUCT_FIELD(u16_t
id);
124 PACK_STRUCT_FLD_8(u8_t flags1);
125 PACK_STRUCT_FLD_8(u8_t flags2);
126 PACK_STRUCT_FIELD(u16_t numquestions);
127 PACK_STRUCT_FIELD(u16_t numanswers);
128 PACK_STRUCT_FIELD(u16_t numauthrr);
129 PACK_STRUCT_FIELD(u16_t numextrarr);
130 } PACK_STRUCT_STRUCT;
132 #ifdef PACK_STRUCT_USE_INCLUDES 133 # include "arch/epstruct.h" 135 #define SIZEOF_DNS_HDR 12 141 #ifndef DNS_MQUERY_PORT 142 #define DNS_MQUERY_PORT 5353 146 #ifndef DNS_MQUERY_IPV4_GROUP_INIT 147 #define DNS_MQUERY_IPV4_GROUP_INIT IPADDR4_INIT_BYTES(224,0,0,251) 151 #ifndef DNS_MQUERY_IPV6_GROUP_INIT 152 #define DNS_MQUERY_IPV6_GROUP_INIT IPADDR6_INIT_HOST(0xFF020000,0,0,0xFB) #define PACK_STRUCT_BEGIN