40 #ifndef included_snap_h 41 #define included_snap_h 46 #define foreach_ieee_oui \ 47 _ (0x000000, ethernet) \ 51 #define _(n,f) IEEE_OUI_##f = n, 56 #define foreach_snap_cisco_protocol \ 58 _ (0x0104, port_aggregation_protocol) \ 59 _ (0x0105, mls_hello) \ 60 _ (0x010b, per_vlan_spanning_tree) \ 61 _ (0x010c, vlan_bridge) \ 62 _ (0x0111, unidirectional_link_detection) \ 67 _ (0x200a, stp_uplink_fast) 70 #define _(n,f) SNAP_cisco_##f = n, 110 h->protocol = clib_host_to_net_u16 (protocol);
111 h->oui[0] = (oui >> 16) & 0xff;
112 h->oui[1] = (oui >> 8) & 0xff;
113 h->oui[2] = (oui >> 0) & 0xff;
116 #define foreach_snap_error \ 117 _ (NONE, "no error") \ 118 _ (UNKNOWN_PROTOCOL, "unknown oui/snap protocol") 121 #define _(f,s) SNAP_ERROR_##f, 143 return (h->oui[0] << 16) | (h->oui[1] << 8) | h->oui[2];
170 uword max_data_bytes,
static void snap_setup_node(vlib_main_t *vm, u32 node_index)
#define foreach_snap_error
format_function_t format_snap_header
static pg_node_t * pg_get_node(uword node_index)
#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)
unformat_function_t unformat_snap_protocol
void snap_set_adjacency(vnet_rewrite_header_t *rw, uword max_data_bytes, u32 ieee_oui, u16 protocol)
snap_oui_and_protocol_t oui_and_protocol
format_function_t format_snap_header_with_length
format_function_t * format_buffer
#define foreach_snap_cisco_protocol
static snap_protocol_info_t * snap_get_protocol_info(snap_main_t *sm, snap_header_t *h)
uword * protocol_info_by_name
unformat_function_t * unformat_buffer
unformat_function_t * unformat_edit
static uword * mhash_get(mhash_t *h, void *key)
unformat_function_t unformat_pg_snap_header
static u32 snap_header_get_oui(snap_header_t *h)
unformat_function_t unformat_snap_header
format_function_t format_snap_protocol
void snap_register_input_protocol(vlib_main_t *vm, char *name, u32 ieee_oui, u16 protocol, u32 node_index)
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
snap_protocol_info_t * protocols