55 s =
format (s,
"0x%02x", p);
64 u32 max_header_bytes = va_arg (*args,
u32);
66 uword indent, header_bytes;
69 if (max_header_bytes != 0 && header_bytes > max_header_bytes)
70 return format (s,
"llc header truncated");
74 s =
format (s,
"LLC %U -> %U",
81 if (max_header_bytes != 0 && header_bytes > max_header_bytes)
89 max_header_bytes - header_bytes);
105 u8 * result = va_arg (*args,
u8 *);
134 u8 ** result = va_arg (*args,
u8 **);
147 u32 n_bytes =
sizeof (h[0]);
161 uword max_rewrite_bytes)
166 if (max_rewrite_bytes <
sizeof (h[0]))
170 #define _(a,b) case VNET_L3_PACKET_TYPE_##a: protocol = LLC_PROTOCOL_##b; break 180 return sizeof (h[0]);
192 char * protocol_name)
200 pi->
name = protocol_name;
213 memset (pm, 0,
sizeof (pm[0]));
219 #define _(f,n) add_protocol (pm, LLC_PROTOCOL_##f, #f); always_inline u16 llc_header_get_control(llc_header_t *h)
u8 * format_llc_header_with_length(u8 *s, va_list *args)
#define hash_set(h, key, value)
sll srl srl sll sra u16x4 i
llc_protocol_info_t * protocol_infos
uword * protocol_info_by_protocol
always_inline llc_protocol_info_t * llc_get_protocol_info(llc_main_t *m, llc_protocol_t protocol)
always_inline vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
always_inline u8 llc_header_length(llc_header_t *h)
VNET_HW_INTERFACE_CLASS(llc_hw_interface_class)
static clib_error_t * llc_input_init(vlib_main_t *vm)
uword unformat_llc_header(unformat_input_t *input, va_list *args)
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
#define hash_set_mem(h, key, value)
#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)
uword * protocol_info_by_name
u8 * format_llc_protocol(u8 *s, va_list *args)
format_function_t * format_buffer
static void add_protocol(llc_main_t *pm, llc_protocol_t protocol, char *protocol_name)
#define clib_memcpy(a, b, c)
#define hash_create(elts, value_bytes)
static clib_error_t * llc_init(vlib_main_t *vm)
uword unformat_llc_protocol(unformat_input_t *input, va_list *args)
static uword llc_set_rewrite(vnet_main_t *vnm, u32 sw_if_index, u32 l3_type, void *dst_address, void *rewrite, uword max_rewrite_bytes)
static clib_error_t * snap_init(vlib_main_t *vm)
u8 * format_llc_header(u8 *s, va_list *args)