FD.io VPP  v19.08.3-2-gbabecb413
Vector Packet Processing
fib_types.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 #include <vnet/ip/ip.h>
17 
18 #include <vnet/fib/fib_types.h>
19 #include <vnet/fib/fib_internal.h>
20 #include <vnet/fib/fib_table.h>
21 #include <vnet/mfib/mfib_types.h>
22 #include <vnet/mpls/mpls.h>
23 
24 /*
25  * arrays of protocol and link names
26  */
27 static const char* fib_protocol_names[] = FIB_PROTOCOLS;
28 static const char* vnet_link_names[] = VNET_LINKS;
29 static const char* fib_forw_chain_names[] = FIB_FORW_CHAINS;
31 
32 u8 *
33 format_fib_protocol (u8 * s, va_list * ap)
34 {
35  fib_protocol_t proto = va_arg(*ap, int); // fib_protocol_t promotion
36 
37  return (format (s, "%s", fib_protocol_names[proto]));
38 }
39 
40 u8 *
41 format_vnet_link (u8 * s, va_list * ap)
42 {
43  vnet_link_t link = va_arg(*ap, int); // vnet_link_t promotion
44 
45  return (format (s, "%s", vnet_link_names[link]));
46 }
47 
48 u8 *
49 format_fib_forw_chain_type (u8 * s, va_list * args)
50 {
51  fib_forward_chain_type_t fct = va_arg(*args, int);
52 
53  return (format (s, "%s", fib_forw_chain_names[fct]));
54 }
55 
56 u8 *
57 format_fib_mpls_lsp_mode(u8 *s, va_list *ap)
58 {
59  fib_mpls_lsp_mode_t mode = va_arg(*ap, int);
60 
61  return (format (s, "%s", fib_mpls_lsp_mode_names[mode]));
62 }
63 
64 u8 *
65 format_fib_mpls_label (u8 *s, va_list *ap)
66 {
67  fib_mpls_label_t *label = va_arg(*ap, fib_mpls_label_t *);
68 
69  s = format(s, "%U %U ttl:%d exp:%d",
71  label->fml_value,
73  label->fml_mode,
74  label->fml_ttl,
75  label->fml_exp);
76 
77  return (s);
78 }
79 
80 void
81 fib_prefix_from_ip46_addr (const ip46_address_t *addr,
82  fib_prefix_t *pfx)
83 {
85 
86  pfx->fp_proto = ((ip46_address_is_ip4(addr) ?
89  pfx->fp_len = ((ip46_address_is_ip4(addr) ?
90  32 : 128));
91  pfx->fp_addr = *addr;
92  pfx->___fp___pad = 0;
93 }
94 
95 void
97  mpls_eos_bit_t eos,
98  fib_prefix_t *pfx)
99 {
101  pfx->fp_len = 21;
102  pfx->fp_label = label;
103  pfx->fp_eos = eos;
104  pfx->___fp___pad = 0;
105 }
106 
107 void
109  const fib_prefix_t *src)
110 {
111  clib_memcpy(dst, src, sizeof(*dst));
112 }
113 
114 int
116  const fib_prefix_t *p2)
117 {
118  int res;
119 
120  res = (p1->fp_proto - p2->fp_proto);
121 
122  if (0 == res)
123  {
124  switch (p1->fp_proto)
125  {
126  case FIB_PROTOCOL_IP4:
127  case FIB_PROTOCOL_IP6:
128  res = (p1->fp_len - p2->fp_len);
129 
130  if (0 == res)
131  {
132  res = ip46_address_cmp(&p1->fp_addr, &p2->fp_addr);
133  }
134  break;
135  case FIB_PROTOCOL_MPLS:
136  res = (p1->fp_label - p2->fp_label);
137 
138  if (0 == res)
139  {
140  res = (p1->fp_eos - p2->fp_eos);
141  }
142  break;
143  }
144  }
145 
146  return (res);
147 }
148 
149 int
151  const fib_prefix_t *p2)
152 {
153  switch (p1->fp_proto)
154  {
155  case FIB_PROTOCOL_IP4:
157  &p1->fp_addr.ip4,
158  &p2->fp_addr.ip4,
159  p1->fp_len));
160  case FIB_PROTOCOL_IP6:
162  &p1->fp_addr.ip6,
163  &p2->fp_addr.ip6,
164  p1->fp_len));
165  case FIB_PROTOCOL_MPLS:
166  break;
167  }
168  return (0);
169 }
170 
171 int
173 {
174  switch (prefix->fp_proto)
175  {
176  case FIB_PROTOCOL_IP4:
177  return (prefix->fp_len == 32);
178  case FIB_PROTOCOL_IP6:
179  return (prefix->fp_len == 128);
180  case FIB_PROTOCOL_MPLS:
181  return (!0);
182  }
183  return (0);
184 }
185 
186 u8 *
187 format_fib_prefix (u8 * s, va_list * args)
188 {
189  fib_prefix_t *fp = va_arg (*args, fib_prefix_t *);
190 
191  /*
192  * protocol specific so it prints ::/0 correctly.
193  */
194  switch (fp->fp_proto)
195  {
196  case FIB_PROTOCOL_IP6:
197  {
198  ip6_address_t p6 = fp->fp_addr.ip6;
199 
201  s = format (s, "%U", format_ip6_address, &p6);
202  break;
203  }
204  case FIB_PROTOCOL_IP4:
205  {
206  ip4_address_t p4 = fp->fp_addr.ip4;
207  p4.as_u32 &= ip4_main.fib_masks[fp->fp_len];
208 
209  s = format (s, "%U", format_ip4_address, &p4);
210  break;
211  }
212  case FIB_PROTOCOL_MPLS:
213  s = format (s, "%U:%U",
216  break;
217  }
218  s = format (s, "/%d", fp->fp_len);
219 
220  return (s);
221 }
222 
223 int
225  const fib_route_path_t *rpath2)
226 {
227  int res;
228 
229  res = ip46_address_cmp(&rpath1->frp_addr,
230  &rpath2->frp_addr);
231 
232  if (0 != res) return (res);
233 
234  res = (rpath1->frp_sw_if_index - rpath2->frp_sw_if_index);
235 
236  if (0 != res) return (res);
237 
238  if (ip46_address_is_zero(&rpath1->frp_addr))
239  {
240  res = rpath1->frp_fib_index - rpath2->frp_fib_index;
241  }
242 
243  return (res);
244 }
245 
248 {
249  switch (fib_proto)
250  {
251  case FIB_PROTOCOL_IP6:
252  return (DPO_PROTO_IP6);
253  case FIB_PROTOCOL_IP4:
254  return (DPO_PROTO_IP4);
255  case FIB_PROTOCOL_MPLS:
256  return (DPO_PROTO_MPLS);
257  }
258  ASSERT(0);
259  return (0);
260 }
261 
264 {
265  switch (dpo_proto)
266  {
267  case DPO_PROTO_IP6:
268  return (FIB_PROTOCOL_IP6);
269  case DPO_PROTO_IP4:
270  return (FIB_PROTOCOL_IP4);
271  case DPO_PROTO_MPLS:
272  return (FIB_PROTOCOL_MPLS);
273  default:
274  break;
275  }
276  ASSERT(0);
277  return (0);
278 }
279 
282 {
283  switch (proto)
284  {
285  case FIB_PROTOCOL_IP4:
286  return (VNET_LINK_IP4);
287  case FIB_PROTOCOL_IP6:
288  return (VNET_LINK_IP6);
289  case FIB_PROTOCOL_MPLS:
290  return (VNET_LINK_MPLS);
291  }
292  ASSERT(0);
293  return (0);
294 }
295 
298 {
299  switch (fproto)
300  {
301  case FIB_PROTOCOL_IP4:
302  return (IP46_TYPE_IP4);
303  case FIB_PROTOCOL_IP6:
304  return (IP46_TYPE_IP6);
305  case FIB_PROTOCOL_MPLS:
306  return (IP46_TYPE_ANY);
307  }
308  ASSERT(0);
309  return (IP46_TYPE_ANY);
310 }
311 
314 {
315  switch (iproto)
316  {
317  case IP46_TYPE_IP4:
318  return FIB_PROTOCOL_IP4;
319  case IP46_TYPE_IP6:
320  return FIB_PROTOCOL_IP6;
321  case IP46_TYPE_ANY:
322  ASSERT(0);
323  return FIB_PROTOCOL_IP4;
324  }
325 
326  ASSERT(0);
327  return FIB_PROTOCOL_IP4;
328 }
329 
332 {
333  switch (proto)
334  {
335  case DPO_PROTO_IP4:
337  case DPO_PROTO_IP6:
339  case DPO_PROTO_MPLS:
341  case DPO_PROTO_ETHERNET:
343  case DPO_PROTO_NSH:
344  return (FIB_FORW_CHAIN_TYPE_NSH);
345  case DPO_PROTO_BIER:
346  return (FIB_FORW_CHAIN_TYPE_BIER);
347  }
348  ASSERT(0);
350 }
351 
354 {
355  switch (proto)
356  {
357  case FIB_PROTOCOL_IP4:
359  case FIB_PROTOCOL_IP6:
361  case FIB_PROTOCOL_MPLS:
363  }
364  ASSERT(0);
366 }
367 
370 {
371  switch (fct)
372  {
375  return (VNET_LINK_IP4);
378  return (VNET_LINK_IP6);
380  return (VNET_LINK_ETHERNET);
382  return (VNET_LINK_NSH);
385  /*
386  * insufficient information to to convert
387  */
388  ASSERT(0);
389  break;
391  return (VNET_LINK_MPLS);
392  }
393  return (VNET_LINK_IP4);
394 }
395 
398 {
399  switch (link_type)
400  {
401  case VNET_LINK_IP4:
403  case VNET_LINK_IP6:
405  case VNET_LINK_MPLS:
407  case VNET_LINK_ETHERNET:
409  case VNET_LINK_NSH:
410  return (FIB_FORW_CHAIN_TYPE_NSH);
411  case VNET_LINK_ARP:
412  break;
413  }
414 
415  ASSERT(0);
417 }
418 
421 {
422  switch (fct)
423  {
426  return (DPO_PROTO_IP4);
429  return (DPO_PROTO_IP6);
431  return (DPO_PROTO_ETHERNET);
433  return (DPO_PROTO_NSH);
435  return (DPO_PROTO_BIER);
438  return (DPO_PROTO_MPLS);
439  }
440  return (DPO_PROTO_IP4);
441 }
442 
443 uword
444 unformat_fib_route_path (unformat_input_t * input, va_list * args)
445 {
446  fib_route_path_t *rpath = va_arg (*args, fib_route_path_t *);
447  dpo_proto_t *payload_proto = va_arg (*args, void*);
448  u32 weight, preference, udp_encap_id, fi;
449  mpls_label_t out_label;
450  vnet_main_t *vnm;
451 
452  vnm = vnet_get_main ();
453  clib_memset(rpath, 0, sizeof(*rpath));
454  rpath->frp_weight = 1;
455  rpath->frp_sw_if_index = ~0;
456 
458  {
459  if (unformat (input, "%U %U",
461  &rpath->frp_addr.ip4,
463  &rpath->frp_sw_if_index))
464  {
465  rpath->frp_proto = DPO_PROTO_IP4;
466  }
467  else if (unformat (input, "%U %U",
469  &rpath->frp_addr.ip6,
471  &rpath->frp_sw_if_index))
472  {
473  rpath->frp_proto = DPO_PROTO_IP6;
474  }
475  else if (unformat (input, "weight %u", &weight))
476  {
477  rpath->frp_weight = weight;
478  }
479  else if (unformat (input, "preference %u", &preference))
480  {
481  rpath->frp_preference = preference;
482  }
483  else if (unformat (input, "%U next-hop-table %d",
485  &rpath->frp_addr.ip4,
486  &rpath->frp_fib_index))
487  {
488  rpath->frp_sw_if_index = ~0;
489  rpath->frp_proto = DPO_PROTO_IP4;
490 
491  /*
492  * the user enter table-ids, convert to index
493  */
495  if (~0 == fi)
496  return 0;
497  rpath->frp_fib_index = fi;
498  }
499  else if (unformat (input, "%U next-hop-table %d",
501  &rpath->frp_addr.ip6,
502  &rpath->frp_fib_index))
503  {
504  rpath->frp_sw_if_index = ~0;
505  rpath->frp_proto = DPO_PROTO_IP6;
507  if (~0 == fi)
508  return 0;
509  rpath->frp_fib_index = fi;
510  }
511  else if (unformat (input, "%U",
513  &rpath->frp_addr.ip4))
514  {
515  /*
516  * the recursive next-hops are by default in the default table
517  */
518  rpath->frp_fib_index = 0;
519  rpath->frp_sw_if_index = ~0;
520  rpath->frp_proto = DPO_PROTO_IP4;
521  }
522  else if (unformat (input, "%U",
524  &rpath->frp_addr.ip6))
525  {
526  rpath->frp_fib_index = 0;
527  rpath->frp_sw_if_index = ~0;
528  rpath->frp_proto = DPO_PROTO_IP6;
529  }
530  else if (unformat (input, "udp-encap %d", &udp_encap_id))
531  {
532  rpath->frp_udp_encap_id = udp_encap_id;
534  rpath->frp_proto = *payload_proto;
535  }
536  else if (unformat (input, "lookup in table %d", &rpath->frp_fib_index))
537  {
538  rpath->frp_proto = *payload_proto;
539  rpath->frp_sw_if_index = ~0;
540  rpath->frp_flags |= FIB_ROUTE_PATH_DEAG;
541  }
542  else if (unformat (input, "resolve-via-host"))
543  {
545  }
546  else if (unformat (input, "resolve-via-attached"))
547  {
549  }
550  else if (unformat (input, "pop-pw-cw"))
551  {
553  }
554  else if (unformat (input,
555  "ip4-lookup-in-table %d",
556  &rpath->frp_fib_index))
557  {
558  rpath->frp_proto = DPO_PROTO_IP4;
559  *payload_proto = DPO_PROTO_IP4;
561  if (~0 == fi)
562  return 0;
563  rpath->frp_fib_index = fi;
564  }
565  else if (unformat (input,
566  "ip6-lookup-in-table %d",
567  &rpath->frp_fib_index))
568  {
569  rpath->frp_proto = DPO_PROTO_IP6;
570  *payload_proto = DPO_PROTO_IP6;
572  if (~0 == fi)
573  return 0;
574  rpath->frp_fib_index = fi;
575  }
576  else if (unformat (input,
577  "mpls-lookup-in-table %d",
578  &rpath->frp_fib_index))
579  {
580  rpath->frp_proto = DPO_PROTO_MPLS;
581  *payload_proto = DPO_PROTO_MPLS;
583  if (~0 == fi)
584  return 0;
585  rpath->frp_fib_index = fi;
586  }
587  else if (unformat (input, "src-lookup"))
588  {
590  }
591  else if (unformat (input,
592  "l2-input-on %U",
594  &rpath->frp_sw_if_index))
595  {
596  rpath->frp_proto = DPO_PROTO_ETHERNET;
597  *payload_proto = DPO_PROTO_ETHERNET;
599  }
600  else if (unformat (input, "via-label %U",
602  &rpath->frp_local_label))
603  {
604  rpath->frp_eos = MPLS_NON_EOS;
605  rpath->frp_proto = DPO_PROTO_MPLS;
606  rpath->frp_sw_if_index = ~0;
607  }
608  else if (unformat (input, "rx-ip4 %U",
610  &rpath->frp_sw_if_index))
611  {
612  rpath->frp_proto = DPO_PROTO_IP4;
614  }
615  else if (unformat (input, "local"))
616  {
617  clib_memset (&rpath->frp_addr, 0, sizeof (rpath->frp_addr));
618  rpath->frp_sw_if_index = ~0;
619  rpath->frp_weight = 1;
621  }
622  else if (unformat (input, "%U",
624  ;
625  else if (unformat (input, "out-labels"))
626  {
627  while (unformat (input, "%U",
628  unformat_mpls_unicast_label, &out_label))
629  {
630  fib_mpls_label_t fml = {
631  .fml_value = out_label,
632  };
633  vec_add1(rpath->frp_label_stack, fml);
634  }
635  }
636  else if (unformat (input, "%U",
638  &rpath->frp_sw_if_index))
639  {
640  rpath->frp_proto = *payload_proto;
641  }
642  else if (unformat (input, "via"))
643  {
644  /* new path, back up and return */
645  unformat_put_input (input);
646  unformat_put_input (input);
647  unformat_put_input (input);
648  unformat_put_input (input);
649  break;
650  }
651  else
652  {
653  return (0);
654  }
655  }
656 
657  return (1);
658 }
static const char * vnet_link_names[]
Definition: fib_types.c:28
fib_protocol_t fp_proto
protocol type
Definition: fib_types.h:212
Contribute an object that is to be used to forward BIER packets.
Definition: fib_types.h:122
Contribute an object that is to be used to forward IP6 packets.
Definition: fib_types.h:137
ip46_address_t frp_addr
The next-hop address.
Definition: fib_types.h:501
Contribute an object that is to be used to forward IP6 packets.
Definition: fib_types.h:113
fib_forward_chain_type_t fib_forw_chain_type_from_link_type(vnet_link_t link_type)
Convert from a adjacency&#39;s link type to chain type.
Definition: fib_types.c:397
static const char * fib_protocol_names[]
Definition: fib_types.c:27
mpls_eos_bit_t frp_eos
EOS bit for the resolving label.
Definition: fib_types.h:512
int fib_route_path_cmp(const fib_route_path_t *rpath1, const fib_route_path_t *rpath2)
Definition: fib_types.c:224
A representation of a path as described by a route producer.
Definition: fib_types.h:485
uword unformat_mfib_itf_flags(unformat_input_t *input, va_list *args)
Definition: mfib_types.c:198
vnet_main_t * vnet_get_main(void)
Definition: misc.c:46
ip46_type_t fib_proto_to_ip46(fib_protocol_t fproto)
Convert from fib_protocol to ip46_type.
Definition: fib_types.c:297
uword unformat_fib_route_path(unformat_input_t *input, va_list *args)
Unformat a fib_route_path_t from CLI input.
Definition: fib_types.c:444
u32 frp_mitf_flags
MFIB interface flags.
Definition: fib_types.h:554
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
u32 mpls_label_t
A label value only, i.e.
Definition: packet.h:26
dpo_proto_t fib_forw_chain_type_to_dpo_proto(fib_forward_chain_type_t fct)
Convert from a chain type to the DPO proto it will install.
Definition: fib_types.c:420
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Definition: vec.h:522
vl_api_address_t src
Definition: gre.api:51
#define VNET_LINKS
Definition: interface.h:335
Contribute an object that is to be used to forward IP4 packets.
Definition: fib_types.h:109
static uword ip4_destination_matches_route(const ip4_main_t *im, const ip4_address_t *key, const ip4_address_t *dest, uword dest_length)
Definition: ip4.h:196
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:424
dpo_proto_t frp_proto
The protocol of the address below.
Definition: fib_types.h:490
unformat_function_t unformat_vnet_sw_interface
vl_api_mprefix_t prefix
Definition: ip.api:456
A path that result in received traffic being recieved/recirculated so that it appears to have arrived...
Definition: fib_types.h:355
static void ip6_address_mask(ip6_address_t *a, const ip6_address_t *mask)
Definition: ip6_packet.h:268
vhost_vring_addr_t addr
Definition: vhost_user.h:147
#define ip46_address_cmp(ip46_1, ip46_2)
Definition: ip6_packet.h:92
unsigned char u8
Definition: types.h:56
int fib_prefix_is_host(const fib_prefix_t *prefix)
Return true is the prefix is a host prefix.
Definition: fib_types.c:172
u8 * format_fib_protocol(u8 *s, va_list *ap)
Definition: fib_types.c:33
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
unformat_function_t unformat_mpls_unicast_label
Definition: mpls.h:81
#define clib_memcpy(d, s, n)
Definition: string.h:180
u8 preference
Definition: fib_types.api:121
format_function_t format_ip4_address
Definition: format.h:75
unformat_function_t unformat_ip4_address
Definition: format.h:70
u32 frp_sw_if_index
The interface.
Definition: fib_types.h:525
static const char * fib_mpls_lsp_mode_names[]
Definition: fib_types.c:30
u8 * format_fib_mpls_lsp_mode(u8 *s, va_list *ap)
Format an LSP mode type.
Definition: fib_types.c:57
static uword ip6_destination_matches_route(const ip6_main_t *im, const ip6_address_t *key, const ip6_address_t *dest, uword dest_length)
Definition: ip6.h:266
Recursion constraint of via a host prefix.
Definition: fib_types.h:330
u8 * format_fib_prefix(u8 *s, va_list *args)
Definition: fib_types.c:187
Aggregate type for a prefix.
Definition: fib_types.h:203
int fib_prefix_is_cover(const fib_prefix_t *p1, const fib_prefix_t *p2)
Compare two prefixes for covering relationship.
Definition: fib_types.c:150
A path via a UDP encap object.
Definition: fib_types.h:367
unsigned int u32
Definition: types.h:88
Contribute an object that is to be used to forward Ethernet packets.
Definition: fib_types.h:141
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
Definition: fib_table.c:1080
fib_protocol_t dpo_proto_to_fib(dpo_proto_t dpo_proto)
Definition: fib_types.c:263
u16 fp_len
The mask length.
Definition: fib_types.h:207
fib_protocol_t fib_proto_from_ip46(ip46_type_t iproto)
Convert from ip46_type to fib_protocol.
Definition: fib_types.c:313
Contribute an object that is to be used to forward end-of-stack MPLS packets.
Definition: fib_types.h:129
format_function_t format_mpls_eos_bit
Definition: mpls.h:69
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
Definition: fib_types.h:226
struct _unformat_input_t unformat_input_t
enum fib_mpls_lsp_mode_t_ fib_mpls_lsp_mode_t
MPLS LSP mode - only valid at the head and tail.
u8 weight
Definition: fib_types.api:120
static const char * fib_forw_chain_names[]
Definition: fib_types.c:29
Configuration for each label value in the output-stack.
Definition: fib_types.h:440
fib_mpls_label_t * frp_label_stack
The outgoing MPLS label Stack.
Definition: fib_types.h:546
Recursion constraint of via an attahced prefix.
Definition: fib_types.h:334
static void unformat_put_input(unformat_input_t *input)
Definition: format.h:205
u32 label
Definition: fib_types.api:25
vl_api_address_t dst
Definition: gre.api:52
fib_mpls_lsp_mode_t fml_mode
The LSP mode.
Definition: fib_types.h:450
Pop a Psuedo Wire Control Word.
Definition: fib_types.h:396
#define ip46_address_is_ip4(ip46)
Definition: ip6_packet.h:88
unformat_function_t unformat_ip6_address
Definition: format.h:91
ip6_address_t fib_masks[129]
Definition: ip6.h:191
vnet_link_t fib_forw_chain_type_to_link_type(fib_forward_chain_type_t fct)
Convert from a chain type to the adjacency&#39;s link type.
Definition: fib_types.c:369
#define UNFORMAT_END_OF_INPUT
Definition: format.h:145
format_function_t format_ip6_address
Definition: format.h:93
Contribute an object that is to be used to forward NSH packets.
Definition: fib_types.h:147
void fib_prefix_from_mpls_label(mpls_label_t label, mpls_eos_bit_t eos, fib_prefix_t *pfx)
Definition: fib_types.c:96
mpls_label_t fml_value
The label value.
Definition: fib_types.h:445
void fib_prefix_from_ip46_addr(const ip46_address_t *addr, fib_prefix_t *pfx)
Host prefix from ip.
Definition: fib_types.c:81
vl_api_vxlan_gbp_api_tunnel_mode_t mode
Definition: vxlan_gbp.api:44
mpls_label_t fp_label
Definition: fib_types.h:229
#define ASSERT(truth)
ip6_main_t ip6_main
Definition: ip6_forward.c:2805
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
ip46_type_t
Definition: ip6_packet.h:70
u8 frp_preference
A path preference.
Definition: fib_types.h:591
A deag path using the packet&#39;s source not destination address.
Definition: fib_types.h:363
enum fib_forward_chain_type_t_ fib_forward_chain_type_t
FIB output chain type.
fib_route_path_flags_t frp_flags
flags on the path
Definition: fib_types.h:595
u8 * format_fib_forw_chain_type(u8 *s, va_list *args)
Definition: fib_types.c:49
#define FIB_FORW_CHAINS
Definition: fib_types.h:150
dpo_proto_t fib_proto_to_dpo(fib_protocol_t fib_proto)
Definition: fib_types.c:247
void fib_prefix_copy(fib_prefix_t *dst, const fib_prefix_t *src)
Copy a prefix.
Definition: fib_types.c:108
A path that resolves via another table.
Definition: fib_types.h:383
format_function_t format_mpls_unicast_label
Definition: mpls.h:71
mpls_label_t frp_local_label
The MPLS local Label to reursively resolve through.
Definition: fib_types.h:508
#define FIB_MPLS_LSP_MODES
Definition: fib_types.h:427
int fib_prefix_cmp(const fib_prefix_t *p1, const fib_prefix_t *p2)
Compare two prefixes for equality.
Definition: fib_types.c:115
A for-us/local path.
Definition: fib_types.h:338
u64 uword
Definition: types.h:112
u8 * format_fib_mpls_label(u8 *s, va_list *ap)
Format an MPLS label.
Definition: fib_types.c:65
ip4_main_t ip4_main
Global ip4 main structure.
Definition: ip4_forward.c:1076
vnet_link_t fib_proto_to_link(fib_protocol_t proto)
Convert from a protocol to a link type.
Definition: fib_types.c:281
u8 fml_exp
EXP bits; valid only at imposition.
Definition: fib_types.h:460
u8 * format_vnet_link(u8 *s, va_list *ap)
Definition: fib_types.c:41
Contribute an object that is to be used to forward non-end-of-stack MPLS packets. ...
Definition: fib_types.h:118
u8 frp_weight
[un]equal cost path weight
Definition: fib_types.h:585
u32 frp_udp_encap_id
UDP encap ID.
Definition: fib_types.h:565
#define ip46_address_is_zero(ip46)
Definition: ip6_packet.h:93
Contribute an object that is to be used to forward IP4 packets.
Definition: fib_types.h:133
u32 frp_fib_index
The FIB index to lookup the nexthop Only valid for recursive paths.
Definition: fib_types.h:537
fib_forward_chain_type_t fib_forw_chain_type_from_dpo_proto(dpo_proto_t proto)
Convert from a payload-protocol to a chain type.
Definition: fib_types.c:331
#define FIB_PROTOCOLS
Definition: fib_types.h:42
fib_forward_chain_type_t fib_forw_chain_type_from_fib_proto(fib_protocol_t proto)
Convert from a fib-protocol to a chain type.
Definition: fib_types.c:353
uword unformat(unformat_input_t *i, const char *fmt,...)
Definition: unformat.c:978
vl_api_fib_path_nh_proto_t proto
Definition: fib_types.api:125
static uword unformat_check_input(unformat_input_t *i)
Definition: format.h:171
mpls_eos_bit_t fp_eos
Definition: fib_types.h:230
u32 fib_masks[33]
Definition: ip4.h:118
enum mpls_eos_bit_t_ mpls_eos_bit_t