47 #define LISP_ADJ_SET_KEY(_key, _itf, _nh) \ 49 _key.key[0] = (_nh)->ip.v6.as_u64[0]; \ 50 _key.key[1] = (_nh)->ip.v6.as_u64[1]; \ 51 _key.key[2] = (_itf); \ 56 BVT (clib_bihash_kv) kv;
60 if (BV (clib_bihash_search) (&
lisp_adj_db, &kv, &kv) < 0)
73 BVT (clib_bihash_kv) kv;
84 BVT (clib_bihash_kv) kv;
190 #define is_v4_packet(_h) ((*(u8*) _h) & 0xF0) == 0x40 282 if (lcm->
flags & LISP_FLAG_STATS_ENABLED)
377 ladj->
flags = LISP_GPE_FLAGS_I;
380 ladj->
flags |= LISP_GPE_FLAGS_P;
457 if (0 == ladj->
locks)
516 format (s,
"index %d locks:%d\n", ladj - lisp_adj_pool, ladj->
locks);
522 if (flags & LISP_GPE_ADJ_FORMAT_FLAG_DETAIL)
533 s =
format (s,
" LISP L3 sub-interface index: %d,",
564 ladj - lisp_adj_pool,
577 .path =
"show gpe adjacency",
582 #define LISP_ADJ_NBR_DEFAULT_HASH_NUM_BUCKETS (256) 583 #define LISP_ADJ_NBR_DEFAULT_HASH_MEMORY_SIZE (1<<20) 589 "Adjacency Neighbour table",
static void lisp_gpe_increment_stats_counters(lisp_cp_main_t *lcm, const ip_adjacency_t *adj, vlib_buffer_t *b)
const lisp_gpe_tunnel_t * lisp_gpe_tunnel_get(index_t lgti)
static lisp_gpe_adjacency_t * lisp_gpe_adjacency_get_i(index_t lai)
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.
Contribute an object that is to be used to forward IP6 packets.
enum lisp_gpe_adjacency_format_flags_t_ lisp_gpe_adjacency_format_flags_t
Flags for displaying the adjacency.
static void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 thread_index, u32 index, u64 n_packets, u64 n_bytes)
Increment a combined counter.
void ip_address_set(ip_address_t *dst, const void *src, u8 version)
#define LISP_ADJ_NBR_DEFAULT_HASH_MEMORY_SIZE
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.
u32 locks
The number of locks/reference counts on the adjacency.
u32 fib_entry_child_add(fib_node_index_t fib_entry_index, fib_node_type_t child_type, fib_node_index_t child_index)
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
vnet_link_t adj_get_link_type(adj_index_t ai)
Return the link type of the adjacency.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
index_t lisp_gpe_tunnel_find_or_create_and_lock(const locator_pair_t *pair, u32 rloc_fib_index)
u16 current_length
Nbytes between current data and the end of this buffer.
void fib_entry_child_remove(fib_node_index_t fib_entry_index, u32 sibling_index)
static clib_error_t * lisp_gpe_adj_module_init(vlib_main_t *vm)
static void lisp_gpe_adjacency_last_lock_gone(lisp_gpe_adjacency_t *ladj)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
u8 * format_lisp_gpe_tunnel(u8 *s, va_list *args)
Format LISP-GPE tunnel.
Contribute an object that is to be used to forward IP4 packets.
static index_t lisp_adj_find(const ip_address_t *addr, u32 sw_if_index)
#define STRUCT_OFFSET_OF(t, f)
static fib_node_t * lisp_gpe_adjacency_get_fib_node(fib_node_index_t index)
#define ip_addr_version(_a)
static u8 ip46_address_is_ip4(const ip46_address_t *ip46)
u8 * format_lisp_gpe_sub_interface(u8 *s, va_list *ap)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
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.
static clib_error_t * lisp_gpe_adjacency_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
void fib_node_register_type(fib_node_type_t type, const fib_node_vft_t *vft)
fib_node_register_type
vnet_link_t ia_link
link/ether-type 1 bytes
static lisp_gpe_next_protocol_e lisp_gpe_adj_proto_from_vnet_link_type(vnet_link_t linkt)
u32 fib_entry_child_index
This adjacency is a child of the FIB entry to reach the RLOC.
static lisp_gpe_main_t * vnet_lisp_gpe_get_main()
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
fib_node_index_t fib_entry_index
the FIB entry through which the remote rloc is reachable s
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
vl_api_interface_index_t sw_if_index
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.
#define VLIB_INIT_FUNCTION(x)
fib_node_t fib_node
The LISP adj is a part of the FIB control plane graph.
vlib_combined_counter_main_t counters
enum adj_walk_rc_t_ adj_walk_rc_t
return codes from a adjacency walker callback function
static void lisp_gpe_adj_stack(lisp_gpe_adjacency_t *ladj)
void lisp_gpe_tunnel_unlock(index_t lgti)
struct ip_adjacency_t_::@119::@120 nbr
IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE.
void lisp_gpe_adjacency_unlock(index_t lai)
u32 * fwd_entry_by_mapping_index
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.
const lisp_gpe_sub_interface_t * lisp_gpe_sub_interface_get(index_t l3si)
u32 sw_if_index
The SW if index assigned to this sub-interface.
union ip_adjacency_t_::@119 sub_type
u8 * lisp_gpe_build_rewrite(vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
static lisp_cp_main_t * vnet_lisp_cp_get_main()
Common utility functions for IPv4, IPv6 and L2 LISP-GPE adjacencys.
static void ip46_address_to_ip_address(const ip46_address_t *a, ip_address_t *b)
void ip_address_to_46(const ip_address_t *addr, ip46_address_t *a, fib_protocol_t *proto)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Common utility functions for IPv4, IPv6 and L2 LISP-GPE tunnels.
static lisp_adj_db
Hash table of all adjacencies.
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define pool_put(P, E)
Free an object E in pool P.
u32 sw_if_index
The SW IF index of the sub-interface this adjacency uses.
u8 * format_gid_address(u8 *s, va_list *args)
const lisp_gpe_adjacency_t * lisp_gpe_adjacency_get(index_t lai)
#define LISP_ADJ_NBR_DEFAULT_HASH_NUM_BUCKETS
An node in the FIB graph.
void clib_bihash_init(clib_bihash *h, char *name, u32 nbuckets, uword memory_size)
initialize a bounded index extensible hash table
static void lisp_gpe_adjacency_last_fib_lock_gone(fib_node_t *node)
index_t lisp_gpe_adjacency_find_or_create_and_lock(const locator_pair_t *pair, u32 overlay_table_id, u32 vni)
static void ip_udp_fixup_one(vlib_main_t *vm, vlib_buffer_t *b0, u8 is_ip4)
static_always_inline uword vlib_get_thread_index(void)
#define LISP_ADJ_SET_KEY(_key, _itf, _nh)
#define clib_warning(format, args...)
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
u8 * format_ip_address(u8 *s, va_list *args)
u32 fib_node_index_t
A typedef of a node index.
u32 adj_index_t
An index for adjacencies.
void lisp_gpe_sub_interface_unlock(index_t l3si)
vlib_main_t vlib_node_runtime_t * node
Context passed between object during a back walk.
#define VLIB_CLI_COMMAND(x,...)
struct _gid_address_t gid_address_t
static void lisp_gpe_fixup(vlib_main_t *vm, const ip_adjacency_t *adj, vlib_buffer_t *b, const void *data)
static lisp_afi_e lisp_afi_from_vnet_link_type(vnet_link_t link)
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
gid_dictionary_t mapping_index_by_gid
u32 gid_dictionary_sd_lookup(gid_dictionary_t *db, gid_address_t *dst, gid_address_t *src)
enum fib_forward_chain_type_t_ fib_forward_chain_type_t
FIB output chain type.
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.
enum adj_flags_t_ adj_flags_t
Flags on an IP adjacency.
index_t lisp_gpe_sub_interface_find_or_create_and_lock(const ip_address_t *lrloc, u32 overlay_table_id, u32 vni)
u32 tunnel_index
The index of the LISP GPE tunnel that provides the transport in the underlay.
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
VLIB buffer representation.
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.
fib_forward_chain_type_t lisp_gpe_adj_get_fib_chain_type(const lisp_gpe_adjacency_t *ladj)
#define hash_get_mem(h, key)
static void lisp_adj_remove(const ip_address_t *addr, u32 sw_if_index)
A FIB graph nodes virtual function table.
u8 * format_lisp_gpe_adjacency(u8 *s, va_list *args)
static lisp_gpe_adjacency_t * lisp_adj_pool
Memory pool of all adjacencies.
void ip_address_copy(ip_address_t *dst, const ip_address_t *src)
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)
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.
u32 lisp_l3_sub_index
The index of the LISP L3 subinterface.
uword * lisp_stats_index_by_key
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
u8 flags
LISP header fields in HOST byte order.
ip_address_t remote_rloc
remote RLOC.
static void lisp_adj_insert(const ip_address_t *addr, u32 sw_if_index, index_t ai)
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.
static uword pool_elts(void *v)
Number of active elements in a pool.