summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2022-04-12 11:34:27 +0300
committerDonatas Abraitis <donatas@opensourcerouting.org>2022-04-12 22:13:55 +0300
commit9c2fd3fe44dc9979a34b94f465639cd9b8c1d289 (patch)
treed447aa1e336354e098418e6f1b2facb79992afc2
parentd54f55f22d582310b0894efe7ef1feafd5636007 (diff)
bgpd: Convert vpn_policy_direction_t to enum
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
-rw-r--r--bgpd/bgp_mplsvpn.c8
-rw-r--r--bgpd/bgp_mplsvpn.h4
-rw-r--r--bgpd/bgp_vty.c12
-rw-r--r--bgpd/bgpd.c2
-rw-r--r--bgpd/bgpd.h4
5 files changed, 15 insertions, 15 deletions
diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c
index 08a68d0c12..5200fe33de 100644
--- a/bgpd/bgp_mplsvpn.c
+++ b/bgpd/bgp_mplsvpn.c
@@ -1924,7 +1924,7 @@ void vpn_handle_router_id_update(struct bgp *bgp, bool withdraw,
struct bgp *bgp_import;
struct listnode *node;
struct ecommunity *ecom;
- vpn_policy_direction_t idir, edir;
+ enum vpn_policy_direction idir, edir;
/*
* Router-id change that is not explicitly configured
@@ -2037,7 +2037,7 @@ void vrf_import_from_vrf(struct bgp *to_bgp, struct bgp *from_bgp,
afi_t afi, safi_t safi)
{
const char *export_name;
- vpn_policy_direction_t idir, edir;
+ enum vpn_policy_direction idir, edir;
char *vname, *tmp_name;
char buf[RD_ADDRSTRLEN];
struct ecommunity *ecom;
@@ -2166,7 +2166,7 @@ void vrf_unimport_from_vrf(struct bgp *to_bgp, struct bgp *from_bgp,
afi_t afi, safi_t safi)
{
const char *export_name, *tmp_name;
- vpn_policy_direction_t idir, edir;
+ enum vpn_policy_direction idir, edir;
char *vname;
struct ecommunity *ecom = NULL;
struct listnode *node;
@@ -3089,7 +3089,7 @@ void bgp_vpn_leak_export(struct bgp *from_bgp)
char *vname;
struct listnode *node, *next;
struct ecommunity *ecom;
- vpn_policy_direction_t idir, edir;
+ enum vpn_policy_direction idir, edir;
safi_t safi = SAFI_UNICAST;
struct bgp *to_bgp;
int debug;
diff --git a/bgpd/bgp_mplsvpn.h b/bgpd/bgp_mplsvpn.h
index 5bf772fefe..8c2eae279c 100644
--- a/bgpd/bgp_mplsvpn.h
+++ b/bgpd/bgp_mplsvpn.h
@@ -205,7 +205,7 @@ static inline int vpn_leak_from_vpn_active(struct bgp *bgp_vrf, afi_t afi,
return 1;
}
-static inline void vpn_leak_prechange(vpn_policy_direction_t direction,
+static inline void vpn_leak_prechange(enum vpn_policy_direction direction,
afi_t afi, struct bgp *bgp_vpn,
struct bgp *bgp_vrf)
{
@@ -225,7 +225,7 @@ static inline void vpn_leak_prechange(vpn_policy_direction_t direction,
}
}
-static inline void vpn_leak_postchange(vpn_policy_direction_t direction,
+static inline void vpn_leak_postchange(enum vpn_policy_direction direction,
afi_t afi, struct bgp *bgp_vpn,
struct bgp *bgp_vrf)
{
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 7bed1d3f50..673b00109b 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -8700,7 +8700,7 @@ DEFPY (af_rt_vpn_imexport,
int ret;
struct ecommunity *ecom = NULL;
int dodir[BGP_VPN_POLICY_DIR_MAX] = {0};
- vpn_policy_direction_t dir;
+ enum vpn_policy_direction dir;
afi_t afi;
int idx = 0;
bool yes = true;
@@ -8780,7 +8780,7 @@ DEFPY (af_route_map_vpn_imexport,
VTY_DECLVAR_CONTEXT(bgp, bgp);
int ret;
int dodir[BGP_VPN_POLICY_DIR_MAX] = {0};
- vpn_policy_direction_t dir;
+ enum vpn_policy_direction dir;
afi_t afi;
int idx = 0;
bool yes = true;
@@ -8843,7 +8843,7 @@ DEFPY(af_import_vrf_route_map, af_import_vrf_route_map_cmd,
"name of route-map\n")
{
VTY_DECLVAR_CONTEXT(bgp, bgp);
- vpn_policy_direction_t dir = BGP_VPN_POLICY_DIR_FROMVPN;
+ enum vpn_policy_direction dir = BGP_VPN_POLICY_DIR_FROMVPN;
afi_t afi;
struct bgp *bgp_default;
@@ -8896,7 +8896,7 @@ DEFPY(af_no_import_vrf_route_map, af_no_import_vrf_route_map_cmd,
"name of route-map\n")
{
VTY_DECLVAR_CONTEXT(bgp, bgp);
- vpn_policy_direction_t dir = BGP_VPN_POLICY_DIR_FROMVPN;
+ enum vpn_policy_direction dir = BGP_VPN_POLICY_DIR_FROMVPN;
afi_t afi;
afi = vpn_policy_getafi(vty, bgp, true);
@@ -9027,7 +9027,7 @@ DEFPY (bgp_imexport_vpn,
int idx = 0;
bool yes = true;
int flag;
- vpn_policy_direction_t dir;
+ enum vpn_policy_direction dir;
if (argv_find(argv, argc, "no", &idx))
yes = false;
@@ -14626,7 +14626,7 @@ static int bgp_show_route_leak_vty(struct vty *vty, const char *name,
char *vname;
char buf1[INET6_ADDRSTRLEN];
char *ecom_str;
- vpn_policy_direction_t dir;
+ enum vpn_policy_direction dir;
if (json) {
json_object *json_import_vrfs = NULL;
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index d790283817..e24c816794 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -3766,7 +3766,7 @@ void bgp_free(struct bgp *bgp)
XFREE(MTYPE_BGP_EVPN_INFO, bgp->evpn_info);
for (afi = AFI_IP; afi < AFI_MAX; afi++) {
- vpn_policy_direction_t dir;
+ enum vpn_policy_direction dir;
if (bgp->vpn_policy[afi].import_vrf)
list_delete(&bgp->vpn_policy[afi].import_vrf);
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index a98479bf53..dfed9f2ae9 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -192,11 +192,11 @@ struct bgp_redist {
struct bgp_rmap rmap;
};
-typedef enum {
+enum vpn_policy_direction {
BGP_VPN_POLICY_DIR_FROMVPN = 0,
BGP_VPN_POLICY_DIR_TOVPN = 1,
BGP_VPN_POLICY_DIR_MAX = 2
-} vpn_policy_direction_t;
+};
struct vpn_policy {
struct bgp *bgp; /* parent */