37 s =
format (s,
"DNS46_REPLY: pool index %d, disposition %d",
45 #define _(sym,string) string, 63 u32 n_left_from, *from, *to_next;
71 while (n_left_from > 0)
78 while (n_left_from >= 4 && n_left_to_next >= 2)
80 u32 next0 = DNS46_REQUEST_NEXT_INTERFACE_OUTPUT;
81 u32 next1 = DNS46_REQUEST_NEXT_INTERFACE_OUTPUT;
82 u32 sw_if_index0, sw_if_index1;
103 to_next[0] = bi0 = from[0];
104 to_next[1] = bi1 = from[1];
117 if (b0->
flags & VLIB_BUFFER_IS_TRACED)
121 t->sw_if_index = sw_if_index0;
122 t->next_index = next0;
124 if (b1->
flags & VLIB_BUFFER_IS_TRACED)
128 t->sw_if_index = sw_if_index1;
129 t->next_index = next1;
135 to_next, n_left_to_next,
136 bi0, bi1, next0, next1);
140 while (n_left_from > 0 && n_left_to_next > 0)
145 u32 error0 = DNS46_REQUEST_ERROR_NONE;
154 u32 pool_index0 = ~0;
180 error0 = DNS46_REQUEST_ERROR_UNIMPLEMENTED;
188 error0 = DNS46_REQUEST_ERROR_IP_OPTIONS;
193 flags0 = clib_net_to_host_u16 (d0->flags);
199 error0 = DNS46_REQUEST_ERROR_BAD_REQUEST;
202 if (clib_net_to_host_u16 (d0->qdcount) != 1)
205 error0 = DNS46_REQUEST_ERROR_TOO_MANY_REQUESTS;
209 label0 = (
u8 *) (d0 + 1);
217 _vec_len (name0) -= 1;
229 if (!memcmp (aptr0,
".arpa", 5))
240 sizeof (ip6_address_t));
257 error0 = DNS46_REQUEST_ERROR_RESOLUTION_REQUIRED;
264 && (b0->
flags & VLIB_BUFFER_IS_TRACED)))
274 to_next, n_left_to_next,
296 .name =
"dns4-request",
297 .vector_size =
sizeof (
u32),
323 .name =
"dns6-request",
324 .vector_size =
sizeof (
u32),
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
#define clib_memcpy_fast(a, b, c)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
vlib_error_t * errors
Vector of errors for this node.
vlib_node_registration_t dns46_request_node
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
void vnet_send_dns4_reply(dns_main_t *dm, dns_pending_request_t *pr, dns_cache_entry_t *ep, vlib_buffer_t *b0)
static uword dns4_request_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
vl_api_fib_path_type_t type
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define DNS_QR
query=0, response=1
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define vlib_validate_buffer_enqueue_x2(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, next0, next1)
Finish enqueueing two buffers forward in the graph.
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
vlib_node_registration_t dns6_request_node
(constructor) VLIB_REGISTER_NODE (dns6_request_node)
#define VLIB_REGISTER_NODE(x,...)
#define CLIB_PREFETCH(addr, size, type)
static uword dns46_request_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_ip6)
static uword dns6_request_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
int vnet_dns_resolve_name(dns_main_t *dm, u8 *name, dns_pending_request_t *t, dns_cache_entry_t **retp)
vlib_node_registration_t dns4_request_node
(constructor) VLIB_REGISTER_NODE (dns4_request_node)
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
vlib_main_t vlib_node_runtime_t * node
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
u8 * vnet_dns_labels_to_name(u8 *label, u8 *full_text, u8 **parse_from_here)
arc-function for the above.
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
struct _vlib_node_registration vlib_node_registration_t
static char * dns46_request_error_strings[]
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void vnet_send_dns6_reply(dns_main_t *dm, dns_pending_request_t *pr, dns_cache_entry_t *ep, vlib_buffer_t *b0)
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static u8 * format_dns46_request_trace(u8 *s, va_list *args)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
u16 flags
Copy of main node flags.
#define VLIB_NODE_FLAG_TRACE
#define CLIB_CACHE_LINE_BYTES
#define foreach_dns46_request_error
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
int is_enabled
enable / disable flag