|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
56 s =
format (s,
"0x%04x", p);
66 u32 max_header_bytes = va_arg (*args,
u32);
68 u32 indent, header_bytes;
70 header_bytes =
sizeof (
h[0]);
71 if (max_header_bytes != 0 && header_bytes > max_header_bytes)
72 return format (s,
"hdlc header truncated");
78 if (
h->address != 0xff)
79 s =
format (s,
", address 0x%02x",
h->address);
80 if (
h->control != 0x03)
81 s =
format (s,
", control 0x%02x",
h->control);
83 if (max_header_bytes != 0 && header_bytes > max_header_bytes)
87 if (
node->format_buffer)
90 node->format_buffer, (
void *) (
h + 1),
91 max_header_bytes - header_bytes);
109 u16 *result = va_arg (*args,
u16 *);
138 u16 *result = va_arg (*args,
u16 *);
141 *result = clib_host_to_net_u16 ((
u16) * result);
148 u8 **result = va_arg (*args,
u8 **);
157 h->protocol = clib_host_to_net_u16 (p);
182 #define _(a,b) case VNET_LINK_##a: protocol = HDLC_PROTOCOL_##b; break
185 _(MPLS, mpls_unicast);
195 h->protocol = clib_host_to_net_u16 (
protocol);
219 pi->
name = protocol_name;
238 #define _(n,s) add_protocol (pm, HDLC_PROTOCOL_##s, #s);
hdlc_protocol_info_t * protocol_infos
#define hash_set(h, key, value)
#define clib_memcpy(d, s, n)
vlib_main_t vlib_node_runtime_t * node
u8 * format_hdlc_header_with_length(u8 *s, va_list *args)
#define hash_create_string(elts, value_bytes)
static clib_error_t * hdlc_init(vlib_main_t *vm)
uword unformat_hdlc_protocol_net_byte_order(unformat_input_t *input, va_list *args)
#define hash_set_mem(h, key, value)
#define vlib_call_init_function(vm, x)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
VNET_HW_INTERFACE_CLASS(hdlc_hw_interface_class)
u8 * format_hdlc_protocol(u8 *s, va_list *args)
static u8 * hdlc_build_rewrite(vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
vnet_hw_interface_class_t hdlc_hw_interface_class
uword * protocol_info_by_protocol
u8 * format_hdlc_header(u8 *s, va_list *args)
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
static clib_error_t * hdlc_input_init(vlib_main_t *vm)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
static hdlc_protocol_info_t * hdlc_get_protocol_info(hdlc_main_t *em, hdlc_protocol_t protocol)
uword unformat_hdlc_header(unformat_input_t *input, va_list *args)
static void add_protocol(hdlc_main_t *pm, hdlc_protocol_t protocol, char *protocol_name)
description fragment has unexpected format
#define VLIB_INIT_FUNCTION(x)
vl_api_ip_proto_t protocol
uword unformat_hdlc_protocol_host_byte_order(unformat_input_t *input, va_list *args)
uword * protocol_info_by_name
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
@ VNET_HW_INTERFACE_CLASS_FLAG_P2P
a point 2 point interface
vl_api_interface_index_t sw_if_index
#define hash_create(elts, value_bytes)