56 ip4_udp_lisp_gpe_header_t *h0;
63 h0 = (ip4_udp_lisp_gpe_header_t *) rw;
77 h0->udp.src_port = clib_host_to_net_u16 (4341);
78 h0->udp.dst_port = clib_host_to_net_u16 (UDP_DST_PORT_lisp_gpe);
85 ip6_udp_lisp_gpe_header_t *h0;
92 h0 = (ip6_udp_lisp_gpe_header_t *) rw;
97 clib_host_to_net_u32 (0x6 << 28);
106 h0->udp.src_port = clib_host_to_net_u16 (4341);
107 h0->udp.dst_port = clib_host_to_net_u16 (UDP_DST_PORT_lisp_gpe);
117 lisp0->
iid = clib_host_to_net_u32 (ladj->
vni) >> 8;
149 .fib_index = rloc_fib_index,
158 pool_get (lisp_gpe_tunnel_pool, lgt);
159 memset (lgt, 0,
sizeof (*lgt));
162 memset (lgt->
key, 0, sizeof (*lgt->
key));
181 (lgt - lisp_gpe_tunnel_pool));
186 return (lgt - lisp_gpe_tunnel_pool);
201 pool_put (lisp_gpe_tunnel_pool, lgt);
217 s =
format (s,
"tunnel %d\n", lgt - lisp_gpe_tunnel_pool);
218 s =
format (s,
" fib-index: %d, locks:%d \n",
220 s =
format (s,
" lisp ver 0\n");
222 s =
format (s,
" locator-pair:\n");
223 s =
format (s,
" local: %U remote: %U\n",
242 if (
pool_elts (lisp_gpe_tunnel_pool) == 0)
266 .path =
"show lisp 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.
Recursive resolution source.
index_t lisp_gpe_tunnel_find_or_create_and_lock(const locator_pair_t *pair, u32 rloc_fib_index)
void ip_address_to_fib_prefix(const ip_address_t *addr, fib_prefix_t *prefix)
convert from a LISP address to a FIB prefix
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 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
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
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)
Aggregrate type for a prefix.
#define ip_addr_version(_a)
Common utility functions for IPv4, IPv6 and L2 LISP-GPE adjacencys.
static clib_error_t * lisp_gpe_tunnel_module_init(vlib_main_t *vm)
#define hash_create_mem(elts, key_bytes, value_bytes)
void ip_address_copy_addr(void *dst, const ip_address_t *src)
#define ADJ_INDEX_INVALID
Invalid ADJ index - used when no adj is known likewise blazoned capitals INVALID speak volumes where ...
#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.
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, adj_index_t adj_index)
Add a 'special' entry to the FIB that links to the adj passed A special entry is an entry that the FI...
#define pool_put(P, E)
Free an object E in pool P.
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static lisp_gpe_tunnel_t * lisp_gpe_tunnel_pool
Pool of all LISP tunnels.
u32 locks
number of reference counting locks
lisp_gpe_tunnel_key_t * key
RLOC pair and rloc fib_index.
#define VLIB_CLI_COMMAND(x,...)
u8 * format_ip_address(u8 *s, va_list *args)
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.