55 #define _(n,f) case n: t = #f; break; 62 return format (s,
"%s", t);
64 return format (s,
"unknown 0x%x", protocol);
76 case IEEE_OUI_ethernet:
83 return format (s,
"oui 0x%06x 0x%04x", oui, protocol);
93 u32 max_header_bytes = va_arg (*args,
u32);
94 u32 indent, header_bytes;
96 header_bytes =
sizeof (h[0]);
97 if (max_header_bytes != 0 && header_bytes > max_header_bytes)
98 return format (s,
"snap header truncated");
104 if (max_header_bytes != 0 && header_bytes > max_header_bytes && pi != 0)
111 max_header_bytes - header_bytes);
136 if (p.
oui >= (1 << 24))
160 u8 **result = va_arg (*args,
u8 **);
169 u32 n_bytes =
sizeof (h[0]);
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
#define clib_memcpy(d, s, n)
#define VLIB_INIT_FUNCTION(x)
static clib_error_t * snap_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 void snap_header_set_protocol(snap_header_t *h, snap_oui_and_protocol_t *p)
#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)
static snap_protocol_info_t * snap_get_protocol_info(snap_main_t *sm, snap_header_t *h)
uword unformat_snap_header(unformat_input_t *input, va_list *args)
uword * protocol_info_by_name
static u32 snap_header_get_oui(snap_header_t *h)
u8 * format_snap_protocol(u8 *s, va_list *args)
uword unformat_snap_protocol(unformat_input_t *input, va_list *args)
u8 * format_snap_header_with_length(u8 *s, va_list *args)
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
snap_protocol_info_t * protocols
u8 * format_snap_header(u8 *s, va_list *args)
static clib_error_t * snap_init(vlib_main_t *vm)