FD.io VPP  v19.04.4-rc0-5-ge88582fac
Vector Packet Processing
dns.h File Reference
+ Include dependency graph for dns.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dns_pending_request_t
 
struct  dns_cache_entry_t
 
struct  dns_main_t
 

Macros

#define DNS_CACHE_ENTRY_FLAG_VALID   (1<<0)
 we have Actual Data More...
 
#define DNS_CACHE_ENTRY_FLAG_STATIC   (1<<1)
 static entry More...
 
#define DNS_CACHE_ENTRY_FLAG_CNAME   (1<<2)
 CNAME (indirect) entry. More...
 
#define DNS_RETRIES_PER_SERVER   3
 
#define DNS_RESOLVER_EVENT_RESOLVED   1
 
#define DNS_RESOLVER_EVENT_PENDING   2
 
#define foreach_dns46_request_error
 
#define foreach_dns46_reply_error
 

Enumerations

enum  dns_pending_request_type_t { DNS_API_PENDING_NAME_TO_IP = 1, DNS_API_PENDING_IP_TO_NAME, DNS_PEER_PENDING_NAME_TO_IP, DNS_PEER_PENDING_IP_TO_NAME }
 
enum  dns46_request_error_t { DNS46_REQUEST_N_ERROR }
 
enum  dns46_reply_error_t { DNS46_REPLY_N_ERROR }
 

Functions

void vnet_send_dns_request (dns_main_t *dm, dns_cache_entry_t *ep)
 
int vnet_dns_cname_indirection_nolock (dns_main_t *dm, u32 ep_index, u8 *reply)
 Handle cname indirection. More...
 
int vnet_dns_delete_entry_by_index_nolock (dns_main_t *dm, u32 index)
 
int vnet_dns_resolve_name (dns_main_t *dm, u8 *name, dns_pending_request_t *t, dns_cache_entry_t **retp)
 
void vnet_dns_send_dns6_request (dns_main_t *dm, dns_cache_entry_t *ep, ip6_address_t *server)
 
void vnet_dns_send_dns4_request (dns_main_t *dm, dns_cache_entry_t *ep, ip4_address_t *server)
 
void vnet_send_dns4_reply (dns_main_t *dm, dns_pending_request_t *t, dns_cache_entry_t *ep, vlib_buffer_t *b0)
 
void vnet_send_dns6_reply (dns_main_t *dm, dns_pending_request_t *t, dns_cache_entry_t *ep, vlib_buffer_t *b0)
 
u8vnet_dns_labels_to_name (u8 *label, u8 *full_text, u8 **parse_from_here)
 arc-function for the above. More...
 
static void dns_cache_lock (dns_main_t *dm)
 
static void dns_cache_unlock (dns_main_t *dm)
 

Variables

dns_main_t dns_main
 
vlib_node_registration_t dns46_reply_node
 (constructor) VLIB_REGISTER_NODE (dns46_reply_node) More...
 
vlib_node_registration_t dns4_request_node
 (constructor) VLIB_REGISTER_NODE (dns4_request_node) More...
 
vlib_node_registration_t dns6_request_node
 (constructor) VLIB_REGISTER_NODE (dns6_request_node) More...
 
vlib_node_registration_t dns_resolver_node
 (constructor) VLIB_REGISTER_NODE (dns_resolver_node) More...
 
format_function_t format_dns_reply
 

Macro Definition Documentation

◆ DNS_CACHE_ENTRY_FLAG_CNAME

#define DNS_CACHE_ENTRY_FLAG_CNAME   (1<<2)

CNAME (indirect) entry.

Definition at line 81 of file dns.h.

◆ DNS_CACHE_ENTRY_FLAG_STATIC

#define DNS_CACHE_ENTRY_FLAG_STATIC   (1<<1)

static entry

Definition at line 80 of file dns.h.

◆ DNS_CACHE_ENTRY_FLAG_VALID

#define DNS_CACHE_ENTRY_FLAG_VALID   (1<<0)

we have Actual Data

Definition at line 79 of file dns.h.

◆ DNS_RESOLVER_EVENT_PENDING

#define DNS_RESOLVER_EVENT_PENDING   2

Definition at line 86 of file dns.h.

◆ DNS_RESOLVER_EVENT_RESOLVED

#define DNS_RESOLVER_EVENT_RESOLVED   1

Definition at line 85 of file dns.h.

◆ DNS_RETRIES_PER_SERVER

#define DNS_RETRIES_PER_SERVER   3

Definition at line 83 of file dns.h.

◆ foreach_dns46_reply_error

#define foreach_dns46_reply_error
Value:
_(DISABLED, "DNS pkts punted (feature disabled)") \
_(PROCESSED, "DNS reply pkts processed") \
_(NO_ELT, "No DNS pool element") \
_(FORMAT_ERROR, "DNS format errors") \
_(TEST_DROP, "DNS reply pkt dropped for test purposes")

Definition at line 145 of file dns.h.

◆ foreach_dns46_request_error

#define foreach_dns46_request_error
Value:
_(NONE, "No error") \
_(UNIMPLEMENTED, "Unimplemented") \
_(PROCESSED, "DNS request pkts processed") \
_(IP_OPTIONS, "DNS pkts with ip options (dropped)") \
_(BAD_REQUEST, "DNS pkts with serious discrepanices (dropped)") \
_(TOO_MANY_REQUESTS, "DNS pkts asking too many questions") \
_(RESOLUTION_REQUIRED, "DNS pkts pending upstream name resolution")

Definition at line 128 of file dns.h.

Enumeration Type Documentation

◆ dns46_reply_error_t

Enumerator
DNS46_REPLY_N_ERROR 

Definition at line 152 of file dns.h.

◆ dns46_request_error_t

Enumerator
DNS46_REQUEST_N_ERROR 

Definition at line 137 of file dns.h.

◆ dns_pending_request_type_t

Enumerator
DNS_API_PENDING_NAME_TO_IP 
DNS_API_PENDING_IP_TO_NAME 
DNS_PEER_PENDING_NAME_TO_IP 
DNS_PEER_PENDING_IP_TO_NAME 

Definition at line 40 of file dns.h.

Function Documentation

◆ dns_cache_lock()

static void dns_cache_lock ( dns_main_t dm)
inlinestatic

Definition at line 189 of file dns.h.

+ Here is the caller graph for this function:

◆ dns_cache_unlock()

static void dns_cache_unlock ( dns_main_t dm)
inlinestatic

Definition at line 199 of file dns.h.

+ Here is the caller graph for this function:

◆ vnet_dns_cname_indirection_nolock()

int vnet_dns_cname_indirection_nolock ( dns_main_t dm,
u32  ep_index,
u8 reply 
)

Handle cname indirection.

JFC. Called with the cache locked. returns 0 if the reply is not a CNAME.

Definition at line 955 of file dns.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_dns_delete_entry_by_index_nolock()

int vnet_dns_delete_entry_by_index_nolock ( dns_main_t dm,
u32  index 
)

Definition at line 656 of file dns.c.

+ Here is the caller graph for this function:

◆ vnet_dns_labels_to_name()

u8* vnet_dns_labels_to_name ( u8 label,
u8 full_text,
u8 **  parse_from_here 
)

arc-function for the above.

Translate "0x3 f o o 0x3 c o m 0x0" into "foo.com" Produces a non-NULL-terminated u8 *vector. v format is your friend.

Definition at line 491 of file dns.c.

+ Here is the caller graph for this function:

◆ vnet_dns_resolve_name()

int vnet_dns_resolve_name ( dns_main_t dm,
u8 name,
dns_pending_request_t t,
dns_cache_entry_t **  retp 
)

Definition at line 802 of file dns.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_dns_send_dns4_request()

void vnet_dns_send_dns4_request ( dns_main_t dm,
dns_cache_entry_t ep,
ip4_address_t server 
)

Definition at line 219 of file dns.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_dns_send_dns6_request()

void vnet_dns_send_dns6_request ( dns_main_t dm,
dns_cache_entry_t ep,
ip6_address_t server 
)

Definition at line 335 of file dns.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_send_dns4_reply()

void vnet_send_dns4_reply ( dns_main_t dm,
dns_pending_request_t t,
dns_cache_entry_t ep,
vlib_buffer_t b0 
)

Definition at line 2737 of file dns.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_send_dns6_reply()

void vnet_send_dns6_reply ( dns_main_t dm,
dns_pending_request_t t,
dns_cache_entry_t ep,
vlib_buffer_t b0 
)

Definition at line 2729 of file dns.c.

+ Here is the caller graph for this function:

◆ vnet_send_dns_request()

void vnet_send_dns_request ( dns_main_t dm,
dns_cache_entry_t ep 
)

Definition at line 533 of file dns.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ dns46_reply_node

vlib_node_registration_t dns46_reply_node
Initial value:
=
{
.function = dns46_reply_node_fn,
.name = "dns46_reply",
.vector_size = sizeof (u32),
.format_trace = format_dns46_reply_trace,
.error_strings = dns46_reply_error_strings,
.n_next_nodes = DNS46_REPLY_N_NEXT,
.next_nodes = {
[DNS46_REPLY_NEXT_DROP] = "error-drop",
[DNS46_REPLY_NEXT_PUNT] = "error-punt",
},
}
static uword dns46_reply_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: reply_node.c:58
unsigned int u32
Definition: types.h:88
static u8 * format_dns46_reply_trace(u8 *s, va_list *args)
Definition: reply_node.c:31
static char * dns46_reply_error_strings[]
Definition: reply_node.c:44
#define ARRAY_LEN(x)
Definition: clib.h:62

(constructor) VLIB_REGISTER_NODE (dns46_reply_node)

Definition at line 42 of file reply_node.c.

◆ dns4_request_node

vlib_node_registration_t dns4_request_node

(constructor) VLIB_REGISTER_NODE (dns4_request_node)

Definition at line 293 of file request_node.c.

◆ dns6_request_node

vlib_node_registration_t dns6_request_node

(constructor) VLIB_REGISTER_NODE (dns6_request_node)

Definition at line 320 of file request_node.c.

◆ dns_main

dns_main_t dns_main

Definition at line 42 of file dns.c.

◆ dns_resolver_node

vlib_node_registration_t dns_resolver_node
Initial value:
=
{
.function = dns_resolver_process,
.name = "dns-resolver-process",
}
static uword dns_resolver_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)

(constructor) VLIB_REGISTER_NODE (dns_resolver_node)

Definition at line 326 of file resolver_process.c.

◆ format_dns_reply

format_function_t format_dns_reply

Definition at line 186 of file dns.h.