15 #ifndef included_nsh_h 16 #define included_nsh_h 32 #define MAX_METADATA_LEN 62 103 #define MAX_MD2_OPTIONS 256 149 nsh_tlv_header_t * opt);
151 nsh_tlv_header_t * old_opt,
152 nsh_tlv_header_t * new_opt);
154 nsh_tlv_header_t * opt);
183 #define foreach_copy_nsh_base_hdr_field \ 191 #define foreach_nsh_node_error \ 192 _(MAPPED, "NSH header found and mapped") \ 193 _(NO_MAPPING, "no mapping for nsh key") \ 194 _(NO_ENTRY, "no entry for nsh key") \ 195 _(NO_PROXY, "no proxy for transport key") \ 196 _(INVALID_NEXT_PROTOCOL, "invalid next protocol") \ 197 _(INVALID_OPTIONS, "invalid md2 options") \ 198 _(INVALID_TTL, "ttl equals zero") \ 201 #define _(sym,str) NSH_NODE_ERROR_##sym, 208 #define foreach_nsh_node_next \ 209 _(DROP, "error-drop") \ 210 _(ENCAP_GRE4, "gre4-input" ) \ 211 _(ENCAP_GRE6, "gre6-input" ) \ 212 _(ENCAP_VXLANGPE, "vxlan-gpe-encap" ) \ 213 _(ENCAP_VXLAN4, "vxlan4-encap" ) \ 214 _(ENCAP_VXLAN6, "vxlan6-encap" ) \ 215 _(DECAP_ETH_INPUT, "ethernet-input" ) \ 216 _(ENCAP_LISP_GPE, "interface-output" ) \ 217 _(ENCAP_ETHERNET, "nsh-eth-output") \ 222 #define _(s,n) NSH_NODE_NEXT_##s, 241 #define VNET_SW_INTERFACE_FLAG_ADMIN_DOWN 0 244 #define NSH_MD2_IOAM_CLASS 0x9 245 #define NSH_MD2_IOAM_OPTION_TYPE_TRACE 0x3B 246 #define NSH_MD2_IOAM_OPTION_TYPE_PROOF_OF_TRANSIT 0x3C 248 #define NSH_MD2_IOAM_TRACE_DUMMY_LEN 0x8 250 #define MAX_NSH_HEADER_LEN 256 251 #define MAX_NSH_OPTION_LEN 128 257 int add_options (
u8 * opt,
260 nsh_tlv_header_t * opt),
262 nsh_tlv_header_t * old_opt,
263 nsh_tlv_header_t * new_opt),
265 nsh_tlv_header_t * opt),
267 nsh_tlv_header_t * opt));
269 typedef struct _nsh_main_placeholder
271 u8 output_feature_arc_index;
static vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
u32 * tunnel_index_by_sw_if_index
Mapping from sw_if_index to tunnel index.
#define foreach_nsh_node_next
vlib_node_registration_t nsh_eth_output_node
(constructor) VLIB_REGISTER_NODE (nsh_eth_output_node)
int nsh_add_del_proxy_session(nsh_add_del_map_args_t *a)
Action function to add or del an nsh-proxy-session.
vlib_node_registration_t nsh_aware_vnf_proxy_node
(constructor) VLIB_REGISTER_NODE (nsh_aware_vnf_proxy_node)
u8 output_feature_arc_index
nsh_base_header_t nsh_base
nsh_proxy_session_t * nsh_proxy_sessions
u8 input_feature_arc_index
nsh_entry_t * nsh_entries
u32 * free_nsh_tunnel_hw_if_indices
Free vlib hw_if_indices.
struct _nsh_main_placeholder nsh_main_placeholder_t
u8 * format_nsh_node_map_trace(u8 *s, va_list *args)
u8 * format_nsh_input_map_trace(u8 *s, va_list *args)
u8 * rewrite
Rewrite string.
nsh_option_map_t * nsh_option_mappings
int nsh_add_del_map(nsh_add_del_map_args_t *a, u32 *map_indexp)
Action function to add or del an nsh map.
uword decap_v4_next_override
u32 nsh_classifier_node_index
u8 * format_nsh_header_with_length(u8 *s, va_list *args)
int nsh_add_del_entry(nsh_add_del_entry_args_t *a, u32 *entry_indexp)
Action function for adding an NSH entry nsh_add_del_entry_args_t *a: host order.
uword * nsh_proxy_session_by_key
u32 nsp_nsi
Key for nsh_header_t entry: 24bit NSP 8bit NSI.
u32 nsh_hw_if
vnet intfc hw_if_index
#define foreach_nsh_node_error
nsh_tlv_header_t nsh_md2_data_t
u32 mapped_nsp_nsi
Key for nsh_header_t entry to map to.
struct _vlib_node_registration vlib_node_registration_t
VLIB buffer representation.
int nsh_md2_register_option(u16 class, u8 type, u8 option_size, int add_options(u8 *opt, u8 *opt_size), int options(vlib_buffer_t *b, nsh_tlv_header_t *opt), int swap_options(vlib_buffer_t *b, nsh_tlv_header_t *old_opt, nsh_tlv_header_t *new_opt), int pop_options(vlib_buffer_t *b, nsh_tlv_header_t *opt), u8 *trace(u8 *s, nsh_tlv_header_t *opt))
uword * nsh_option_map_by_key
static struct option options[]
uword * nsh_mapping_by_mapped_key
Note: rewrite and rewrite_size used to support varied nsh header.
nsh_option_map_t * nsh_md2_lookup_option(u16 class, u8 type)
clib_error_t * nsh_api_init(vlib_main_t *vm, nsh_main_t *nm)
uword * nsh_mapping_by_key
u8 * format_nsh_header(u8 *s, va_list *args)