summaryrefslogtreecommitdiff
path: root/bgpd
diff options
context:
space:
mode:
authorMichael Lambert <lambert@psc.edu>2010-07-22 13:20:55 -0400
committerGreg Troxel <gdt@ir.bbn.com>2010-10-06 12:33:05 -0400
commit4c9641ba4df276080c670e03f65b1d442660a50f (patch)
tree15085df8068d8a3864224937eaa407c0484ff57f /bgpd
parent11d3fe9b9a327b3218a76b2b9001ace50c08de8c (diff)
bgpd, lib: adopt afi_t and safi_t in several places
* bgpd/bgp_attr.c, bgpd/bgp_open.h, bgpd/bgp_route.c, lib/prefix.c, lib/prefix.h: Various integer types were being used where, if we had strict type checking, afi_t and safi_t would be required. Signed-off-by: G.Balaji <balajig81@gmail.com> (cherry picked from commit c8af35ffa2dc79ff7d7ff00b1b61f1f50a100ab6)
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_attr.c8
-rw-r--r--bgpd/bgp_open.h8
-rw-r--r--bgpd/bgp_route.c16
3 files changed, 16 insertions, 16 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index 3996afd3..ae0dc88a 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -1301,8 +1301,8 @@ int
bgp_mp_reach_parse (struct peer *peer, bgp_size_t length, struct attr *attr,
struct bgp_nlri *mp_update)
{
- u_int16_t afi;
- u_char safi;
+ afi_t afi;
+ safi_t safi;
bgp_size_t nlri_len;
size_t start;
int ret;
@@ -1436,8 +1436,8 @@ bgp_mp_unreach_parse (struct peer *peer, bgp_size_t length,
struct bgp_nlri *mp_withdraw)
{
struct stream *s;
- u_int16_t afi;
- u_char safi;
+ afi_t afi;
+ safi_t safi;
u_int16_t withdraw_len;
int ret;
diff --git a/bgpd/bgp_open.h b/bgpd/bgp_open.h
index 59265dc9..2b1382d8 100644
--- a/bgpd/bgp_open.h
+++ b/bgpd/bgp_open.h
@@ -31,9 +31,9 @@ struct capability_header
/* Generic MP capability data */
struct capability_mp_data
{
- u_int16_t afi;
+ afi_t afi;
u_char reserved;
- u_char safi;
+ safi_t safi;
};
#pragma pack(1)
@@ -55,8 +55,8 @@ struct capability_as4
struct graceful_restart_af
{
- u_int16_t afi;
- u_char safi;
+ afi_t afi;
+ safi_t safi;
u_char flag;
};
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index a92ca4e2..2391f740 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -3518,8 +3518,8 @@ bgp_static_update (struct bgp *bgp, struct prefix *p,
}
static void
-bgp_static_update_vpnv4 (struct bgp *bgp, struct prefix *p, u_int16_t afi,
- u_char safi, struct prefix_rd *prd, u_char *tag)
+bgp_static_update_vpnv4 (struct bgp *bgp, struct prefix *p, afi_t afi,
+ safi_t safi, struct prefix_rd *prd, u_char *tag)
{
struct bgp_node *rn;
struct bgp_info *new;
@@ -3599,8 +3599,8 @@ bgp_check_local_routes_rsclient (struct peer *rsclient, afi_t afi, safi_t safi)
}
static void
-bgp_static_withdraw_vpnv4 (struct bgp *bgp, struct prefix *p, u_int16_t afi,
- u_char safi, struct prefix_rd *prd, u_char *tag)
+bgp_static_withdraw_vpnv4 (struct bgp *bgp, struct prefix *p, afi_t afi,
+ safi_t safi, struct prefix_rd *prd, u_char *tag)
{
struct bgp_node *rn;
struct bgp_info *ri;
@@ -3653,7 +3653,7 @@ bgp_pathlimit_update_parents (struct bgp *bgp, struct bgp_node *rn,
route should be installed as valid. */
static int
bgp_static_set (struct vty *vty, struct bgp *bgp, const char *ip_str,
- u_int16_t afi, u_char safi, const char *rmap, int backdoor,
+ afi_t afi, safi_t safi, const char *rmap, int backdoor,
u_char ttl)
{
int ret;
@@ -3798,7 +3798,7 @@ bgp_static_set (struct vty *vty, struct bgp *bgp, const char *ip_str,
/* Configure static BGP network. */
static int
bgp_static_unset (struct vty *vty, struct bgp *bgp, const char *ip_str,
- u_int16_t afi, u_char safi)
+ afi_t afi, safi_t safi)
{
int ret;
struct prefix p;
@@ -7622,7 +7622,7 @@ DEFUN (show_ipv6_mbgp_community_all,
static int
bgp_show_community (struct vty *vty, int argc, const char **argv, int exact,
- u_int16_t afi, u_char safi)
+ afi_t afi, safi_t safi)
{
struct community *com;
struct buffer *b;
@@ -8622,7 +8622,7 @@ ALIAS (show_ipv6_mbgp_community_exact,
static int
bgp_show_community_list (struct vty *vty, const char *com, int exact,
- u_int16_t afi, u_char safi)
+ afi_t afi, safi_t safi)
{
struct community_list *list;