FD.io VPP  v19.08.2-294-g37e99c22d
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...
 
void vnet_dns_create_resolver_process (dns_main_t *dm)
 
static void dns_cache_lock (dns_main_t *dm, int tag)
 
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...
 
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 83 of file dns.h.

◆ DNS_CACHE_ENTRY_FLAG_STATIC

#define DNS_CACHE_ENTRY_FLAG_STATIC   (1<<1)

static entry

Definition at line 82 of file dns.h.

◆ DNS_CACHE_ENTRY_FLAG_VALID

#define DNS_CACHE_ENTRY_FLAG_VALID   (1<<0)

we have Actual Data

Definition at line 81 of file dns.h.

◆ DNS_RESOLVER_EVENT_PENDING

#define DNS_RESOLVER_EVENT_PENDING   2

Definition at line 88 of file dns.h.

◆ DNS_RESOLVER_EVENT_RESOLVED

#define DNS_RESOLVER_EVENT_RESOLVED   1

Definition at line 87 of file dns.h.

◆ DNS_RETRIES_PER_SERVER

#define DNS_RETRIES_PER_SERVER   3

Definition at line 85 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") \
_(MULTIPLE_REPLY, "DNS multiple reply packets") \
_(NO_UNRESOLVED_ENTRY, "No unresolved entry for pkt")

Definition at line 154 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 discrepancies (dropped)") \
_(TOO_MANY_REQUESTS, "DNS pkts asking too many questions") \
_(RESOLUTION_REQUIRED, "DNS pkts pending upstream name resolution")

Definition at line 137 of file dns.h.

Enumeration Type Documentation

◆ dns46_reply_error_t

Enumerator
DNS46_REPLY_N_ERROR 

Definition at line 163 of file dns.h.

◆ dns46_request_error_t

Enumerator
DNS46_REQUEST_N_ERROR 

Definition at line 146 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 42 of file dns.h.

Function Documentation

◆ dns_cache_lock()

static void dns_cache_lock ( dns_main_t dm,
int  tag 
)
inlinestatic

Definition at line 202 of file dns.h.

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

◆ dns_cache_unlock()

static void dns_cache_unlock ( dns_main_t dm)
inlinestatic

Definition at line 214 of file dns.h.

+ Here is the call graph for this function:
+ 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 986 of file dns.c.

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

◆ vnet_dns_create_resolver_process()

void vnet_dns_create_resolver_process ( dns_main_t dm)

Definition at line 363 of file resolver_process.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 682 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 516 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 830 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 240 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 359 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 2777 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 2769 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 558 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
vl_api_fib_path_type_t type
Definition: fib_types.api:123
static char * dns46_reply_error_strings[]
Definition: reply_node.c:44
#define ARRAY_LEN(x)
Definition: clib.h:63

(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 61 of file dns.c.

◆ format_dns_reply

format_function_t format_dns_reply

Definition at line 199 of file dns.h.