diff options
author | G. Paul Ziemba <paulz@labn.net> | 2018-04-07 20:32:52 +0200 |
---|---|---|
committer | G. Paul Ziemba <paulz@labn.net> | 2018-04-12 08:18:35 +0200 |
commit | e70e9f8e242b9e55711d700920ea676ff3479d94 (patch) | |
tree | db120522af7d1650a30468aeddb068ad661a7035 /bgpd/bgpd.h | |
parent | bgpd: dynamic mpls label pool (diff) | |
download | frr-e70e9f8e242b9e55711d700920ea676ff3479d94.tar.xz frr-e70e9f8e242b9e55711d700920ea676ff3479d94.zip |
bgpd: vpn-vrf leaking: use dynamic label pool for "auto" labels
Add support for CLI "auto" keyword in vrf->vpn export label:
router bgp NNN vrf FOO
address-family ipv4 unicast
label vpn export auto
exit-address-family
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
Diffstat (limited to 'bgpd/bgpd.h')
-rw-r--r-- | bgpd/bgpd.h | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index 2f3a732ac..680bac021 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -171,6 +171,25 @@ typedef enum { BGP_VPN_POLICY_DIR_MAX = 2 } vpn_policy_direction_t; +struct vpn_policy { + struct bgp *bgp; /* parent */ + afi_t afi; + struct ecommunity *rtlist[BGP_VPN_POLICY_DIR_MAX]; + struct ecommunity *import_redirect_rtlist; + char *rmap_name[BGP_VPN_POLICY_DIR_MAX]; + struct route_map *rmap[BGP_VPN_POLICY_DIR_MAX]; + + /* should be mpls_label_t? */ + uint32_t tovpn_label; /* may be MPLS_LABEL_NONE */ + uint32_t tovpn_zebra_vrf_label_last_sent; + struct prefix_rd tovpn_rd; + struct prefix tovpn_nexthop; /* unset => set to 0 */ + uint32_t flags; +#define BGP_VPN_POLICY_TOVPN_LABEL_AUTO (1 << 0) +#define BGP_VPN_POLICY_TOVPN_RD_SET (1 << 1) +#define BGP_VPN_POLICY_TOVPN_NEXTHOP_SET (1 << 2) +}; + /* * Type of 'struct bgp'. * - Default: The default instance @@ -469,22 +488,7 @@ struct bgp { /* route map for advertise ipv4/ipv6 unicast (type-5 routes) */ struct bgp_rmap adv_cmd_rmap[AFI_MAX][SAFI_MAX]; - /* vpn-policy */ - struct { - struct ecommunity *rtlist[BGP_VPN_POLICY_DIR_MAX]; - struct ecommunity *import_redirect_rtlist; - char *rmap_name[BGP_VPN_POLICY_DIR_MAX]; - struct route_map *rmap[BGP_VPN_POLICY_DIR_MAX]; - - /* should be mpls_label_t? */ - uint32_t tovpn_label; /* may be MPLS_LABEL_NONE */ - uint32_t tovpn_zebra_vrf_label_last_sent; - struct prefix_rd tovpn_rd; - struct prefix tovpn_nexthop; /* unset => set to 0 */ - uint32_t flags; -#define BGP_VPN_POLICY_TOVPN_RD_SET 0x00000004 -#define BGP_VPN_POLICY_TOVPN_NEXTHOP_SET 0x00000008 - } vpn_policy[AFI_MAX]; + struct vpn_policy vpn_policy[AFI_MAX]; QOBJ_FIELDS }; |