FD.io VPP  v17.01.1-3-gc6833f8
Vector Packet Processing
lisp_gpe_adjacency.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 /**
16  * @file
17  * @brief Common utility functions for IPv4, IPv6 and L2 LISP-GPE adjacencys.
18  *
19  */
20 
21 #include <vnet/dpo/load_balance.h>
26 #include <vnet/fib/fib_entry.h>
27 #include <vnet/adj/adj_midchain.h>
28 
29 /**
30  * Memory pool of all adjacencies
31  */
33 
34 /**
35  * Hash table of all adjacencies. key:{nh, itf}
36  * We never have an all zeros address since the interfaces are multi-access,
37  * therefore there is no ambiguity between a v4 and v6 next-hop, so we don't
38  * need to add the protocol to the key.
39  */
40 static
41 BVT (clib_bihash)
43 
44 #define LISP_ADJ_SET_KEY(_key, _itf, _nh) \
45 { \
46  _key.key[0] = (_nh)->ip.v6.as_u64[0]; \
47  _key.key[1] = (_nh)->ip.v6.as_u64[1]; \
48  _key.key[2] = (_itf); \
49 }
50 
51  static index_t lisp_adj_find (const ip_address_t * addr, u32 sw_if_index)
52 {
53  BVT (clib_bihash_kv) kv;
54 
55  LISP_ADJ_SET_KEY (kv, sw_if_index, addr);
56 
57  if (BV (clib_bihash_search) (&lisp_adj_db, &kv, &kv) < 0)
58  {
59  return (INDEX_INVALID);
60  }
61  else
62  {
63  return (kv.value);
64  }
65 }
66 
67 static void
68 lisp_adj_insert (const ip_address_t * addr, u32 sw_if_index, index_t ai)
69 {
70  BVT (clib_bihash_kv) kv;
71 
72  LISP_ADJ_SET_KEY (kv, sw_if_index, addr);
73  kv.value = ai;
74 
75  BV (clib_bihash_add_del) (&lisp_adj_db, &kv, 1);
76 }
77 
78 static void
79 lisp_adj_remove (const ip_address_t * addr, u32 sw_if_index)
80 {
81  BVT (clib_bihash_kv) kv;
82 
83  LISP_ADJ_SET_KEY (kv, sw_if_index, addr);
84 
85  BV (clib_bihash_add_del) (&lisp_adj_db, &kv, 0);
86 }
87 
88 static lisp_gpe_adjacency_t *
90 {
91  return (pool_elt_at_index (lisp_adj_pool, lai));
92 }
93 
96 {
97  switch (ip_addr_version (&ladj->remote_rloc))
98  {
99  case IP4:
101  case IP6:
103  default:
104  ASSERT (0);
105  break;
106  }
108 }
109 
110 static void
111 ip46_address_to_ip_address (const ip46_address_t * a, ip_address_t * b)
112 {
113  if (ip46_address_is_ip4 (a))
114  {
115  memset (b, 0, sizeof (*b));
116  ip_address_set (b, &a->ip4, IP4);
117  }
118  else
119  {
120  ip_address_set (b, &a->ip6, IP6);
121  }
122 }
123 
124 /**
125  * @brief Stack the tunnel's midchain on the IP forwarding chain of the via
126  */
127 static void
129 {
130  const lisp_gpe_tunnel_t *lgt;
131  dpo_id_t tmp = DPO_INVALID;
132 
133  lgt = lisp_gpe_tunnel_get (ladj->tunnel_index);
136  &tmp);
137 
138  if (DPO_LOAD_BALANCE == tmp.dpoi_type)
139  {
140  /*
141  * post LISP rewrite we will load-balance. However, the LISP encap
142  * is always the same for this adjacency/tunnel and hence the IP/UDP src,dst
143  * hash is always the same result too. So we do that hash now and
144  * stack on the choice.
145  * If the choice is an incomplete adj then we will need a poke when
146  * it becomes complete. This happens since the adj update walk propagates
147  * as far a recursive paths.
148  */
149  const dpo_id_t *choice;
150  load_balance_t *lb;
151  int hash;
152 
153  lb = load_balance_get (tmp.dpoi_index);
154 
155  if (IP4 == ip_addr_version (&ladj->remote_rloc))
156  {
158  lb->lb_hash_config);
159  }
160  else
161  {
163  lb->lb_hash_config);
164  }
165 
166  choice =
168  dpo_copy (&tmp, choice);
169  }
170 
171  adj_nbr_midchain_stack (ai, &tmp);
172  dpo_reset (&tmp);
173 }
174 
175 /**
176  * @brief Call back when restacking all adjacencies on a GRE interface
177  */
178 static adj_walk_rc_t
180 {
181  lisp_gpe_adjacency_t *ladj = ctx;
182 
183  lisp_gpe_adj_stack_one (ladj, ai);
184 
185  return (ADJ_WALK_RC_CONTINUE);
186 }
187 
188 static void
190 {
191  fib_protocol_t nh_proto;
192  ip46_address_t nh;
193 
194  ip_address_to_46 (&ladj->remote_rloc, &nh, &nh_proto);
195 
196  /*
197  * walk all the adjacencies on th lisp interface and restack them
198  */
200  nh_proto, &nh, lisp_gpe_adj_walk_cb, ladj);
201 }
202 
205 {
206  switch (linkt)
207  {
208  case VNET_LINK_IP4:
209  return (LISP_GPE_NEXT_PROTO_IP4);
210  case VNET_LINK_IP6:
211  return (LISP_GPE_NEXT_PROTO_IP6);
212  case VNET_LINK_ETHERNET:
214  default:
215  ASSERT (0);
216  }
217  return (LISP_GPE_NEXT_PROTO_IP4);
218 }
219 
220 #define is_v4_packet(_h) ((*(u8*) _h) & 0xF0) == 0x40
221 
222 static void
224 {
225  /* Fixup the checksum and len fields in the LISP tunnel encap
226  * that was applied at the midchain node */
228 }
229 
230 /**
231  * @brief The LISP-GPE interface registered function to update, i.e.
232  * provide an rewrite string for, an adjacency.
233  */
234 void
236 {
237  const lisp_gpe_tunnel_t *lgt;
238  lisp_gpe_adjacency_t *ladj;
239  ip_adjacency_t *adj;
240  ip_address_t rloc;
241  vnet_link_t linkt;
242  index_t lai;
243 
244  adj = adj_get (ai);
245  ip46_address_to_ip_address (&adj->sub_type.nbr.next_hop, &rloc);
246 
247  /*
248  * find an existing or create a new adj
249  */
250  lai = lisp_adj_find (&rloc, sw_if_index);
251 
252  ASSERT (INDEX_INVALID != lai);
253 
254  ladj = pool_elt_at_index (lisp_adj_pool, lai);
255  lgt = lisp_gpe_tunnel_get (ladj->tunnel_index);
256  linkt = adj_get_link_type (ai);
257 
259  (ai, lisp_gpe_fixup,
260  (VNET_LINK_ETHERNET == linkt ?
264  (lgt, ladj, lisp_gpe_adj_proto_from_vnet_link_type (linkt)));
265 
266  lisp_gpe_adj_stack_one (ladj, ai);
267 }
268 
269 u8 *
271  u32 sw_if_index,
272  vnet_link_t link_type, const void *dst_address)
273 {
274  ASSERT (0);
275  return (NULL);
276 }
277 
278 index_t
280  u32 overlay_table_id, u32 vni)
281 {
282  const lisp_gpe_sub_interface_t *l3s;
283  const lisp_gpe_tunnel_t *lgt;
284  lisp_gpe_adjacency_t *ladj;
285  index_t lai, l3si;
286 
287  /*
288  * first find the L3 sub-interface that corresponds to the loacl-rloc and vni
289  */
291  overlay_table_id,
292  vni);
293  l3s = lisp_gpe_sub_interface_get (l3si);
294 
295  /*
296  * find an existing or create a new adj
297  */
298  lai = lisp_adj_find (&pair->rmt_loc, l3s->sw_if_index);
299 
300  if (INDEX_INVALID == lai)
301  {
302 
303  pool_get (lisp_adj_pool, ladj);
304  memset (ladj, 0, sizeof (*ladj));
305  lai = (ladj - lisp_adj_pool);
306 
307  ip_address_copy (&ladj->remote_rloc, &pair->rmt_loc);
308  ladj->vni = vni;
309  /* transfer the lock to the adj */
310  ladj->lisp_l3_sub_index = l3si;
311  ladj->sw_if_index = l3s->sw_if_index;
312 
313  /* if vni is non-default */
314  if (ladj->vni)
315  ladj->flags = LISP_GPE_FLAGS_I;
316 
317  /* work in lisp-gpe not legacy mode */
318  ladj->flags |= LISP_GPE_FLAGS_P;
319 
320  /*
321  * find the tunnel that will provide the underlying transport
322  * and hence the rewrite.
323  * The RLOC FIB index is default table - always.
324  */
326 
327  lgt = lisp_gpe_tunnel_get (ladj->tunnel_index);
328 
329  /*
330  * become of child of the RLOC FIB entry so we are updated when
331  * its reachability changes, allowing us to re-stack the midcahins
332  */
335  lai);
336 
337  lisp_adj_insert (&ladj->remote_rloc, ladj->sw_if_index, lai);
338  }
339  else
340  {
341  /* unlock the interface from the find. */
343  ladj = lisp_gpe_adjacency_get_i (lai);
344  }
345 
346  ladj->locks++;
347 
348  return (lai);
349 }
350 
351 /**
352  * @brief Get a pointer to a tunnel from a pointer to a FIB node
353  */
354 static lisp_gpe_adjacency_t *
356 {
357  return ((lisp_gpe_adjacency_t *)
358  ((char *) node -
360 }
361 
362 static void
364 {
365  const lisp_gpe_tunnel_t *lgt;
366 
367  /*
368  * no children so we are not counting locks. no-op.
369  * at least not counting
370  */
371  lisp_adj_remove (&ladj->remote_rloc, ladj->sw_if_index);
372 
373  /*
374  * unlock the resources this adj holds
375  */
376  lgt = lisp_gpe_tunnel_get (ladj->tunnel_index);
377 
379 
382 
383  pool_put (lisp_adj_pool, ladj);
384 }
385 
386 void
388 {
389  lisp_gpe_adjacency_t *ladj;
390 
391  ladj = lisp_gpe_adjacency_get_i (lai);
392 
393  ladj->locks--;
394 
395  if (0 == ladj->locks)
396  {
398  }
399 }
400 
401 const lisp_gpe_adjacency_t *
403 {
404  return (lisp_gpe_adjacency_get_i (lai));
405 }
406 
407 
408 /**
409  * @brief LISP GPE tunnel back walk
410  *
411  * The FIB entry through which this tunnel resolves has been updated.
412  * re-stack the midchain on the new forwarding.
413  */
417 {
419 
421 }
422 
423 static fib_node_t *
425 {
426  lisp_gpe_adjacency_t *ladj;
427 
428  ladj = pool_elt_at_index (lisp_adj_pool, index);
429  return (&ladj->fib_node);
430 }
431 
432 static void
434 {
436 }
437 
438 const static fib_node_vft_t lisp_gpe_tuennel_vft = {
440  .fnv_back_walk = lisp_gpe_adjacency_back_walk,
441  .fnv_last_lock = lisp_gpe_adjacency_last_fib_lock_gone,
442 };
443 
444 u8 *
445 format_lisp_gpe_adjacency (u8 * s, va_list * args)
446 {
447  lisp_gpe_adjacency_t *ladj = va_arg (*args, lisp_gpe_adjacency_t *);
449  va_arg (*args, lisp_gpe_adjacency_format_flags_t);
450 
452  {
453  s =
454  format (s, "index %d locks:%d\n", ladj - lisp_adj_pool, ladj->locks);
455  }
456 
457  s = format (s, " vni: %d,", ladj->vni);
458  s = format (s, " remote-RLOC: %U,", format_ip_address, &ladj->remote_rloc);
459 
460  if (flags & LISP_GPE_ADJ_FORMAT_FLAG_DETAIL)
461  {
462  s = format (s, " %U\n",
465  s = format (s, " %U\n",
468  }
469  else
470  {
471  s = format (s, " LISP L3 sub-interface index: %d,",
472  ladj->lisp_l3_sub_index);
473  s = format (s, " LISP tunnel index: %d", ladj->tunnel_index);
474  }
475 
476 
477  return (s);
478 }
479 
480 static clib_error_t *
482  unformat_input_t * input, vlib_cli_command_t * cmd)
483 {
484  lisp_gpe_adjacency_t *ladj;
485  index_t index;
486 
487  if (pool_elts (lisp_adj_pool) == 0)
488  vlib_cli_output (vm, "No lisp-gpe Adjacencies");
489 
490  if (unformat (input, "%d", &index))
491  {
492  ladj = lisp_gpe_adjacency_get_i (index);
495  }
496  else
497  {
498  /* *INDENT-OFF* */
499  pool_foreach (ladj, lisp_adj_pool,
500  ({
501  vlib_cli_output (vm, "[%d] %U\n",
502  ladj - lisp_adj_pool,
505  }));
506  /* *INDENT-ON* */
507  }
508 
509  return 0;
510 }
511 
512 /* *INDENT-OFF* */
513 VLIB_CLI_COMMAND (show_lisp_gpe_tunnel_command, static) =
514 {
515  .path = "show lisp gpe adjacency",
516  .function = lisp_gpe_adjacency_show,
517 };
518 /* *INDENT-ON* */
519 
520 #define LISP_ADJ_NBR_DEFAULT_HASH_NUM_BUCKETS (256)
521 #define LISP_ADJ_NBR_DEFAULT_HASH_MEMORY_SIZE (1<<20)
522 
523 static clib_error_t *
525 {
527  "Adjacency Neighbour table",
530 
531  fib_node_register_type (FIB_NODE_TYPE_LISP_ADJ, &lisp_gpe_tuennel_vft);
532  return (NULL);
533 }
534 
536 /*
537  * fd.io coding-style-patch-verification: ON
538  *
539  * Local Variables:
540  * eval: (c-set-style "gnu")
541  * End:
542  */
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.
Definition: adj_nbr.c:634
Contribute an object that is to be used to forward IP6 packets.
Definition: fib_types.h:85
enum lisp_gpe_adjacency_format_flags_t_ lisp_gpe_adjacency_format_flags_t
Flags for displaying the adjacency.
uword unformat(unformat_input_t *i, char *fmt,...)
Definition: unformat.c:966
a
Definition: bitmap.h:516
#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)
Definition: fib_entry.c:472
const u8 * adj_get_rewrite(adj_index_t ai)
Return the link type of the adjacency.
Definition: adj.c:288
vnet_link_t adj_get_link_type(adj_index_t ai)
Return the link type of the adjacency.
Definition: adj.c:262
#define NULL
Definition: clib.h:55
static u32 ip4_compute_flow_hash(const ip4_header_t *ip, flow_hash_config_t flow_hash_config)
Definition: ip4.h:271
IP unicast adjacency.
Definition: lookup.h:188
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
void fib_entry_contribute_forwarding(fib_node_index_t fib_entry_index, fib_forward_chain_type_t fct, dpo_id_t *dpo)
Definition: fib_entry.c:391
flow_hash_config_t lb_hash_config
the hash config to use when selecting a bucket.
Definition: load_balance.h:122
index_t lisp_gpe_tunnel_find_or_create_and_lock(const locator_pair_t *pair, u32 rloc_fib_index)
void fib_entry_child_remove(fib_node_index_t fib_entry_index, u32 sibling_index)
Definition: fib_entry.c:483
static clib_error_t * lisp_gpe_adj_module_init(vlib_main_t *vm)
void dpo_copy(dpo_id_t *dst, const dpo_id_t *src)
atomic copy a data-plane object.
Definition: dpo.c:221
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...
Definition: dpo.h:41
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.
Definition: fib_types.h:81
static index_t lisp_adj_find(const ip_address_t *addr, u32 sw_if_index)
#define STRUCT_OFFSET_OF(t, f)
Definition: clib.h:62
static fib_node_t * lisp_gpe_adjacency_get_fib_node(fib_node_index_t index)
void ip_address_copy(ip_address_t *dst, const ip_address_t *src)
Definition: lisp_types.c:750
void ip_address_set(ip_address_t *dst, const void *src, u8 version)
Definition: lisp_types.c:772
static void lisp_gpe_fixup(vlib_main_t *vm, ip_adjacency_t *adj, vlib_buffer_t *b)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
Definition: pool.h:200
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)
union ip_adjacency_t_::@175 sub_type
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
Definition: fib_node.c:58
void adj_nbr_midchain_update_rewrite(adj_index_t adj_index, adj_midchain_fixup_t fixup, adj_midchain_flag_t flags, u8 *rewrite)
adj_nbr_midchain_update_rewrite
Definition: adj_midchain.c:375
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 ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
Definition: adj.h:117
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.
Definition: pool.h:348
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)
Definition: init.h:111
fib_node_t fib_node
The LISP adj is a part of the FIB control plane graph.
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
Definition: buffer.h:194
u16 lb_n_buckets_minus_1
number of buckets in the load-balance - 1.
Definition: load_balance.h:92
static BVT(clib_bihash)
Definition: adj_nbr.c:26
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)
void lisp_gpe_adjacency_unlock(index_t lai)
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.
u8 * lisp_gpe_build_rewrite(vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
#define ip_addr_version(_a)
Definition: lisp_types.h:56
Common utility functions for IPv4, IPv6 and L2 LISP-GPE adjacencys.
LISP sub-interfaces.
static void ip46_address_to_ip_address(const ip46_address_t *a, ip_address_t *b)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
Definition: dpo.h:138
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:369
Common utility functions for IPv4, IPv6 and L2 LISP-GPE tunnels.
dpo_type_t dpoi_type
the type
Definition: dpo.h:142
static const dpo_id_t * load_balance_get_bucket_i(const load_balance_t *lb, u32 bucket)
Definition: load_balance.h:194
load-balancing over a choice of [un]equal cost paths
Definition: dpo.h:102
static lisp_adj_db
Hash table of all adjacencies.
static u32 ip6_compute_flow_hash(const ip6_header_t *ip, flow_hash_config_t flow_hash_config)
Definition: ip6.h:410
#define pool_put(P, E)
Free an object E in pool P.
Definition: pool.h:214
The FIB DPO provieds;.
Definition: load_balance.h:83
u32 sw_if_index
The SW IF index of the sub-interface this adjacency uses.
const lisp_gpe_adjacency_t * lisp_gpe_adjacency_get(index_t lai)
#define LISP_ADJ_NBR_DEFAULT_HASH_NUM_BUCKETS
ip_address_t lcl_loc
Definition: lisp_types.h:334
#define is_v4_packet(_h)
An node in the FIB graph.
Definition: fib_node.h:273
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)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
Definition: cli.c:576
void ip_address_to_46(const ip_address_t *addr, ip46_address_t *a, fib_protocol_t *proto)
Definition: lisp_types.c:779
Packets TX through the midchain do not increment the interface counters.
Definition: adj_midchain.h:44
#define ip46_address_is_ip4(ip46)
Definition: ip6_packet.h:76
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)
Definition: udp.h:127
struct ip_adjacency_t_::@175::@176 nbr
IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE.
#define LISP_ADJ_SET_KEY(_key, _itf, _nh)
fib_node_get_t fnv_get
Definition: fib_node.h:261
u32 fib_node_index_t
A typedef of a node index.
Definition: fib_types.h:28
u32 adj_index_t
An index for adjacencies.
Definition: adj_types.h:30
void lisp_gpe_sub_interface_unlock(index_t l3si)
Context passed between object during a back walk.
Definition: fib_node.h:186
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:154
#define ASSERT(truth)
void adj_nbr_midchain_stack(adj_index_t adj_index, const dpo_id_t *next)
adj_nbr_midchain_stack
Definition: adj_midchain.c:463
unsigned int u32
Definition: types.h:88
u8 * format_ip_address(u8 *s, va_list *args)
Definition: lisp_types.c:127
int clib_bihash_search(clib_bihash *h, clib_bihash_kv *search_v, clib_bihash_kv *return_v)
Search a bi-hash table.
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
static load_balance_t * load_balance_get(index_t lbi)
Definition: load_balance.h:185
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.
A LISP GPE Adjacency.
index_t lisp_gpe_sub_interface_find_or_create_and_lock(const ip_address_t *lrloc, u32 overlay_table_id, u32 vni)
index_t dpoi_index
the index of objects of that type
Definition: dpo.h:154
unsigned char u8
Definition: types.h:56
A LISP L3 sub-interface.
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...
Definition: dpo.h:47
u8 * format_lisp_gpe_sub_interface(u8 *s, va_list ap)
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
Definition: dpo.h:165
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)
Definition: lisp_types.h:37
static void lisp_adj_remove(const ip_address_t *addr, u32 sw_if_index)
A FIB graph nodes virtual function table.
Definition: fib_node.h:260
u8 * format_lisp_gpe_adjacency(u8 *s, va_list *args)
static lisp_gpe_adjacency_t * lisp_adj_pool
Memory pool of all adjacencies.
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:418
ip_address_t rmt_loc
Definition: lisp_types.h:335
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
Definition: dpo.c:191
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.
vhost_vring_addr_t addr
Definition: vhost-user.h:81
struct _unformat_input_t unformat_input_t
lisp_gpe_next_protocol_e
u32 flags
Definition: vhost-user.h:75
Definition: lisp_types.h:38
fib_node_t node
This object joins the FIB control plane graph to receive updates to for changes to the graph...
u8 flags
LISP header fields in HOST byte order.
ip_address_t remote_rloc
remote RLOC.
A LISP GPE Tunnel.
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&#39;s midchain on the IP forwarding chain of the via.
static uword pool_elts(void *v)
Number of active elements in a pool.
Definition: pool.h:109