|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
21 #define foreach_dhcp_client_detect \
26 #define _(sym,str) DHCP_CLIENT_DETECT_ERROR_##sym,
33 #define _(sym,string) string,
40 #define _(sym,str) DHCP_CLIENT_DETECT_NEXT_##sym,
60 u16 dhcp_client_port_network_order;
64 dhcp_client_port_network_order =
65 clib_net_to_host_u16 (UDP_DST_PORT_dhcp_to_client);
87 u32 next0, next1, next2, next3;
88 u32 bi0, bi1, bi2, bi3;
90 next0 = next1 = next2 = next3 = ~0;
91 bi0 = to_next[0] =
from[0];
92 bi1 = to_next[1] =
from[1];
93 bi2 = to_next[2] =
from[2];
94 bi3 = to_next[3] =
from[3];
139 if (ip0->
protocol == IP_PROTOCOL_UDP)
143 if (dhcp_client_port_network_order == udp0->
dst_port)
145 next0 = DHCP_CLIENT_DETECT_NEXT_EXTRACT;
149 if (ip1->
protocol == IP_PROTOCOL_UDP)
153 if (dhcp_client_port_network_order == udp1->
dst_port)
155 next1 = DHCP_CLIENT_DETECT_NEXT_EXTRACT;
159 if (ip2->
protocol == IP_PROTOCOL_UDP)
163 if (dhcp_client_port_network_order == udp2->
dst_port)
165 next2 = DHCP_CLIENT_DETECT_NEXT_EXTRACT;
169 if (ip3->
protocol == IP_PROTOCOL_UDP)
173 if (dhcp_client_port_network_order == udp3->
dst_port)
175 next3 = DHCP_CLIENT_DETECT_NEXT_EXTRACT;
184 t->
extracted = (next0 == DHCP_CLIENT_DETECT_NEXT_EXTRACT);
190 t->
extracted = (next1 == DHCP_CLIENT_DETECT_NEXT_EXTRACT);
196 t->
extracted = (next2 == DHCP_CLIENT_DETECT_NEXT_EXTRACT);
202 t->
extracted = (next3 == DHCP_CLIENT_DETECT_NEXT_EXTRACT);
207 to_next, n_left_to_next,
209 next0, next1, next2, next3);
242 if (ip0->
protocol == IP_PROTOCOL_UDP)
246 if (dhcp_client_port_network_order == udp0->
dst_port)
248 next0 = DHCP_CLIENT_DETECT_NEXT_EXTRACT;
257 t->
extracted = (next0 == DHCP_CLIENT_DETECT_NEXT_EXTRACT);
262 to_next, n_left_to_next,
270 DHCP_CLIENT_DETECT_ERROR_EXTRACT, extractions);
272 return frame->n_vectors;
284 s =
format (s,
"dhcp-client-detect: %s", (t->
extracted ?
"yes" :
"no"));
291 .name =
"ip4-dhcp-client-detect",
292 .vector_size =
sizeof (
u32),
305 [DHCP_CLIENT_DETECT_NEXT_EXTRACT] =
"ip4-udp-lookup",
311 .arc_name =
"ip4-unicast",
312 .node_name =
"ip4-dhcp-client-detect",
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
nat44_ei_hairpin_src_next_t next_index
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
@ VLIB_NODE_TYPE_INTERNAL
vlib_main_t vlib_node_runtime_t * node
#define vlib_validate_buffer_enqueue_x4(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, bi2, bi3, next0, next1, next2, next3)
Finish enqueueing four buffers forward in the graph.
static char * dhcp_client_detect_error_strings[]
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
VNET_FEATURE_INIT(ip4_dvr_reinject_feat_node, static)
#define CLIB_PREFETCH(addr, size, type)
#define VLIB_NODE_FN(node)
dhcp_client_detect_error_t
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define foreach_dhcp_client_detect
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
struct _vlib_node_registration vlib_node_registration_t
static u8 * format_dhcp_client_detect_trace(u8 *s, va_list *args)
#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.
@ DHCP_CLIENT_DETECT_N_ERROR
description fragment has unexpected format
vlib_put_next_frame(vm, node, next_index, 0)
vlib_node_registration_t dhcp_client_detect_node
(constructor) VLIB_REGISTER_NODE (dhcp_client_detect_node)
@ DHCP_CLIENT_DETECT_N_NEXT
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
#define VNET_FEATURES(...)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
struct dhcp_client_detect_trace_t_ dhcp_client_detect_trace_t
per-packet trace data
dhcp_client_detect_next_t
#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).
vl_api_fib_path_type_t type
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)