summaryrefslogtreecommitdiff
path: root/bgpd/bgp_attr_evpn.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2018-03-27 15:13:34 -0400
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-03-27 15:13:34 -0400
commitd7c0a89a3a5697783a6dd89333ab660074790890 (patch)
treeeefa73e502f919b524b8a345437260d4acc23083 /bgpd/bgp_attr_evpn.c
parent28ac5a038101c66e4275a9b1ef6fb37b4f74fb6a (diff)
*: use C99 standard fixed-width integer types
The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_attr_evpn.c')
-rw-r--r--bgpd/bgp_attr_evpn.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/bgpd/bgp_attr_evpn.c b/bgpd/bgp_attr_evpn.c
index 8d5eff9a6f..d2a61b93fe 100644
--- a/bgpd/bgp_attr_evpn.c
+++ b/bgpd/bgp_attr_evpn.c
@@ -78,7 +78,7 @@ int str2esi(const char *str, struct eth_segment_id *id)
char *esi2str(struct eth_segment_id *id)
{
char *ptr;
- u_char *val;
+ uint8_t *val;
if (!id)
return NULL;
@@ -117,9 +117,9 @@ void bgp_attr_rmac(struct attr *attr, struct ethaddr *rmac)
/* If there is a router mac extended community, set RMAC in attr */
for (i = 0; i < ecom->size; i++) {
- u_char *pnt = NULL;
- u_char type = 0;
- u_char sub_type = 0;
+ uint8_t *pnt = NULL;
+ uint8_t type = 0;
+ uint8_t sub_type = 0;
pnt = (ecom->val + (i * ECOMMUNITY_SIZE));
type = *pnt++;
@@ -148,8 +148,8 @@ uint8_t bgp_attr_default_gw(struct attr *attr)
/* If there is a default gw extendd community return true otherwise
* return 0 */
for (i = 0; i < ecom->size; i++) {
- u_char *pnt;
- u_char type, sub_type;
+ uint8_t *pnt;
+ uint8_t type, sub_type;
pnt = (ecom->val + (i * ECOMMUNITY_SIZE));
type = *pnt++;
@@ -167,11 +167,11 @@ uint8_t bgp_attr_default_gw(struct attr *attr)
* Fetch and return the sequence number from MAC Mobility extended
* community, if present, else 0.
*/
-u_int32_t bgp_attr_mac_mobility_seqnum(struct attr *attr, u_char *sticky)
+uint32_t bgp_attr_mac_mobility_seqnum(struct attr *attr, uint8_t *sticky)
{
struct ecommunity *ecom;
int i;
- u_char flags = 0;
+ uint8_t flags = 0;
ecom = attr->ecommunity;
if (!ecom || !ecom->size)
@@ -184,9 +184,9 @@ u_int32_t bgp_attr_mac_mobility_seqnum(struct attr *attr, u_char *sticky)
* one.
*/
for (i = 0; i < ecom->size; i++) {
- u_char *pnt;
- u_char type, sub_type;
- u_int32_t seq_num;
+ uint8_t *pnt;
+ uint8_t type, sub_type;
+ uint32_t seq_num;
pnt = (ecom->val + (i * ECOMMUNITY_SIZE));
type = *pnt++;
@@ -233,12 +233,12 @@ extern int bgp_build_evpn_prefix(int evpn_type, uint32_t eth_tag,
SET_IPADDR_V4(&p_evpn_p->ip);
memcpy(&p_evpn_p->ip.ipaddr_v4, &src->u.prefix4,
sizeof(struct in_addr));
- dst->prefixlen = (u_char)PREFIX_LEN_ROUTE_TYPE_5_IPV4;
+ dst->prefixlen = (uint8_t)PREFIX_LEN_ROUTE_TYPE_5_IPV4;
} else {
SET_IPADDR_V6(&p_evpn_p->ip);
memcpy(&p_evpn_p->ip.ipaddr_v6, &src->u.prefix6,
sizeof(struct in6_addr));
- dst->prefixlen = (u_char)PREFIX_LEN_ROUTE_TYPE_5_IPV6;
+ dst->prefixlen = (uint8_t)PREFIX_LEN_ROUTE_TYPE_5_IPV6;
}
} else
return -1;