|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
96 ip4->dst_address.as_u32 =
108 ip4->dst_address.as_u32 =
126 ip4->ip_version_and_header_length = 0x45;
128 ip4->protocol = IP_PROTOCOL_IPV6;
131 ip4->dst_address.as_u32 = 0;
225 if (sixrd_ad == NULL)
279 if ((ip6_prefix_len + 32 - ip4_prefix_len) > 64)
280 return VNET_API_ERROR_INVALID_VALUE;
286 ipip_tunnel_key_t
key;
293 return VNET_API_ERROR_IF_ALREADY_EXISTS;
298 u32 t_idx = t -
gm->tunnels;
310 (ip4_prefix_len < 32) ? 64 - ip6_prefix_len - (32 - ip4_prefix_len) : 0;
316 sixrd_hw_interface_class.index, t_idx);
333 gm->tunnel_index_by_sw_if_index[
hi->sw_if_index] = t_idx;
360 if (!
gm->ip4_protocol_registered)
378 ipip_tunnel_key_t
key;
382 clib_warning (
"SIXRD tunnel delete: tunnel does not exist: %d",
void ipip_mk_key_i(ipip_transport_t transport, ipip_mode_t mode, const ip46_address_t *src, const ip46_address_t *dst, u32 fib_index, ipip_tunnel_key_t *key)
int sixrd_del_tunnel(u32 sw_if_index)
static void sixrd_fib_node_last_lock_gone(fib_node_t *node)
index_t ad_index
The index passed by the provider to identify its delegate instance.
vlib_node_registration_t ip4_sixrd_node
This code supports the following sixrd modes:
clib_error_t * vnet_sw_interface_set_flags(vnet_main_t *vnm, u32 sw_if_index, vnet_sw_interface_flags_t flags)
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
void ip_set(ip46_address_t *dst, void *src, u8 is_ip4)
void vnet_sw_interface_set_mtu(vnet_main_t *vnm, u32 sw_if_index, u32 mtu)
An ADJ delegate virtual function table.
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
fib_node_index_t fib_table_entry_update_one_path(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, dpo_proto_t next_hop_proto, const ip46_address_t *next_hop, u32 next_hop_sw_if_index, u32 next_hop_fib_index, u32 next_hop_weight, fib_mpls_label_t *next_hop_labels, fib_route_path_flags_t path_flags)
Update the entry to have just one path.
#define ip46_address_initializer
static fib_node_t * sixrd_fib_node_get(fib_node_index_t index)
Function definition to get a FIB node from its index.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static clib_error_t * ipip_init(vlib_main_t *vm)
void fib_entry_untrack(fib_node_index_t fei, u32 sibling)
Stop tracking a FIB entry.
static sixrd_adj_delegate_t * sixrd_adj_delegate_from_fib_node(fib_node_t *node)
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
ipip_tunnel_t * ipip_tunnel_db_find_by_sw_if_index(u32 sw_if_index)
vlib_main_t vlib_node_runtime_t * node
A FIB graph nodes virtual function table.
@ FIB_ENTRY_FLAG_ATTACHED
static adj_delegate_type_t sixrd_adj_delegate_type
Adj delegate registered type.
static void ip6ip_tunnel_stack(adj_index_t ai, u32 fib_entry_index)
const ip46_address_t ADJ_BCAST_ADDR
The special broadcast address (to construct a broadcast adjacency.
#define vlib_call_init_function(vm, x)
@ VNET_SW_INTERFACE_FLAG_ADMIN_UP
#define pool_put(P, E)
Free an object E in pool P.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
@ VNET_HW_INTERFACE_FLAG_LINK_UP
void ip4_register_protocol(u32 protocol, u32 node_index)
static fib_node_back_walk_rc_t sixrd_fib_node_back_walk_notify(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
struct sixrd_adj_delegate_t_ sixrd_adj_delegate_t
Adj delegate data.
enum fib_node_type_t_ fib_node_type_t
The types of nodes in a FIB graph.
void adj_nbr_midchain_stack_on_fib_entry(adj_index_t ai, fib_node_index_t fei, fib_forward_chain_type_t fct)
[re]stack a midchain.
static void sixrd_update_adj(vnet_main_t *vnm, u32 sw_if_index, adj_index_t ai)
A representation of a IPIP tunnel.
manual_print typedef ip6_prefix
static void sixrd_adj_delegate_adj_deleted(adj_delegate_t *aed)
@ FIB_FORW_CHAIN_TYPE_UNICAST_IP4
Contribute an object that is to be used to forward IP4 packets.
fib_node_index_t fib_entry_track(u32 fib_index, const fib_prefix_t *prefix, fib_node_type_t child_type, index_t child_index, u32 *sibling)
Trackers are used on FIB entries by objects that which to track the changing state of the entry.
#define STRUCT_OFFSET_OF(t, f)
const static adj_delegate_vft_t sixrd_adj_delegate_vft
VFT registered with the adjacency delegate.
int adj_delegate_add(ip_adjacency_t *adj, adj_delegate_type_t adt, index_t adi)
Add a delegate to an adjacency.
void fib_table_entry_path_remove(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, dpo_proto_t next_hop_proto, const ip46_address_t *next_hop, u32 next_hop_sw_if_index, u32 next_hop_fib_index, u32 next_hop_weight, fib_route_path_flags_t path_flags)
remove one path to an entry (aka route) in the FIB.
ip_lookup_next_t lookup_next_index
Next hop after ip4-lookup.
void ipip_mk_key(const ipip_tunnel_t *t, ipip_tunnel_key_t *key)
static const sixrd_adj_delegate_t * sixrd_adj_from_const_base(const adj_delegate_t *ad)
enum adj_delegate_type_t_ adj_delegate_type_t
A Delagate is a means to implement the Delagation design pattern; the extension of an object's functi...
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
vnet_main_t * vnet_get_main(void)
VNET_DEVICE_CLASS(sixrd_device_class)
void ipip_tunnel_db_add(ipip_tunnel_t *t, const ipip_tunnel_key_t *key)
u32 fib_node_index_t
A typedef of a node index.
void vnet_delete_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
static void sixrd_tunnel_stack(adj_index_t ai, u32 fib_index)
static_always_inline u32 sixrd_get_addr_net(const ipip_tunnel_t *t, u64 dal)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
adj_delegate_type_t adj_delegate_register_new_type(const adj_delegate_vft_t *vft)
adj_delegate_register_new_type
static void sixrd_fixup(vlib_main_t *vm, const ip_adjacency_t *adj, vlib_buffer_t *b0, const void *data)
VNET_HW_INTERFACE_CLASS(sixrd_hw_interface_class)
clib_error_t * sixrd_interface_admin_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
@ IP_LOOKUP_NEXT_BCAST
Broadcast Adjacency.
@ LOOKUP_TABLE_FROM_CONFIG
static sixrd_adj_delegate_t * sixrd_adj_delegate_pool
Pool of delegate structs.
#define CLIB_CACHE_LINE_BYTES
int sixrd_add_tunnel(ip6_address_t *ip6_prefix, u8 ip6_prefix_len, ip4_address_t *ip4_prefix, u8 ip4_prefix_len, ip4_address_t *ip4_src, bool security_check, u32 ip4_fib_index, u32 ip6_fib_index, u32 *sw_if_index)
struct _vlib_node_registration vlib_node_registration_t
@ FIB_NODE_BACK_WALK_CONTINUE
void ipip_tunnel_db_remove(ipip_tunnel_t *t, const ipip_tunnel_key_t *key)
struct ipip_tunnel_t::@420 sixrd
static void ip6ip_fixup(vlib_main_t *vm, const ip_adjacency_t *adj, vlib_buffer_t *b0, const void *data)
void adj_nbr_midchain_stack(adj_index_t adj_index, const dpo_id_t *next)
adj_nbr_midchain_stack
union ip_adjacency_t_::@144 sub_type
static sixrd_adj_delegate_t * sixrd_adj_from_base(adj_delegate_t *ad)
adj_delegate_t * adj_delegate_get(const ip_adjacency_t *adj, adj_delegate_type_t type)
Get a delegate from an adjacency.
static u8 * sixrd_build_rewrite(vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
void adj_nbr_midchain_update_rewrite(adj_index_t adj_index, adj_midchain_fixup_t fixup, const void *fixup_data, adj_flags_t flags, u8 *rewrite)
adj_nbr_midchain_update_rewrite
static fib_node_type_t sixrd_fib_node_type
FIB node registered type.
ip46_address_t tunnel_src
description fragment has unexpected format
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header,...
@ FIB_ROUTE_PATH_FLAG_NONE
void fib_table_lock(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Release a reference counting lock on the table.
vnet_link_t adj_get_link_type(adj_index_t ai)
Return the link type of the adjacency.
#define VLIB_INIT_FUNCTION(x)
adj_delegate_adj_deleted_t adv_adj_deleted
ipip_tunnel_t * ipip_tunnel_db_find(const ipip_tunnel_key_t *key)
void ip6_sw_interface_enable_disable(u32 sw_if_index, u32 is_enable)
fib_protocol_t fp_proto
protocol type
manual_print typedef ip4_prefix
An node in the FIB graph.
void adj_nbr_midchain_unstack(adj_index_t adj_index)
adj_nbr_midchain_unstack
u32 adj_index_t
An index for adjacencies.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
void fib_node_init(fib_node_t *node, fib_node_type_t type)
clib_error_t * vnet_hw_interface_set_flags(vnet_main_t *vnm, u32 hw_if_index, vnet_hw_interface_flags_t flags)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static u16 ip4_header_checksum(ip4_header_t *i)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
static clib_error_t * sixrd_init(vlib_main_t *vm)
void fib_table_unlock(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Take a reference counting lock on the table.
static u8 * sixrd_adj_delegate_format(const adj_delegate_t *aed, u8 *s)
struct ip_adjacency_t_::@144::@145 nbr
IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE.
Context passed between object during a back walk.
#define clib_warning(format, args...)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
fib_node_index_t sixrd_fib_entry_index
@ FIB_SOURCE_6RD
From 6RD.
static uword vnet_hw_interface_get_flags(vnet_main_t *vnm, u32 hw_if_index)
vl_api_interface_index_t sw_if_index
void lookup_dpo_add_or_lock_w_fib_index(fib_node_index_t fib_index, dpo_proto_t proto, lookup_cast_t cast, lookup_input_t input, lookup_table_t table_config, dpo_id_t *dpo)
const static fib_node_vft_t sixrd_fib_node_vft
VFT registered with the FIB node for the adj delegate.
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
fib_node_type_t fib_node_register_new_type(const fib_node_vft_t *vft)
Create a new FIB node type and Register the function table for it.
Aggregate type for a prefix.
u32 vnet_register_interface(vnet_main_t *vnm, u32 dev_class_index, u32 dev_instance, u32 hw_class_index, u32 hw_instance)
VLIB buffer representation.
vl_api_wireguard_peer_flags_t flags