diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-01-07 09:33:28 -0500 |
|---|---|---|
| committer | vivek <vivek@cumulusnetworks.com> | 2016-06-06 14:20:24 -0700 |
| commit | e978e1de98b4464f960f27ef3fda1c45769bfb0c (patch) | |
| tree | d95250a1bd866131395f53ac2b048f7a8ca893e7 /lib/zebra.h | |
| parent | ff75b6c05bb9ca1b9c4c48f2231fd4cbfd393b17 (diff) | |
lib, bgpd: Fixup afi_t to be an enum and cleanup zebra.h
This code change does two things:
1) Removes ZEBRA_AFI_XXX #defines since they were redundant information
2) Switches afi_t to an enumerated type so that the compiler
can do a bit more compile time checking.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit f3cfc46450cccc5ac035a5a97c5a1a5484205705)
Conflicts:
bgpd/bgp_open.c
bgpd/bgp_open.h
bgpd/bgp_routemap.c
Diffstat (limited to 'lib/zebra.h')
| -rw-r--r-- | lib/zebra.h | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/zebra.h b/lib/zebra.h index e3e3b6c71e..59c154ba46 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -475,11 +475,6 @@ extern int proto_redistnum(int afi, const char *s); extern const char *zserv_command_string (unsigned int command); -/* Zebra's family types. */ -#define ZEBRA_FAMILY_IPV4 1 -#define ZEBRA_FAMILY_IPV6 2 -#define ZEBRA_FAMILY_MAX 3 - /* Error codes of zebra. */ #define ZEBRA_ERR_NOERROR 0 #define ZEBRA_ERR_RTEXIST -1 @@ -513,9 +508,11 @@ extern const char *zserv_command_string (unsigned int command); #endif /* Address family numbers from RFC1700. */ -#define AFI_IP 1 -#define AFI_IP6 2 -#define AFI_MAX 3 +typedef enum { + AFI_IP = 1, + AFI_IP6 = 2, +#define AFI_MAX 3 +} afi_t; /* Subsequent Address Family Identifier. */ #define SAFI_UNICAST 1 @@ -549,8 +546,6 @@ extern const char *zserv_command_string (unsigned int command); #define UNSET_FLAG(V,F) (V) &= ~(F) #define RESET_FLAG(V) (V) = 0 -/* AFI and SAFI type. */ -typedef u_int16_t afi_t; typedef u_int8_t safi_t; /* Zebra types. Used in Zserv message header. */ |
