|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
48 #define LISP_ADJ_SET_KEY(_key, _itf, _nh) \
50 _key.key[0] = ip_addr_v6((_nh)).as_u64[0]; \
51 _key.key[1] = ip_addr_v6((_nh)).as_u64[1]; \
52 _key.key[2] = (_itf); \
57 BVT (clib_bihash_kv) kv;
61 if (BV (clib_bihash_search) (&
lisp_adj_db, &kv, &kv) < 0)
74 BVT (clib_bihash_kv) kv;
85 BVT (clib_bihash_kv) kv;
191 #define is_v4_packet(_h) ((*(u8*) _h) & 0xF0) == 0x40
264 key.fwd_entry_index = feip[0];
283 if (lcm->
flags & LISP_FLAG_STATS_ENABLED)
378 ladj->
flags = LISP_GPE_FLAGS_I;
381 ladj->
flags |= LISP_GPE_FLAGS_P;
458 if (0 == ladj->
locks)
534 s =
format (s,
" LISP L3 sub-interface index: %d,",
578 .path =
"show gpe adjacency",
583 #define LISP_ADJ_NBR_DEFAULT_HASH_NUM_BUCKETS (256)
584 #define LISP_ADJ_NBR_DEFAULT_HASH_MEMORY_SIZE (1<<20)
590 "Adjacency Neighbour table",
@ ADJ_FLAG_MIDCHAIN_NO_COUNT
static lisp_gpe_adjacency_t * lisp_gpe_adjacency_from_fib_node(const fib_node_t *node)
Get a pointer to a tunnel from a pointer to a FIB node.
static clib_error_t * lisp_gpe_adj_module_init(vlib_main_t *vm)
static lisp_gpe_next_protocol_e lisp_gpe_adj_proto_from_vnet_link_type(vnet_link_t linkt)
ip_address_t remote_rloc
remote RLOC.
void get_src_and_dst_eids_from_buffer(lisp_cp_main_t *lcm, vlib_buffer_t *b, gid_address_t *src, gid_address_t *dst, u16 type)
#define LISP_ADJ_SET_KEY(_key, _itf, _nh)
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
static index_t lisp_adj_find(const ip_address_t *addr, u32 sw_if_index)
index_t lisp_gpe_tunnel_find_or_create_and_lock(const locator_pair_t *pair, u32 rloc_fib_index)
void lisp_gpe_update_adjacency(vnet_main_t *vnm, u32 sw_if_index, adj_index_t ai)
The LISP-GPE interface registered function to update, i.e.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
u32 locks
The number of locks/reference counts on the adjacency.
vlib_main_t vlib_node_runtime_t * node
enum adj_walk_rc_t_ adj_walk_rc_t
return codes from a adjacency walker callback function
A FIB graph nodes virtual function table.
static u8 ip46_address_is_ip4(const ip46_address_t *ip46)
static void lisp_gpe_fixup(vlib_main_t *vm, const ip_adjacency_t *adj, vlib_buffer_t *b, const void *data)
@ LISP_GPE_NEXT_PROTO_NSH
#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.
@ LISP_GPE_NEXT_PROTO_ETHERNET
u32 sw_if_index
The SW if index assigned to this sub-interface.
vnet_link_t ia_link
link/ether-type 1 bytes
fib_forward_chain_type_t lisp_gpe_adj_get_fib_chain_type(const lisp_gpe_adjacency_t *ladj)
u8 * format_lisp_gpe_sub_interface(u8 *s, va_list *ap)
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.
@ LISP_GPE_ADJ_FORMAT_FLAG_DETAIL
#define LISP_ADJ_NBR_DEFAULT_HASH_NUM_BUCKETS
static void lisp_adj_remove(const ip_address_t *addr, u32 sw_if_index)
static lisp_gpe_main_t * vnet_lisp_gpe_get_main()
enum adj_flags_t_ adj_flags_t
Flags on an IP adjacency.
enum lisp_gpe_adjacency_format_flags_t_ lisp_gpe_adjacency_format_flags_t
Flags for displaying the adjacency.
@ FIB_FORW_CHAIN_TYPE_UNICAST_IP4
Contribute an object that is to be used to forward IP4 packets.
#define STRUCT_OFFSET_OF(t, f)
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
static clib_error_t * lisp_gpe_adjacency_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define ip_addr_version(_a)
@ LISP_GPE_NEXT_PROTO_IP6
#define pool_foreach(VAR, POOL)
Iterate through pool.
u32 fib_entry_child_add(fib_node_index_t fib_entry_index, fib_node_type_t child_type, fib_node_index_t child_index)
fib_node_t fib_node
The LISP adj is a part of the FIB control plane graph.
static void lisp_gpe_adjacency_last_lock_gone(lisp_gpe_adjacency_t *ladj)
void clib_bihash_init(clib_bihash *h, char *name, u32 nbuckets, uword memory_size)
initialize a bounded index extensible hash table
u32 * fwd_entry_by_mapping_index
enum fib_forward_chain_type_t_ fib_forward_chain_type_t
FIB output chain type.
@ LISP_GPE_ADJ_FORMAT_FLAG_NONE
static lisp_cp_main_t * vnet_lisp_cp_get_main()
static_always_inline uword vlib_get_thread_index(void)
static lisp_gpe_adjacency_t * lisp_adj_pool
Memory pool of all adjacencies.
gid_dictionary_t mapping_index_by_gid
fib_node_index_t fib_entry_index
the FIB entry through which the remote rloc is reachable s
u32 fib_entry_child_index
This adjacency is a child of the FIB entry to reach the RLOC.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
static vlib_cli_command_t show_lisp_gpe_tunnel_command
(constructor) VLIB_CLI_COMMAND (show_lisp_gpe_tunnel_command)
static fib_node_t * lisp_gpe_adjacency_get_fib_node(fib_node_index_t index)
u32 fib_node_index_t
A typedef of a node index.
u8 * format_ip_address(u8 *s, va_list *args)
void lisp_gpe_adjacency_unlock(index_t lai)
static void lisp_adj_insert(const ip_address_t *addr, u32 sw_if_index, index_t ai)
static lisp_afi_e lisp_afi_from_vnet_link_type(vnet_link_t link)
BVT(clib_bihash)
The table of adjacencies indexed by the rewrite string.
const lisp_gpe_tunnel_t * lisp_gpe_tunnel_get(index_t lgti)
u8 * lisp_gpe_build_rewrite(vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
static void lisp_gpe_adjacency_last_fib_lock_gone(fib_node_t *node)
static void lisp_gpe_adj_stack_one(lisp_gpe_adjacency_t *ladj, adj_index_t ai)
Stack the tunnel's midchain on the IP forwarding chain of the via.
const lisp_gpe_sub_interface_t * lisp_gpe_sub_interface_get(index_t l3si)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
#define VLIB_CLI_COMMAND(x,...)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
fib_protocol_t ip_address_to_46(const ip_address_t *addr, ip46_address_t *a)
u32 sw_if_index
The SW IF index of the sub-interface this adjacency uses.
void ip_address_set(ip_address_t *dst, const void *src, ip_address_family_t af)
uword * lisp_stats_index_by_key
#define ALWAYS_ASSERT(truth)
void fib_node_register_type(fib_node_type_t type, const fib_node_vft_t *vft)
fib_node_register_type
@ FIB_NODE_BACK_WALK_CONTINUE
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
Common utility functions for IPv4, IPv6 and L2 LISP-GPE tunnels.
u16 current_length
Nbytes between current data and the end of this buffer.
u32 gid_dictionary_sd_lookup(gid_dictionary_t *db, gid_address_t *dst, gid_address_t *src)
union ip_adjacency_t_::@144 sub_type
const lisp_gpe_adjacency_t * lisp_gpe_adjacency_get(index_t lai)
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 void ip46_address_to_ip_address(const ip46_address_t *a, ip_address_t *b)
#define hash_get_mem(h, key)
static lisp_adj_db
Hash table of all adjacencies.
description fragment has unexpected format
vnet_link_t adj_get_link_type(adj_index_t ai)
Return the link type of the adjacency.
@ LISP_GPE_NEXT_PROTO_IP4
#define VLIB_INIT_FUNCTION(x)
static void ip_udp_fixup_one(vlib_main_t *vm, vlib_buffer_t *b0, u8 is_ip4)
static void lisp_gpe_adj_stack(lisp_gpe_adjacency_t *ladj)
static uword pool_elts(void *v)
Number of active elements in a pool.
int clib_bihash_add_del(clib_bihash *h, clib_bihash_kv *add_v, int is_add)
Add or delete a (key,value) pair from a bi-hash table.
index_t lisp_gpe_adjacency_find_or_create_and_lock(const locator_pair_t *pair, u32 overlay_table_id, u32 vni)
index_t lisp_gpe_sub_interface_find_or_create_and_lock(const ip_address_t *lrloc, u32 overlay_table_id, u32 vni)
u8 * lisp_gpe_tunnel_build_rewrite(const lisp_gpe_tunnel_t *lgt, const lisp_gpe_adjacency_t *ladj, lisp_gpe_next_protocol_e payload_proto)
Compute IP-UDP-GPE sub-tunnel encap/rewrite header.
An node in the FIB graph.
#define LISP_ADJ_NBR_DEFAULT_HASH_MEMORY_SIZE
static fib_node_back_walk_rc_t lisp_gpe_adjacency_back_walk(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
LISP GPE tunnel back walk.
u8 flags
LISP header fields in HOST byte order.
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.
Common utility functions for IPv4, IPv6 and L2 LISP-GPE adjacencys.
void lisp_gpe_sub_interface_unlock(index_t l3si)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
void adj_nbr_walk_nh(u32 sw_if_index, fib_protocol_t adj_nh_proto, const ip46_address_t *nh, adj_walk_cb_t cb, void *ctx)
Walk adjacencies on a link with a given next-hop.
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
void lisp_gpe_tunnel_unlock(index_t lgti)
u8 * format_gid_address(u8 *s, va_list *args)
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...)
struct _gid_address_t gid_address_t
u32 tunnel_index
The index of the LISP GPE tunnel that provides the transport in the underlay.
u8 * format_lisp_gpe_adjacency(u8 *s, va_list *args)
vlib_combined_counter_main_t counters
@ FIB_FORW_CHAIN_TYPE_UNICAST_IP6
Contribute an object that is to be used to forward IP6 packets.
u8 * format_lisp_gpe_tunnel(u8 *s, va_list *args)
Format LISP-GPE tunnel.
static adj_walk_rc_t lisp_gpe_adj_walk_cb(adj_index_t ai, void *ctx)
Call back when restacking all adjacencies on a GRE interface.
void fib_entry_child_remove(fib_node_index_t fib_entry_index, u32 sibling_index)
const static fib_node_vft_t lisp_gpe_tuennel_vft
static lisp_gpe_adjacency_t * lisp_gpe_adjacency_get_i(index_t lai)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
void ip_address_copy(ip_address_t *dst, const ip_address_t *src)
vl_api_interface_index_t sw_if_index
@ ADJ_FLAG_MIDCHAIN_IP_STACK
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
u32 lisp_l3_sub_index
The index of the LISP L3 subinterface.
static void lisp_gpe_increment_stats_counters(lisp_cp_main_t *lcm, const ip_adjacency_t *adj, vlib_buffer_t *b)
vlib_increment_combined_counter(ccm, ti, sw_if_index, n_buffers, n_bytes)
VLIB buffer representation.
vl_api_wireguard_peer_flags_t flags