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,
always_inline snap_protocol_info_t * snap_get_protocol_info(snap_main_t *sm, snap_header_t *h)
always_inline pg_node_t * pg_get_node(uword node_index)
always_inline vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
#define foreach_snap_error
format_function_t format_snap_header
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
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
uword * protocol_info_by_name
unformat_function_t * unformat_buffer
unformat_function_t * unformat_edit
unformat_function_t unformat_pg_snap_header
always_inline u32 snap_header_get_oui(snap_header_t *h)
unformat_function_t unformat_snap_header
format_function_t format_snap_protocol
always_inline void snap_header_set_protocol(snap_header_t *h, snap_oui_and_protocol_t *p)
void snap_register_input_protocol(vlib_main_t *vm, char *name, u32 ieee_oui, u16 protocol, u32 node_index)
always_inline void snap_setup_node(vlib_main_t *vm, u32 node_index)
snap_protocol_info_t * protocols
always_inline uword * mhash_get(mhash_t *h, void *key)