FD.io VPP  v20.01-48-g3e0dafb74
Vector Packet Processing
dns_packet.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DNS_RCODE_MASK   (0xf)
 
#define DNS_RCODE_NO_ERROR   0
 
#define DNS_RCODE_FORMAT_ERROR   1
 
#define DNS_RCODE_SERVER_FAILURE   2
 
#define DNS_RCODE_NAME_ERROR   3
 
#define DNS_RCODE_NOT_IMPLEMENTED   4
 
#define DNS_RCODE_REFUSED   5
 
#define DNS_RA   (1<<7)
 recursion available More...
 
#define DNS_RD   (1<<8)
 recursion desired More...
 
#define DNS_TC   (1<<9)
 truncation More...
 
#define DNS_AA   (1<<10)
 authoritative answer More...
 
#define DNS_OPCODE_MASK   (0xf<<11)
 opcode mask More...
 
#define DNS_OPCODE_QUERY   (0<<11)
 standard query More...
 
#define DNS_OPCODE_IQUERY   (1<<11)
 inverse query (deprecated) More...
 
#define DNS_OPCODE_STATUS   (2<<11)
 server status More...
 
#define DNS_QR   (1<<15)
 query=0, response=1 More...
 
#define foreach_dns_type
 Host info. More...
 
#define DNS_CLASS_IN   1
 The Internet. More...
 

Enumerations

enum  dns_type_t { foreach_dns_type }
 

Functions

typedef CLIB_PACKED (struct { u16 id;u16 flags;u16 qdcount;u16 anscount;u16 nscount;u16 arcount;}) dns_header_t
 DNS packet header format. More...
 
typedef CLIB_PACKED (struct { u16 type;u16 class;}) dns_query_t
 DNS "question" fixed header. More...
 
typedef CLIB_PACKED (struct { u16 type;u16 class;u32 ttl;u16 rdlength;u8 rdata[0];}) dns_rr_t
 DNS RR fixed header. More...
 

Macro Definition Documentation

◆ DNS_AA

#define DNS_AA   (1<<10)

authoritative answer

Definition at line 45 of file dns_packet.h.

◆ DNS_CLASS_IN

#define DNS_CLASS_IN   1

The Internet.

Definition at line 145 of file dns_packet.h.

◆ DNS_OPCODE_IQUERY

#define DNS_OPCODE_IQUERY   (1<<11)

inverse query (deprecated)

Definition at line 48 of file dns_packet.h.

◆ DNS_OPCODE_MASK

#define DNS_OPCODE_MASK   (0xf<<11)

opcode mask

Definition at line 46 of file dns_packet.h.

◆ DNS_OPCODE_QUERY

#define DNS_OPCODE_QUERY   (0<<11)

standard query

Definition at line 47 of file dns_packet.h.

◆ DNS_OPCODE_STATUS

#define DNS_OPCODE_STATUS   (2<<11)

server status

Definition at line 49 of file dns_packet.h.

◆ DNS_QR

#define DNS_QR   (1<<15)

query=0, response=1

Definition at line 50 of file dns_packet.h.

◆ DNS_RA

#define DNS_RA   (1<<7)

recursion available

Definition at line 42 of file dns_packet.h.

◆ DNS_RCODE_FORMAT_ERROR

#define DNS_RCODE_FORMAT_ERROR   1

Definition at line 36 of file dns_packet.h.

◆ DNS_RCODE_MASK

#define DNS_RCODE_MASK   (0xf)

Definition at line 34 of file dns_packet.h.

◆ DNS_RCODE_NAME_ERROR

#define DNS_RCODE_NAME_ERROR   3

Definition at line 38 of file dns_packet.h.

◆ DNS_RCODE_NO_ERROR

#define DNS_RCODE_NO_ERROR   0

Definition at line 35 of file dns_packet.h.

◆ DNS_RCODE_NOT_IMPLEMENTED

#define DNS_RCODE_NOT_IMPLEMENTED   4

Definition at line 39 of file dns_packet.h.

◆ DNS_RCODE_REFUSED

#define DNS_RCODE_REFUSED   5

Definition at line 40 of file dns_packet.h.

◆ DNS_RCODE_SERVER_FAILURE

#define DNS_RCODE_SERVER_FAILURE   2

Definition at line 37 of file dns_packet.h.

◆ DNS_RD

#define DNS_RD   (1<<8)

recursion desired

Definition at line 43 of file dns_packet.h.

◆ DNS_TC

#define DNS_TC   (1<<9)

truncation

Definition at line 44 of file dns_packet.h.

◆ foreach_dns_type

#define foreach_dns_type
Value:
_(A, 1) /**< ip4 host address */ \
_(AAAA, 28) /**< ip6 host address */ \
_(ALL, 255) /**< all available data */ \
_(TEXT, 16) /**< a text string */ \
_(NAMESERVER, 2) /**< a nameserver */ \
_(CNAME, 5) /**< a CNAME (alias) */ \
_(MAIL_EXCHANGE, 15) /**< a mail exchange */ \
_(PTR, 12) /**< a PTR (pointer) record */ \
_(HINFO, 13)
#define A(x)
Definition: main.c:1021

Host info.

Definition at line 127 of file dns_packet.h.

Enumeration Type Documentation

◆ dns_type_t

enum dns_type_t
Enumerator
foreach_dns_type 

Definition at line 138 of file dns_packet.h.

Function Documentation

◆ CLIB_PACKED() [1/3]

typedef CLIB_PACKED ( struct { u16 id;u16 flags;u16 qdcount;u16 anscount;u16 nscount;u16 arcount;}  )

DNS packet header format.

◆ CLIB_PACKED() [2/3]

typedef CLIB_PACKED ( struct { u16 type;u16 class;}  )

DNS "question" fixed header.

◆ CLIB_PACKED() [3/3]

typedef CLIB_PACKED ( struct { u16 type;u16 class;u32 ttl;u16 rdlength;u8 rdata[0];}  )

DNS RR fixed header.