50 u16 protocol = clib_net_to_host_u16 (h->protocol);
54 #define _(n,f) case n: t = #f; break; 60 return format (s,
"%s", t);
62 return format (s,
"unknown 0x%x", protocol);
69 u16 protocol = clib_net_to_host_u16 (h->protocol);
73 case IEEE_OUI_ethernet:
80 return format (s,
"oui 0x%06x 0x%04x", oui, protocol);
89 u32 max_header_bytes = va_arg (*args,
u32);
90 uword indent, header_bytes;
92 header_bytes =
sizeof (h[0]);
93 if (max_header_bytes != 0 && header_bytes > max_header_bytes)
94 return format (s,
"snap header truncated");
100 if (max_header_bytes != 0 && header_bytes > max_header_bytes && pi != 0)
107 max_header_bytes - header_bytes);
131 if (p.
oui >= (1 << 24))
155 u8 ** result = va_arg (*args,
u8 **);
164 u32 n_bytes =
sizeof (h[0]);
177 memset (sm, 0,
sizeof (sm[0]));
always_inline snap_protocol_info_t * snap_get_protocol_info(snap_main_t *sm, snap_header_t *h)
sll srl srl sll sra u16x4 i
always_inline vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
#define VLIB_INIT_FUNCTION(x)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define vlib_call_init_function(vm, x)
#define hash_create_string(elts, value_bytes)
snap_oui_and_protocol_t oui_and_protocol
format_function_t * format_buffer
static u8 * format_cisco_snap_protocol(u8 *s, va_list *args)
u8 * format_ethernet_type(u8 *s, va_list *args)
void mhash_init(mhash_t *h, uword n_value_bytes, uword n_key_bytes)
uword unformat_snap_header(unformat_input_t *input, va_list *args)
uword * protocol_info_by_name
#define clib_memcpy(a, b, c)
u8 * format_snap_protocol(u8 *s, va_list *args)
always_inline u32 snap_header_get_oui(snap_header_t *h)
always_inline void snap_header_set_protocol(snap_header_t *h, snap_oui_and_protocol_t *p)
uword unformat_snap_protocol(unformat_input_t *input, va_list *args)
u8 * format_snap_header_with_length(u8 *s, va_list *args)
snap_protocol_info_t * protocols
u8 * format_snap_header(u8 *s, va_list *args)
static clib_error_t * snap_input_init(vlib_main_t *vm)
static clib_error_t * snap_init(vlib_main_t *vm)