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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #include <vnet/ip/ip.h>
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>
25 * arrays of protocol and link names
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;
30 static const char* fib_mpls_lsp_mode_names[] = FIB_MPLS_LSP_MODES;
33 format_fib_protocol (u8 * s, va_list * ap)
35 fib_protocol_t proto = va_arg(*ap, int); // fib_protocol_t promotion
37 return (format (s, "%s", fib_protocol_names[proto]));
41 format_vnet_link (u8 * s, va_list * ap)
43 vnet_link_t link = va_arg(*ap, int); // vnet_link_t promotion
45 return (format (s, "%s", vnet_link_names[link]));
49 format_fib_forw_chain_type (u8 * s, va_list * args)
51 fib_forward_chain_type_t fct = va_arg(*args, int);
53 return (format (s, "%s", fib_forw_chain_names[fct]));
57 format_fib_mpls_lsp_mode(u8 *s, va_list *ap)
59 fib_mpls_lsp_mode_t mode = va_arg(*ap, int);
61 return (format (s, "%s", fib_mpls_lsp_mode_names[mode]));
65 format_fib_mpls_label (u8 *s, va_list *ap)
67 fib_mpls_label_t *label = va_arg(*ap, fib_mpls_label_t *);
69 s = format(s, "%U %U ttl:%d exp:%d",
70 format_mpls_unicast_label,
72 format_fib_mpls_lsp_mode,
81 fib_prefix_from_ip46_addr (fib_protocol_t fproto,
82 const ip46_address_t *addr,
85 ASSERT(FIB_PROTOCOL_MPLS != fproto);
87 pfx->fp_proto = fproto;
88 pfx->fp_len = ((FIB_PROTOCOL_IP4 == fproto) ?
95 format_fib_route_path_flags (u8 *s, va_list *ap)
97 fib_route_path_flags_t flags = va_arg (*ap, fib_route_path_flags_t);
99 if (flags & FIB_ROUTE_PATH_RESOLVE_VIA_HOST)
100 s = format (s, "via-host");
101 if (flags & FIB_ROUTE_PATH_RESOLVE_VIA_ATTACHED)
102 s = format (s, "via-attached,");
103 if (flags & FIB_ROUTE_PATH_LOCAL)
104 s = format (s, "local,");
105 if (flags & FIB_ROUTE_PATH_ATTACHED)
106 s = format (s, "attached,");
107 if (flags & FIB_ROUTE_PATH_DROP)
108 s = format (s, "drop,");
109 if (flags & FIB_ROUTE_PATH_EXCLUSIVE)
110 s = format (s, "exclusive,");
111 if (flags & FIB_ROUTE_PATH_INTF_RX)
112 s = format (s, "intf-rx,");
113 if (flags & FIB_ROUTE_PATH_RPF_ID)
114 s = format (s, "rpf-id,");
115 if (flags & FIB_ROUTE_PATH_SOURCE_LOOKUP)
116 s = format (s, "src-lkup,");
117 if (flags & FIB_ROUTE_PATH_UDP_ENCAP)
118 s = format (s, "udp-encap,");
119 if (flags & FIB_ROUTE_PATH_BIER_FMASK)
120 s = format (s, "bier-fmask,");
121 if (flags & FIB_ROUTE_PATH_BIER_TABLE)
122 s = format (s, "bier-table,");
123 if (flags & FIB_ROUTE_PATH_BIER_IMP)
124 s = format (s, "bier-imp,");
125 if (flags & FIB_ROUTE_PATH_DEAG)
126 s = format (s, "deag,");
127 if (flags & FIB_ROUTE_PATH_DVR)
128 s = format (s, "dvr,");
129 if (flags & FIB_ROUTE_PATH_ICMP_UNREACH)
130 s = format (s, "imcp-unreach,");
131 if (flags & FIB_ROUTE_PATH_ICMP_PROHIBIT)
132 s = format (s, "icmp-prohibit,");
133 if (flags & FIB_ROUTE_PATH_CLASSIFY)
134 s = format (s, "classify,");
135 if (flags & FIB_ROUTE_PATH_POP_PW_CW)
136 s = format (s, "pop-pw-cw,");
142 format_fib_route_path (u8 *s, va_list *ap)
144 fib_route_path_t *rpath = va_arg (*ap, fib_route_path_t*);
146 s = format (s, "%U %U, %U, [%U]",
147 format_dpo_proto, rpath->frp_proto,
148 format_ip46_address, &rpath->frp_addr, IP46_TYPE_ANY,
149 format_vnet_sw_if_index_name, vnet_get_main (),
150 rpath->frp_sw_if_index,
151 format_fib_route_path_flags, rpath->frp_flags);
157 fib_prefix_from_mpls_label (mpls_label_t label,
161 pfx->fp_proto = FIB_PROTOCOL_MPLS;
163 pfx->fp_label = label;
165 pfx->___fp___pad = 0;
169 fib_prefix_copy (fib_prefix_t *dst,
170 const fib_prefix_t *src)
172 clib_memcpy(dst, src, sizeof(*dst));
176 fib_prefix_cmp (const fib_prefix_t *p1,
177 const fib_prefix_t *p2)
181 res = (p1->fp_proto - p2->fp_proto);
185 switch (p1->fp_proto)
187 case FIB_PROTOCOL_IP4:
188 case FIB_PROTOCOL_IP6:
189 res = (p1->fp_len - p2->fp_len);
193 res = ip46_address_cmp(&p1->fp_addr, &p2->fp_addr);
196 case FIB_PROTOCOL_MPLS:
197 res = (p1->fp_label - p2->fp_label);
201 res = (p1->fp_eos - p2->fp_eos);
211 fib_prefix_is_cover (const fib_prefix_t *p1,
212 const fib_prefix_t *p2)
214 switch (p1->fp_proto)
216 case FIB_PROTOCOL_IP4:
217 return (ip4_destination_matches_route(&ip4_main,
221 case FIB_PROTOCOL_IP6:
222 return (ip6_destination_matches_route(&ip6_main,
226 case FIB_PROTOCOL_MPLS:
233 fib_prefix_get_host_length (fib_protocol_t proto)
237 case FIB_PROTOCOL_IP4:
239 case FIB_PROTOCOL_IP6:
241 case FIB_PROTOCOL_MPLS:
248 fib_prefix_is_host (const fib_prefix_t *prefix)
250 switch (prefix->fp_proto)
252 case FIB_PROTOCOL_IP4:
253 return (prefix->fp_len == 32);
254 case FIB_PROTOCOL_IP6:
255 return (prefix->fp_len == 128);
256 case FIB_PROTOCOL_MPLS:
263 fib_prefix_normalize (const fib_prefix_t *p,
266 fib_prefix_copy (out, p);
270 case FIB_PROTOCOL_IP4:
271 ip4_address_normalize(&out->fp_addr.ip4, out->fp_len);
273 case FIB_PROTOCOL_IP6:
274 ip6_address_normalize(&out->fp_addr.ip6, out->fp_len);
276 case FIB_PROTOCOL_MPLS:
282 format_fib_prefix (u8 * s, va_list * args)
284 fib_prefix_t *fp = va_arg (*args, fib_prefix_t *);
287 * protocol specific so it prints ::/0 correctly.
289 switch (fp->fp_proto)
291 case FIB_PROTOCOL_IP6:
293 ip6_address_t p6 = fp->fp_addr.ip6;
295 ip6_address_mask(&p6, &(ip6_main.fib_masks[fp->fp_len]));
296 s = format (s, "%U", format_ip6_address, &p6);
299 case FIB_PROTOCOL_IP4:
301 ip4_address_t p4 = fp->fp_addr.ip4;
302 p4.as_u32 &= ip4_main.fib_masks[fp->fp_len];
304 s = format (s, "%U", format_ip4_address, &p4);
307 case FIB_PROTOCOL_MPLS:
308 s = format (s, "%U:%U",
309 format_mpls_unicast_label, fp->fp_label,
310 format_mpls_eos_bit, fp->fp_eos);
313 s = format (s, "/%d", fp->fp_len);
319 fib_route_path_cmp (const fib_route_path_t *rpath1,
320 const fib_route_path_t *rpath2)
324 res = ip46_address_cmp(&rpath1->frp_addr,
327 if (0 != res) return (res);
329 res = (rpath1->frp_sw_if_index - rpath2->frp_sw_if_index);
331 if (0 != res) return (res);
333 if (ip46_address_is_zero(&rpath1->frp_addr))
335 res = rpath1->frp_fib_index - rpath2->frp_fib_index;
342 fib_proto_to_dpo (fib_protocol_t fib_proto)
346 case FIB_PROTOCOL_IP6:
347 return (DPO_PROTO_IP6);
348 case FIB_PROTOCOL_IP4:
349 return (DPO_PROTO_IP4);
350 case FIB_PROTOCOL_MPLS:
351 return (DPO_PROTO_MPLS);
358 dpo_proto_to_fib (dpo_proto_t dpo_proto)
363 return (FIB_PROTOCOL_IP6);
365 return (FIB_PROTOCOL_IP4);
367 return (FIB_PROTOCOL_MPLS);
376 fib_proto_to_link (fib_protocol_t proto)
380 case FIB_PROTOCOL_IP4:
381 return (VNET_LINK_IP4);
382 case FIB_PROTOCOL_IP6:
383 return (VNET_LINK_IP6);
384 case FIB_PROTOCOL_MPLS:
385 return (VNET_LINK_MPLS);
392 fib_proto_to_ip46 (fib_protocol_t fproto)
396 case FIB_PROTOCOL_IP4:
397 return (IP46_TYPE_IP4);
398 case FIB_PROTOCOL_IP6:
399 return (IP46_TYPE_IP6);
400 case FIB_PROTOCOL_MPLS:
401 return (IP46_TYPE_ANY);
404 return (IP46_TYPE_ANY);
408 fib_proto_from_ip46 (ip46_type_t iproto)
413 return FIB_PROTOCOL_IP4;
415 return FIB_PROTOCOL_IP6;
418 return FIB_PROTOCOL_IP4;
422 return FIB_PROTOCOL_IP4;
425 fib_forward_chain_type_t
426 fib_forw_chain_type_from_dpo_proto (dpo_proto_t proto)
431 return (FIB_FORW_CHAIN_TYPE_UNICAST_IP4);
433 return (FIB_FORW_CHAIN_TYPE_UNICAST_IP6);
435 return (FIB_FORW_CHAIN_TYPE_MPLS_NON_EOS);
436 case DPO_PROTO_ETHERNET:
437 return (FIB_FORW_CHAIN_TYPE_ETHERNET);
439 return (FIB_FORW_CHAIN_TYPE_NSH);
441 return (FIB_FORW_CHAIN_TYPE_BIER);
444 return (FIB_FORW_CHAIN_TYPE_UNICAST_IP4);
447 fib_forward_chain_type_t
448 fib_forw_chain_type_from_fib_proto (fib_protocol_t proto)
452 case FIB_PROTOCOL_IP4:
453 return (FIB_FORW_CHAIN_TYPE_UNICAST_IP4);
454 case FIB_PROTOCOL_IP6:
455 return (FIB_FORW_CHAIN_TYPE_UNICAST_IP6);
456 case FIB_PROTOCOL_MPLS:
457 return (FIB_FORW_CHAIN_TYPE_MPLS_NON_EOS);
460 return (FIB_FORW_CHAIN_TYPE_UNICAST_IP4);
464 fib_forw_chain_type_to_link_type (fib_forward_chain_type_t fct)
468 case FIB_FORW_CHAIN_TYPE_UNICAST_IP4:
469 case FIB_FORW_CHAIN_TYPE_MCAST_IP4:
470 return (VNET_LINK_IP4);
471 case FIB_FORW_CHAIN_TYPE_UNICAST_IP6:
472 case FIB_FORW_CHAIN_TYPE_MCAST_IP6:
473 return (VNET_LINK_IP6);
474 case FIB_FORW_CHAIN_TYPE_ETHERNET:
475 return (VNET_LINK_ETHERNET);
476 case FIB_FORW_CHAIN_TYPE_NSH:
477 return (VNET_LINK_NSH);
478 case FIB_FORW_CHAIN_TYPE_MPLS_EOS:
479 case FIB_FORW_CHAIN_TYPE_BIER:
481 * insufficient information to to convert
485 case FIB_FORW_CHAIN_TYPE_MPLS_NON_EOS:
486 return (VNET_LINK_MPLS);
488 return (VNET_LINK_IP4);
491 fib_forward_chain_type_t
492 fib_forw_chain_type_from_link_type (vnet_link_t link_type)
497 return (FIB_FORW_CHAIN_TYPE_UNICAST_IP4);
499 return (FIB_FORW_CHAIN_TYPE_UNICAST_IP6);
501 return (FIB_FORW_CHAIN_TYPE_MPLS_NON_EOS);
502 case VNET_LINK_ETHERNET:
503 return (FIB_FORW_CHAIN_TYPE_ETHERNET);
505 return (FIB_FORW_CHAIN_TYPE_NSH);
511 return (FIB_FORW_CHAIN_TYPE_UNICAST_IP4);
515 fib_forw_chain_type_to_dpo_proto (fib_forward_chain_type_t fct)
519 case FIB_FORW_CHAIN_TYPE_UNICAST_IP4:
520 case FIB_FORW_CHAIN_TYPE_MCAST_IP4:
521 return (DPO_PROTO_IP4);
522 case FIB_FORW_CHAIN_TYPE_UNICAST_IP6:
523 case FIB_FORW_CHAIN_TYPE_MCAST_IP6:
524 return (DPO_PROTO_IP6);
525 case FIB_FORW_CHAIN_TYPE_ETHERNET:
526 return (DPO_PROTO_ETHERNET);
527 case FIB_FORW_CHAIN_TYPE_NSH:
528 return (DPO_PROTO_NSH);
529 case FIB_FORW_CHAIN_TYPE_BIER:
530 return (DPO_PROTO_BIER);
531 case FIB_FORW_CHAIN_TYPE_MPLS_EOS:
532 case FIB_FORW_CHAIN_TYPE_MPLS_NON_EOS:
533 return (DPO_PROTO_MPLS);
535 return (DPO_PROTO_IP4);
539 unformat_fib_route_path (unformat_input_t * input, va_list * args)
541 fib_route_path_t *rpath = va_arg (*args, fib_route_path_t *);
542 dpo_proto_t *payload_proto = va_arg (*args, void*);
543 dpo_proto_t explicit_proto = DPO_PROTO_NONE;
544 u32 weight, preference, udp_encap_id, fi;
545 mpls_label_t out_label;
548 vnm = vnet_get_main ();
549 clib_memset(rpath, 0, sizeof(*rpath));
550 rpath->frp_weight = 1;
551 rpath->frp_sw_if_index = ~0;
553 while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
555 if (unformat (input, "%U %U",
556 unformat_ip4_address,
557 &rpath->frp_addr.ip4,
558 unformat_vnet_sw_interface, vnm,
559 &rpath->frp_sw_if_index))
561 rpath->frp_proto = DPO_PROTO_IP4;
563 else if (unformat (input, "%U %U",
564 unformat_ip6_address,
565 &rpath->frp_addr.ip6,
566 unformat_vnet_sw_interface, vnm,
567 &rpath->frp_sw_if_index))
569 rpath->frp_proto = DPO_PROTO_IP6;
571 else if (unformat (input, "weight %u", &weight))
573 rpath->frp_weight = weight;
575 else if (unformat (input, "preference %u", &preference))
577 rpath->frp_preference = preference;
579 else if (unformat (input, "%U next-hop-table %d",
580 unformat_ip4_address,
581 &rpath->frp_addr.ip4,
582 &rpath->frp_fib_index))
584 rpath->frp_sw_if_index = ~0;
585 rpath->frp_proto = DPO_PROTO_IP4;
588 * the user enter table-ids, convert to index
590 fi = fib_table_find (FIB_PROTOCOL_IP4, rpath->frp_fib_index);
593 rpath->frp_fib_index = fi;
595 else if (unformat (input, "%U next-hop-table %d",
596 unformat_ip6_address,
597 &rpath->frp_addr.ip6,
598 &rpath->frp_fib_index))
600 rpath->frp_sw_if_index = ~0;
601 rpath->frp_proto = DPO_PROTO_IP6;
602 fi = fib_table_find (FIB_PROTOCOL_IP6, rpath->frp_fib_index);
605 rpath->frp_fib_index = fi;
607 else if (unformat (input, "%U",
608 unformat_ip4_address,
609 &rpath->frp_addr.ip4))
612 * the recursive next-hops are by default in the default table
614 rpath->frp_fib_index = 0;
615 rpath->frp_sw_if_index = ~0;
616 rpath->frp_proto = DPO_PROTO_IP4;
618 else if (unformat (input, "%U",
619 unformat_ip6_address,
620 &rpath->frp_addr.ip6))
622 rpath->frp_fib_index = 0;
623 rpath->frp_sw_if_index = ~0;
624 rpath->frp_proto = DPO_PROTO_IP6;
626 else if (unformat (input, "udp-encap %d", &udp_encap_id))
628 rpath->frp_udp_encap_id = udp_encap_id;
629 rpath->frp_flags |= FIB_ROUTE_PATH_UDP_ENCAP;
630 rpath->frp_proto = *payload_proto;
632 else if (unformat (input, "lookup in table %d", &rpath->frp_fib_index))
634 rpath->frp_proto = *payload_proto;
635 rpath->frp_sw_if_index = ~0;
636 rpath->frp_flags |= FIB_ROUTE_PATH_DEAG;
638 else if (unformat (input, "resolve-via-host"))
640 rpath->frp_flags |= FIB_ROUTE_PATH_RESOLVE_VIA_HOST;
642 else if (unformat (input, "resolve-via-attached"))
644 rpath->frp_flags |= FIB_ROUTE_PATH_RESOLVE_VIA_ATTACHED;
646 else if (unformat (input, "pop-pw-cw"))
648 rpath->frp_flags |= FIB_ROUTE_PATH_POP_PW_CW;
650 else if (unformat (input,
651 "ip4-lookup-in-table %d",
652 &rpath->frp_fib_index))
654 rpath->frp_proto = DPO_PROTO_IP4;
655 *payload_proto = DPO_PROTO_IP4;
656 fi = fib_table_find (FIB_PROTOCOL_IP4, rpath->frp_fib_index);
659 rpath->frp_fib_index = fi;
661 else if (unformat (input,
662 "ip6-lookup-in-table %d",
663 &rpath->frp_fib_index))
665 rpath->frp_proto = DPO_PROTO_IP6;
666 *payload_proto = DPO_PROTO_IP6;
667 fi = fib_table_find (FIB_PROTOCOL_IP6, rpath->frp_fib_index);
670 rpath->frp_fib_index = fi;
672 else if (unformat (input,
673 "mpls-lookup-in-table %d",
674 &rpath->frp_fib_index))
676 rpath->frp_proto = DPO_PROTO_MPLS;
677 *payload_proto = DPO_PROTO_MPLS;
678 fi = fib_table_find (FIB_PROTOCOL_MPLS, rpath->frp_fib_index);
681 rpath->frp_fib_index = fi;
683 else if (unformat (input, "src-lookup"))
685 rpath->frp_flags |= FIB_ROUTE_PATH_SOURCE_LOOKUP;
687 else if (unformat (input,
689 unformat_vnet_sw_interface, vnm,
690 &rpath->frp_sw_if_index))
692 rpath->frp_proto = DPO_PROTO_ETHERNET;
693 *payload_proto = DPO_PROTO_ETHERNET;
694 rpath->frp_flags |= FIB_ROUTE_PATH_INTF_RX;
696 else if (unformat (input, "via-label %U",
697 unformat_mpls_unicast_label,
698 &rpath->frp_local_label))
700 rpath->frp_eos = MPLS_NON_EOS;
701 rpath->frp_proto = DPO_PROTO_MPLS;
702 rpath->frp_sw_if_index = ~0;
704 else if (unformat (input, "rx-ip4 %U",
705 unformat_vnet_sw_interface, vnm,
706 &rpath->frp_sw_if_index))
708 rpath->frp_proto = DPO_PROTO_IP4;
709 rpath->frp_flags = FIB_ROUTE_PATH_INTF_RX;
711 else if (unformat (input, "local"))
713 clib_memset (&rpath->frp_addr, 0, sizeof (rpath->frp_addr));
714 rpath->frp_sw_if_index = ~0;
715 rpath->frp_weight = 1;
716 rpath->frp_flags |= FIB_ROUTE_PATH_LOCAL;
718 else if (unformat (input, "out-labels"))
720 while (unformat (input, "%U",
721 unformat_mpls_unicast_label, &out_label))
723 fib_mpls_label_t fml = {
724 .fml_value = out_label,
726 vec_add1(rpath->frp_label_stack, fml);
729 else if (unformat (input, "ip4"))
731 explicit_proto = DPO_PROTO_IP4;
733 else if (unformat (input, "ip6"))
735 explicit_proto = DPO_PROTO_IP6;
737 else if (unformat (input, "%U",
738 unformat_vnet_sw_interface, vnm,
739 &rpath->frp_sw_if_index))
741 rpath->frp_proto = *payload_proto;
743 else if (unformat (input, "%U",
744 unformat_mfib_itf_flags, &rpath->frp_mitf_flags))
746 else if (unformat (input, "via"))
748 /* new path, back up and return */
749 unformat_put_input (input);
750 unformat_put_input (input);
751 unformat_put_input (input);
752 unformat_put_input (input);
761 if (DPO_PROTO_NONE != explicit_proto)
762 *payload_proto = rpath->frp_proto = explicit_proto;
768 * Return true if the path is attached
771 fib_route_path_is_attached (const fib_route_path_t *rpath)
774 * DVR paths are not attached, since we are not playing the
777 if (rpath->frp_flags & (FIB_ROUTE_PATH_DVR |
778 FIB_ROUTE_PATH_UDP_ENCAP))
784 * - All zeros next-hop
785 * - a valid interface
787 if (ip46_address_is_zero(&rpath->frp_addr) &&
788 (~0 != rpath->frp_sw_if_index))
792 else if (rpath->frp_flags & FIB_ROUTE_PATH_ATTACHED ||
793 rpath->frp_flags & FIB_ROUTE_PATH_GLEAN)
801 fib_prefix_ip4_addr_increment (fib_prefix_t *pfx)
803 /* Calculate the addend based on the host length of address */
804 u32 incr = 1ULL << (32 - pfx->fp_len);
805 ip4_address_t dst = (pfx->fp_addr).ip4;
806 dst.as_u32 = clib_host_to_net_u32 (incr + clib_net_to_host_u32 (dst.as_u32));
807 pfx->fp_addr.ip4.as_u32 = dst.as_u32;
811 fib_prefix_ip6_addr_increment (fib_prefix_t *pfx)
814 * Calculate the addend based on the host length of address
815 * and which part(lower 64 bits or higher 64 bits) it lies
818 u32 host_len = 128 - pfx->fp_len;
819 u64 incr = 1ULL << ((host_len > 64) ? (host_len - 64) : host_len);
820 i32 bucket = (host_len < 64 ? 1 : 0);
821 ip6_address_t dst = (pfx->fp_addr).ip6;
822 u64 tmp = incr + clib_net_to_host_u64 (dst.as_u64[bucket]);
823 /* Handle overflow */
824 if (bucket && (tmp < incr))
826 dst.as_u64[1] = clib_host_to_net_u64 (tmp);
827 dst.as_u64[0] = clib_host_to_net_u64 (1ULL + clib_net_to_host_u64 (dst.as_u64[0]));
830 dst.as_u64[bucket] = clib_host_to_net_u64 (tmp);
832 pfx->fp_addr.ip6.as_u128 = dst.as_u128;
836 * Increase IPv4/IPv6 address according to the prefix length
838 void fib_prefix_increment (fib_prefix_t *pfx)
840 switch (pfx->fp_proto)
842 case FIB_PROTOCOL_IP4:
843 fib_prefix_ip4_addr_increment (pfx);
845 case FIB_PROTOCOL_IP6:
846 fib_prefix_ip6_addr_increment (pfx);
848 case FIB_PROTOCOL_MPLS: