15 #ifndef included_vnet_mpls_h 16 #define included_vnet_mpls_h 27 #define mpls_error(n,s) MPLS_ERROR_##n, 57 #define MPLS_FIB_DEFAULT_TABLE_ID 0 62 #define MPLS_FIB_KEY_SIZE 21 63 #define MPLS_FIB_DB_SIZE (1 << (MPLS_FIB_KEY_SIZE-1)) 133 #define VNET_MPLS_FEATURE_INIT(x,...) \ 134 __VA_ARGS__ vnet_feature_registration_t uc_##x; \ 135 static void __vnet_add_feature_registration_uc_##x (void) \ 136 __attribute__((__constructor__)) ; \ 137 static void __vnet_add_feature_registration_uc_##x (void) \ 139 mpls_main_t * mm = &mpls_main; \ 140 uc_##x.next = mm->next_feature[VNET_IP_RX_UNICAST_FEAT]; \ 141 mm->next_feature[VNET_IP_RX_UNICAST_FEAT] = &uc_##x; \ 143 __VA_ARGS__ vnet_feature_registration_t uc_##x 145 #define VNET_MPLS_TX_FEATURE_INIT(x,...) \ 146 __VA_ARGS__ vnet_feature_registration_t tx_##x; \ 147 static void __vnet_add_feature_registration_tx_##x (void) \ 148 __attribute__((__constructor__)) ; \ 149 static void __vnet_add_feature_registration_tx_##x (void) \ 151 mpls_main_t * mm = &mpls_main; \ 152 tx_##x.next = mm->next_feature[VNET_IP_TX_FEAT]; \ 153 mm->next_feature[VNET_IP_TX_FEAT] = &tx_##x; \ 155 __VA_ARGS__ vnet_feature_registration_t tx_##x 198 u32 * tunnel_sw_if_index,
205 u32 *labels_host_byte_order,
206 u32 policy_tunnel_index,
207 int no_dst_hash,
u32 * indexp,
int is_add);
211 u32 policy_tunnel_index);
213 #define foreach_mpls_input_next \ 214 _(DROP, "error-drop") \ 215 _(LOOKUP, "mpls-lookup") 218 #define _(s,n) MPLS_INPUT_NEXT_##s, 224 #define foreach_mpls_lookup_next \ 225 _(DROP, "error-drop") \ 226 _(IP4_INPUT, "ip4-input") \ 227 _(L2_OUTPUT, "l2-output") 231 #define _(s,n) MPLS_LOOKUP_NEXT_##s, 237 #define foreach_mpls_output_next \ 238 _(DROP, "error-drop") 241 #define _(s,n) MPLS_OUTPUT_NEXT_##s, struct mpls_fib_t_ mpls_fib_t
u8 * format_mpls_eth_tx_trace(u8 *s, va_list *args)
format_function_t format_mpls_header
#define foreach_mpls_lookup_next
format_function_t format_mpls_eth_header_with_length
u32 mpls_rx_feature_not_enabled
int mpls_label_cmp(void *a1, void *a2)
void mpls_sw_interface_enable_disable(mpls_main_t *mm, u32 sw_if_index, u8 is_enable)
u32 * fib_index_by_sw_if_index
format_function_t format_mpls_protocol
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
struct _vlib_node_registration vlib_node_registration_t
u32 mpls_tx_feature_interface_output
uword * mpls_encap_by_fib_and_dest
#define foreach_mpls_input_next
unformat_function_t unformat_mpls_unicast_label
u8 * mpls_enabled_by_sw_if_index
format_function_t format_mpls_unicast_header_net_byte_order
void(* mpls_interface_state_change_callback_t)(u32 sw_if_index, u32 is_enable)
Definition of a callback for receiving MPLS interface state change notifications. ...
vlib_node_registration_t mpls_midchain_node
(constructor) VLIB_REGISTER_NODE (mpls_midchain_node)
ip4_address_t intfc_address
format_function_t format_mpls_eos_bit
vlib_node_registration_t mpls_policy_encap_node
(constructor) VLIB_REGISTER_NODE (mpls_policy_encap_node)
int mpls_fib_reset_labels(u32 fib_id)
vlib_node_registration_t mpls_input_node
(constructor) VLIB_REGISTER_NODE (mpls_input_node)
struct fib_table_t_ * fibs
A pool of all the MPLS FIBs.
u32 * free_eth_sw_if_indices
int mpls_fib_index_cmp(void *a1, void *a2)
unformat_function_t unformat_mpls_protocol_net_byte_order
unformat_function_t unformat_mpls_header
unformat_function_t unformat_mpls_protocol_host_byte_order
unformat_function_t unformat_pg_mpls_header
u32 ip4_classify_mpls_policy_encap_next_index
u32 fib_node_index_t
A typedef of a node index.
mpls_eth_tunnel_t * eth_tunnels
clib_error_t * mpls_feature_init(vlib_main_t *vm)
#define foreach_mpls_output_next
uword * mf_entries
A hash table of entries.
u32 ip6_classify_mpls_policy_encap_next_index
u8 mpls_sw_interface_is_enabled(u32 sw_if_index)
int vnet_mpls_ethernet_add_del_tunnel(u8 *dst, ip4_address_t *intfc, u32 mask_width, u32 inner_fib_id, u32 tx_sw_if_index, u32 *tunnel_sw_if_index, u8 l2_only, u8 is_add)
format_function_t format_mpls_unicast_label
int vnet_mpls_add_del_encap(ip4_address_t *dest, u32 fib_id, u32 *labels_host_byte_order, u32 policy_tunnel_index, int no_dst_hash, u32 *indexp, int is_add)
int vnet_mpls_policy_tunnel_add_rewrite(mpls_main_t *mm, mpls_encap_t *e, u32 policy_tunnel_index)
mpls_encap_t * mpls_encap_by_fib_and_dest(mpls_main_t *mm, u32 rx_fib, u32 dst_address)
unformat_function_t unformat_mpls_label_net_byte_order
format_function_t format_mpls_encap_index
index_t mf_lbs[MPLS_FIB_DB_SIZE]
The load-balance indeices keyed by 21 bit label+eos bit.
uword * fib_index_by_table_id
A hash table to lookup the mpls_fib by table ID.
u32 mpls_rx_feature_lookup
vlib_node_registration_t mpls_output_node
(constructor) VLIB_REGISTER_NODE (mpls_output_node)
mpls_unicast_header_t * labels
int mpls_dest_cmp(void *a1, void *a2)
A protocol Independent FIB table.
struct _vnet_feature_registration vnet_feature_registration_t
feature registration object