40 #ifndef included_snap_h 41 #define included_snap_h 46 #define foreach_ieee_oui \ 47 _ (0x000000, ethernet) \ 52 #define _(n,f) IEEE_OUI_##f = n, 57 #define foreach_snap_cisco_protocol \ 59 _ (0x0104, port_aggregation_protocol) \ 60 _ (0x0105, mls_hello) \ 61 _ (0x010b, per_vlan_spanning_tree) \ 62 _ (0x010c, vlan_bridge) \ 63 _ (0x0111, unidirectional_link_detection) \ 68 _ (0x200a, stp_uplink_fast) 72 #define _(n,f) SNAP_cisco_##f = n, 117 h->protocol = clib_host_to_net_u16 (protocol);
118 h->oui[0] = (oui >> 16) & 0xff;
119 h->oui[1] = (oui >> 8) & 0xff;
120 h->oui[2] = (oui >> 0) & 0xff;
123 #define foreach_snap_error \ 124 _ (NONE, "no error") \ 125 _ (UNKNOWN_PROTOCOL, "unknown oui/snap protocol") 129 #define _(f,s) SNAP_ERROR_##f, 152 return (h->oui[0] << 16) | (h->oui[1] << 8) | h->oui[2];
174 u32 ieee_oui,
u16 protocol,
u32 node_index);
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
unformat_function_t unformat_pg_snap_header
static u32 snap_header_get_oui(snap_header_t *h)
static uword * mhash_get(mhash_t *h, const void *key)
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