57 ip4_udp_lisp_gpe_header_t *h0;
64 h0 = (ip4_udp_lisp_gpe_header_t *) rw;
78 h0->udp.src_port = clib_host_to_net_u16 (4341);
79 h0->udp.dst_port = clib_host_to_net_u16 (UDP_DST_PORT_lisp_gpe);
86 ip6_udp_lisp_gpe_header_t *h0;
93 h0 = (ip6_udp_lisp_gpe_header_t *) rw;
98 clib_host_to_net_u32 (0x6 << 28);
107 h0->udp.src_port = clib_host_to_net_u16 (4341);
108 h0->udp.dst_port = clib_host_to_net_u16 (UDP_DST_PORT_lisp_gpe);
117 lisp0->
flags &= ~LISP_GPE_FLAGS_P;
122 lisp0->
iid = clib_host_to_net_u32 (ladj->
vni) >> 8;
154 .fib_index = rloc_fib_index,
163 pool_get (lisp_gpe_tunnel_pool, lgt);
185 (lgt - lisp_gpe_tunnel_pool));
190 return (lgt - lisp_gpe_tunnel_pool);
205 pool_put (lisp_gpe_tunnel_pool, lgt);
221 s =
format (s,
"tunnel %d\n", lgt - lisp_gpe_tunnel_pool);
222 s =
format (s,
" fib-index: %d, locks:%d \n",
224 s =
format (s,
" lisp ver 0\n");
226 s =
format (s,
" locator-pair:\n");
227 s =
format (s,
" local: %U remote: %U\n",
246 if (
pool_elts (lisp_gpe_tunnel_pool) == 0)
270 .path =
"show gpe tunnel",
const lisp_gpe_tunnel_t * lisp_gpe_tunnel_get(index_t lgti)
static clib_error_t * show_lisp_gpe_tunnel_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI command to show LISP-GPE tunnels.
#define pool_foreach(VAR, POOL)
Iterate through pool.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
index_t lisp_gpe_tunnel_find_or_create_and_lock(const locator_pair_t *pair, u32 rloc_fib_index)
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.
#define hash_set_mem(h, key, value)
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
#define ip_addr_version(_a)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
fib_node_index_t fib_entry_index
the FIB entry through which the remote rloc is reachable s
lisp_gpe_tunnel_t * lisp_gpe_tunnel_get_i(index_t lgti)
#define VLIB_INIT_FUNCTION(x)
void lisp_gpe_tunnel_unlock(index_t lgti)
description fragment has unexpected format
Recursive resolution source.
Aggregate type for a prefix.
void ip_address_to_fib_prefix(const ip_address_t *addr, fib_prefix_t *prefix)
convert from a IP address to a FIB prefix
enum gpe_encap_mode_e gpe_encap_mode_t
Common utility functions for IPv4, IPv6 and L2 LISP-GPE adjacencys.
void ip_address_copy_addr(void *dst, const ip_address_t *src)
static clib_error_t * lisp_gpe_tunnel_module_init(vlib_main_t *vm)
#define hash_create_mem(elts, key_bytes, value_bytes)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define hash_unset_mem(h, key)
Common utility functions for IPv4, IPv6 and L2 LISP-GPE tunnels.
#define pool_put(P, E)
Free an object E in pool P.
fib_node_index_t fib_table_entry_special_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags)
Add a 'special' entry to the FIB.
static lisp_gpe_tunnel_t * lisp_gpe_tunnel_pool
Pool of all LISP tunnels.
u8 * format_ip_address(u8 *s, va_list *args)
u32 locks
number of reference counting locks
lisp_gpe_tunnel_key_t * key
RLOC pair and rloc fib_index.
#define VLIB_CLI_COMMAND(x,...)
gpe_encap_mode_t vnet_gpe_get_encap_mode(void)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static void clib_mem_free(void *p)
static void * clib_mem_alloc(uword size)
static uword * lisp_gpe_tunnel_db
a DB of all tunnels
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.
#define hash_get_mem(h, key)
static lisp_gpe_tunnel_t * lisp_gpe_tunnel_db_find(const lisp_gpe_tunnel_key_t *key)
#define CLIB_CACHE_LINE_BYTES
u8 flags
LISP header fields in HOST byte order.
static u16 ip4_header_checksum(ip4_header_t *i)
static uword pool_elts(void *v)
Number of active elements in a pool.