]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgpd.h
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / bgpd / bgpd.h
index 57685390c84d8c9e18bb4ed7ad2af70d58c27663..2a7c7a31437ec331c864fa83a48b69ac2332f55c 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP message definition header.
  * Copyright (C) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGPD_H
@@ -218,6 +203,7 @@ struct vpn_policy {
        /* should be mpls_label_t? */
        uint32_t tovpn_label; /* may be MPLS_LABEL_NONE */
        uint32_t tovpn_zebra_vrf_label_last_sent;
+       char *tovpn_rd_pretty;
        struct prefix_rd tovpn_rd;
        struct prefix tovpn_nexthop; /* unset => set to 0 */
        uint32_t flags;
@@ -751,6 +737,7 @@ struct bgp {
 
        /* RD for this VRF */
        struct prefix_rd vrf_prd;
+       char *vrf_prd_pretty;
 
        /* import rt list for the vrf instance */
        struct list *vrf_import_rtl;
@@ -1264,6 +1251,8 @@ struct peer {
 #define PEER_CAP_GRACEFUL_RESTART_N_BIT_RCV (1U << 24)
 #define PEER_CAP_ROLE_ADV                   (1U << 25) /* role advertised */
 #define PEER_CAP_ROLE_RCV                   (1U << 26) /* role received */
+#define PEER_CAP_SOFT_VERSION_ADV (1U << 27)
+#define PEER_CAP_SOFT_VERSION_RCV (1U << 28)
 
        /* Capability flags (reset in bgp_stop) */
        uint32_t af_cap[AFI_MAX][SAFI_MAX];
@@ -1297,7 +1286,7 @@ struct peer {
         * so if a flag is unset, the corresponding override flag is unset too.
         * However if a flag is set, the corresponding override flag is set.
         */
-       uint32_t flags_override;
+       uint64_t flags_override;
        /*
         * Parallel array to flags that indicates whether the default behavior
         * of *flags_override* should be inverted. If a flag is unset and the
@@ -1335,11 +1324,13 @@ struct peer {
         * inversion state of the flag differs between peer and peer-group, the
         * newly set value must equal to the inverted state of the peer-group.
         */
-       uint32_t flags_invert;
+       uint64_t flags_invert;
        /*
         * Effective array for storing the peer/peer-group flags. In case of a
         * peer-group, the peer-specific overrides (see flags_override and
         * flags_invert) must be respected.
+        * When changing the structure of flags/af_flags, do not forget to
+        * change flags_invert/flags_override too.
         */
        uint64_t flags;
 #define PEER_FLAG_PASSIVE                   (1ULL << 0) /* passive mode */
@@ -1390,6 +1381,7 @@ struct peer {
 #define PEER_FLAG_PORT (1ULL << 33)
 #define PEER_FLAG_AIGP (1ULL << 34)
 #define PEER_FLAG_GRACEFUL_SHUTDOWN (1ULL << 35)
+#define PEER_FLAG_CAPABILITY_SOFT_VERSION (1ULL << 36)
 
        /*
         *GR-Disabled mode means unset PEER_FLAG_GRACEFUL_RESTART
@@ -1782,6 +1774,13 @@ struct peer {
        /* Path attributes discard */
        bool discard_attrs[BGP_ATTR_MAX];
 
+       /* Path attributes treat-as-withdraw */
+       bool withdraw_attrs[BGP_ATTR_MAX];
+
+       /* BGP Software Version Capability */
+#define BGP_MAX_SOFT_VERSION 64
+       char *soft_version;
+
        QOBJ_FIELDS;
 };
 DECLARE_QOBJ_TYPE(peer);
@@ -2657,6 +2656,8 @@ extern void peer_on_policy_change(struct peer *peer, afi_t afi, safi_t safi,
                                  int outbound);
 extern bool bgp_path_attribute_discard(struct peer *peer, char *buf,
                                       size_t size);
+extern bool bgp_path_attribute_treat_as_withdraw(struct peer *peer, char *buf,
+                                                size_t size);
 #ifdef _FRR_ATTRIBUTE_PRINTFRR
 /* clang-format off */
 #pragma FRR printfrr_ext "%pBP" (struct peer *)