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,
"ppp header truncated");
83 if (max_header_bytes != 0 && header_bytes > max_header_bytes)
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);
162 u32 n_bytes =
sizeof (h[0]);
182 #define _(a,b) case VNET_LINK_##a: protocol = PPP_PROTOCOL_##b; break 185 _(MPLS, mpls_unicast);
195 h->
protocol = clib_host_to_net_u16 (protocol);
219 pi->
name = protocol_name;
232 memset (pm, 0,
sizeof (pm[0]));
238 #define _(n,s) add_protocol (pm, PPP_PROTOCOL_##s, #s); #define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
#define hash_set(h, key, value)
static clib_error_t * ppp_input_init(vlib_main_t *vm)
static void add_protocol(ppp_main_t *pm, ppp_protocol_t protocol, char *protocol_name)
#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)
uword * protocol_info_by_protocol
static u8 * ppp_build_rewrite(vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_hw_address)
memset(h->entries, 0, sizeof(h->entries[0])*entries)
#define VLIB_INIT_FUNCTION(x)
u8 * format_ppp_header_with_length(u8 *s, va_list *args)
#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)
VNET_HW_INTERFACE_CLASS(ppp_hw_interface_class)
format_function_t * format_buffer
static ppp_protocol_info_t * ppp_get_protocol_info(ppp_main_t *em, ppp_protocol_t protocol)
ppp_protocol_info_t * protocol_infos
#define clib_memcpy(a, b, c)
u8 * format_ppp_header(u8 *s, va_list *args)
uword * protocol_info_by_name
#define hash_create(elts, value_bytes)
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
uword unformat_ppp_protocol_host_byte_order(unformat_input_t *input, va_list *args)
a point 2 point interface
static clib_error_t * ppp_init(vlib_main_t *vm)
uword unformat_ppp_header(unformat_input_t *input, va_list *args)
u8 * format_ppp_protocol(u8 *s, va_list *args)
vnet_hw_interface_class_t ppp_hw_interface_class
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
uword unformat_ppp_protocol_net_byte_order(unformat_input_t *input, va_list *args)