3 * Copyright (C) 2018 Cumulus Networks, Inc.
6 * FRR is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
11 * FRR is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 #include "nexthop_group.h"
35 #include "pbr_zebra.h"
36 #include "pbr_memory.h"
37 #include "pbr_debug.h"
40 DEFINE_MTYPE_STATIC(PBRD
, PBR_MAP
, "PBR Map")
41 DEFINE_MTYPE_STATIC(PBRD
, PBR_MAP_SEQNO
, "PBR Map Sequence")
42 DEFINE_MTYPE_STATIC(PBRD
, PBR_MAP_INTERFACE
, "PBR Map Interface")
44 static uint32_t pbr_map_sequence_unique
;
46 static bool pbr_map_check_valid_internal(struct pbr_map
*pbrm
);
47 static inline int pbr_map_compare(const struct pbr_map
*pbrmap1
,
48 const struct pbr_map
*pbrmap2
);
50 RB_GENERATE(pbr_map_entry_head
, pbr_map
, pbr_map_entry
, pbr_map_compare
)
52 struct pbr_map_entry_head pbr_maps
= RB_INITIALIZER(&pbr_maps
);
54 DEFINE_QOBJ_TYPE(pbr_map_sequence
)
56 static inline int pbr_map_compare(const struct pbr_map
*pbrmap1
,
57 const struct pbr_map
*pbrmap2
)
59 return strcmp(pbrmap1
->name
, pbrmap2
->name
);
62 static int pbr_map_sequence_compare(const struct pbr_map_sequence
*pbrms1
,
63 const struct pbr_map_sequence
*pbrms2
)
65 if (pbrms1
->seqno
== pbrms2
->seqno
)
68 if (pbrms1
->seqno
< pbrms2
->seqno
)
74 static void pbr_map_sequence_delete(struct pbr_map_sequence
*pbrms
)
76 XFREE(MTYPE_TMP
, pbrms
->internal_nhg_name
);
78 XFREE(MTYPE_PBR_MAP_SEQNO
, pbrms
);
81 static int pbr_map_interface_compare(const struct pbr_map_interface
*pmi1
,
82 const struct pbr_map_interface
*pmi2
)
84 return strcmp(pmi1
->ifp
->name
, pmi2
->ifp
->name
);
87 static void pbr_map_interface_list_delete(struct pbr_map_interface
*pmi
)
89 struct pbr_map_interface
*pmi_int
;
90 struct listnode
*node
, *nnode
;
93 RB_FOREACH (pbrm
, pbr_map_entry_head
, &pbr_maps
) {
94 for (ALL_LIST_ELEMENTS(pbrm
->incoming
, node
, nnode
, pmi_int
)) {
96 pbr_map_policy_delete(pbrm
, pmi
);
103 static bool pbrms_is_installed(const struct pbr_map_sequence
*pbrms
,
104 const struct pbr_map_interface
*pmi
)
106 uint64_t is_installed
= (uint64_t)1 << pmi
->install_bit
;
108 is_installed
&= pbrms
->installed
;
116 /* If any sequence is installed on the interface, assume installed */
118 pbr_map_interface_is_installed(const struct pbr_map
*pbrm
,
119 const struct pbr_map_interface
*check_pmi
)
122 struct pbr_map_sequence
*pbrms
;
123 struct pbr_map_interface
*pmi
;
124 struct listnode
*node
, *inode
;
126 for (ALL_LIST_ELEMENTS_RO(pbrm
->seqnumbers
, node
, pbrms
))
127 for (ALL_LIST_ELEMENTS_RO(pbrm
->incoming
, inode
, pmi
))
128 if (pmi
== check_pmi
&& pbrms_is_installed(pbrms
, pmi
))
134 static bool pbr_map_interface_is_valid(const struct pbr_map_interface
*pmi
)
136 /* Don't install rules without a real ifindex on the incoming interface.
138 * This can happen when we have config for an interface that does not
139 * exist or when an interface is changing vrfs.
141 if (pmi
->ifp
&& pmi
->ifp
->ifindex
!= IFINDEX_INTERNAL
)
147 static void pbr_map_pbrms_update_common(struct pbr_map_sequence
*pbrms
,
150 struct pbr_map
*pbrm
;
151 struct listnode
*node
;
152 struct pbr_map_interface
*pmi
;
154 pbrm
= pbrms
->parent
;
156 if (pbrms
->nhs_installed
&& pbrm
->incoming
->count
) {
157 for (ALL_LIST_ELEMENTS_RO(pbrm
->incoming
, node
, pmi
)) {
161 if (install
&& !pbr_map_interface_is_valid(pmi
))
164 pbr_send_pbr_map(pbrms
, pmi
, install
);
169 static void pbr_map_pbrms_install(struct pbr_map_sequence
*pbrms
)
171 pbr_map_pbrms_update_common(pbrms
, true);
174 static void pbr_map_pbrms_uninstall(struct pbr_map_sequence
*pbrms
)
176 pbr_map_pbrms_update_common(pbrms
, false);
179 static const char *const pbr_map_reason_str
[] = {
180 "Invalid NH-group", "Invalid NH", "No Nexthops",
181 "Both NH and NH-Group", "Invalid Src or Dst", "Invalid VRF",
185 void pbr_map_reason_string(unsigned int reason
, char *buf
, int size
)
193 for (bit
= 0; bit
< array_size(pbr_map_reason_str
); bit
++) {
194 if ((reason
& (1 << bit
)) && (len
< size
)) {
195 len
+= snprintf((buf
+ len
), (size
- len
), "%s%s",
196 (len
> 0) ? ", " : "",
197 pbr_map_reason_str
[bit
]);
202 void pbr_map_final_interface_deletion(struct pbr_map
*pbrm
,
203 struct pbr_map_interface
*pmi
)
205 if (pmi
->delete && !pbr_map_interface_is_installed(pbrm
, pmi
)) {
206 listnode_delete(pbrm
->incoming
, pmi
);
209 bf_release_index(pbrm
->ifi_bitfield
, pmi
->install_bit
);
210 XFREE(MTYPE_PBR_MAP_INTERFACE
, pmi
);
214 void pbr_map_interface_delete(struct pbr_map
*pbrm
, struct interface
*ifp_del
)
217 struct listnode
*node
;
218 struct pbr_map_interface
*pmi
;
220 for (ALL_LIST_ELEMENTS_RO(pbrm
->incoming
, node
, pmi
)) {
221 if (ifp_del
== pmi
->ifp
)
226 pbr_map_policy_delete(pbrm
, pmi
);
229 void pbr_map_add_interface(struct pbr_map
*pbrm
, struct interface
*ifp_add
)
231 struct listnode
*node
;
232 struct pbr_map_interface
*pmi
;
234 for (ALL_LIST_ELEMENTS_RO(pbrm
->incoming
, node
, pmi
)) {
235 if (ifp_add
== pmi
->ifp
)
239 pmi
= XCALLOC(MTYPE_PBR_MAP_INTERFACE
, sizeof(*pmi
));
242 listnode_add_sort(pbrm
->incoming
, pmi
);
244 bf_assign_index(pbrm
->ifi_bitfield
, pmi
->install_bit
);
245 pbr_map_check_valid(pbrm
->name
);
247 pbr_map_install(pbrm
);
251 pbr_map_policy_interface_update_common(const struct interface
*ifp
,
252 struct pbr_interface
**pbr_ifp
,
253 struct pbr_map
**pbrm
)
256 DEBUGD(&pbr_dbg_map
, "%s: %s has no pbr_interface info",
257 __func__
, ifp
->name
);
261 *pbr_ifp
= ifp
->info
;
263 *pbrm
= pbrm_find((*pbr_ifp
)->mapname
);
266 DEBUGD(&pbr_dbg_map
, "%s: applied PBR-MAP(%s) does not exist?",
267 __func__
, (*pbr_ifp
)->mapname
);
274 void pbr_map_policy_interface_update(const struct interface
*ifp
, bool state_up
)
276 struct pbr_interface
*pbr_ifp
;
277 struct pbr_map_sequence
*pbrms
;
278 struct pbr_map
*pbrm
;
279 struct listnode
*node
, *inode
;
280 struct pbr_map_interface
*pmi
;
282 if (pbr_map_policy_interface_update_common(ifp
, &pbr_ifp
, &pbrm
))
285 DEBUGD(&pbr_dbg_map
, "%s: %s %s rules on interface %s", __func__
,
286 pbr_ifp
->mapname
, (state_up
? "installing" : "removing"),
290 * Walk the list and install/remove maps on the interface.
292 for (ALL_LIST_ELEMENTS_RO(pbrm
->seqnumbers
, node
, pbrms
))
293 for (ALL_LIST_ELEMENTS_RO(pbrm
->incoming
, inode
, pmi
))
294 if (pmi
->ifp
== ifp
&& pbr_map_interface_is_valid(pmi
))
295 pbr_send_pbr_map(pbrms
, pmi
, state_up
);
298 static void pbrms_vrf_update(struct pbr_map_sequence
*pbrms
,
299 const struct pbr_vrf
*pbr_vrf
)
301 const char *vrf_name
= pbr_vrf_name(pbr_vrf
);
303 if (pbrms
->vrf_lookup
304 && (strncmp(vrf_name
, pbrms
->vrf_name
, sizeof(pbrms
->vrf_name
))
306 DEBUGD(&pbr_dbg_map
, "\tSeq %u uses vrf %s (%u), updating map",
307 pbrms
->seqno
, vrf_name
, pbr_vrf_id(pbr_vrf
));
309 pbr_map_check(pbrms
);
313 /* Vrf enabled/disabled */
314 void pbr_map_vrf_update(const struct pbr_vrf
*pbr_vrf
)
316 struct pbr_map
*pbrm
;
317 struct pbr_map_sequence
*pbrms
;
318 struct listnode
*node
;
323 bool enabled
= pbr_vrf_is_enabled(pbr_vrf
);
325 DEBUGD(&pbr_dbg_map
, "%s: %s (%u) %s, updating pbr maps", __func__
,
326 pbr_vrf_name(pbr_vrf
), pbr_vrf_id(pbr_vrf
),
327 enabled
? "enabled" : "disabled");
329 RB_FOREACH (pbrm
, pbr_map_entry_head
, &pbr_maps
) {
330 DEBUGD(&pbr_dbg_map
, "%s: Looking at %s", __func__
, pbrm
->name
);
331 for (ALL_LIST_ELEMENTS_RO(pbrm
->seqnumbers
, node
, pbrms
))
332 pbrms_vrf_update(pbrms
, pbr_vrf
);
336 void pbr_map_write_interfaces(struct vty
*vty
, struct interface
*ifp
)
338 struct pbr_interface
*pbr_ifp
= ifp
->info
;
341 && strncmp(pbr_ifp
->mapname
, "", sizeof(pbr_ifp
->mapname
)) != 0)
342 vty_out(vty
, " pbr-policy %s\n", pbr_ifp
->mapname
);
345 struct pbr_map
*pbrm_find(const char *name
)
349 strlcpy(pbrm
.name
, name
, sizeof(pbrm
.name
));
351 return RB_FIND(pbr_map_entry_head
, &pbr_maps
, &pbrm
);
354 extern void pbr_map_delete(struct pbr_map_sequence
*pbrms
)
356 struct pbr_map
*pbrm
;
357 struct listnode
*inode
;
358 struct pbr_map_interface
*pmi
;
360 pbrm
= pbrms
->parent
;
362 for (ALL_LIST_ELEMENTS_RO(pbrm
->incoming
, inode
, pmi
))
363 pbr_send_pbr_map(pbrms
, pmi
, false);
366 pbr_nht_delete_individual_nexthop(pbrms
);
368 listnode_delete(pbrm
->seqnumbers
, pbrms
);
370 if (pbrm
->seqnumbers
->count
== 0) {
371 RB_REMOVE(pbr_map_entry_head
, &pbr_maps
, pbrm
);
373 bf_free(pbrm
->ifi_bitfield
);
374 XFREE(MTYPE_PBR_MAP
, pbrm
);
378 static void pbr_map_delete_common(struct pbr_map_sequence
*pbrms
)
380 struct pbr_map
*pbrm
= pbrms
->parent
;
382 pbr_map_pbrms_uninstall(pbrms
);
385 pbrms
->nhs_installed
= false;
386 pbrms
->reason
|= PBR_MAP_INVALID_NO_NEXTHOPS
;
387 pbrms
->nhgrp_name
= NULL
;
390 void pbr_map_delete_nexthops(struct pbr_map_sequence
*pbrms
)
392 pbr_map_delete_common(pbrms
);
395 void pbr_map_delete_vrf(struct pbr_map_sequence
*pbrms
)
397 pbr_map_delete_common(pbrms
);
400 struct pbr_map_sequence
*pbrms_lookup_unique(uint32_t unique
, ifindex_t ifindex
,
401 struct pbr_map_interface
**ppmi
)
403 struct pbr_map_sequence
*pbrms
;
404 struct listnode
*snode
, *inode
;
405 struct pbr_map_interface
*pmi
;
406 struct pbr_map
*pbrm
;
408 RB_FOREACH (pbrm
, pbr_map_entry_head
, &pbr_maps
) {
409 for (ALL_LIST_ELEMENTS_RO(pbrm
->incoming
, inode
, pmi
)) {
410 if (pmi
->ifp
->ifindex
!= ifindex
)
416 for (ALL_LIST_ELEMENTS_RO(pbrm
->seqnumbers
, snode
,
418 DEBUGD(&pbr_dbg_map
, "%s: Comparing %u to %u",
419 __func__
, pbrms
->unique
, unique
);
420 if (pbrms
->unique
== unique
)
429 static void pbr_map_add_interfaces(struct pbr_map
*pbrm
)
431 struct interface
*ifp
;
432 struct pbr_interface
*pbr_ifp
;
435 RB_FOREACH (vrf
, vrf_name_head
, &vrfs_by_name
) {
436 FOR_ALL_INTERFACES (vrf
, ifp
) {
439 if (strcmp(pbrm
->name
, pbr_ifp
->mapname
) == 0)
440 pbr_map_add_interface(pbrm
, ifp
);
446 struct pbr_map_sequence
*pbrms_get(const char *name
, uint32_t seqno
)
448 struct pbr_map
*pbrm
;
449 struct pbr_map_sequence
*pbrms
;
450 struct listnode
*node
;
452 pbrm
= pbrm_find(name
);
454 pbrm
= XCALLOC(MTYPE_PBR_MAP
, sizeof(*pbrm
));
455 snprintf(pbrm
->name
, sizeof(pbrm
->name
), "%s", name
);
457 pbrm
->seqnumbers
= list_new();
458 pbrm
->seqnumbers
->cmp
=
459 (int (*)(void *, void *))pbr_map_sequence_compare
;
460 pbrm
->seqnumbers
->del
=
461 (void (*)(void *))pbr_map_sequence_delete
;
463 pbrm
->incoming
= list_new();
464 pbrm
->incoming
->cmp
=
465 (int (*)(void *, void *))pbr_map_interface_compare
;
466 pbrm
->incoming
->del
=
467 (void (*)(void *))pbr_map_interface_list_delete
;
469 RB_INSERT(pbr_map_entry_head
, &pbr_maps
, pbrm
);
471 bf_init(pbrm
->ifi_bitfield
, 64);
472 pbr_map_add_interfaces(pbrm
);
475 for (ALL_LIST_ELEMENTS_RO(pbrm
->seqnumbers
, node
, pbrms
)) {
476 if (pbrms
->seqno
== seqno
)
482 pbrms
= XCALLOC(MTYPE_PBR_MAP_SEQNO
, sizeof(*pbrms
));
483 pbrms
->unique
= pbr_map_sequence_unique
++;
484 pbrms
->seqno
= seqno
;
485 pbrms
->ruleno
= pbr_nht_get_next_rule(seqno
);
486 pbrms
->parent
= pbrm
;
488 PBR_MAP_INVALID_EMPTY
|
489 PBR_MAP_INVALID_NO_NEXTHOPS
;
490 pbrms
->vrf_name
[0] = '\0';
492 QOBJ_REG(pbrms
, pbr_map_sequence
);
493 listnode_add_sort(pbrm
->seqnumbers
, pbrms
);
500 pbr_map_sequence_check_nexthops_valid(struct pbr_map_sequence
*pbrms
)
502 /* Check if any are present first */
503 if (!pbrms
->vrf_unchanged
&& !pbrms
->vrf_lookup
&& !pbrms
->nhg
504 && !pbrms
->nhgrp_name
) {
505 pbrms
->reason
|= PBR_MAP_INVALID_NO_NEXTHOPS
;
510 * Check validness of vrf.
513 /* This one can be considered always valid */
514 if (pbrms
->vrf_unchanged
)
515 pbrms
->nhs_installed
= true;
517 if (pbrms
->vrf_lookup
) {
518 struct pbr_vrf
*pbr_vrf
=
519 pbr_vrf_lookup_by_name(pbrms
->vrf_name
);
521 if (pbr_vrf
&& pbr_vrf_is_valid(pbr_vrf
))
522 pbrms
->nhs_installed
= true;
524 pbrms
->reason
|= PBR_MAP_INVALID_VRF
;
528 * Check validness of the nexthop or nexthop-group
531 /* Only nexthop or nexthop group allowed */
532 if (pbrms
->nhg
&& pbrms
->nhgrp_name
)
533 pbrms
->reason
|= PBR_MAP_INVALID_BOTH_NHANDGRP
;
536 !pbr_nht_nexthop_group_valid(pbrms
->internal_nhg_name
))
537 pbrms
->reason
|= PBR_MAP_INVALID_NEXTHOP
;
539 if (pbrms
->nhgrp_name
) {
540 if (!pbr_nht_nexthop_group_valid(pbrms
->nhgrp_name
))
541 pbrms
->reason
|= PBR_MAP_INVALID_NEXTHOP_GROUP
;
543 pbrms
->nhs_installed
= true;
547 static void pbr_map_sequence_check_not_empty(struct pbr_map_sequence
*pbrms
)
549 if (!pbrms
->src
&& !pbrms
->dst
&& !pbrms
->mark
)
550 pbrms
->reason
|= PBR_MAP_INVALID_EMPTY
;
554 * Checks to see if we think that the pbmrs is valid. If we think
555 * the config is valid return true.
557 static void pbr_map_sequence_check_valid(struct pbr_map_sequence
*pbrms
)
559 pbr_map_sequence_check_nexthops_valid(pbrms
);
561 pbr_map_sequence_check_not_empty(pbrms
);
564 static bool pbr_map_check_valid_internal(struct pbr_map
*pbrm
)
566 struct pbr_map_sequence
*pbrms
;
567 struct listnode
*node
;
570 for (ALL_LIST_ELEMENTS_RO(pbrm
->seqnumbers
, node
, pbrms
)) {
572 pbr_map_sequence_check_valid(pbrms
);
574 * A pbr_map_sequence that is invalid causes
575 * the whole shebang to be invalid
577 if (pbrms
->reason
!= 0)
585 * For a given PBR-MAP check to see if we think it is a
586 * valid config or not. If so note that it is and return
589 bool pbr_map_check_valid(const char *name
)
591 struct pbr_map
*pbrm
;
593 pbrm
= pbrm_find(name
);
596 "%s: Specified PBR-MAP(%s) does not exist?", __func__
,
601 pbr_map_check_valid_internal(pbrm
);
605 void pbr_map_schedule_policy_from_nhg(const char *nh_group
)
607 struct pbr_map_sequence
*pbrms
;
608 struct pbr_map
*pbrm
;
609 struct listnode
*node
;
611 RB_FOREACH (pbrm
, pbr_map_entry_head
, &pbr_maps
) {
612 DEBUGD(&pbr_dbg_map
, "%s: Looking at %s", __func__
, pbrm
->name
);
613 for (ALL_LIST_ELEMENTS_RO(pbrm
->seqnumbers
, node
, pbrms
)) {
614 DEBUGD(&pbr_dbg_map
, "\tNH Grp name: %s",
616 pbrms
->nhgrp_name
: pbrms
->internal_nhg_name
);
618 if (pbrms
->nhgrp_name
619 && (strcmp(nh_group
, pbrms
->nhgrp_name
) == 0)) {
620 pbrms
->nhs_installed
= true;
622 pbr_map_check(pbrms
);
626 && (strcmp(nh_group
, pbrms
->internal_nhg_name
)
628 pbrms
->nhs_installed
= true;
630 pbr_map_check(pbrms
);
636 void pbr_map_policy_install(const char *name
)
638 struct pbr_map_sequence
*pbrms
;
639 struct pbr_map
*pbrm
;
640 struct listnode
*node
, *inode
;
641 struct pbr_map_interface
*pmi
;
643 DEBUGD(&pbr_dbg_map
, "%s: for %s", __func__
, name
);
644 pbrm
= pbrm_find(name
);
648 for (ALL_LIST_ELEMENTS_RO(pbrm
->seqnumbers
, node
, pbrms
)) {
650 "%s: Looking at what to install %s(%u) %d %d", __func__
,
651 name
, pbrms
->seqno
, pbrm
->valid
, pbrms
->nhs_installed
);
653 if (pbrm
->valid
&& pbrms
->nhs_installed
654 && pbrm
->incoming
->count
) {
655 DEBUGD(&pbr_dbg_map
, "\tInstalling %s %u", pbrm
->name
,
657 for (ALL_LIST_ELEMENTS_RO(pbrm
->incoming
, inode
, pmi
))
658 if (pbr_map_interface_is_valid(pmi
))
659 pbr_send_pbr_map(pbrms
, pmi
, true);
664 void pbr_map_policy_delete(struct pbr_map
*pbrm
, struct pbr_map_interface
*pmi
)
666 struct listnode
*node
;
667 struct pbr_map_sequence
*pbrms
;
670 for (ALL_LIST_ELEMENTS_RO(pbrm
->seqnumbers
, node
, pbrms
))
671 pbr_send_pbr_map(pbrms
, pmi
, false);
677 * For a nexthop group specified, see if any of the pbr-maps
678 * are using it and if so, check to see that we are still
679 * valid for usage. If we are valid then schedule the installation/deletion
682 void pbr_map_check_nh_group_change(const char *nh_group
)
684 struct pbr_map_sequence
*pbrms
;
685 struct pbr_map
*pbrm
;
686 struct listnode
*node
, *inode
;
687 struct pbr_map_interface
*pmi
;
690 RB_FOREACH (pbrm
, pbr_map_entry_head
, &pbr_maps
) {
691 for (ALL_LIST_ELEMENTS_RO(pbrm
->seqnumbers
, node
, pbrms
)) {
693 if (pbrms
->nhgrp_name
)
695 !strcmp(nh_group
, pbrms
->nhgrp_name
);
697 found_name
= !strcmp(nh_group
,
698 pbrms
->internal_nhg_name
);
701 bool original
= pbrm
->valid
;
703 pbr_map_check_valid_internal(pbrm
);
705 if (pbrm
->valid
&& (original
!= pbrm
->valid
))
706 pbr_map_install(pbrm
);
708 if (pbrm
->valid
== false)
709 for (ALL_LIST_ELEMENTS_RO(
710 pbrm
->incoming
, inode
,
712 pbr_send_pbr_map(pbrms
, pmi
,
719 void pbr_map_check(struct pbr_map_sequence
*pbrms
)
721 struct pbr_map
*pbrm
;
724 pbrm
= pbrms
->parent
;
725 DEBUGD(&pbr_dbg_map
, "%s: for %s(%u)", __func__
, pbrm
->name
,
727 if (pbr_map_check_valid(pbrm
->name
))
728 DEBUGD(&pbr_dbg_map
, "We are totally valid %s",
731 if (pbrms
->reason
== PBR_MAP_VALID_SEQUENCE_NUMBER
) {
733 DEBUGD(&pbr_dbg_map
, "%s: Installing %s(%u) reason: %" PRIu64
,
734 __func__
, pbrm
->name
, pbrms
->seqno
, pbrms
->reason
);
736 "\tSending PBR_MAP_POLICY_INSTALL event");
739 DEBUGD(&pbr_dbg_map
, "%s: Removing %s(%u) reason: %" PRIu64
,
740 __func__
, pbrm
->name
, pbrms
->seqno
, pbrms
->reason
);
744 pbr_map_pbrms_install(pbrms
);
746 pbr_map_pbrms_uninstall(pbrms
);
749 void pbr_map_install(struct pbr_map
*pbrm
)
751 struct pbr_map_sequence
*pbrms
;
752 struct listnode
*node
;
754 if (!pbrm
->incoming
->count
)
757 for (ALL_LIST_ELEMENTS_RO(pbrm
->seqnumbers
, node
, pbrms
))
758 pbr_map_pbrms_install(pbrms
);
761 void pbr_map_init(void)
763 RB_INIT(pbr_map_entry_head
, &pbr_maps
);
765 pbr_map_sequence_unique
= 1;