diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-03-27 21:13:34 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-03-27 21:13:34 +0200 |
commit | d7c0a89a3a5697783a6dd89333ab660074790890 (patch) | |
tree | eefa73e502f919b524b8a345437260d4acc23083 /bgpd | |
parent | tools, doc: update checkpatch for u_int_* (diff) | |
download | frr-d7c0a89a3a5697783a6dd89333ab660074790890.tar.xz frr-d7c0a89a3a5697783a6dd89333ab660074790890.zip |
*: 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')
68 files changed, 983 insertions, 993 deletions
diff --git a/bgpd/bgp_advertise.c b/bgpd/bgp_advertise.c index 29b6ca6bf..94413117c 100644 --- a/bgpd/bgp_advertise.c +++ b/bgpd/bgp_advertise.c @@ -146,7 +146,7 @@ void bgp_advertise_unintern(struct hash *hash, struct bgp_advertise_attr *baa) } int bgp_adj_out_lookup(struct peer *peer, struct bgp_node *rn, - u_int32_t addpath_tx_id) + uint32_t addpath_tx_id) { struct bgp_adj_out *adj; struct peer_af *paf; @@ -179,7 +179,7 @@ int bgp_adj_out_lookup(struct peer *peer, struct bgp_node *rn, void bgp_adj_in_set(struct bgp_node *rn, struct peer *peer, struct attr *attr, - u_int32_t addpath_id) + uint32_t addpath_id) { struct bgp_adj_in *adj; @@ -209,7 +209,7 @@ void bgp_adj_in_remove(struct bgp_node *rn, struct bgp_adj_in *bai) } int bgp_adj_in_unset(struct bgp_node *rn, struct peer *peer, - u_int32_t addpath_id) + uint32_t addpath_id) { struct bgp_adj_in *adj; struct bgp_adj_in *adj_next; diff --git a/bgpd/bgp_advertise.h b/bgpd/bgp_advertise.h index 3fdc6d8d2..920cca630 100644 --- a/bgpd/bgp_advertise.h +++ b/bgpd/bgp_advertise.h @@ -29,7 +29,7 @@ struct update_subgroup; struct bgp_advertise_fifo { struct bgp_advertise *next; struct bgp_advertise *prev; - u_int32_t count; + uint32_t count; }; /* BGP advertise attribute. */ @@ -80,7 +80,7 @@ struct bgp_adj_out { /* Prefix information. */ struct bgp_node *rn; - u_int32_t addpath_tx_id; + uint32_t addpath_tx_id; /* Advertised attribute. */ struct attr *attr; @@ -102,7 +102,7 @@ struct bgp_adj_in { struct attr *attr; /* Addpath identifier */ - u_int32_t addpath_rx_id; + uint32_t addpath_rx_id; }; /* BGP advertisement list. */ @@ -168,10 +168,10 @@ struct bgp_synchronize { : (F)->next) /* Prototypes. */ -extern int bgp_adj_out_lookup(struct peer *, struct bgp_node *, u_int32_t); +extern int bgp_adj_out_lookup(struct peer *, struct bgp_node *, uint32_t); extern void bgp_adj_in_set(struct bgp_node *, struct peer *, struct attr *, - u_int32_t); -extern int bgp_adj_in_unset(struct bgp_node *, struct peer *, u_int32_t); + uint32_t); +extern int bgp_adj_in_unset(struct bgp_node *, struct peer *, uint32_t); extern void bgp_adj_in_remove(struct bgp_node *, struct bgp_adj_in *); extern void bgp_sync_init(struct peer *); diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c index c3bbb7168..e02617691 100644 --- a/bgpd/bgp_aspath.c +++ b/bgpd/bgp_aspath.c @@ -80,8 +80,8 @@ * NOT the internal representation! */ struct assegment_header { - u_char type; - u_char length; + uint8_t type; + uint8_t length; }; /* Hash for aspath. This is the top level structure of AS path. */ @@ -109,7 +109,7 @@ const char *aspath_segment_type_str[] = {"as-invalid", "as-set", "as-sequence", * the caller should immediately assign data to the segment, as the segment * otherwise is not generally valid */ -static struct assegment *assegment_new(u_char type, u_short length) +static struct assegment *assegment_new(uint8_t type, unsigned short length) { struct assegment *new; @@ -345,7 +345,7 @@ void aspath_unintern(struct aspath **aspath) /* Return the start or end delimiters for a particular Segment type */ #define AS_SEG_START 0 #define AS_SEG_END 1 -static char aspath_delimiter_char(u_char type, u_char which) +static char aspath_delimiter_char(uint8_t type, uint8_t which) { int i; struct { @@ -864,7 +864,7 @@ static void assegment_data_put(struct stream *s, as_t *as, int num, } } -static size_t assegment_header_put(struct stream *s, u_char type, int length) +static size_t assegment_header_put(struct stream *s, uint8_t type, int length) { size_t lenp; assert(length <= AS_SEGMENT_MAX); @@ -962,7 +962,7 @@ size_t aspath_put(struct stream *s, struct aspath *as, int use32bit) * We have no way to manage the storage, so we use a static stream * wrapper around aspath_put. */ -u_char *aspath_snmp_pathseg(struct aspath *as, size_t *varlen) +uint8_t *aspath_snmp_pathseg(struct aspath *as, size_t *varlen) { #define SNMP_PATHSEG_MAX 1024 @@ -1541,7 +1541,7 @@ struct aspath *aspath_filter_exclude(struct aspath *source, /* Add specified AS to the leftmost of aspath. */ static struct aspath *aspath_add_asns(struct aspath *aspath, as_t asno, - u_char type, unsigned num) + uint8_t type, unsigned num) { struct assegment *assegment = aspath->segments; unsigned i; @@ -1872,7 +1872,7 @@ enum as_token { /* Return next token and point for string parse. */ static const char *aspath_gettoken(const char *buf, enum as_token *token, - u_long *asno) + unsigned long *asno) { const char *p = buf; @@ -1937,8 +1937,8 @@ static const char *aspath_gettoken(const char *buf, enum as_token *token, struct aspath *aspath_str2aspath(const char *str) { enum as_token token = as_token_unknown; - u_short as_type; - u_long asno = 0; + unsigned short as_type; + unsigned long asno = 0; struct aspath *aspath; int needtype; diff --git a/bgpd/bgp_aspath.h b/bgpd/bgp_aspath.h index 0c065cc93..1acc2f67a 100644 --- a/bgpd/bgp_aspath.h +++ b/bgpd/bgp_aspath.h @@ -51,8 +51,8 @@ struct assegment { struct assegment *next; as_t *as; - u_short length; - u_char type; + unsigned short length; + uint8_t type; }; /* AS path may be include some AsSegments. */ @@ -127,6 +127,6 @@ extern struct aspath *aspath_reconcile_as4(struct aspath *, struct aspath *); extern unsigned int aspath_has_as4(struct aspath *); /* For SNMP BGP4PATHATTRASPATHSEGMENT, might be useful for debug */ -extern u_char *aspath_snmp_pathseg(struct aspath *, size_t *); +extern uint8_t *aspath_snmp_pathseg(struct aspath *, size_t *); #endif /* _QUAGGA_BGP_ASPATH_H */ diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index c3a110599..58788a895 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -693,7 +693,7 @@ struct attr *bgp_attr_intern(struct attr *attr) } /* Make network statement's attribute. */ -struct attr *bgp_attr_default_set(struct attr *attr, u_char origin) +struct attr *bgp_attr_default_set(struct attr *attr, uint8_t origin) { memset(attr, 0, sizeof(struct attr)); @@ -712,10 +712,10 @@ struct attr *bgp_attr_default_set(struct attr *attr, u_char origin) } /* Create the attributes for an aggregate */ -struct attr *bgp_attr_aggregate_intern(struct bgp *bgp, u_char origin, +struct attr *bgp_attr_aggregate_intern(struct bgp *bgp, uint8_t origin, struct aspath *aspath, struct community *community, int as_set, - u_char atomic_aggregate) + uint8_t atomic_aggregate) { struct attr attr; struct attr *new; @@ -737,7 +737,7 @@ struct attr *bgp_attr_aggregate_intern(struct bgp *bgp, u_char origin, attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_NEXT_HOP); if (community) { - u_int32_t gshut = COMMUNITY_GSHUT; + uint32_t gshut = COMMUNITY_GSHUT; /* If we are not shutting down ourselves and we are * aggregating a route that contains the GSHUT community we @@ -901,16 +901,16 @@ void bgp_attr_flush(struct attr *attr) * introduced by the sending neighbour. */ static bgp_attr_parse_ret_t -bgp_attr_malformed(struct bgp_attr_parser_args *args, u_char subcode, +bgp_attr_malformed(struct bgp_attr_parser_args *args, uint8_t subcode, bgp_size_t length) { struct peer *const peer = args->peer; - const u_int8_t flags = args->flags; + const uint8_t flags = args->flags; /* startp and length must be special-cased, as whether or not to * send the attribute data with the NOTIFY depends on the error, * the caller therefore signals this with the seperate length argument */ - u_char *notify_datap = (length > 0 ? args->startp : NULL); + uint8_t *notify_datap = (length > 0 ? args->startp : NULL); /* Only relax error handling for eBGP peers */ if (peer->sort != BGP_PEER_EBGP) { @@ -976,12 +976,12 @@ bgp_attr_malformed(struct bgp_attr_parser_args *args, u_char subcode, non-transitive" attribute. */ static void bgp_attr_flags_diagnose(struct bgp_attr_parser_args *args, - u_int8_t desired_flags /* how RFC says it must be */ - ) + uint8_t desired_flags /* how RFC says it must be */ +) { - u_char seen = 0, i; - u_char real_flags = args->flags; - const u_int8_t attr_code = args->type; + uint8_t seen = 0, i; + uint8_t real_flags = args->flags; + const uint8_t attr_code = args->type; desired_flags &= ~BGP_ATTR_FLAG_EXTLEN; real_flags &= ~BGP_ATTR_FLAG_EXTLEN; @@ -1008,41 +1008,36 @@ bgp_attr_flags_diagnose(struct bgp_attr_parser_args *args, /* Required flags for attributes. EXTLEN will be masked off when testing, * as will PARTIAL for optional+transitive attributes. */ -const u_int8_t attr_flags_values[] = { - [BGP_ATTR_ORIGIN] = BGP_ATTR_FLAG_TRANS, - [BGP_ATTR_AS_PATH] = BGP_ATTR_FLAG_TRANS, - [BGP_ATTR_NEXT_HOP] = BGP_ATTR_FLAG_TRANS, - [BGP_ATTR_MULTI_EXIT_DISC] = BGP_ATTR_FLAG_OPTIONAL, - [BGP_ATTR_LOCAL_PREF] = BGP_ATTR_FLAG_TRANS, - [BGP_ATTR_ATOMIC_AGGREGATE] = BGP_ATTR_FLAG_TRANS, - [BGP_ATTR_AGGREGATOR] = - BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL, - [BGP_ATTR_COMMUNITIES] = - BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL, - [BGP_ATTR_ORIGINATOR_ID] = BGP_ATTR_FLAG_OPTIONAL, - [BGP_ATTR_CLUSTER_LIST] = BGP_ATTR_FLAG_OPTIONAL, - [BGP_ATTR_MP_REACH_NLRI] = BGP_ATTR_FLAG_OPTIONAL, - [BGP_ATTR_MP_UNREACH_NLRI] = BGP_ATTR_FLAG_OPTIONAL, - [BGP_ATTR_EXT_COMMUNITIES] = - BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS, - [BGP_ATTR_AS4_PATH] = - BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS, - [BGP_ATTR_AS4_AGGREGATOR] = - BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS, - [BGP_ATTR_PMSI_TUNNEL] = - BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS, - [BGP_ATTR_LARGE_COMMUNITIES] = - BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS, - [BGP_ATTR_PREFIX_SID] = - BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS, +const uint8_t attr_flags_values[] = { + [BGP_ATTR_ORIGIN] = BGP_ATTR_FLAG_TRANS, + [BGP_ATTR_AS_PATH] = BGP_ATTR_FLAG_TRANS, + [BGP_ATTR_NEXT_HOP] = BGP_ATTR_FLAG_TRANS, + [BGP_ATTR_MULTI_EXIT_DISC] = BGP_ATTR_FLAG_OPTIONAL, + [BGP_ATTR_LOCAL_PREF] = BGP_ATTR_FLAG_TRANS, + [BGP_ATTR_ATOMIC_AGGREGATE] = BGP_ATTR_FLAG_TRANS, + [BGP_ATTR_AGGREGATOR] = BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL, + [BGP_ATTR_COMMUNITIES] = BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL, + [BGP_ATTR_ORIGINATOR_ID] = BGP_ATTR_FLAG_OPTIONAL, + [BGP_ATTR_CLUSTER_LIST] = BGP_ATTR_FLAG_OPTIONAL, + [BGP_ATTR_MP_REACH_NLRI] = BGP_ATTR_FLAG_OPTIONAL, + [BGP_ATTR_MP_UNREACH_NLRI] = BGP_ATTR_FLAG_OPTIONAL, + [BGP_ATTR_EXT_COMMUNITIES] = + BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS, + [BGP_ATTR_AS4_PATH] = BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS, + [BGP_ATTR_AS4_AGGREGATOR] = + BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS, + [BGP_ATTR_PMSI_TUNNEL] = BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS, + [BGP_ATTR_LARGE_COMMUNITIES] = + BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS, + [BGP_ATTR_PREFIX_SID] = BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS, }; static const size_t attr_flags_values_max = array_size(attr_flags_values) - 1; static int bgp_attr_flag_invalid(struct bgp_attr_parser_args *args) { - u_int8_t mask = BGP_ATTR_FLAG_EXTLEN; - const u_int8_t flags = args->flags; - const u_int8_t attr_code = args->type; + uint8_t mask = BGP_ATTR_FLAG_EXTLEN; + const uint8_t flags = args->flags; + const uint8_t attr_code = args->type; /* there may be attributes we don't know about */ if (attr_code > attr_flags_values_max) @@ -1531,7 +1526,7 @@ bgp_attr_community(struct bgp_attr_parser_args *args) } attr->community = - community_parse((u_int32_t *)stream_pnt(peer->curr), length); + community_parse((uint32_t *)stream_pnt(peer->curr), length); /* XXX: fix community_parse to use stream API and remove this */ stream_forward_getp(peer->curr, length); @@ -1723,7 +1718,7 @@ int bgp_mp_reach_parse(struct bgp_attr_parser_args *args, } { - u_char val; + uint8_t val; if ((val = stream_getc(s))) zlog_warn( "%s sent non-zero value, %u, for defunct SNPA-length field", @@ -1768,7 +1763,7 @@ int bgp_mp_unreach_parse(struct bgp_attr_parser_args *args, afi_t afi; iana_safi_t pkt_safi; safi_t safi; - u_int16_t withdraw_len; + uint16_t withdraw_len; struct peer *const peer = args->peer; struct attr *const attr = args->attr; const bgp_size_t length = args->length; @@ -1827,7 +1822,7 @@ bgp_attr_large_community(struct bgp_attr_parser_args *args) } attr->lcommunity = - lcommunity_parse((u_int8_t *)stream_pnt(peer->curr), length); + lcommunity_parse((uint8_t *)stream_pnt(peer->curr), length); /* XXX: fix ecommunity_parse to use stream API */ stream_forward_getp(peer->curr, length); @@ -1847,7 +1842,7 @@ bgp_attr_ext_communities(struct bgp_attr_parser_args *args) struct peer *const peer = args->peer; struct attr *const attr = args->attr; const bgp_size_t length = args->length; - u_char sticky = 0; + uint8_t sticky = 0; if (length == 0) { attr->ecommunity = NULL; @@ -1856,7 +1851,7 @@ bgp_attr_ext_communities(struct bgp_attr_parser_args *args) } attr->ecommunity = - ecommunity_parse((u_int8_t *)stream_pnt(peer->curr), length); + ecommunity_parse((uint8_t *)stream_pnt(peer->curr), length); /* XXX: fix ecommunity_parse to use stream API */ stream_forward_getp(peer->curr, length); @@ -1883,8 +1878,8 @@ bgp_attr_ext_communities(struct bgp_attr_parser_args *args) static int bgp_attr_encap(uint8_t type, struct peer *peer, /* IN */ bgp_size_t length, /* IN: attr's length field */ struct attr *attr, /* IN: caller already allocated */ - u_char flag, /* IN: attr's flags field */ - u_char *startp) + uint8_t flag, /* IN: attr's flags field */ + uint8_t *startp) { bgp_size_t total; uint16_t tunneltype = 0; @@ -2017,10 +2012,10 @@ bgp_attr_prefix_sid(struct bgp_attr_parser_args *args, struct attr *const attr = args->attr; int type; int length; - u_int32_t label_index; + uint32_t label_index; struct in6_addr ipv6_sid; - u_int32_t srgb_base; - u_int32_t srgb_range; + uint32_t srgb_base; + uint32_t srgb_range; int srgb_count; attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_PREFIX_SID); @@ -2116,7 +2111,7 @@ bgp_attr_pmsi_tunnel(struct bgp_attr_parser_args *args) struct peer *const peer = args->peer; struct attr *const attr = args->attr; const bgp_size_t length = args->length; - u_int8_t tnl_type; + uint8_t tnl_type; /* Verify that the receiver is expecting "ingress replication" as we * can only support that. @@ -2159,9 +2154,9 @@ static bgp_attr_parse_ret_t bgp_attr_unknown(struct bgp_attr_parser_args *args) struct transit *transit; struct peer *const peer = args->peer; struct attr *const attr = args->attr; - u_char *const startp = args->startp; - const u_char type = args->type; - const u_char flag = args->flags; + uint8_t *const startp = args->startp; + const uint8_t type = args->type; + const uint8_t flag = args->flags; const bgp_size_t length = args->length; if (bgp_debug_update(peer, NULL, NULL, 1)) @@ -2213,7 +2208,7 @@ static bgp_attr_parse_ret_t bgp_attr_unknown(struct bgp_attr_parser_args *args) /* Well-known attribute check. */ static int bgp_attr_check(struct peer *peer, struct attr *attr) { - u_char type = 0; + uint8_t type = 0; /* BGP Graceful-Restart End-of-RIB for IPv4 unicast is signaled as an * empty UPDATE. */ @@ -2264,12 +2259,12 @@ bgp_attr_parse_ret_t bgp_attr_parse(struct peer *peer, struct attr *attr, struct bgp_nlri *mp_withdraw) { int ret; - u_char flag = 0; - u_char type = 0; + uint8_t flag = 0; + uint8_t type = 0; bgp_size_t length; - u_char *startp, *endp; - u_char *attr_endp; - u_char seen[BGP_ATTR_BITMAP_SIZE]; + uint8_t *startp, *endp; + uint8_t *attr_endp; + uint8_t seen[BGP_ATTR_BITMAP_SIZE]; /* we need the as4_path only until we have synthesized the as_path with * it */ /* same goes for as4_aggregator */ @@ -2742,8 +2737,8 @@ size_t bgp_packet_mpattr_start(struct stream *s, struct peer *peer, afi_t afi, void bgp_packet_mpattr_prefix(struct stream *s, afi_t afi, safi_t safi, struct prefix *p, struct prefix_rd *prd, - mpls_label_t *label, u_int32_t num_labels, - int addpath_encode, u_int32_t addpath_tx_id, + mpls_label_t *label, uint32_t num_labels, + int addpath_encode, uint32_t addpath_tx_id, struct attr *attr) { if (safi == SAFI_MPLS_VPN) { @@ -2886,8 +2881,8 @@ bgp_size_t bgp_packet_attribute(struct bgp *bgp, struct peer *peer, struct bpacket_attr_vec_arr *vecarr, struct prefix *p, afi_t afi, safi_t safi, struct peer *from, struct prefix_rd *prd, - mpls_label_t *label, u_int32_t num_labels, - int addpath_encode, u_int32_t addpath_tx_id) + mpls_label_t *label, uint32_t num_labels, + int addpath_encode, uint32_t addpath_tx_id) { size_t cp; size_t aspath_sizep; @@ -3072,7 +3067,7 @@ bgp_size_t bgp_packet_attribute(struct bgp *bgp, struct peer *peer, */ send_as4_aggregator = 1; } else - stream_putw(s, (u_int16_t)attr->aggregator_as); + stream_putw(s, (uint16_t)attr->aggregator_as); } stream_put_ipv4(s, attr->aggregator_addr.s_addr); } @@ -3179,7 +3174,7 @@ bgp_size_t bgp_packet_attribute(struct bgp *bgp, struct peer *peer, stream_put(s, attr->ecommunity->val, attr->ecommunity->size * 8); } else { - u_int8_t *pnt; + uint8_t *pnt; int tbit; int ecom_tr_size = 0; int i; @@ -3233,7 +3228,7 @@ bgp_size_t bgp_packet_attribute(struct bgp *bgp, struct peer *peer, /* Label index attribute. */ if (safi == SAFI_LABELED_UNICAST) { if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_PREFIX_SID)) { - u_int32_t label_index; + uint32_t label_index; label_index = attr->label_index; @@ -3350,11 +3345,11 @@ size_t bgp_packet_mpunreach_start(struct stream *s, afi_t afi, safi_t safi) void bgp_packet_mpunreach_prefix(struct stream *s, struct prefix *p, afi_t afi, safi_t safi, struct prefix_rd *prd, - mpls_label_t *label, u_int32_t num_labels, - int addpath_encode, u_int32_t addpath_tx_id, + mpls_label_t *label, uint32_t num_labels, + int addpath_encode, uint32_t addpath_tx_id, struct attr *attr) { - u_char wlabel[3] = {0x80, 0x00, 0x00}; + uint8_t wlabel[3] = {0x80, 0x00, 0x00}; if (safi == SAFI_LABELED_UNICAST) { label = (mpls_label_t *)wlabel; @@ -3404,7 +3399,7 @@ void bgp_dump_routes_attr(struct stream *s, struct attr *attr, size_t aspath_lenp; struct aspath *aspath; int addpath_encode = 0; - u_int32_t addpath_tx_id = 0; + uint32_t addpath_tx_id = 0; /* Remember current pointer. */ cp = stream_get_endp(s); diff --git a/bgpd/bgp_attr.h b/bgpd/bgp_attr.h index 5403f3254..758db4a44 100644 --- a/bgpd/bgp_attr.h +++ b/bgpd/bgp_attr.h @@ -126,19 +126,19 @@ struct attr { /* Apart from in6_addr, the remaining static attributes */ struct in_addr nexthop; - u_int32_t med; - u_int32_t local_pref; + uint32_t med; + uint32_t local_pref; ifindex_t nh_ifindex; /* Path origin attribute */ - u_char origin; + uint8_t origin; /* PMSI tunnel type (RFC 6514). */ enum pta_type pmsi_tnl_type; /* has the route-map changed any attribute? Used on the peer outbound side. */ - u_int32_t rmap_change_flags; + uint32_t rmap_change_flags; /* Multi-Protocol Nexthop, AFI IPv6 */ struct in6_addr mp_nexthop_global; @@ -165,28 +165,28 @@ struct attr { struct in_addr originator_id; /* Local weight, not actually an attribute */ - u_int32_t weight; + uint32_t weight; /* Aggregator ASN */ as_t aggregator_as; /* MP Nexthop length */ - u_char mp_nexthop_len; + uint8_t mp_nexthop_len; /* MP Nexthop preference */ - u_char mp_nexthop_prefer_global; + uint8_t mp_nexthop_prefer_global; /* Static MAC for EVPN */ - u_char sticky; + uint8_t sticky; /* Flag for default gateway extended community in EVPN */ - u_char default_gw; + uint8_t default_gw; /* route tag */ route_tag_t tag; /* Label index */ - u_int32_t label_index; + uint32_t label_index; /* MPLS label */ mpls_label_t label; @@ -201,7 +201,7 @@ struct attr { struct overlay_index evpn_overlay; /* EVPN MAC Mobility sequence number, if any. */ - u_int32_t mm_seqnum; + uint32_t mm_seqnum; /* EVPN local router-mac */ struct ethaddr rmac; @@ -227,7 +227,7 @@ struct cluster_list { struct transit { unsigned long refcnt; int length; - u_char *val; + uint8_t *val; }; /* "(void) 0" will generate a compiler error. this is a safety check to @@ -265,18 +265,17 @@ extern struct attr *bgp_attr_intern(struct attr *attr); extern void bgp_attr_unintern_sub(struct attr *); extern void bgp_attr_unintern(struct attr **); extern void bgp_attr_flush(struct attr *); -extern struct attr *bgp_attr_default_set(struct attr *attr, u_char); -extern struct attr *bgp_attr_aggregate_intern(struct bgp *, u_char, +extern struct attr *bgp_attr_default_set(struct attr *attr, uint8_t); +extern struct attr *bgp_attr_aggregate_intern(struct bgp *, uint8_t, struct aspath *, struct community *, int as_set, - u_char); + uint8_t); extern bgp_size_t bgp_packet_attribute(struct bgp *bgp, struct peer *, struct stream *, struct attr *, struct bpacket_attr_vec_arr *vecarr, struct prefix *, afi_t, safi_t, struct peer *, struct prefix_rd *, - mpls_label_t *, u_int32_t, int, - u_int32_t); + mpls_label_t *, uint32_t, int, uint32_t); extern void bgp_dump_routes_attr(struct stream *, struct attr *, struct prefix *); extern int attrhash_cmp(const void *, const void *); @@ -298,9 +297,9 @@ struct bgp_attr_parser_args { bgp_size_t length; /* attribute data length; */ bgp_size_t total; /* total length, inc header */ struct attr *attr; - u_int8_t type; - u_int8_t flags; - u_char *startp; + uint8_t type; + uint8_t flags; + uint8_t *startp; }; extern int bgp_mp_reach_parse(struct bgp_attr_parser_args *args, struct bgp_nlri *); @@ -324,9 +323,9 @@ extern size_t bgp_packet_mpattr_start(struct stream *s, struct peer *peer, struct attr *attr); extern void bgp_packet_mpattr_prefix(struct stream *s, afi_t afi, safi_t safi, struct prefix *p, struct prefix_rd *prd, - mpls_label_t *label, u_int32_t num_labels, - int addpath_encode, - u_int32_t addpath_tx_id, struct attr *); + mpls_label_t *label, uint32_t num_labels, + int addpath_encode, uint32_t addpath_tx_id, + struct attr *); extern size_t bgp_packet_mpattr_prefix_size(afi_t afi, safi_t safi, struct prefix *p); extern void bgp_packet_mpattr_end(struct stream *s, size_t sizep); @@ -336,12 +335,11 @@ extern size_t bgp_packet_mpunreach_start(struct stream *s, afi_t afi, extern void bgp_packet_mpunreach_prefix(struct stream *s, struct prefix *p, afi_t afi, safi_t safi, struct prefix_rd *prd, mpls_label_t *, - u_int32_t, int, u_int32_t, - struct attr *); + uint32_t, int, uint32_t, struct attr *); extern void bgp_packet_mpunreach_end(struct stream *s, size_t attrlen_pnt); -static inline int bgp_rmap_nhop_changed(u_int32_t out_rmap_flags, - u_int32_t in_rmap_flags) +static inline int bgp_rmap_nhop_changed(uint32_t out_rmap_flags, + uint32_t in_rmap_flags) { return ((CHECK_FLAG(out_rmap_flags, BATTR_RMAP_NEXTHOP_PEER_ADDRESS) || CHECK_FLAG(out_rmap_flags, BATTR_RMAP_NEXTHOP_UNCHANGED) @@ -356,7 +354,7 @@ static inline int bgp_rmap_nhop_changed(u_int32_t out_rmap_flags, : 0); } -static inline u_int32_t mac_mobility_seqnum(struct attr *attr) +static inline uint32_t mac_mobility_seqnum(struct attr *attr) { return (attr) ? attr->mm_seqnum : 0; } diff --git a/bgpd/bgp_attr_evpn.c b/bgpd/bgp_attr_evpn.c index 8d5eff9a6..d2a61b93f 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; diff --git a/bgpd/bgp_attr_evpn.h b/bgpd/bgp_attr_evpn.h index a211da8d2..cb1c131ef 100644 --- a/bgpd/bgp_attr_evpn.h +++ b/bgpd/bgp_attr_evpn.h @@ -34,11 +34,11 @@ #define MAX_ET 0xffffffff -u_long eth_tag_id; +unsigned long eth_tag_id; struct attr; struct eth_segment_id { - u_char val[ESI_LEN]; + uint8_t val[ESI_LEN]; }; union gw_addr { @@ -60,8 +60,8 @@ extern void bgp_add_routermac_ecom(struct attr *attr, extern int bgp_build_evpn_prefix(int type, uint32_t eth_tag, struct prefix *dst); extern void bgp_attr_rmac(struct attr *attr, struct ethaddr *rmac); -extern u_int32_t bgp_attr_mac_mobility_seqnum(struct attr *attr, - u_char *sticky); +extern uint32_t bgp_attr_mac_mobility_seqnum(struct attr *attr, + uint8_t *sticky); extern uint8_t bgp_attr_default_gw(struct attr *attr); #endif /* _QUAGGA_BGP_ATTR_EVPN_H */ diff --git a/bgpd/bgp_bfd.c b/bgpd/bgp_bfd.c index 91b6929ff..c7d624987 100644 --- a/bgpd/bgp_bfd.c +++ b/bgpd/bgp_bfd.c @@ -383,8 +383,8 @@ static int bgp_bfd_dest_update(int command, struct zclient *zclient, /* * bgp_bfd_peer_param_set - Set the configured BFD paramter values for peer. */ -static int bgp_bfd_peer_param_set(struct peer *peer, u_int32_t min_rx, - u_int32_t min_tx, u_int8_t detect_mult, +static int bgp_bfd_peer_param_set(struct peer *peer, uint32_t min_rx, + uint32_t min_tx, uint8_t detect_mult, int defaults) { struct peer_group *group; @@ -526,7 +526,7 @@ void bgp_bfd_peer_config_write(struct vty *vty, struct peer *peer, char *addr) /* * bgp_bfd_show_info - Show the peer BFD information. */ -void bgp_bfd_show_info(struct vty *vty, struct peer *peer, u_char use_json, +void bgp_bfd_show_info(struct vty *vty, struct peer *peer, uint8_t use_json, json_object *json_neigh) { bfd_show_info(vty, (struct bfd_info *)peer->bfd_info, @@ -571,9 +571,9 @@ DEFUN (neighbor_bfd_param, int idx_number_2 = 4; int idx_number_3 = 5; struct peer *peer; - u_int32_t rx_val; - u_int32_t tx_val; - u_int8_t dm_val; + uint32_t rx_val; + uint32_t tx_val; + uint8_t dm_val; int ret; peer = peer_and_group_lookup_vty(vty, argv[idx_peer]->arg); diff --git a/bgpd/bgp_bfd.h b/bgpd/bgp_bfd.h index 72d86596b..a3cfca9c0 100644 --- a/bgpd/bgp_bfd.h +++ b/bgpd/bgp_bfd.h @@ -35,7 +35,7 @@ extern void bgp_bfd_peer_config_write(struct vty *vty, struct peer *peer, char *addr); extern void bgp_bfd_show_info(struct vty *vty, struct peer *peer, - u_char use_json, json_object *json_neigh); + uint8_t use_json, json_object *json_neigh); extern int bgp_bfd_is_peer_multihop(struct peer *peer); diff --git a/bgpd/bgp_btoa.c b/bgpd/bgp_btoa.c index 4faebb538..bf2607f2e 100644 --- a/bgpd/bgp_btoa.c +++ b/bgpd/bgp_btoa.c @@ -68,12 +68,12 @@ enum MRT_MSG_TYPES { MSG_TABLE_DUMP /* routing table dump */ }; -static int attr_parse(struct stream *s, u_int16_t len) +static int attr_parse(struct stream *s, uint16_t len) { - u_int flag; - u_int type; - u_int16_t length; - u_int16_t lim; + unsigned int flag; + unsigned int type; + uint16_t length; + uint16_t lim; lim = s->getp + len; @@ -94,7 +94,7 @@ static int attr_parse(struct stream *s, u_int16_t len) switch (type) { case BGP_ATTR_ORIGIN: { - u_char origin; + uint8_t origin; origin = stream_getc(s); printf("ORIGIN: %d\n", origin); } break; @@ -134,7 +134,7 @@ int main(int argc, char **argv) int family; struct in_addr sip; struct in_addr dip; - u_int16_t viewno, seq_num; + uint16_t viewno, seq_num; struct prefix_ipv4 p; s = stream_new(10000); @@ -230,10 +230,10 @@ int main(int argc, char **argv) /* printf ("now read %d\n", len); */ if (type == MSG_TABLE_DUMP) { - u_char status; + uint8_t status; time_t originated; struct in_addr peer; - u_int16_t attrlen; + uint16_t attrlen; viewno = stream_getw(s); seq_num = stream_getw(s); diff --git a/bgpd/bgp_clist.c b/bgpd/bgp_clist.c index 72b1098ed..8f38f5765 100644 --- a/bgpd/bgp_clist.c +++ b/bgpd/bgp_clist.c @@ -334,13 +334,13 @@ community_list_entry_lookup(struct community_list *list, const void *arg, static char *community_str_get(struct community *com, int i) { int len; - u_int32_t comval; - u_int16_t as; - u_int16_t val; + uint32_t comval; + uint16_t as; + uint16_t val; char *str; char *pnt; - memcpy(&comval, com_nthval(com, i), sizeof(u_int32_t)); + memcpy(&comval, com_nthval(com, i), sizeof(uint32_t)); comval = ntohl(comval); switch (comval) { @@ -451,11 +451,11 @@ static int community_regexp_match(struct community *com, regex_t *reg) static char *lcommunity_str_get(struct lcommunity *lcom, int i) { struct lcommunity_val lcomval; - u_int32_t globaladmin; - u_int32_t localdata1; - u_int32_t localdata2; + uint32_t globaladmin; + uint32_t localdata1; + uint32_t localdata2; char *str; - u_char *ptr; + uint8_t *ptr; char *pnt; ptr = lcom->val + (i * LCOMMUNITY_SIZE); @@ -465,7 +465,7 @@ static char *lcommunity_str_get(struct lcommunity *lcom, int i) /* Allocate memory. 48 bytes taken off bgp_lcommunity.c */ str = pnt = XMALLOC(MTYPE_LCOMMUNITY_STR, 48); - ptr = (u_char *)lcomval.val; + ptr = (uint8_t *)lcomval.val; ptr = ptr_get_be32(ptr, &globaladmin); ptr = ptr_get_be32(ptr, &localdata1); ptr = ptr_get_be32(ptr, &localdata2); @@ -549,7 +549,7 @@ static struct community * community_regexp_delete (struct community *com, regex_t * reg) { int i; - u_int32_t comval; + uint32_t comval; /* Maximum is "65535:65535" + '\0'. */ char c[12]; const char *str; @@ -560,7 +560,7 @@ community_regexp_delete (struct community *com, regex_t * reg) i = 0; while (i < com->size) { - memcpy (&comval, com_nthval (com, i), sizeof (u_int32_t)); + memcpy (&comval, com_nthval (com, i), sizeof (uint32_t)); comval = ntohl (comval); switch (comval) @@ -694,8 +694,8 @@ struct community *community_list_match_delete(struct community *com, struct community_list *list) { struct community_entry *entry; - u_int32_t val; - u_int32_t com_index_to_delete[com->size]; + uint32_t val; + uint32_t com_index_to_delete[com->size]; int delete_index = 0; int i; @@ -895,8 +895,8 @@ struct lcommunity *lcommunity_list_match_delete(struct lcommunity *lcom, struct community_list *list) { struct community_entry *entry; - u_int32_t com_index_to_delete[lcom->size]; - u_char *ptr; + uint32_t com_index_to_delete[lcom->size]; + uint8_t *ptr; int delete_index = 0; int i; diff --git a/bgpd/bgp_clist.h b/bgpd/bgp_clist.h index c21654f39..0dbde2a45 100644 --- a/bgpd/bgp_clist.h +++ b/bgpd/bgp_clist.h @@ -68,13 +68,13 @@ struct community_entry { struct community_entry *prev; /* Permit or deny. */ - u_char direct; + uint8_t direct; /* Standard or expanded. */ - u_char style; + uint8_t style; /* Any match. */ - u_char any; + uint8_t any; /* Community structure. */ union { diff --git a/bgpd/bgp_community.c b/bgpd/bgp_community.c index b78edcb2f..10ce1486a 100644 --- a/bgpd/bgp_community.c +++ b/bgpd/bgp_community.c @@ -55,7 +55,7 @@ void community_free(struct community *com) } /* Add one community value to the community. */ -static void community_add_val(struct community *com, u_int32_t val) +static void community_add_val(struct community *com, uint32_t val) { com->size++; if (com->val) @@ -65,11 +65,11 @@ static void community_add_val(struct community *com, u_int32_t val) com->val = XMALLOC(MTYPE_COMMUNITY_VAL, com_length(com)); val = htonl(val); - memcpy(com_lastval(com), &val, sizeof(u_int32_t)); + memcpy(com_lastval(com), &val, sizeof(uint32_t)); } /* Delete one community. */ -void community_del_val(struct community *com, u_int32_t *val) +void community_del_val(struct community *com, uint32_t *val) { int i = 0; int c = 0; @@ -78,7 +78,7 @@ void community_del_val(struct community *com, u_int32_t *val) return; while (i < com->size) { - if (memcmp(com->val + i, val, sizeof(u_int32_t)) == 0) { + if (memcmp(com->val + i, val, sizeof(uint32_t)) == 0) { c = com->size - i - 1; if (c > 0) @@ -117,11 +117,11 @@ struct community *community_delete(struct community *com1, /* Callback function from qsort(). */ static int community_compare(const void *a1, const void *a2) { - u_int32_t v1; - u_int32_t v2; + uint32_t v1; + uint32_t v2; - memcpy(&v1, a1, sizeof(u_int32_t)); - memcpy(&v2, a2, sizeof(u_int32_t)); + memcpy(&v1, a1, sizeof(uint32_t)); + memcpy(&v2, a2, sizeof(uint32_t)); v1 = ntohl(v1); v2 = ntohl(v2); @@ -132,28 +132,28 @@ static int community_compare(const void *a1, const void *a2) return 0; } -int community_include(struct community *com, u_int32_t val) +int community_include(struct community *com, uint32_t val) { int i; val = htonl(val); for (i = 0; i < com->size; i++) - if (memcmp(&val, com_nthval(com, i), sizeof(u_int32_t)) == 0) + if (memcmp(&val, com_nthval(com, i), sizeof(uint32_t)) == 0) return 1; return 0; } -u_int32_t community_val_get(struct community *com, int i) +uint32_t community_val_get(struct community *com, int i) { - u_char *p; - u_int32_t val; + uint8_t *p; + uint32_t val; - p = (u_char *)com->val; + p = (uint8_t *)com->val; p += (i * 4); - memcpy(&val, p, sizeof(u_int32_t)); + memcpy(&val, p, sizeof(uint32_t)); return ntohl(val); } @@ -163,7 +163,7 @@ struct community *community_uniq_sort(struct community *com) { int i; struct community *new; - u_int32_t val; + uint32_t val; if (!com) return NULL; @@ -178,7 +178,7 @@ struct community *community_uniq_sort(struct community *com) community_add_val(new, val); } - qsort(new->val, new->size, sizeof(u_int32_t), community_compare); + qsort(new->val, new->size, sizeof(uint32_t), community_compare); return new; } @@ -201,9 +201,9 @@ static void set_community_string(struct community *com, bool make_json) char *pnt; int len; int first; - u_int32_t comval; - u_int16_t as; - u_int16_t val; + uint32_t comval; + uint16_t as; + uint16_t val; json_object *json_community_list = NULL; json_object *json_string = NULL; @@ -234,7 +234,7 @@ static void set_community_string(struct community *com, bool make_json) len = 0; for (i = 0; i < com->size; i++) { - memcpy(&comval, com_nthval(com, i), sizeof(u_int32_t)); + memcpy(&comval, com_nthval(com, i), sizeof(uint32_t)); comval = ntohl(comval); switch (comval) { @@ -265,7 +265,7 @@ static void set_community_string(struct community *com, bool make_json) /* Fill in string. */ for (i = 0; i < com->size; i++) { - memcpy(&comval, com_nthval(com, i), sizeof(u_int32_t)); + memcpy(&comval, com_nthval(com, i), sizeof(uint32_t)); comval = ntohl(comval); if (first) @@ -391,7 +391,7 @@ void community_unintern(struct community **com) } /* Create new community attribute. */ -struct community *community_parse(u_int32_t *pnt, u_short length) +struct community *community_parse(uint32_t *pnt, unsigned short length) { struct community tmp; struct community *new; @@ -441,7 +441,7 @@ char *community_str(struct community *com, bool make_json) hash package.*/ unsigned int community_hash_make(struct community *com) { - u_int32_t *pnt = (u_int32_t *)com->val; + uint32_t *pnt = (uint32_t *)com->val; return jhash2(pnt, com->size, 0x43ea96c1); } @@ -462,8 +462,7 @@ int community_match(const struct community *com1, const struct community *com2) /* Every community on com2 needs to be on com1 for this to match */ while (i < com1->size && j < com2->size) { - if (memcmp(com1->val + i, com2->val + j, sizeof(u_int32_t)) - == 0) + if (memcmp(com1->val + i, com2->val + j, sizeof(uint32_t)) == 0) j++; i++; } @@ -518,7 +517,7 @@ enum community_token { /* Get next community token from string. */ static const char * -community_gettoken(const char *buf, enum community_token *token, u_int32_t *val) +community_gettoken(const char *buf, enum community_token *token, uint32_t *val) { const char *p = buf; @@ -573,8 +572,8 @@ community_gettoken(const char *buf, enum community_token *token, u_int32_t *val) if (isdigit((int)*p)) { int separator = 0; int digit = 0; - u_int32_t community_low = 0; - u_int32_t community_high = 0; + uint32_t community_low = 0; + uint32_t community_high = 0; while (isdigit((int)*p) || *p == ':') { if (*p == ':') { @@ -624,7 +623,7 @@ struct community *community_str2com(const char *str) { struct community *com = NULL; struct community *com_sort = NULL; - u_int32_t val = 0; + uint32_t val = 0; enum community_token token = community_token_unknown; do { diff --git a/bgpd/bgp_community.h b/bgpd/bgp_community.h index 5016f132f..c180bea46 100644 --- a/bgpd/bgp_community.h +++ b/bgpd/bgp_community.h @@ -32,7 +32,7 @@ struct community { int size; /* Communities value. */ - u_int32_t *val; + uint32_t *val; /* Communities as a json object */ json_object *json; @@ -60,7 +60,7 @@ extern void community_init(void); extern void community_finish(void); extern void community_free(struct community *); extern struct community *community_uniq_sort(struct community *); -extern struct community *community_parse(u_int32_t *, u_short); +extern struct community *community_parse(uint32_t *, unsigned short); extern struct community *community_intern(struct community *); extern void community_unintern(struct community **); extern char *community_str(struct community *, bool make_json); @@ -73,10 +73,10 @@ extern struct community *community_merge(struct community *, extern struct community *community_delete(struct community *, struct community *); extern struct community *community_dup(struct community *); -extern int community_include(struct community *, u_int32_t); -extern void community_del_val(struct community *, u_int32_t *); +extern int community_include(struct community *, uint32_t); +extern void community_del_val(struct community *, uint32_t *); extern unsigned long community_count(void); extern struct hash *community_hash(void); -extern u_int32_t community_val_get(struct community *com, int i); +extern uint32_t community_val_get(struct community *com, int i); #endif /* _QUAGGA_BGP_COMMUNITY_H */ diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c index e2f97bf4f..1ed557e07 100644 --- a/bgpd/bgp_damp.c +++ b/bgpd/bgp_damp.c @@ -523,7 +523,7 @@ void bgp_config_write_damp(struct vty *vty) } static const char *bgp_get_reuse_time(unsigned int penalty, char *buf, - size_t len, u_char use_json, + size_t len, uint8_t use_json, json_object *json) { time_t reuse_time = 0; @@ -641,7 +641,7 @@ void bgp_damp_info_vty(struct vty *vty, struct bgp_info *binfo, } const char *bgp_damp_reuse_time_vty(struct vty *vty, struct bgp_info *binfo, - char *timebuf, size_t len, u_char use_json, + char *timebuf, size_t len, uint8_t use_json, json_object *json) { struct bgp_damp_info *bdi; diff --git a/bgpd/bgp_damp.h b/bgpd/bgp_damp.h index 1139ef839..d3b0ae42a 100644 --- a/bgpd/bgp_damp.h +++ b/bgpd/bgp_damp.h @@ -53,7 +53,7 @@ struct bgp_damp_info { int index; /* Last time message type. */ - u_char lastrecord; + uint8_t lastrecord; #define BGP_RECORD_UPDATE 1U #define BGP_RECORD_WITHDRAW 2U @@ -141,7 +141,7 @@ extern void bgp_config_write_damp(struct vty *); extern void bgp_damp_info_vty(struct vty *, struct bgp_info *, json_object *json_path); extern const char *bgp_damp_reuse_time_vty(struct vty *, struct bgp_info *, - char *, size_t, u_char, + char *, size_t, uint8_t, json_object *); extern int bgp_show_dampening_parameters(struct vty *vty, afi_t, safi_t); diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c index f86726695..54fcd47e4 100644 --- a/bgpd/bgp_debug.c +++ b/bgpd/bgp_debug.c @@ -469,13 +469,13 @@ const char *bgp_notify_subcode_str(char code, char subcode) } /* extract notify admin reason if correctly present */ -const char *bgp_notify_admin_message(char *buf, size_t bufsz, u_char *data, +const char *bgp_notify_admin_message(char *buf, size_t bufsz, uint8_t *data, size_t datalen) { if (!data || datalen < 1) return NULL; - u_char len = data[0]; + uint8_t len = data[0]; if (len > 128 || len > datalen - 1) return NULL; @@ -2159,8 +2159,8 @@ int bgp_debug_zebra(struct prefix *p) const char *bgp_debug_rdpfxpath2str(afi_t afi, safi_t safi, struct prefix_rd *prd, union prefixconstptr pu, - mpls_label_t *label, u_int32_t num_labels, - int addpath_valid, u_int32_t addpath_id, + mpls_label_t *label, uint32_t num_labels, + int addpath_valid, uint32_t addpath_id, char *str, int size) { char rd_buf[RD_ADDRSTRLEN]; @@ -2192,7 +2192,7 @@ const char *bgp_debug_rdpfxpath2str(afi_t afi, safi_t safi, bgp_evpn_label2str(label, num_labels, tag_buf2, 20); sprintf(tag_buf, " label %s", tag_buf2); } else { - u_int32_t label_value; + uint32_t label_value; label_value = decode_label(label); sprintf(tag_buf, " label %u", label_value); diff --git a/bgpd/bgp_debug.h b/bgpd/bgp_debug.h index fe7ca8c46..d5dee5991 100644 --- a/bgpd/bgp_debug.h +++ b/bgpd/bgp_debug.h @@ -161,9 +161,9 @@ extern int bgp_debug_zebra(struct prefix *p); extern int bgp_debug_count(void); extern const char *bgp_debug_rdpfxpath2str(afi_t, safi_t, struct prefix_rd *, union prefixconstptr, mpls_label_t *, - u_int32_t, int, u_int32_t, char *, + uint32_t, int, uint32_t, char *, int); -const char *bgp_notify_admin_message(char *buf, size_t bufsz, u_char *data, +const char *bgp_notify_admin_message(char *buf, size_t bufsz, uint8_t *data, size_t datalen); #endif /* _QUAGGA_BGP_DEBUG_H */ diff --git a/bgpd/bgp_dump.c b/bgpd/bgp_dump.c index 4e998b1fd..d69b1c46f 100644 --- a/bgpd/bgp_dump.c +++ b/bgpd/bgp_dump.c @@ -277,7 +277,7 @@ static void bgp_dump_routes_index_table(struct bgp *bgp) if (sockunion_family(&peer->su) == AF_INET) { stream_put_in_addr(obuf, &peer->su.sin.sin_addr); } else if (sockunion_family(&peer->su) == AF_INET6) { - stream_write(obuf, (u_char *)&peer->su.sin6.sin6_addr, + stream_write(obuf, (uint8_t *)&peer->su.sin6.sin6_addr, IPV6_MAX_BYTELEN); } @@ -329,12 +329,12 @@ static struct bgp_info *bgp_dump_route_node_record(int afi, struct bgp_node *rn, if (afi == AFI_IP) { /* We'll dump only the useful bits (those not 0), but have to * align on 8 bits */ - stream_write(obuf, (u_char *)&rn->p.u.prefix4, + stream_write(obuf, (uint8_t *)&rn->p.u.prefix4, (rn->p.prefixlen + 7) / 8); } else if (afi == AFI_IP6) { /* We'll dump only the useful bits (those not 0), but have to * align on 8 bits */ - stream_write(obuf, (u_char *)&rn->p.u.prefix6, + stream_write(obuf, (uint8_t *)&rn->p.u.prefix6, (rn->p.prefixlen + 7) / 8); } diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c index cea1c6baa..8b60ead38 100644 --- a/bgpd/bgp_ecommunity.c +++ b/bgpd/bgp_ecommunity.c @@ -68,7 +68,7 @@ static void ecommunity_hash_free(struct ecommunity *ecom) else return 0. */ int ecommunity_add_val(struct ecommunity *ecom, struct ecommunity_val *eval) { - u_int8_t *p; + uint8_t *p; int ret; int c; @@ -126,7 +126,7 @@ struct ecommunity *ecommunity_uniq_sort(struct ecommunity *ecom) } /* Parse Extended Communites Attribute in BGP packet. */ -struct ecommunity *ecommunity_parse(u_int8_t *pnt, u_short length) +struct ecommunity *ecommunity_parse(uint8_t *pnt, unsigned short length) { struct ecommunity tmp; struct ecommunity *new; @@ -283,8 +283,8 @@ enum ecommunity_token { * Encode BGP extended community from passed values. Supports types * defined in RFC 4360 and well-known sub-types. */ -static int ecommunity_encode(u_char type, u_char sub_type, int trans, as_t as, - struct in_addr ip, u_int32_t val, +static int ecommunity_encode(uint8_t type, uint8_t sub_type, int trans, as_t as, + struct in_addr ip, uint32_t val, struct ecommunity_val *eval) { assert(eval); @@ -338,8 +338,8 @@ static const char *ecommunity_gettoken(const char *str, char *endptr; struct in_addr ip; as_t as = 0; - u_int32_t val = 0; - u_char ecomm_type; + uint32_t val = 0; + uint8_t ecomm_type; char buf[INET_ADDRSTRLEN + 1]; /* Skip white space. */ @@ -547,7 +547,7 @@ struct ecommunity *ecommunity_str2com(const char *str, int type, return ecom; } -static int ecommunity_rt_soo_str(char *buf, u_int8_t *pnt, int type, +static int ecommunity_rt_soo_str(char *buf, uint8_t *pnt, int type, int sub_type, int format) { int len = 0; @@ -628,7 +628,7 @@ static int ecommunity_rt_soo_str(char *buf, u_int8_t *pnt, int type, char *ecommunity_ecom2str(struct ecommunity *ecom, int format, int filter) { int i; - u_int8_t *pnt; + uint8_t *pnt; int type = 0; int sub_type = 0; #define ECOMMUNITY_STR_DEFAULT_LEN 27 @@ -712,8 +712,8 @@ char *ecommunity_ecom2str(struct ecommunity *ecom, int format, int filter) (uint8_t)rmac.octet[5]); } else if (*pnt == ECOMMUNITY_EVPN_SUBTYPE_MACMOBILITY) { - u_int32_t seqnum; - u_char flags = *++pnt; + uint32_t seqnum; + uint8_t flags = *++pnt; memcpy(&seqnum, pnt + 2, 4); seqnum = ntohl(seqnum); @@ -774,7 +774,7 @@ int ecommunity_match(const struct ecommunity *ecom1, extern struct ecommunity_val *ecommunity_lookup(const struct ecommunity *ecom, uint8_t type, uint8_t subtype) { - u_int8_t *p; + uint8_t *p; int c; /* If the value already exists in the structure return 0. */ @@ -795,7 +795,7 @@ extern struct ecommunity_val *ecommunity_lookup(const struct ecommunity *ecom, extern int ecommunity_strip(struct ecommunity *ecom, uint8_t type, uint8_t subtype) { - u_int8_t *p; + uint8_t *p; int c, found = 0; /* When this is fist value, just add it. */ if (ecom == NULL || ecom->val == NULL) { diff --git a/bgpd/bgp_ecommunity.h b/bgpd/bgp_ecommunity.h index c967f8bd4..4cdb8b8ac 100644 --- a/bgpd/bgp_ecommunity.h +++ b/bgpd/bgp_ecommunity.h @@ -64,7 +64,7 @@ struct ecommunity { int size; /* Extended Communities value. */ - u_int8_t *val; + uint8_t *val; /* Human readable format string. */ char *str; @@ -90,7 +90,7 @@ struct ecommunity_val { /* * Encode BGP Route Target AS:nn. */ -static inline void encode_route_target_as(as_t as, u_int32_t val, +static inline void encode_route_target_as(as_t as, uint32_t val, struct ecommunity_val *eval) { eval->val[0] = ECOMMUNITY_ENCODE_AS; @@ -106,7 +106,7 @@ static inline void encode_route_target_as(as_t as, u_int32_t val, /* * Encode BGP Route Target IP:nn. */ -static inline void encode_route_target_ip(struct in_addr ip, u_int16_t val, +static inline void encode_route_target_ip(struct in_addr ip, uint16_t val, struct ecommunity_val *eval) { eval->val[0] = ECOMMUNITY_ENCODE_IP; @@ -119,7 +119,7 @@ static inline void encode_route_target_ip(struct in_addr ip, u_int16_t val, /* * Encode BGP Route Target AS4:nn. */ -static inline void encode_route_target_as4(as_t as, u_int16_t val, +static inline void encode_route_target_as4(as_t as, uint16_t val, struct ecommunity_val *eval) { eval->val[0] = ECOMMUNITY_ENCODE_AS4; @@ -135,7 +135,7 @@ static inline void encode_route_target_as4(as_t as, u_int16_t val, extern void ecommunity_init(void); extern void ecommunity_finish(void); extern void ecommunity_free(struct ecommunity **); -extern struct ecommunity *ecommunity_parse(u_int8_t *, u_short); +extern struct ecommunity *ecommunity_parse(uint8_t *, unsigned short); extern struct ecommunity *ecommunity_dup(struct ecommunity *); extern struct ecommunity *ecommunity_merge(struct ecommunity *, struct ecommunity *); diff --git a/bgpd/bgp_encap_types.h b/bgpd/bgp_encap_types.h index cf6f70cf5..8d1bf682a 100644 --- a/bgpd/bgp_encap_types.h +++ b/bgpd/bgp_encap_types.h @@ -82,7 +82,7 @@ struct bgp_tea_subtlv_color { /* per draft-rosen-idr-tunnel-encaps */ struct bgp_tea_subtlv_remote_endpoint { - u_char family; /* IPv4 or IPv6 */ + uint8_t family; /* IPv4 or IPv6 */ union { struct in_addr v4; struct in6_addr v6; diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index c1fc45f07..d9f99bc08 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -335,7 +335,7 @@ static int evpn_route_target_cmp(struct ecommunity *ecom1, static inline void mask_ecom_global_admin(struct ecommunity_val *dst, struct ecommunity_val *src) { - u_char type; + uint8_t type; type = src->val[0]; dst->val[0] = 0; @@ -488,7 +488,7 @@ static void evpn_convert_nexthop_to_ipv6(struct attr *attr) static int bgp_zebra_send_remote_macip(struct bgp *bgp, struct bgpevpn *vpn, struct prefix_evpn *p, struct in_addr remote_vtep_ip, int add, - u_char flags) + uint8_t flags) { struct stream *s; int ipa_len; @@ -603,7 +603,7 @@ static void build_evpn_type5_route_extcomm(struct bgp *bgp_vrf, memset(&ecom_encap, 0, sizeof(ecom_encap)); encode_encap_extcomm(tnl_type, &eval); ecom_encap.size = 1; - ecom_encap.val = (u_int8_t *)eval.val; + ecom_encap.val = (uint8_t *)eval.val; /* Add Encap */ attr->ecommunity = ecommunity_dup(&ecom_encap); @@ -653,7 +653,7 @@ static void build_evpn_route_extcomm(struct bgpevpn *vpn, struct attr *attr, bgp_encap_types tnl_type; struct listnode *node, *nnode; struct ecommunity *ecom; - u_int32_t seqnum; + uint32_t seqnum; struct list *vrf_export_rtl = NULL; /* Encap */ @@ -661,7 +661,7 @@ static void build_evpn_route_extcomm(struct bgpevpn *vpn, struct attr *attr, memset(&ecom_encap, 0, sizeof(ecom_encap)); encode_encap_extcomm(tnl_type, &eval); ecom_encap.size = 1; - ecom_encap.val = (u_int8_t *)eval.val; + ecom_encap.val = (uint8_t *)eval.val; /* Add Encap */ attr->ecommunity = ecommunity_dup(&ecom_encap); @@ -689,7 +689,7 @@ static void build_evpn_route_extcomm(struct bgpevpn *vpn, struct attr *attr, memset(&ecom_sticky, 0, sizeof(ecom_sticky)); encode_mac_mobility_extcomm(1, seqnum, &eval_sticky); ecom_sticky.size = 1; - ecom_sticky.val = (u_int8_t *)eval_sticky.val; + ecom_sticky.val = (uint8_t *)eval_sticky.val; attr->ecommunity = ecommunity_merge(attr->ecommunity, &ecom_sticky); } @@ -720,13 +720,13 @@ static void build_evpn_route_extcomm(struct bgpevpn *vpn, struct attr *attr, /* * Add MAC mobility extended community to attribute. */ -static void add_mac_mobility_to_attr(u_int32_t seq_num, struct attr *attr) +static void add_mac_mobility_to_attr(uint32_t seq_num, struct attr *attr) { struct ecommunity ecom_tmp; struct ecommunity_val eval; - u_int8_t *ecom_val_ptr; + uint8_t *ecom_val_ptr; int i; - u_int8_t *pnt; + uint8_t *pnt; int type = 0; int sub_type = 0; @@ -745,9 +745,8 @@ static void add_mac_mobility_to_attr(u_int32_t seq_num, struct attr *attr) if (type == ECOMMUNITY_ENCODE_EVPN && sub_type == ECOMMUNITY_EVPN_SUBTYPE_MACMOBILITY) { - ecom_val_ptr = - (u_int8_t *)(attr->ecommunity->val - + (i * 8)); + ecom_val_ptr = (uint8_t *)(attr->ecommunity->val + + (i * 8)); break; } } @@ -761,7 +760,7 @@ static void add_mac_mobility_to_attr(u_int32_t seq_num, struct attr *attr) else { memset(&ecom_tmp, 0, sizeof(ecom_tmp)); ecom_tmp.size = 1; - ecom_tmp.val = (u_int8_t *)eval.val; + ecom_tmp.val = (uint8_t *)eval.val; attr->ecommunity = ecommunity_merge(attr->ecommunity, &ecom_tmp); @@ -771,7 +770,7 @@ static void add_mac_mobility_to_attr(u_int32_t seq_num, struct attr *attr) /* Install EVPN route into zebra. */ static int evpn_zebra_install(struct bgp *bgp, struct bgpevpn *vpn, struct prefix_evpn *p, - struct in_addr remote_vtep_ip, u_char flags) + struct in_addr remote_vtep_ip, uint8_t flags) { int ret; @@ -848,7 +847,7 @@ static int evpn_route_select_install(struct bgp *bgp, struct bgpevpn *vpn, afi_t afi = AFI_L2VPN; safi_t safi = SAFI_EVPN; int ret = 0; - u_char flags = 0; + uint8_t flags = 0; /* Compute the best path. */ bgp_best_selection(bgp, rn, &bgp->maxpaths[afi][safi], &old_and_new, @@ -1111,15 +1110,15 @@ static int update_evpn_type5_route(struct bgp *bgp_vrf, struct prefix_evpn *evp, static int update_evpn_route_entry(struct bgp *bgp, struct bgpevpn *vpn, afi_t afi, safi_t safi, struct bgp_node *rn, struct attr *attr, int add, int vni_table, - struct bgp_info **ri, u_char flags) + struct bgp_info **ri, uint8_t flags) { struct bgp_info *tmp_ri; struct bgp_info *local_ri, *remote_ri; struct attr *attr_new; mpls_label_t label[BGP_MAX_LABELS]; - u_int32_t num_labels = 1; + uint32_t num_labels = 1; int route_change = 1; - u_char sticky = 0; + uint8_t sticky = 0; struct prefix_evpn *evp; *ri = NULL; @@ -1167,7 +1166,7 @@ static int update_evpn_route_entry(struct bgp *bgp, struct bgpevpn *vpn, * This will ensure that local routes are preferred for g/w macs */ if (remote_ri && !CHECK_FLAG(flags, ZEBRA_MACIP_TYPE_GW)) { - u_int32_t cur_seqnum; + uint32_t cur_seqnum; /* Add MM extended community to route. */ cur_seqnum = mac_mobility_seqnum(remote_ri->attr); @@ -1260,7 +1259,7 @@ static int update_evpn_route_entry(struct bgp *bgp, struct bgpevpn *vpn, * and schedule for processing. */ static int update_evpn_route(struct bgp *bgp, struct bgpevpn *vpn, - struct prefix_evpn *p, u_char flags) + struct prefix_evpn *p, uint8_t flags) { struct bgp_node *rn; struct attr attr; @@ -2083,8 +2082,8 @@ static int is_route_matching_for_vrf(struct bgp *bgp_vrf, struct bgp_info *ri) * matches, we're done. */ for (i = 0; i < ecom->size; i++) { - u_char *pnt; - u_char type, sub_type; + uint8_t *pnt; + uint8_t type, sub_type; struct ecommunity_val *eval; struct ecommunity_val eval_tmp; struct vrf_irt_node *irt; @@ -2150,8 +2149,8 @@ static int is_route_matching_for_vni(struct bgp *bgp, struct bgpevpn *vpn, * matches, we're done. */ for (i = 0; i < ecom->size; i++) { - u_char *pnt; - u_char type, sub_type; + uint8_t *pnt; + uint8_t type, sub_type; struct ecommunity_val *eval; struct ecommunity_val eval_tmp; struct irt_node *irt; @@ -2519,8 +2518,8 @@ static int install_uninstall_evpn_route(struct bgp *bgp, afi_t afi, safi_t safi, * the route into matching VNIs/VRFs. */ for (i = 0; i < ecom->size; i++) { - u_char *pnt; - u_char type, sub_type; + uint8_t *pnt; + uint8_t type, sub_type; struct ecommunity_val *eval; struct ecommunity_val eval_tmp; struct irt_node *irt; /* import rt for l2vni */ @@ -2806,15 +2805,15 @@ static void withdraw_router_id_vni(struct hash_backet *backet, struct bgp *bgp) * Process received EVPN type-2 route (advertise or withdraw). */ static int process_type2_route(struct peer *peer, afi_t afi, safi_t safi, - struct attr *attr, u_char *pfx, int psize, - u_int32_t addpath_id) + struct attr *attr, uint8_t *pfx, int psize, + uint32_t addpath_id) { struct prefix_rd prd; struct prefix_evpn p; - u_char ipaddr_len; - u_char macaddr_len; + uint8_t ipaddr_len; + uint8_t macaddr_len; mpls_label_t label[BGP_MAX_LABELS]; /* holds the VNI(s) as in packet */ - u_int32_t num_labels = 0; + uint32_t num_labels = 0; int ret; /* Type-2 route should be either 33, 37 or 49 bytes or an @@ -2915,12 +2914,12 @@ static int process_type2_route(struct peer *peer, afi_t afi, safi_t safi, * Process received EVPN type-3 route (advertise or withdraw). */ static int process_type3_route(struct peer *peer, afi_t afi, safi_t safi, - struct attr *attr, u_char *pfx, int psize, - u_int32_t addpath_id) + struct attr *attr, uint8_t *pfx, int psize, + uint32_t addpath_id) { struct prefix_rd prd; struct prefix_evpn p; - u_char ipaddr_len; + uint8_t ipaddr_len; int ret; /* Type-3 route should be either 17 or 29 bytes: RD (8), Eth Tag (4), @@ -2988,14 +2987,14 @@ static int process_type3_route(struct peer *peer, afi_t afi, safi_t safi, * Process received EVPN type-5 route (advertise or withdraw). */ static int process_type5_route(struct peer *peer, afi_t afi, safi_t safi, - struct attr *attr, u_char *pfx, int psize, - u_int32_t addpath_id, int withdraw) + struct attr *attr, uint8_t *pfx, int psize, + uint32_t addpath_id, int withdraw) { struct prefix_rd prd; struct prefix_evpn p; struct bgp_route_evpn evpn; - u_char ippfx_len; - u_int32_t eth_tag; + uint8_t ippfx_len; + uint32_t eth_tag; mpls_label_t label; /* holds the VNI as in the packet */ int ret; @@ -3087,7 +3086,7 @@ static int process_type5_route(struct peer *peer, afi_t afi, safi_t safi, static void evpn_mpattr_encode_type5(struct stream *s, struct prefix *p, struct prefix_rd *prd, mpls_label_t *label, - u_int32_t num_labels, struct attr *attr) + uint32_t num_labels, struct attr *attr) { int len; char temp[16]; @@ -3547,7 +3546,7 @@ int bgp_evpn_uninstall_routes(struct bgp *bgp, struct bgpevpn *vpn) /* * TODO: Hardcoded for a maximum of 2 VNIs right now */ -char *bgp_evpn_label2str(mpls_label_t *label, u_int32_t num_labels, char *buf, +char *bgp_evpn_label2str(mpls_label_t *label, uint32_t num_labels, char *buf, int len) { vni_t vni1, vni2; @@ -3596,7 +3595,7 @@ void bgp_evpn_route2json(struct prefix_evpn *p, json_object *json) buf1, sizeof(buf1))); } else { - u_char family; + uint8_t family; family = IS_EVPN_PREFIX_IPADDR_V4(p) ? AF_INET : AF_INET6; @@ -3647,7 +3646,7 @@ char *bgp_evpn_route2str(struct prefix_evpn *p, char *buf, int len) prefix_mac2str(&p->prefix.mac, buf1, sizeof(buf1))); else { - u_char family; + uint8_t family; family = IS_EVPN_PREFIX_IPADDR_V4(p) ? AF_INET : AF_INET6; @@ -3680,8 +3679,8 @@ char *bgp_evpn_route2str(struct prefix_evpn *p, char *buf, int len) */ void bgp_evpn_encode_prefix(struct stream *s, struct prefix *p, struct prefix_rd *prd, mpls_label_t *label, - u_int32_t num_labels, struct attr *attr, - int addpath_encode, u_int32_t addpath_tx_id) + uint32_t num_labels, struct attr *attr, + int addpath_encode, uint32_t addpath_tx_id) { struct prefix_evpn *evp = (struct prefix_evpn *)p; int len, ipa_len = 0; @@ -3740,15 +3739,15 @@ void bgp_evpn_encode_prefix(struct stream *s, struct prefix *p, int bgp_nlri_parse_evpn(struct peer *peer, struct attr *attr, struct bgp_nlri *packet, int withdraw) { - u_char *pnt; - u_char *lim; + uint8_t *pnt; + uint8_t *lim; afi_t afi; safi_t safi; - u_int32_t addpath_id; + uint32_t addpath_id; int addpath_encoded; int psize = 0; - u_char rtype; - u_char rlen; + uint8_t rtype; + uint8_t rlen; struct prefix p; /* Start processing the NLRI - there may be multiple in the MP_REACH */ @@ -4192,7 +4191,7 @@ int bgp_evpn_local_macip_del(struct bgp *bgp, vni_t vni, struct ethaddr *mac, * Handle add of a local MACIP. */ int bgp_evpn_local_macip_add(struct bgp *bgp, vni_t vni, struct ethaddr *mac, - struct ipaddr *ip, u_char flags) + struct ipaddr *ip, uint8_t flags) { struct bgpevpn *vpn; struct prefix_evpn p; diff --git a/bgpd/bgp_evpn.h b/bgpd/bgp_evpn.h index 7c0d63832..343327a66 100644 --- a/bgpd/bgp_evpn.h +++ b/bgpd/bgp_evpn.h @@ -36,7 +36,7 @@ static inline int is_evpn_enabled(void) static inline void vni2label(vni_t vni, mpls_label_t *label) { - u_char *tag = (u_char *)label; + uint8_t *tag = (uint8_t *)label; tag[0] = (vni >> 16) & 0xFF; tag[1] = (vni >> 8) & 0xFF; @@ -45,12 +45,12 @@ static inline void vni2label(vni_t vni, mpls_label_t *label) static inline vni_t label2vni(mpls_label_t *label) { - u_char *tag = (u_char *)label; + uint8_t *tag = (uint8_t *)label; vni_t vni; - vni = ((u_int32_t)*tag++ << 16); - vni |= (u_int32_t)*tag++ << 8; - vni |= (u_int32_t)(*tag & 0xFF); + vni = ((uint32_t)*tag++ << 16); + vni |= (uint32_t)*tag++ << 8; + vni |= (uint32_t)(*tag & 0xFF); return vni; } @@ -86,14 +86,14 @@ extern void bgp_evpn_advertise_type5_routes(struct bgp *bgp_vrf, afi_t afi, safi_t safi); extern void bgp_evpn_vrf_delete(struct bgp *bgp_vrf); extern void bgp_evpn_handle_router_id_update(struct bgp *bgp, int withdraw); -extern char *bgp_evpn_label2str(mpls_label_t *label, u_int32_t num_labels, +extern char *bgp_evpn_label2str(mpls_label_t *label, uint32_t num_labels, char *buf, int len); extern char *bgp_evpn_route2str(struct prefix_evpn *p, char *buf, int len); extern void bgp_evpn_route2json(struct prefix_evpn *p, json_object *json); extern void bgp_evpn_encode_prefix(struct stream *s, struct prefix *p, struct prefix_rd *prd, mpls_label_t *label, - u_int32_t num_labels, struct attr *attr, - int addpath_encode, u_int32_t addpath_tx_id); + uint32_t num_labels, struct attr *attr, + int addpath_encode, uint32_t addpath_tx_id); extern int bgp_nlri_parse_evpn(struct peer *peer, struct attr *attr, struct bgp_nlri *packet, int withdraw); extern int bgp_evpn_import_route(struct bgp *bgp, afi_t afi, safi_t safi, @@ -105,7 +105,7 @@ extern int bgp_evpn_local_macip_del(struct bgp *bgp, vni_t vni, struct ethaddr *mac, struct ipaddr *ip); extern int bgp_evpn_local_macip_add(struct bgp *bgp, vni_t vni, struct ethaddr *mac, struct ipaddr *ip, - u_char flags); + uint8_t flags); extern int bgp_evpn_local_l3vni_add(vni_t vni, vrf_id_t vrf_id, struct ethaddr *rmac, struct in_addr originator_ip, int filter); diff --git a/bgpd/bgp_evpn_private.h b/bgpd/bgp_evpn_private.h index ce279005d..1eecb9ecf 100644 --- a/bgpd/bgp_evpn_private.h +++ b/bgpd/bgp_evpn_private.h @@ -55,7 +55,7 @@ typedef enum { struct bgpevpn { vni_t vni; vrf_id_t tenant_vrf_id; - u_int32_t flags; + uint32_t flags; #define VNI_FLAG_CFGD 0x1 /* VNI is user configured */ #define VNI_FLAG_LIVE 0x2 /* VNI is "live" */ #define VNI_FLAG_RD_CFGD 0x4 /* RD is user configured. */ @@ -69,31 +69,31 @@ struct bgpevpn { /* Flag to indicate if we are * advertising the g/w mac ip for * this VNI*/ - u_int8_t advertise_gw_macip; + uint8_t advertise_gw_macip; - /* Flag to indicate if we are - * advertising subnet for this VNI */ - u_int8_t advertise_subnet; + /* Flag to indicate if we are + * advertising subnet for this VNI */ + uint8_t advertise_subnet; - /* Id for deriving the RD - * automatically for this VNI */ - u_int16_t rd_id; + /* Id for deriving the RD + * automatically for this VNI */ + uint16_t rd_id; - /* RD for this VNI. */ - struct prefix_rd prd; + /* RD for this VNI. */ + struct prefix_rd prd; - /* Route type 3 field */ - struct in_addr originator_ip; + /* Route type 3 field */ + struct in_addr originator_ip; - /* Import and Export RTs. */ - struct list *import_rtl; - struct list *export_rtl; + /* Import and Export RTs. */ + struct list *import_rtl; + struct list *export_rtl; - /* Route table for EVPN routes for - * this VNI. */ - struct bgp_table *route_table; + /* Route table for EVPN routes for + * this VNI. */ + struct bgp_table *route_table; - QOBJ_FIELDS + QOBJ_FIELDS }; DECLARE_QOBJ_TYPE(bgpevpn) @@ -254,7 +254,7 @@ static inline void encode_default_gw_extcomm(struct ecommunity_val *eval) eval->val[1] = ECOMMUNITY_EVPN_SUBTYPE_DEF_GW; } -static inline void encode_mac_mobility_extcomm(int static_mac, u_int32_t seq, +static inline void encode_mac_mobility_extcomm(int static_mac, uint32_t seq, struct ecommunity_val *eval) { memset(eval, 0, sizeof(*eval)); diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c index 3d77199bf..8fd7cb5d1 100644 --- a/bgpd/bgp_evpn_vty.c +++ b/bgpd/bgp_evpn_vty.c @@ -56,8 +56,8 @@ struct vni_walk_ctx { static void display_vrf_import_rt(struct vty *vty, struct vrf_irt_node *irt, json_object *json) { - u_char *pnt; - u_char type, sub_type; + uint8_t *pnt; + uint8_t type, sub_type; struct ecommunity_as eas; struct ecommunity_ip eip; struct listnode *node, *nnode; @@ -71,7 +71,7 @@ static void display_vrf_import_rt(struct vty *vty, struct vrf_irt_node *irt, json_vrfs = json_object_new_array(); } - pnt = (u_char *)&irt->rt.val; + pnt = (uint8_t *)&irt->rt.val; type = *pnt++; sub_type = *pnt++; if (sub_type != ECOMMUNITY_ROUTE_TARGET) @@ -164,8 +164,8 @@ static void show_vrf_import_rt_entry(struct hash_backet *backet, void *args[]) static void display_import_rt(struct vty *vty, struct irt_node *irt, json_object *json) { - u_char *pnt; - u_char type, sub_type; + uint8_t *pnt; + uint8_t type, sub_type; struct ecommunity_as eas; struct ecommunity_ip eip; struct listnode *node, *nnode; @@ -181,7 +181,7 @@ static void display_import_rt(struct vty *vty, struct irt_node *irt, /* TODO: This needs to go into a function */ - pnt = (u_char *)&irt->rt.val; + pnt = (uint8_t *)&irt->rt.val; type = *pnt++; sub_type = *pnt++; if (sub_type != ECOMMUNITY_ROUTE_TARGET) @@ -274,10 +274,10 @@ static void bgp_evpn_show_route_rd_header(struct vty *vty, struct bgp_node *rd_rn, json_object *json) { - u_int16_t type; + uint16_t type; struct rd_as rd_as; struct rd_ip rd_ip; - u_char *pnt; + uint8_t *pnt; char rd_str[RD_ADDRSTRLEN]; pnt = rd_rn->p.u.val; @@ -495,7 +495,7 @@ static void show_vni_routes(struct bgp *bgp, struct bgpevpn *vpn, int type, struct bgp_node *rn; struct bgp_info *ri; int header = 1; - u_int32_t prefix_cnt, path_cnt; + uint32_t prefix_cnt, path_cnt; prefix_cnt = path_cnt = 0; @@ -814,7 +814,7 @@ static void show_vni_entry(struct hash_backet *backet, void *args[]) static int bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd, enum bgp_show_type type, void *output_arg, - int option, u_char use_json) + int option, uint8_t use_json) { afi_t afi = AFI_L2VPN; struct bgp *bgp; @@ -930,10 +930,10 @@ static int bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd, header = 0; } if (rd_header) { - u_int16_t type; + uint16_t type; struct rd_as rd_as; struct rd_ip rd_ip; - u_char *pnt; + uint8_t *pnt; pnt = rn->p.u.val; @@ -1103,7 +1103,7 @@ DEFUN(show_ip_bgp_l2vpn_evpn_all_neighbor_routes, union sockunion su; struct peer *peer; int ret; - u_char uj = use_json(argc, argv); + uint8_t uj = use_json(argc, argv); argv_find(argv, argc, "A.B.C.D", &idx_ipv4); @@ -1163,7 +1163,7 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_routes, union sockunion su; struct peer *peer; struct prefix_rd prd; - u_char uj = use_json(argc, argv); + uint8_t uj = use_json(argc, argv); argv_find(argv, argc, "ASN:NN_OR_IP-ADDRESS:NN", &idx_ext_community); argv_find(argv, argc, "A.B.C.D", &idx_ipv4); @@ -1236,7 +1236,7 @@ DEFUN(show_ip_bgp_l2vpn_evpn_all_neighbor_advertised_routes, int ret; struct peer *peer; union sockunion su; - u_char uj = use_json(argc, argv); + uint8_t uj = use_json(argc, argv); argv_find(argv, argc, "A.B.C.D", &idx_ipv4); @@ -1294,7 +1294,7 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_advertised_routes, struct peer *peer; struct prefix_rd prd; union sockunion su; - u_char uj = use_json(argc, argv); + uint8_t uj = use_json(argc, argv); argv_find(argv, argc, "ASN:NN_OR_IP-ADDRESS:NN", &idx_ext_community); argv_find(argv, argc, "A.B.C.D", &idx_ipv4); @@ -1807,7 +1807,7 @@ static void evpn_show_import_rts(struct vty *vty, struct bgp *bgp, static void evpn_show_routes_vni_all(struct vty *vty, struct bgp *bgp, struct in_addr vtep_ip, json_object *json) { - u_int32_t num_vnis; + uint32_t num_vnis; struct vni_walk_ctx wctx; num_vnis = hashcount(bgp->vnihash); @@ -1834,7 +1834,7 @@ static void evpn_show_route_vni_multicast(struct vty *vty, struct bgp *bgp, struct prefix_evpn p; struct bgp_node *rn; struct bgp_info *ri; - u_int32_t path_cnt = 0; + uint32_t path_cnt = 0; afi_t afi; safi_t safi; json_object *json_paths = NULL; @@ -1903,7 +1903,7 @@ static void evpn_show_route_vni_macip(struct vty *vty, struct bgp *bgp, struct prefix_evpn p; struct bgp_node *rn; struct bgp_info *ri; - u_int32_t path_cnt = 0; + uint32_t path_cnt = 0; afi_t afi; safi_t safi; json_object *json_paths = NULL; @@ -1998,7 +1998,7 @@ static void evpn_show_route_rd_macip(struct vty *vty, struct bgp *bgp, struct bgp_info *ri; afi_t afi; safi_t safi; - u_int32_t path_cnt = 0; + uint32_t path_cnt = 0; json_object *json_paths = NULL; char prefix_str[BUFSIZ]; @@ -2065,7 +2065,7 @@ static void evpn_show_route_rd(struct vty *vty, struct bgp *bgp, int rd_header = 1; afi_t afi; safi_t safi; - u_int32_t prefix_cnt, path_cnt; + uint32_t prefix_cnt, path_cnt; char rd_str[RD_ADDRSTRLEN]; json_object *json_rd = NULL; int add_rd_to_json = 0; @@ -2187,7 +2187,7 @@ static void evpn_show_all_routes(struct vty *vty, struct bgp *bgp, int type, int rd_header; afi_t afi; safi_t safi; - u_int32_t prefix_cnt, path_cnt; + uint32_t prefix_cnt, path_cnt; afi = AFI_L2VPN; safi = SAFI_EVPN; @@ -2313,7 +2313,7 @@ static void evpn_show_all_routes(struct vty *vty, struct bgp *bgp, int type, static void evpn_show_vni(struct vty *vty, struct bgp *bgp, vni_t vni, json_object *json) { - u_char found = 0; + uint8_t found = 0; struct bgpevpn *vpn; vpn = bgp_evpn_lookup_vni(bgp, vni); @@ -2906,10 +2906,10 @@ DEFUN(show_bgp_l2vpn_evpn_vni, struct bgp *bgp_def; vni_t vni; int idx = 0; - u_char uj = 0; + uint8_t uj = 0; json_object *json = NULL; - u_int32_t num_l2vnis = 0; - u_int32_t num_l3vnis = 0; + uint32_t num_l2vnis = 0; + uint32_t num_l3vnis = 0; uint32_t num_vnis = 0; struct listnode *node = NULL; struct bgp *bgp_temp = NULL; @@ -2992,7 +2992,7 @@ DEFUN(show_bgp_l2vpn_evpn_summary, JSON_STR) { int idx_vrf = 0; - u_char uj = use_json(argc, argv); + uint8_t uj = use_json(argc, argv); char *vrf = NULL; if (argv_find(argv, argc, "vrf", &idx_vrf)) @@ -3020,7 +3020,7 @@ DEFUN(show_bgp_l2vpn_evpn_route, struct bgp *bgp; int type_idx = 0; int type = 0; - u_char uj = 0; + uint8_t uj = 0; json_object *json = NULL; uj = use_json(argc, argv); @@ -3472,7 +3472,7 @@ DEFUN(show_bgp_l2vpn_evpn_vrf_import_rt, "Show vrf import route target\n" JSON_STR) { - u_char uj = 0; + uint8_t uj = 0; struct bgp *bgp_def = NULL; json_object *json = NULL; @@ -3509,7 +3509,7 @@ DEFUN(show_bgp_l2vpn_evpn_import_rt, JSON_STR) { struct bgp *bgp; - u_char uj = 0; + uint8_t uj = 0; json_object *json = NULL; bgp = bgp_get_default(); @@ -3902,7 +3902,7 @@ DEFUN (show_bgp_vrf_l3vni_info, json_object *json_vnis = NULL; json_object *json_export_rts = NULL; json_object *json_import_rts = NULL; - u_char uj = use_json(argc, argv); + uint8_t uj = use_json(argc, argv); if (uj) { json = json_object_new_object(); diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index e4a0a1d40..a625b7fd2 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -166,8 +166,8 @@ static struct peer *peer_xfer_conn(struct peer *from_peer) zlog_err( "[%s] Dropping pending packet on connection transfer:", peer->host); - u_int16_t type = stream_getc_from(peer->curr, - BGP_MARKER_SIZE + 2); + uint16_t type = stream_getc_from(peer->curr, + BGP_MARKER_SIZE + 2); bgp_dump_packet(peer, type, peer->curr); stream_free(peer->curr); peer->curr = NULL; @@ -763,8 +763,8 @@ int bgp_maxmed_onstartup_active(struct bgp *bgp) void bgp_maxmed_update(struct bgp *bgp) { - u_char maxmed_active; - u_int32_t maxmed_value; + uint8_t maxmed_active; + uint32_t maxmed_value; if (bgp->v_maxmed_admin) { maxmed_active = 1; @@ -1199,7 +1199,8 @@ static int bgp_stop_with_error(struct peer *peer) /* something went wrong, send notify and tear down */ -static int bgp_stop_with_notify(struct peer *peer, u_char code, u_char sub_code) +static int bgp_stop_with_notify(struct peer *peer, uint8_t code, + uint8_t sub_code) { /* Send notify to remote peer */ bgp_notify_send(peer, code, sub_code); diff --git a/bgpd/bgp_io.c b/bgpd/bgp_io.c index 862199741..3882ff8b5 100644 --- a/bgpd/bgp_io.c +++ b/bgpd/bgp_io.c @@ -281,7 +281,7 @@ static int bgp_process_reads(struct thread *thread) */ static uint16_t bgp_write(struct peer *peer) { - u_char type; + uint8_t type; struct stream *s; int num; int update_last_write = 0; diff --git a/bgpd/bgp_label.c b/bgpd/bgp_label.c index 546ed0ed6..ceca644de 100644 --- a/bgpd/bgp_label.c +++ b/bgpd/bgp_label.c @@ -48,7 +48,7 @@ int bgp_parse_fec_update(void) struct bgp *bgp; struct bgp_table *table; struct prefix p; - u_int32_t label; + uint32_t label; afi_t afi; safi_t safi; @@ -124,7 +124,7 @@ void bgp_reg_dereg_for_label(struct bgp_node *rn, struct bgp_info *ri, int reg) struct stream *s; struct prefix *p; int command; - u_int16_t flags = 0; + uint16_t flags = 0; size_t flags_pos = 0; /* Check socket. */ @@ -164,13 +164,13 @@ void bgp_reg_dereg_for_label(struct bgp_node *rn, struct bgp_info *ri, int reg) zclient_send_message(zclient); } -static int bgp_nlri_get_labels(struct peer *peer, u_char *pnt, u_char plen, +static int bgp_nlri_get_labels(struct peer *peer, uint8_t *pnt, uint8_t plen, mpls_label_t *label) { - u_char *data = pnt; - u_char *lim = pnt + plen; - u_char llen = 0; - u_char label_depth = 0; + uint8_t *data = pnt; + uint8_t *lim = pnt + plen; + uint8_t llen = 0; + uint8_t label_depth = 0; for (; data < lim; data += BGP_LABEL_BYTES) { memcpy(label, data, BGP_LABEL_BYTES); @@ -200,17 +200,17 @@ static int bgp_nlri_get_labels(struct peer *peer, u_char *pnt, u_char plen, int bgp_nlri_parse_label(struct peer *peer, struct attr *attr, struct bgp_nlri *packet) { - u_char *pnt; - u_char *lim; + uint8_t *pnt; + uint8_t *lim; struct prefix p; int psize = 0; int prefixlen; afi_t afi; safi_t safi; int addpath_encoded; - u_int32_t addpath_id; + uint32_t addpath_id; mpls_label_t label = MPLS_INVALID_LABEL; - u_char llen; + uint8_t llen; pnt = packet->nlri; lim = pnt + packet->length; diff --git a/bgpd/bgp_label.h b/bgpd/bgp_label.h index 0b5eaa712..01bf8b372 100644 --- a/bgpd/bgp_label.h +++ b/bgpd/bgp_label.h @@ -51,7 +51,7 @@ static inline int bgp_labeled_safi(safi_t safi) static inline int bgp_is_withdraw_label(mpls_label_t *label) { - u_char *pkt = (u_char *)label; + uint8_t *pkt = (uint8_t *)label; /* The check on pkt[2] for 0x00 or 0x02 is in case bgp_set_valid_label() * was called on the withdraw label */ @@ -63,7 +63,7 @@ static inline int bgp_is_withdraw_label(mpls_label_t *label) static inline int bgp_is_valid_label(mpls_label_t *label) { - u_char *t = (u_char *)label; + uint8_t *t = (uint8_t *)label; if (!t) return 0; return (t[2] & 0x02); @@ -71,14 +71,14 @@ static inline int bgp_is_valid_label(mpls_label_t *label) static inline void bgp_set_valid_label(mpls_label_t *label) { - u_char *t = (u_char *)label; + uint8_t *t = (uint8_t *)label; if (t) t[2] |= 0x02; } static inline void bgp_unset_valid_label(mpls_label_t *label) { - u_char *t = (u_char *)label; + uint8_t *t = (uint8_t *)label; if (t) t[2] &= ~0x02; } @@ -95,17 +95,17 @@ static inline void bgp_unregister_for_label(struct bgp_node *rn) } /* Label stream to value */ -static inline u_int32_t label_pton(mpls_label_t *label) +static inline uint32_t label_pton(mpls_label_t *label) { - u_char *t = (u_char *)label; + uint8_t *t = (uint8_t *)label; return ((((unsigned int)t[0]) << 12) | (((unsigned int)t[1]) << 4) | ((unsigned int)((t[2] & 0xF0) >> 4))); } /* Encode label values */ -static inline void label_ntop(u_int32_t l, int bos, mpls_label_t *label) +static inline void label_ntop(uint32_t l, int bos, mpls_label_t *label) { - u_char *t = (u_char *)label; + uint8_t *t = (uint8_t *)label; t[0] = ((l & 0x000FF000) >> 12); t[1] = ((l & 0x00000FF0) >> 4); t[2] = ((l & 0x0000000F) << 4); @@ -114,9 +114,9 @@ static inline void label_ntop(u_int32_t l, int bos, mpls_label_t *label) } /* Return BOS value of label stream */ -static inline u_char label_bos(mpls_label_t *label) +static inline uint8_t label_bos(mpls_label_t *label) { - u_char *t = (u_char *)label; + uint8_t *t = (uint8_t *)label; return (t[2] & 0x01); }; diff --git a/bgpd/bgp_lcommunity.c b/bgpd/bgp_lcommunity.c index 36980b7c2..09b3a8718 100644 --- a/bgpd/bgp_lcommunity.c +++ b/bgpd/bgp_lcommunity.c @@ -66,7 +66,7 @@ static void lcommunity_hash_free(struct lcommunity *lcom) static int lcommunity_add_val(struct lcommunity *lcom, struct lcommunity_val *lval) { - u_int8_t *p; + uint8_t *p; int ret; int c; @@ -124,7 +124,7 @@ struct lcommunity *lcommunity_uniq_sort(struct lcommunity *lcom) } /* Parse Large Communites Attribute in BGP packet. */ -struct lcommunity *lcommunity_parse(u_int8_t *pnt, u_short length) +struct lcommunity *lcommunity_parse(uint8_t *pnt, unsigned short length) { struct lcommunity tmp; struct lcommunity *new; @@ -291,9 +291,9 @@ static const char *lcommunity_gettoken(const char *str, if (isdigit((int)*p)) { int separator = 0; int digit = 0; - u_int32_t globaladmin = 0; - u_int32_t localdata1 = 0; - u_int32_t localdata2 = 0; + uint32_t globaladmin = 0; + uint32_t localdata1 = 0; + uint32_t localdata2 = 0; while (isdigit((int)*p) || *p == ':') { if (*p == ':') { @@ -375,10 +375,10 @@ struct lcommunity *lcommunity_str2com(const char *str) return lcom; } -int lcommunity_include(struct lcommunity *lcom, u_char *ptr) +int lcommunity_include(struct lcommunity *lcom, uint8_t *ptr) { int i; - u_char *lcom_ptr; + uint8_t *lcom_ptr; for (i = 0; i < lcom->size; i++) { lcom_ptr = lcom->val + (i * LCOMMUNITY_SIZE); @@ -394,14 +394,14 @@ int lcommunity_include(struct lcommunity *lcom, u_char *ptr) char *lcommunity_lcom2str(struct lcommunity *lcom, int format) { int i; - u_int8_t *pnt; + uint8_t *pnt; #define LCOMMUNITY_STR_DEFAULT_LEN 40 int str_size; int str_pnt; char *str_buf; int len = 0; int first = 1; - u_int32_t globaladmin, localdata1, localdata2; + uint32_t globaladmin, localdata1, localdata2; if (lcom->size == 0) { str_buf = XMALLOC(MTYPE_LCOMMUNITY_STR, 1); @@ -472,7 +472,7 @@ int lcommunity_match(const struct lcommunity *lcom1, } /* Delete one lcommunity. */ -void lcommunity_del_val(struct lcommunity *lcom, u_char *ptr) +void lcommunity_del_val(struct lcommunity *lcom, uint8_t *ptr) { int i = 0; int c = 0; diff --git a/bgpd/bgp_lcommunity.h b/bgpd/bgp_lcommunity.h index 7576d7a98..78841accf 100644 --- a/bgpd/bgp_lcommunity.h +++ b/bgpd/bgp_lcommunity.h @@ -38,7 +38,7 @@ struct lcommunity { int size; /* Large Communities value. */ - u_int8_t *val; + uint8_t *val; /* Human readable format string. */ char *str; @@ -54,7 +54,7 @@ struct lcommunity_val { extern void lcommunity_init(void); extern void lcommunity_finish(void); extern void lcommunity_free(struct lcommunity **); -extern struct lcommunity *lcommunity_parse(u_int8_t *, u_short); +extern struct lcommunity *lcommunity_parse(uint8_t *, unsigned short); extern struct lcommunity *lcommunity_dup(struct lcommunity *); extern struct lcommunity *lcommunity_merge(struct lcommunity *, struct lcommunity *); @@ -69,6 +69,6 @@ extern char *lcommunity_lcom2str(struct lcommunity *, int); extern int lcommunity_match(const struct lcommunity *, const struct lcommunity *); extern char *lcommunity_str(struct lcommunity *); -extern int lcommunity_include(struct lcommunity *lcom, u_char *ptr); -extern void lcommunity_del_val(struct lcommunity *lcom, u_char *ptr); +extern int lcommunity_include(struct lcommunity *lcom, uint8_t *ptr); +extern void lcommunity_del_val(struct lcommunity *lcom, uint8_t *ptr); #endif /* _QUAGGA_BGP_LCOMMUNITY_H */ diff --git a/bgpd/bgp_mpath.c b/bgpd/bgp_mpath.c index 667be5084..e33f3d347 100644 --- a/bgpd/bgp_mpath.c +++ b/bgpd/bgp_mpath.c @@ -46,7 +46,7 @@ * Record maximum-paths configuration for BGP instance */ int bgp_maximum_paths_set(struct bgp *bgp, afi_t afi, safi_t safi, int peertype, - u_int16_t maxpaths, u_int16_t options) + uint16_t maxpaths, uint16_t options) { if (!bgp || (afi >= AFI_MAX) || (safi >= SAFI_MAX)) return -1; @@ -370,7 +370,7 @@ struct bgp_info *bgp_info_mpath_first(struct bgp_info *binfo) * * Given the bestpath bgp_info, return the number of multipath entries */ -u_int32_t bgp_info_mpath_count(struct bgp_info *binfo) +uint32_t bgp_info_mpath_count(struct bgp_info *binfo) { if (!binfo->mpath) return 0; @@ -382,7 +382,7 @@ u_int32_t bgp_info_mpath_count(struct bgp_info *binfo) * * Sets the count of multipaths into bestpath's mpath element */ -static void bgp_info_mpath_count_set(struct bgp_info *binfo, u_int32_t count) +static void bgp_info_mpath_count_set(struct bgp_info *binfo, uint32_t count) { struct bgp_info_mpath *mpath; if (!count && !binfo->mpath) @@ -432,7 +432,7 @@ void bgp_info_mpath_update(struct bgp_node *rn, struct bgp_info *new_best, struct bgp_info *old_best, struct list *mp_list, struct bgp_maxpaths_cfg *mpath_cfg) { - u_int16_t maxpaths, mpath_count, old_mpath_count; + uint16_t maxpaths, mpath_count, old_mpath_count; struct listnode *mp_node, *mp_next_node; struct bgp_info *cur_mpath, *new_mpath, *next_mpath, *prev_mpath; int mpath_changed, debug; @@ -677,7 +677,7 @@ void bgp_info_mpath_aggregate_update(struct bgp_info *new_best, struct aspath *aspath; struct aspath *asmerge; struct attr *new_attr, *old_attr; - u_char origin; + uint8_t origin; struct community *community, *commerge; struct ecommunity *ecomm, *ecommerge; struct lcommunity *lcomm, *lcommerge; diff --git a/bgpd/bgp_mpath.h b/bgpd/bgp_mpath.h index 48af14eb7..1fa11d3d0 100644 --- a/bgpd/bgp_mpath.h +++ b/bgpd/bgp_mpath.h @@ -36,15 +36,15 @@ struct bgp_info_mpath { struct bgp_info *mp_info; /* When attached to best path, the number of selected multipaths */ - u_int32_t mp_count; + uint32_t mp_count; /* Aggregated attribute for advertising multipath route */ struct attr *mp_attr; }; /* Functions to support maximum-paths configuration */ -extern int bgp_maximum_paths_set(struct bgp *, afi_t, safi_t, int, u_int16_t, - u_int16_t); +extern int bgp_maximum_paths_set(struct bgp *, afi_t, safi_t, int, uint16_t, + uint16_t); extern int bgp_maximum_paths_unset(struct bgp *, afi_t, safi_t, int); /* Functions used by bgp_best_selection to record current @@ -70,7 +70,7 @@ extern struct bgp_info *bgp_info_mpath_first(struct bgp_info *); extern struct bgp_info *bgp_info_mpath_next(struct bgp_info *); /* Accessors for multipath information */ -extern u_int32_t bgp_info_mpath_count(struct bgp_info *); +extern uint32_t bgp_info_mpath_count(struct bgp_info *); extern struct attr *bgp_info_mpath_attr(struct bgp_info *); #endif /* _QUAGGA_BGP_MPATH_H */ diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index 9f740db32..57aeb9177 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -70,20 +70,20 @@ extern int argv_find_and_parse_vpnvx(struct cmd_token **argv, int argc, return ret; } -u_int32_t decode_label(mpls_label_t *label_pnt) +uint32_t decode_label(mpls_label_t *label_pnt) { - u_int32_t l; - u_char *pnt = (u_char *)label_pnt; + uint32_t l; + uint8_t *pnt = (uint8_t *)label_pnt; - l = ((u_int32_t)*pnt++ << 12); - l |= (u_int32_t)*pnt++ << 4; - l |= (u_int32_t)((*pnt & 0xf0) >> 4); + l = ((uint32_t)*pnt++ << 12); + l |= (uint32_t)*pnt++ << 4; + l |= (uint32_t)((*pnt & 0xf0) >> 4); return l; } void encode_label(mpls_label_t label, mpls_label_t *label_pnt) { - u_char *pnt = (u_char *)label_pnt; + uint8_t *pnt = (uint8_t *)label_pnt; if (pnt == NULL) return; *pnt++ = (label >> 12) & 0xff; @@ -94,12 +94,12 @@ void encode_label(mpls_label_t label, mpls_label_t *label_pnt) int bgp_nlri_parse_vpn(struct peer *peer, struct attr *attr, struct bgp_nlri *packet) { - u_char *pnt; - u_char *lim; + uint8_t *pnt; + uint8_t *lim; struct prefix p; int psize = 0; int prefixlen; - u_int16_t type; + uint16_t type; struct rd_as rd_as; struct rd_ip rd_ip; struct prefix_rd prd; @@ -107,7 +107,7 @@ int bgp_nlri_parse_vpn(struct peer *peer, struct attr *attr, afi_t afi; safi_t safi; int addpath_encoded; - u_int32_t addpath_id; + uint32_t addpath_id; /* Make prefix_rd */ prd.family = AF_UNSPEC; @@ -340,8 +340,8 @@ static int ecom_intersect(struct ecommunity *e1, struct ecommunity *e2) static struct bgp_info * leak_update(struct bgp *bgp, /* destination bgp instance */ struct bgp_node *bn, struct attr *new_attr, /* already interned */ - afi_t afi, safi_t safi, struct bgp_info *source_bi, u_char type, - u_char sub_type, mpls_label_t *label, int num_labels, void *parent, + afi_t afi, safi_t safi, struct bgp_info *source_bi, uint8_t type, + uint8_t sub_type, mpls_label_t *label, int num_labels, void *parent, struct bgp *bgp_orig, struct prefix *nexthop_orig, int debug) { struct prefix *p = &bn->p; @@ -1307,7 +1307,7 @@ DEFUN (no_vpnv6_network, int bgp_show_mpls_vpn(struct vty *vty, afi_t afi, struct prefix_rd *prd, enum bgp_show_type type, void *output_arg, int tags, - u_char use_json) + uint8_t use_json) { struct bgp *bgp; struct bgp_table *table; @@ -1485,7 +1485,7 @@ DEFUN (show_ip_bgp_vpn_all_neighbor_routes, union sockunion su; struct peer *peer; int ret; - u_char uj = use_json(argc, argv); + uint8_t uj = use_json(argc, argv); afi_t afi; int idx = 0; @@ -1549,7 +1549,7 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_routes, union sockunion su; struct peer *peer; struct prefix_rd prd; - u_char uj = use_json(argc, argv); + uint8_t uj = use_json(argc, argv); afi_t afi; int idx = 0; @@ -1627,7 +1627,7 @@ DEFUN (show_ip_bgp_vpn_all_neighbor_advertised_routes, int ret; struct peer *peer; union sockunion su; - u_char uj = use_json(argc, argv); + uint8_t uj = use_json(argc, argv); afi_t afi; int idx = 0; @@ -1689,7 +1689,7 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_advertised_routes, struct peer *peer; struct prefix_rd prd; union sockunion su; - u_char uj = use_json(argc, argv); + uint8_t uj = use_json(argc, argv); afi_t afi; int idx = 0; diff --git a/bgpd/bgp_mplsvpn.h b/bgpd/bgp_mplsvpn.h index d35568b83..d8016af07 100644 --- a/bgpd/bgp_mplsvpn.h +++ b/bgpd/bgp_mplsvpn.h @@ -43,14 +43,14 @@ extern void bgp_mplsvpn_init(void); extern int bgp_nlri_parse_vpn(struct peer *, struct attr *, struct bgp_nlri *); -extern u_int32_t decode_label(mpls_label_t *); +extern uint32_t decode_label(mpls_label_t *); extern void encode_label(mpls_label_t, mpls_label_t *); extern int argv_find_and_parse_vpnvx(struct cmd_token **argv, int argc, int *index, afi_t *afi); extern int bgp_show_mpls_vpn(struct vty *vty, afi_t afi, struct prefix_rd *prd, enum bgp_show_type type, void *output_arg, - int tags, u_char use_json); + int tags, uint8_t use_json); extern void vpn_leak_from_vrf_update(struct bgp *bgp_vpn, struct bgp *bgp_vrf, struct bgp_info *info_vrf); diff --git a/bgpd/bgp_nexthop.h b/bgpd/bgp_nexthop.h index 2c5b2ab11..ed772868e 100644 --- a/bgpd/bgp_nexthop.h +++ b/bgpd/bgp_nexthop.h @@ -38,13 +38,13 @@ /* BGP nexthop cache value structure. */ struct bgp_nexthop_cache { /* IGP route's metric. */ - u_int32_t metric; + uint32_t metric; /* Nexthop number and nexthop linked list.*/ - u_char nexthop_num; + uint8_t nexthop_num; struct nexthop *nexthop; time_t last_update; - u_int16_t flags; + uint16_t flags; #define BGP_NEXTHOP_VALID (1 << 0) #define BGP_NEXTHOP_REGISTERED (1 << 1) @@ -53,7 +53,7 @@ struct bgp_nexthop_cache { #define BGP_STATIC_ROUTE (1 << 4) #define BGP_STATIC_ROUTE_EXACT_MATCH (1 << 5) - u_int16_t change_flags; + uint16_t change_flags; #define BGP_NEXTHOP_CHANGED (1 << 0) #define BGP_NEXTHOP_METRIC_CHANGED (1 << 1) diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c index 77fb61fbb..5ec63458f 100644 --- a/bgpd/bgp_open.c +++ b/bgpd/bgp_open.c @@ -51,8 +51,8 @@ Next, if we send capability to the peer we want to set my capabilty inforation at each peer. */ -void bgp_capability_vty_out(struct vty *vty, struct peer *peer, u_char use_json, - json_object *json_neigh) +void bgp_capability_vty_out(struct vty *vty, struct peer *peer, + uint8_t use_json, json_object *json_neigh) { char *pnt; char *end; @@ -271,8 +271,8 @@ static int bgp_capability_mp(struct peer *peer, struct capability_header *hdr) } static void bgp_capability_orf_not_support(struct peer *peer, iana_afi_t afi, - iana_safi_t safi, u_char type, - u_char mode) + iana_safi_t safi, uint8_t type, + uint8_t mode) { if (bgp_debug_neighbor_events(peer)) zlog_debug( @@ -295,15 +295,15 @@ static int bgp_capability_orf_entry(struct peer *peer, { struct stream *s = BGP_INPUT(peer); struct capability_mp_data mpc; - u_char num; + uint8_t num; iana_afi_t pkt_afi; afi_t afi; iana_safi_t pkt_safi; safi_t safi; - u_char type; - u_char mode; - u_int16_t sm_cap = 0; /* capability send-mode receive */ - u_int16_t rm_cap = 0; /* capability receive-mode receive */ + uint8_t type; + uint8_t mode; + uint16_t sm_cap = 0; /* capability send-mode receive */ + uint16_t rm_cap = 0; /* capability receive-mode receive */ int i; /* ORF Entry header */ @@ -433,7 +433,7 @@ static int bgp_capability_restart(struct peer *peer, struct capability_header *caphdr) { struct stream *s = BGP_INPUT(peer); - u_int16_t restart_flag_time; + uint16_t restart_flag_time; size_t end = stream_get_getp(s) + caphdr->length; /* Verify length is a multiple of 4 */ @@ -468,7 +468,7 @@ static int bgp_capability_restart(struct peer *peer, safi_t safi; iana_afi_t pkt_afi = stream_getw(s); iana_safi_t pkt_safi = stream_getc(s); - u_char flag = stream_getc(s); + uint8_t flag = stream_getc(s); /* Convert AFI, SAFI to internal values, check. */ if (bgp_map_afi_safi_iana2int(pkt_afi, pkt_safi, &afi, &safi)) { @@ -545,7 +545,7 @@ static int bgp_capability_addpath(struct peer *peer, safi_t safi; iana_afi_t pkt_afi = stream_getw(s); iana_safi_t pkt_safi = stream_getc(s); - u_char send_receive = stream_getc(s); + uint8_t send_receive = stream_getc(s); if (bgp_debug_neighbor_events(peer)) zlog_debug( @@ -659,7 +659,7 @@ static int bgp_capability_hostname(struct peer *peer, struct stream *s = BGP_INPUT(peer); char str[BGP_MAX_HOSTNAME + 1]; size_t end = stream_get_getp(s) + hdr->length; - u_char len; + uint8_t len; SET_FLAG(peer->cap, PEER_CAP_HOSTNAME_RCV); @@ -788,7 +788,7 @@ static const size_t cap_modsizes[] = { * capabilities were encountered. */ static int bgp_capability_parse(struct peer *peer, size_t length, - int *mp_capability, u_char **error) + int *mp_capability, uint8_t **error) { int ret; struct stream *s = BGP_INPUT(peer); @@ -798,7 +798,7 @@ static int bgp_capability_parse(struct peer *peer, size_t length, while (stream_get_getp(s) < end) { size_t start; - u_char *sp = stream_pnt(s); + uint8_t *sp = stream_pnt(s); struct capability_header caphdr; ret = 0; @@ -991,7 +991,7 @@ static int strict_capability_same(struct peer *peer) /* peek into option, stores ASN to *as4 if the AS4 capability was found. * Returns 0 if no as4 found, as4cap value otherwise. */ -as_t peek_for_as4_capability(struct peer *peer, u_char length) +as_t peek_for_as4_capability(struct peer *peer, uint8_t length) { struct stream *s = BGP_INPUT(peer); size_t orig_getp = stream_get_getp(s); @@ -1007,8 +1007,8 @@ as_t peek_for_as4_capability(struct peer *peer, u_char length) * correctly formatted options. */ while (stream_get_getp(s) < end) { - u_char opt_type; - u_char opt_length; + uint8_t opt_type; + uint8_t opt_length; /* Check the length. */ if (stream_get_getp(s) + 2 > end) @@ -1064,11 +1064,11 @@ end: * * @param[out] mp_capability @see bgp_capability_parse() for semantics. */ -int bgp_open_option_parse(struct peer *peer, u_char length, int *mp_capability) +int bgp_open_option_parse(struct peer *peer, uint8_t length, int *mp_capability) { int ret = 0; - u_char *error; - u_char error_data[BGP_MAX_PACKET_SIZE]; + uint8_t *error; + uint8_t error_data[BGP_MAX_PACKET_SIZE]; struct stream *s = BGP_INPUT(peer); size_t end = stream_get_getp(s) + length; @@ -1079,8 +1079,8 @@ int bgp_open_option_parse(struct peer *peer, u_char length, int *mp_capability) peer->host, length); while (stream_get_getp(s) < end) { - u_char opt_type; - u_char opt_length; + uint8_t opt_type; + uint8_t opt_length; /* Must have at least an OPEN option header */ if (STREAM_READABLE(s) < 2) { @@ -1192,10 +1192,10 @@ int bgp_open_option_parse(struct peer *peer, u_char length, int *mp_capability) } static void bgp_open_capability_orf(struct stream *s, struct peer *peer, - afi_t afi, safi_t safi, u_char code) + afi_t afi, safi_t safi, uint8_t code) { - u_char cap_len; - u_char orf_len; + uint8_t cap_len; + uint8_t orf_len; unsigned long capp; unsigned long orfp; unsigned long numberp; @@ -1262,15 +1262,15 @@ static void bgp_open_capability_orf(struct stream *s, struct peer *peer, /* Fill in capability open option to the packet. */ void bgp_open_capability(struct stream *s, struct peer *peer) { - u_char len; + uint8_t len; unsigned long cp, capp, rcapp; iana_afi_t pkt_afi; afi_t afi; safi_t safi; iana_safi_t pkt_safi; as_t local_as; - u_int32_t restart_time; - u_char afi_safi_count = 0; + uint32_t restart_time; + uint8_t afi_safi_count = 0; int adv_addpath_tx = 0; /* Remember current pointer for Opt Parm Len. */ diff --git a/bgpd/bgp_open.h b/bgpd/bgp_open.h index 83b79a589..c92fd9b0a 100644 --- a/bgpd/bgp_open.h +++ b/bgpd/bgp_open.h @@ -23,14 +23,14 @@ /* Standard header for capability TLV */ struct capability_header { - u_char code; - u_char length; + uint8_t code; + uint8_t length; }; /* Generic MP capability data */ struct capability_mp_data { uint16_t afi; /* iana_afi_t */ - u_char reserved; + uint8_t reserved; uint8_t safi; /* iana_safi_t */ }; @@ -41,11 +41,11 @@ struct capability_as4 { struct graceful_restart_af { afi_t afi; safi_t safi; - u_char flag; + uint8_t flag; }; struct capability_gr { - u_int16_t restart_flag_time; + uint16_t restart_flag_time; struct graceful_restart_af gr[]; }; @@ -93,10 +93,10 @@ struct capability_gr { #define RESTART_R_BIT 0x8000 #define RESTART_F_BIT 0x80 -extern int bgp_open_option_parse(struct peer *, u_char, int *); +extern int bgp_open_option_parse(struct peer *, uint8_t, int *); extern void bgp_open_capability(struct stream *, struct peer *); -extern void bgp_capability_vty_out(struct vty *, struct peer *, u_char, +extern void bgp_capability_vty_out(struct vty *, struct peer *, uint8_t, json_object *); -extern as_t peek_for_as4_capability(struct peer *, u_char); +extern as_t peek_for_as4_capability(struct peer *, uint8_t); #endif /* _QUAGGA_BGP_OPEN_H */ diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index d17c33441..3c7bb65fd 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -67,7 +67,7 @@ * @param type the packet type * @return the size of the stream */ -int bgp_packet_set_marker(struct stream *s, u_char type) +int bgp_packet_set_marker(struct stream *s, uint8_t type) { int i; @@ -497,7 +497,7 @@ void bgp_keepalive_send(struct peer *peer) void bgp_open_send(struct peer *peer) { struct stream *s; - u_int16_t send_holdtime; + uint16_t send_holdtime; as_t local_as; if (PEER_OR_GROUP_TIMER_SET(peer)) @@ -518,9 +518,8 @@ void bgp_open_send(struct peer *peer) /* Set open packet values. */ stream_putc(s, BGP_VERSION_4); /* BGP version */ - stream_putw(s, - (local_as <= BGP_AS_MAX) ? (u_int16_t)local_as - : BGP_AS_TRANS); + stream_putw(s, (local_as <= BGP_AS_MAX) ? (uint16_t)local_as + : BGP_AS_TRANS); stream_putw(s, send_holdtime); /* Hold Time */ stream_put_in_addr(s, &peer->local_id); /* BGP Identifier */ @@ -560,7 +559,7 @@ void bgp_open_send(struct peer *peer) static int bgp_write_notify(struct peer *peer) { int ret, val; - u_char type; + uint8_t type; struct stream *s; /* There should be at least one packet. */ @@ -643,8 +642,8 @@ static int bgp_write_notify(struct peer *peer) * @param data Data portion * @param datalen length of data portion */ -void bgp_notify_send_with_data(struct peer *peer, u_char code, u_char sub_code, - u_char *data, size_t datalen) +void bgp_notify_send_with_data(struct peer *peer, uint8_t code, + uint8_t sub_code, uint8_t *data, size_t datalen) { struct stream *s; int length; @@ -753,7 +752,7 @@ void bgp_notify_send_with_data(struct peer *peer, u_char code, u_char sub_code, * @param code BGP error code * @param sub_code BGP error subcode */ -void bgp_notify_send(struct peer *peer, u_char code, u_char sub_code) +void bgp_notify_send(struct peer *peer, uint8_t code, uint8_t sub_code) { bgp_notify_send_with_data(peer, code, sub_code, NULL, 0); } @@ -769,7 +768,8 @@ void bgp_notify_send(struct peer *peer, u_char code, u_char sub_code) * @param remove Whether to remove ORF for specified AFI/SAFI */ void bgp_route_refresh_send(struct peer *peer, afi_t afi, safi_t safi, - u_char orf_type, u_char when_to_refresh, int remove) + uint8_t orf_type, uint8_t when_to_refresh, + int remove) { struct stream *s; struct bgp_filter *filter; @@ -800,7 +800,7 @@ void bgp_route_refresh_send(struct peer *peer, afi_t afi, safi_t safi, if (orf_type == ORF_TYPE_PREFIX || orf_type == ORF_TYPE_PREFIX_OLD) if (remove || filter->plist[FILTER_IN].plist) { - u_int16_t orf_len; + uint16_t orf_len; unsigned long orfp; orf_refresh = 1; @@ -1033,24 +1033,24 @@ static int bgp_collision_detect(struct peer *new, struct in_addr remote_id) static int bgp_open_receive(struct peer *peer, bgp_size_t size) { int ret; - u_char version; - u_char optlen; - u_int16_t holdtime; - u_int16_t send_holdtime; + uint8_t version; + uint8_t optlen; + uint16_t holdtime; + uint16_t send_holdtime; as_t remote_as; as_t as4 = 0; struct in_addr remote_id; int mp_capability; - u_int8_t notify_data_remote_as[2]; - u_int8_t notify_data_remote_as4[4]; - u_int8_t notify_data_remote_id[4]; - u_int16_t *holdtime_ptr; + uint8_t notify_data_remote_as[2]; + uint8_t notify_data_remote_as4[4]; + uint8_t notify_data_remote_id[4]; + uint16_t *holdtime_ptr; /* Parse open packet. */ version = stream_getc(peer->curr); memcpy(notify_data_remote_as, stream_pnt(peer->curr), 2); remote_as = stream_getw(peer->curr); - holdtime_ptr = (u_int16_t *)stream_pnt(peer->curr); + holdtime_ptr = (uint16_t *)stream_pnt(peer->curr); holdtime = stream_getw(peer->curr); memcpy(notify_data_remote_id, stream_pnt(peer->curr), 4); remote_id.s_addr = stream_get_ipv4(peer->curr); @@ -1158,7 +1158,7 @@ static int bgp_open_receive(struct peer *peer, bgp_size_t size) /* Peer BGP version check. */ if (version != BGP_VERSION_4) { - u_int16_t maxver = htons(BGP_VERSION_4); + uint16_t maxver = htons(BGP_VERSION_4); /* XXX this reply may not be correct if version < 4 XXX */ if (bgp_debug_neighbor_events(peer)) zlog_debug( @@ -1167,7 +1167,7 @@ static int bgp_open_receive(struct peer *peer, bgp_size_t size) /* Data must be in network byte order here */ bgp_notify_send_with_data(peer, BGP_NOTIFY_OPEN_ERR, BGP_NOTIFY_OPEN_UNSUP_VERSION, - (u_int8_t *)&maxver, 2); + (uint8_t *)&maxver, 2); return BGP_Stop; } @@ -1225,7 +1225,7 @@ static int bgp_open_receive(struct peer *peer, bgp_size_t size) if (holdtime < 3 && holdtime != 0) { bgp_notify_send_with_data(peer, BGP_NOTIFY_OPEN_ERR, BGP_NOTIFY_OPEN_UNACEP_HOLDTIME, - (u_char *)holdtime_ptr, 2); + (uint8_t *)holdtime_ptr, 2); return BGP_Stop; } @@ -1367,7 +1367,7 @@ static int bgp_keepalive_receive(struct peer *peer, bgp_size_t size) static int bgp_update_receive(struct peer *peer, bgp_size_t size) { int ret, nlri_ret; - u_char *end; + uint8_t *end; struct stream *s; struct attr attr; bgp_size_t attribute_len; @@ -1680,7 +1680,7 @@ static int bgp_notify_receive(struct peer *peer, bgp_size_t size) stream_getc(peer->curr)); strcpy(bgp_notify.data, c); } - bgp_notify.raw_data = (u_char *)peer->notify.data; + bgp_notify.raw_data = (uint8_t *)peer->notify.data; } bgp_notify_print(peer, &bgp_notify, "received"); @@ -1764,10 +1764,10 @@ static int bgp_route_refresh_receive(struct peer *peer, bgp_size_t size) } if (size != BGP_MSG_ROUTE_REFRESH_MIN_SIZE - BGP_HEADER_SIZE) { - u_char *end; - u_char when_to_refresh; - u_char orf_type; - u_int16_t orf_len; + uint8_t *end; + uint8_t when_to_refresh; + uint8_t orf_type; + uint16_t orf_len; if (size - (BGP_MSG_ROUTE_REFRESH_MIN_SIZE - BGP_HEADER_SIZE) < 5) { @@ -1792,8 +1792,8 @@ static int bgp_route_refresh_receive(struct peer *peer, bgp_size_t size) uint8_t *p_pnt = stream_pnt(s); uint8_t *p_end = stream_pnt(s) + orf_len; struct orf_prefix orfp; - u_char common = 0; - u_int32_t seq; + uint8_t common = 0; + uint32_t seq; int psize; char name[BUFSIZ]; int ret = CMD_SUCCESS; @@ -1839,12 +1839,12 @@ static int bgp_route_refresh_receive(struct peer *peer, bgp_size_t size) name); break; } - ok = ((u_int32_t)(p_end - p_pnt) - >= sizeof(u_int32_t)); + ok = ((uint32_t)(p_end - p_pnt) + >= sizeof(uint32_t)); if (ok) { memcpy(&seq, p_pnt, - sizeof(u_int32_t)); - p_pnt += sizeof(u_int32_t); + sizeof(uint32_t)); + p_pnt += sizeof(uint32_t); orfp.seq = ntohl(seq); } else p_pnt = p_end; @@ -1988,13 +1988,13 @@ static int bgp_route_refresh_receive(struct peer *peer, bgp_size_t size) * @param size size of the packet * @return as in summary */ -static int bgp_capability_msg_parse(struct peer *peer, u_char *pnt, +static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt, bgp_size_t length) { - u_char *end; + uint8_t *end; struct capability_mp_data mpc; struct capability_header *hdr; - u_char action; + uint8_t action; iana_afi_t pkt_afi; afi_t afi; iana_safi_t pkt_safi; @@ -2106,7 +2106,7 @@ static int bgp_capability_msg_parse(struct peer *peer, u_char *pnt, */ int bgp_capability_receive(struct peer *peer, bgp_size_t size) { - u_char *pnt; + uint8_t *pnt; /* Fetch pointer. */ pnt = stream_pnt(peer->curr); @@ -2171,7 +2171,7 @@ int bgp_process_packet(struct thread *thread) unsigned int processed = 0; while (processed < rpkt_quanta_old) { - u_char type = 0; + uint8_t type = 0; bgp_size_t size; char notify_data_length[2]; diff --git a/bgpd/bgp_packet.h b/bgpd/bgp_packet.h index 008f2b814..06a190585 100644 --- a/bgpd/bgp_packet.h +++ b/bgpd/bgp_packet.h @@ -39,11 +39,11 @@ /* Packet send and receive function prototypes. */ extern void bgp_keepalive_send(struct peer *); extern void bgp_open_send(struct peer *); -extern void bgp_notify_send(struct peer *, u_int8_t, u_int8_t); -extern void bgp_notify_send_with_data(struct peer *, u_int8_t, u_int8_t, - u_int8_t *, size_t); -extern void bgp_route_refresh_send(struct peer *, afi_t, safi_t, u_char, u_char, - int); +extern void bgp_notify_send(struct peer *, uint8_t, uint8_t); +extern void bgp_notify_send_with_data(struct peer *, uint8_t, uint8_t, + uint8_t *, size_t); +extern void bgp_route_refresh_send(struct peer *, afi_t, safi_t, uint8_t, + uint8_t, int); extern void bgp_capability_send(struct peer *, afi_t, safi_t, int, int); extern void bgp_default_update_send(struct peer *, struct attr *, afi_t, safi_t, struct peer *); @@ -58,7 +58,7 @@ extern void bgp_update_restarted_peers(struct peer *); extern void bgp_update_implicit_eors(struct peer *); extern void bgp_check_update_delay(struct bgp *); -extern int bgp_packet_set_marker(struct stream *s, u_char type); +extern int bgp_packet_set_marker(struct stream *s, uint8_t type); extern int bgp_packet_set_size(struct stream *s); extern int bgp_generate_updgrp_packets(struct thread *); diff --git a/bgpd/bgp_rd.c b/bgpd/bgp_rd.c index ae1ec7b84..64e083d1e 100644 --- a/bgpd/bgp_rd.c +++ b/bgpd/bgp_rd.c @@ -36,57 +36,57 @@ #include "bgpd/rfapi/rfapi_backend.h" #endif -u_int16_t decode_rd_type(u_char *pnt) +uint16_t decode_rd_type(uint8_t *pnt) { - u_int16_t v; + uint16_t v; - v = ((u_int16_t)*pnt++ << 8); + v = ((uint16_t)*pnt++ << 8); #if ENABLE_BGP_VNC /* * VNC L2 stores LHI in lower byte, so omit it */ if (v != RD_TYPE_VNC_ETH) - v |= (u_int16_t)*pnt; + v |= (uint16_t)*pnt; #else /* duplicate code for clarity */ - v |= (u_int16_t)*pnt; + v |= (uint16_t)*pnt; #endif return v; } -void encode_rd_type(u_int16_t v, u_char *pnt) +void encode_rd_type(uint16_t v, uint8_t *pnt) { - *((u_int16_t *)pnt) = htons(v); + *((uint16_t *)pnt) = htons(v); } /* type == RD_TYPE_AS */ -void decode_rd_as(u_char *pnt, struct rd_as *rd_as) +void decode_rd_as(uint8_t *pnt, struct rd_as *rd_as) { - rd_as->as = (u_int16_t)*pnt++ << 8; - rd_as->as |= (u_int16_t)*pnt++; + rd_as->as = (uint16_t)*pnt++ << 8; + rd_as->as |= (uint16_t)*pnt++; ptr_get_be32(pnt, &rd_as->val); } /* type == RD_TYPE_AS4 */ -void decode_rd_as4(u_char *pnt, struct rd_as *rd_as) +void decode_rd_as4(uint8_t *pnt, struct rd_as *rd_as) { pnt = ptr_get_be32(pnt, &rd_as->as); - rd_as->val = ((u_int16_t)*pnt++ << 8); - rd_as->val |= (u_int16_t)*pnt; + rd_as->val = ((uint16_t)*pnt++ << 8); + rd_as->val |= (uint16_t)*pnt; } /* type == RD_TYPE_IP */ -void decode_rd_ip(u_char *pnt, struct rd_ip *rd_ip) +void decode_rd_ip(uint8_t *pnt, struct rd_ip *rd_ip) { memcpy(&rd_ip->ip, pnt, 4); pnt += 4; - rd_ip->val = ((u_int16_t)*pnt++ << 8); - rd_ip->val |= (u_int16_t)*pnt; + rd_ip->val = ((uint16_t)*pnt++ << 8); + rd_ip->val |= (uint16_t)*pnt; } #if ENABLE_BGP_VNC /* type == RD_TYPE_VNC_ETH */ -void decode_rd_vnc_eth(u_char *pnt, struct rd_vnc_eth *rd_vnc_eth) +void decode_rd_vnc_eth(uint8_t *pnt, struct rd_vnc_eth *rd_vnc_eth) { rd_vnc_eth->type = RD_TYPE_VNC_ETH; rd_vnc_eth->local_nve_id = pnt[1]; @@ -161,8 +161,8 @@ out: char *prefix_rd2str(struct prefix_rd *prd, char *buf, size_t size) { - u_char *pnt; - u_int16_t type; + uint8_t *pnt; + uint16_t type; struct rd_as rd_as; struct rd_ip rd_ip; diff --git a/bgpd/bgp_rd.h b/bgpd/bgp_rd.h index cbc449ed4..a8ea83a4a 100644 --- a/bgpd/bgp_rd.h +++ b/bgpd/bgp_rd.h @@ -35,33 +35,33 @@ #define RD_ADDRSTRLEN 28 struct rd_as { - u_int16_t type; + uint16_t type; as_t as; - u_int32_t val; + uint32_t val; }; struct rd_ip { - u_int16_t type; + uint16_t type; struct in_addr ip; - u_int16_t val; + uint16_t val; }; #if ENABLE_BGP_VNC struct rd_vnc_eth { - u_int16_t type; + uint16_t type; uint8_t local_nve_id; struct ethaddr macaddr; }; #endif -extern u_int16_t decode_rd_type(u_char *pnt); -extern void encode_rd_type(u_int16_t, u_char *); +extern uint16_t decode_rd_type(uint8_t *pnt); +extern void encode_rd_type(uint16_t, uint8_t *); -extern void decode_rd_as(u_char *pnt, struct rd_as *rd_as); -extern void decode_rd_as4(u_char *pnt, struct rd_as *rd_as); -extern void decode_rd_ip(u_char *pnt, struct rd_ip *rd_ip); +extern void decode_rd_as(uint8_t *pnt, struct rd_as *rd_as); +extern void decode_rd_as4(uint8_t *pnt, struct rd_as *rd_as); +extern void decode_rd_ip(uint8_t *pnt, struct rd_ip *rd_ip); #if ENABLE_BGP_VNC -extern void decode_rd_vnc_eth(u_char *pnt, struct rd_vnc_eth *rd_vnc_eth); +extern void decode_rd_vnc_eth(uint8_t *pnt, struct rd_vnc_eth *rd_vnc_eth); #endif extern int str2prefix_rd(const char *, struct prefix_rd *); diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index e0c54e084..a37e709f1 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -337,7 +337,7 @@ static int bgp_label_index_differs(struct bgp_info *ri1, struct bgp_info *ri2) /* Set/unset bgp_info flags, adjusting any other state as needed. * This is here primarily to keep prefix-count in check. */ -void bgp_info_set_flag(struct bgp_node *rn, struct bgp_info *ri, u_int32_t flag) +void bgp_info_set_flag(struct bgp_node *rn, struct bgp_info *ri, uint32_t flag) { SET_FLAG(ri->flags, flag); @@ -351,7 +351,7 @@ void bgp_info_set_flag(struct bgp_node *rn, struct bgp_info *ri, u_int32_t flag) } void bgp_info_unset_flag(struct bgp_node *rn, struct bgp_info *ri, - u_int32_t flag) + uint32_t flag) { UNSET_FLAG(ri->flags, flag); @@ -366,7 +366,7 @@ void bgp_info_unset_flag(struct bgp_node *rn, struct bgp_info *ri, /* Get MED value. If MED value is missing and "bgp bestpath missing-as-worst" is specified, treat it as the worst value. */ -static u_int32_t bgp_med_value(struct attr *attr, struct bgp *bgp) +static uint32_t bgp_med_value(struct attr *attr, struct bgp *bgp) { if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC)) return attr->med; @@ -397,12 +397,12 @@ static int bgp_info_cmp(struct bgp *bgp, struct bgp_info *new, struct attr *newattr, *existattr; bgp_peer_sort_t new_sort; bgp_peer_sort_t exist_sort; - u_int32_t new_pref; - u_int32_t exist_pref; - u_int32_t new_med; - u_int32_t exist_med; - u_int32_t new_weight; - u_int32_t exist_weight; + uint32_t new_pref; + uint32_t exist_pref; + uint32_t new_med; + uint32_t exist_med; + uint32_t new_weight; + uint32_t exist_weight; uint32_t newm, existm; struct in_addr new_id; struct in_addr exist_id; @@ -413,8 +413,8 @@ static int bgp_info_cmp(struct bgp *bgp, struct bgp_info *new, int ret = 0; char new_buf[PATH_ADDPATH_STR_BUFFER]; char exist_buf[PATH_ADDPATH_STR_BUFFER]; - u_int32_t new_mm_seq; - u_int32_t exist_mm_seq; + uint32_t new_mm_seq; + uint32_t exist_mm_seq; *paths_eq = 0; @@ -1181,7 +1181,7 @@ static int bgp_output_modifier(struct peer *peer, struct prefix *p, struct bgp_info info; route_map_result_t ret; struct route_map *rmap = NULL; - u_char rmap_type; + uint8_t rmap_type; /* * So if we get to this point and have no rmap_name @@ -1323,7 +1323,7 @@ void bgp_attr_add_gshut_community(struct attr *attr) } -static void subgroup_announce_reset_nhop(u_char family, struct attr *attr) +static void subgroup_announce_reset_nhop(uint8_t family, struct attr *attr) { if (family == AF_INET) attr->nexthop.s_addr = 0; @@ -1992,7 +1992,7 @@ void bgp_best_selection(struct bgp *bgp, struct bgp_node *rn, int subgroup_process_announce_selected(struct update_subgroup *subgrp, struct bgp_info *selected, struct bgp_node *rn, - u_int32_t addpath_tx_id) + uint32_t addpath_tx_id) { struct prefix *p; struct peer *onlypeer; @@ -2521,7 +2521,7 @@ int bgp_maximum_prefix_overflow(struct peer *peer, afi_t afi, safi_t safi, pkt_afi = afi_int2iana(afi); pkt_safi = safi_int2iana(safi); { - u_int8_t ndata[7]; + uint8_t ndata[7]; ndata[0] = (pkt_afi >> 8); ndata[1] = pkt_afi; @@ -2644,7 +2644,7 @@ static void bgp_rib_withdraw(struct bgp_node *rn, struct bgp_info *ri, bgp_rib_remove(rn, ri, peer, afi, safi); } -struct bgp_info *info_make(int type, int sub_type, u_short instance, +struct bgp_info *info_make(int type, int sub_type, unsigned short instance, struct peer *peer, struct attr *attr, struct bgp_node *rn) { @@ -2772,10 +2772,10 @@ static int bgp_update_martian_nexthop(struct bgp *bgp, afi_t afi, safi_t safi, return ret; } -int bgp_update(struct peer *peer, struct prefix *p, u_int32_t addpath_id, +int bgp_update(struct peer *peer, struct prefix *p, uint32_t addpath_id, struct attr *attr, afi_t afi, safi_t safi, int type, int sub_type, struct prefix_rd *prd, mpls_label_t *label, - u_int32_t num_labels, int soft_reconfig, + uint32_t num_labels, int soft_reconfig, struct bgp_route_evpn *evpn) { int ret; @@ -3424,10 +3424,10 @@ filtered: return 0; } -int bgp_withdraw(struct peer *peer, struct prefix *p, u_int32_t addpath_id, +int bgp_withdraw(struct peer *peer, struct prefix *p, uint32_t addpath_id, struct attr *attr, afi_t afi, safi_t safi, int type, int sub_type, struct prefix_rd *prd, mpls_label_t *label, - u_int32_t num_labels, struct bgp_route_evpn *evpn) + uint32_t num_labels, struct bgp_route_evpn *evpn) { struct bgp *bgp; char pfx_buf[BGP_PRD_PATH_STRLEN]; @@ -3629,7 +3629,7 @@ static void bgp_soft_reconfig_table(struct peer *peer, afi_t afi, safi_t safi, continue; struct bgp_info *ri = rn->info; - u_int32_t num_labels = 0; + uint32_t num_labels = 0; mpls_label_t *label_pnt = NULL; if (ri && ri->extra) @@ -4087,15 +4087,15 @@ static int bgp_addpath_encode_rx(struct peer *peer, afi_t afi, safi_t safi) int bgp_nlri_parse_ip(struct peer *peer, struct attr *attr, struct bgp_nlri *packet) { - u_char *pnt; - u_char *lim; + uint8_t *pnt; + uint8_t *lim; struct prefix p; int psize; int ret; afi_t afi; safi_t safi; int addpath_encoded; - u_int32_t addpath_id; + uint32_t addpath_id; pnt = packet->nlri; lim = pnt + packet->length; @@ -4548,7 +4548,7 @@ static void bgp_static_update_safi(struct bgp *bgp, struct prefix *p, #if ENABLE_BGP_VNC mpls_label_t label = 0; #endif - u_int32_t num_labels = 0; + uint32_t num_labels = 0; union gw_addr add; assert(bgp_static); @@ -4713,14 +4713,14 @@ static void bgp_static_update_safi(struct bgp *bgp, struct prefix *p, route should be installed as valid. */ static int bgp_static_set(struct vty *vty, const char *negate, const char *ip_str, afi_t afi, safi_t safi, - const char *rmap, int backdoor, u_int32_t label_index) + const char *rmap, int backdoor, uint32_t label_index) { VTY_DECLVAR_CONTEXT(bgp, bgp); int ret; struct prefix p; struct bgp_static *bgp_static; struct bgp_node *rn; - u_char need_update = 0; + uint8_t need_update = 0; /* Convert IP prefix string to struct prefix. */ ret = str2prefix(ip_str, &p); @@ -5329,10 +5329,10 @@ DEFPY(ipv6_bgp_network, */ struct bgp_aggregate { /* Summary-only flag. */ - u_char summary_only; + uint8_t summary_only; /* AS set generation. */ - u_char as_set; + uint8_t as_set; /* Route-map for aggregated route. */ struct route_map *map; @@ -5363,20 +5363,20 @@ static void bgp_aggregate_route(struct bgp *bgp, struct prefix *p, struct bgp_table *table; struct bgp_node *top; struct bgp_node *rn; - u_char origin; + uint8_t origin; struct aspath *aspath = NULL; struct aspath *asmerge = NULL; struct community *community = NULL; struct community *commerge = NULL; #if defined(AGGREGATE_NEXTHOP_CHECK) struct in_addr nexthop; - u_int32_t med = 0; + uint32_t med = 0; #endif struct bgp_info *ri; struct bgp_info *new; int first = 1; unsigned long match = 0; - u_char atomic_aggregate = 0; + uint8_t atomic_aggregate = 0; /* Record adding route's nexthop and med. */ if (rinew) { @@ -5624,12 +5624,12 @@ static void bgp_aggregate_add(struct bgp *bgp, struct prefix *p, afi_t afi, struct bgp_info *new; struct bgp_info *ri; unsigned long match; - u_char origin = BGP_ORIGIN_IGP; + uint8_t origin = BGP_ORIGIN_IGP; struct aspath *aspath = NULL; struct aspath *asmerge = NULL; struct community *community = NULL; struct community *commerge = NULL; - u_char atomic_aggregate = 0; + uint8_t atomic_aggregate = 0; table = bgp->rib[afi][safi]; @@ -5852,7 +5852,7 @@ static int bgp_aggregate_unset(struct vty *vty, const char *prefix_str, } static int bgp_aggregate_set(struct vty *vty, const char *prefix_str, afi_t afi, - safi_t safi, u_char summary_only, u_char as_set) + safi_t safi, uint8_t summary_only, uint8_t as_set) { VTY_DECLVAR_CONTEXT(bgp, bgp); int ret; @@ -6039,7 +6039,8 @@ DEFUN (no_ipv6_aggregate_address, void bgp_redistribute_add(struct bgp *bgp, struct prefix *p, const union g_addr *nexthop, ifindex_t ifindex, enum nexthop_types_t nhtype, uint32_t metric, - u_char type, u_short instance, route_tag_t tag) + uint8_t type, unsigned short instance, + route_tag_t tag) { struct bgp_info *new; struct bgp_info *bi; @@ -6196,8 +6197,8 @@ void bgp_redistribute_add(struct bgp *bgp, struct prefix *p, aspath_unintern(&attr.aspath); } -void bgp_redistribute_delete(struct bgp *bgp, struct prefix *p, u_char type, - u_short instance) +void bgp_redistribute_delete(struct bgp *bgp, struct prefix *p, uint8_t type, + unsigned short instance) { afi_t afi; struct bgp_node *rn; @@ -6232,7 +6233,7 @@ void bgp_redistribute_delete(struct bgp *bgp, struct prefix *p, u_char type, /* Withdraw specified route type's route. */ void bgp_redistribute_withdraw(struct bgp *bgp, afi_t afi, int type, - u_short instance) + unsigned short instance) { struct bgp_node *rn; struct bgp_info *ri; @@ -6266,7 +6267,7 @@ static void route_vty_out_route(struct prefix *p, struct vty *vty, json_object *json) { int len = 0; - u_int32_t destination; + uint32_t destination; char buf[BUFSIZ]; if (p->family == AF_INET) { @@ -6694,7 +6695,7 @@ void route_vty_out(struct vty *vty, struct prefix *p, struct bgp_info *binfo, /* called from terminal list command */ void route_vty_out_tmp(struct vty *vty, struct prefix *p, struct attr *attr, - safi_t safi, u_char use_json, json_object *json_ar) + safi_t safi, uint8_t use_json, json_object *json_ar) { json_object *json_status = NULL; json_object *json_net = NULL; @@ -7019,7 +7020,7 @@ void route_vty_out_overlay(struct vty *vty, struct prefix *p, /* dampening route */ static void damp_route_vty_out(struct vty *vty, struct prefix *p, struct bgp_info *binfo, int display, safi_t safi, - u_char use_json, json_object *json) + uint8_t use_json, json_object *json) { struct attr *attr; int len; @@ -7082,7 +7083,7 @@ static void damp_route_vty_out(struct vty *vty, struct prefix *p, /* flap route */ static void flap_route_vty_out(struct vty *vty, struct prefix *p, struct bgp_info *binfo, int display, safi_t safi, - u_char use_json, json_object *json) + uint8_t use_json, json_object *json) { struct attr *attr; struct bgp_damp_info *bdi; @@ -8072,7 +8073,7 @@ static int bgp_show_community(struct vty *vty, struct bgp *bgp, static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi, struct bgp_table *table, enum bgp_show_type type, - void *output_arg, u_char use_json, char *rd, + void *output_arg, uint8_t use_json, char *rd, int is_last, unsigned long *output_cum, unsigned long *total_cum, unsigned long *json_header_depth) @@ -8180,7 +8181,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi, continue; } if (type == bgp_show_type_cidr_only) { - u_int32_t destination; + uint32_t destination; destination = ntohl(rn->p.u.prefix4.s_addr); if (IN_CLASSC(destination) @@ -8357,7 +8358,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi, int bgp_show_table_rd(struct vty *vty, struct bgp *bgp, safi_t safi, struct bgp_table *table, struct prefix_rd *prd_match, enum bgp_show_type type, void *output_arg, - u_char use_json) + uint8_t use_json) { struct bgp_node *rn, *next; unsigned long output_cum = 0; @@ -8397,7 +8398,7 @@ int bgp_show_table_rd(struct vty *vty, struct bgp *bgp, safi_t safi, return CMD_SUCCESS; } static int bgp_show(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi, - enum bgp_show_type type, void *output_arg, u_char use_json) + enum bgp_show_type type, void *output_arg, uint8_t use_json) { struct bgp_table *table; unsigned long json_header_depth = 0; @@ -8429,7 +8430,7 @@ static int bgp_show(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi, } static void bgp_show_all_instances_routes_vty(struct vty *vty, afi_t afi, - safi_t safi, u_char use_json) + safi_t safi, uint8_t use_json) { struct listnode *node, *nnode; struct bgp *bgp; @@ -8629,7 +8630,8 @@ static int bgp_show_route_in_table(struct vty *vty, struct bgp *bgp, struct bgp_table *rib, const char *ip_str, afi_t afi, safi_t safi, struct prefix_rd *prd, int prefix_check, - enum bgp_path_type pathtype, u_char use_json) + enum bgp_path_type pathtype, + uint8_t use_json) { int ret; int header; @@ -8759,7 +8761,7 @@ static int bgp_show_route_in_table(struct vty *vty, struct bgp *bgp, static int bgp_show_route(struct vty *vty, struct bgp *bgp, const char *ip_str, afi_t afi, safi_t safi, struct prefix_rd *prd, int prefix_check, enum bgp_path_type pathtype, - u_char use_json) + uint8_t use_json) { if (!bgp) { bgp = bgp_get_default(); @@ -8783,7 +8785,7 @@ static int bgp_show_route(struct vty *vty, struct bgp *bgp, const char *ip_str, static int bgp_show_lcommunity(struct vty *vty, struct bgp *bgp, int argc, struct cmd_token **argv, afi_t afi, safi_t safi, - u_char uj) + uint8_t uj) { struct lcommunity *lcom; struct buffer *b; @@ -8820,7 +8822,7 @@ static int bgp_show_lcommunity(struct vty *vty, struct bgp *bgp, int argc, static int bgp_show_lcommunity_list(struct vty *vty, struct bgp *bgp, const char *lcom, afi_t afi, safi_t safi, - u_char uj) + uint8_t uj) { struct community_list *list; @@ -9126,7 +9128,7 @@ DEFUN (show_ip_bgp_route, char *prefix = NULL; struct bgp *bgp = NULL; enum bgp_path_type path_type; - u_char uj = use_json(argc, argv); + uint8_t uj = use_json(argc, argv); int idx = 0; @@ -9363,7 +9365,7 @@ static int bgp_show_prefix_longer(struct vty *vty, struct bgp *bgp, } static struct peer *peer_lookup_in_view(struct vty *vty, struct bgp *bgp, - const char *ip_str, u_char use_json) + const char *ip_str, uint8_t use_json) { int ret; struct peer *peer; @@ -9762,7 +9764,7 @@ static int bgp_peer_count_walker(struct thread *t) } static int bgp_peer_counts(struct vty *vty, struct peer *peer, afi_t afi, - safi_t safi, u_char use_json) + safi_t safi, uint8_t use_json) { struct peer_pcounts pcounts = {.peer = peer}; unsigned int i; @@ -9908,7 +9910,7 @@ DEFUN (show_ip_bgp_vpn_neighbor_prefix_counts, { int idx_peer = 6; struct peer *peer; - u_char uj = use_json(argc, argv); + uint8_t uj = use_json(argc, argv); peer = peer_lookup_in_view(vty, NULL, argv[idx_peer]->arg, uj); if (!peer) @@ -9981,7 +9983,7 @@ DEFUN (show_ip_bgp_l2vpn_evpn_all_route_prefix, static void show_adj_route(struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, int in, const char *rmap_name, - u_char use_json, json_object *json) + uint8_t use_json, json_object *json) { struct bgp_table *table; struct bgp_adj_in *ain; @@ -10205,7 +10207,7 @@ static void show_adj_route(struct vty *vty, struct peer *peer, afi_t afi, static int peer_adj_routes(struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, int in, const char *rmap_name, - u_char use_json) + uint8_t use_json) { json_object *json = NULL; @@ -10347,7 +10349,7 @@ DEFUN (show_ip_bgp_neighbor_received_prefix_filter, argv_find(argv, argc, "neighbors", &idx); peerstr = argv[++idx]->arg; - u_char uj = use_json(argc, argv); + uint8_t uj = use_json(argc, argv); ret = str2sockunion(peerstr, &su); if (ret < 0) { @@ -10391,7 +10393,7 @@ DEFUN (show_ip_bgp_neighbor_received_prefix_filter, static int bgp_show_neighbor_route(struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, - enum bgp_show_type type, u_char use_json) + enum bgp_show_type type, uint8_t use_json) { /* labeled-unicast routes live in the unicast table */ if (safi == SAFI_LABELED_UNICAST) @@ -10476,7 +10478,7 @@ struct bgp_table *bgp_distance_table[AFI_MAX][SAFI_MAX]; struct bgp_distance { /* Distance value for the IP source prefix. */ - u_char distance; + uint8_t distance; /* Name of the access-list to be matched. */ char *access_list; @@ -10532,7 +10534,7 @@ static int bgp_distance_set(struct vty *vty, const char *distance_str, afi_t afi; safi_t safi; struct prefix p; - u_char distance; + uint8_t distance; struct bgp_node *rn; struct bgp_distance *bdistance; @@ -10619,8 +10621,8 @@ static int bgp_distance_unset(struct vty *vty, const char *distance_str, } /* Apply BGP information to distance method. */ -u_char bgp_distance_apply(struct prefix *p, struct bgp_info *rinfo, afi_t afi, - safi_t safi, struct bgp *bgp) +uint8_t bgp_distance_apply(struct prefix *p, struct bgp_info *rinfo, afi_t afi, + safi_t safi, struct bgp *bgp) { struct bgp_node *rn; struct prefix q; @@ -11197,7 +11199,7 @@ void bgp_config_write_network(struct vty *vty, struct bgp *bgp, afi_t afi, /* "network" configuration display. */ if (bgp_option_check(BGP_OPT_CONFIG_CISCO) && afi == AFI_IP) { - u_int32_t destination; + uint32_t destination; struct in_addr netmask; destination = ntohl(p->u.prefix4.s_addr); diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h index 748c4f911..e1e43bbde 100644 --- a/bgpd/bgp_route.h +++ b/bgpd/bgp_route.h @@ -76,11 +76,11 @@ struct bgp_info_extra { int suppress; /* Nexthop reachability check. */ - u_int32_t igpmetric; + uint32_t igpmetric; /* MPLS label(s) - VNI(s) for EVPN-VxLAN */ mpls_label_t label[BGP_MAX_LABELS]; - u_int32_t num_labels; + uint32_t num_labels; #if ENABLE_BGP_VNC union { @@ -97,7 +97,7 @@ struct bgp_info_extra { void *hme; /* encap monitor, if this is a VPN route */ struct prefix_rd rd; /* import: route's route-distinguisher */ - u_char un_family; /* family of cached un address, 0 if + uint8_t un_family; /* family of cached un address, 0 if unset */ union { struct in_addr addr4; @@ -174,7 +174,7 @@ struct bgp_info { int lock; /* BGP information status. */ - u_int16_t flags; + uint16_t flags; #define BGP_INFO_IGP_CHANGED (1 << 0) #define BGP_INFO_DAMPED (1 << 1) #define BGP_INFO_HISTORY (1 << 2) @@ -191,11 +191,11 @@ struct bgp_info { #define BGP_INFO_RIB_ATTR_CHG (1 << 13) /* BGP route type. This can be static, RIP, OSPF, BGP etc. */ - u_char type; + uint8_t type; /* When above type is BGP. This sub type specify BGP sub type information. */ - u_char sub_type; + uint8_t sub_type; #define BGP_ROUTE_NORMAL 0 #define BGP_ROUTE_STATIC 1 #define BGP_ROUTE_AGGREGATE 2 @@ -205,11 +205,11 @@ struct bgp_info { #endif #define BGP_ROUTE_IMPORTED 5 /* from another bgp instance/safi */ - u_short instance; + unsigned short instance; /* Addpath identifiers */ - u_int32_t addpath_rx_id; - u_int32_t addpath_tx_id; + uint32_t addpath_rx_id; + uint32_t addpath_tx_id; }; /* Structure used in BGP path selection */ @@ -224,20 +224,20 @@ struct bgp_static { int backdoor; /* Label index configuration; applies to LU prefixes. */ - u_int32_t label_index; + uint32_t label_index; #define BGP_INVALID_LABEL_INDEX 0xFFFFFFFF /* Import check status. */ - u_char valid; + uint8_t valid; /* IGP metric. */ - u_int32_t igpmetric; + uint32_t igpmetric; /* IGP nexthop. */ struct in_addr igpnexthop; /* Atomic set reference count (ie cause of pathlimit) */ - u_int32_t atomic; + uint32_t atomic; /* BGP redistribute route-map. */ struct { @@ -348,9 +348,8 @@ extern void bgp_info_add(struct bgp_node *rn, struct bgp_info *ri); extern void bgp_info_reap(struct bgp_node *rn, struct bgp_info *ri); extern void bgp_info_delete(struct bgp_node *rn, struct bgp_info *ri); extern struct bgp_info_extra *bgp_info_extra_get(struct bgp_info *); -extern void bgp_info_set_flag(struct bgp_node *, struct bgp_info *, u_int32_t); -extern void bgp_info_unset_flag(struct bgp_node *, struct bgp_info *, - u_int32_t); +extern void bgp_info_set_flag(struct bgp_node *, struct bgp_info *, uint32_t); +extern void bgp_info_unset_flag(struct bgp_node *, struct bgp_info *, uint32_t); extern void bgp_info_path_with_addpath_rx_str(struct bgp_info *ri, char *buf); extern int bgp_nlri_parse_ip(struct peer *, struct attr *, struct bgp_nlri *); @@ -360,11 +359,11 @@ extern int bgp_maximum_prefix_overflow(struct peer *, afi_t, safi_t, int); extern void bgp_redistribute_add(struct bgp *bgp, struct prefix *p, const union g_addr *nexthop, ifindex_t ifindex, enum nexthop_types_t nhtype, uint32_t metric, - u_char type, u_short instance, + uint8_t type, unsigned short instance, route_tag_t tag); -extern void bgp_redistribute_delete(struct bgp *, struct prefix *, u_char, - u_short); -extern void bgp_redistribute_withdraw(struct bgp *, afi_t, int, u_short); +extern void bgp_redistribute_delete(struct bgp *, struct prefix *, uint8_t, + unsigned short); +extern void bgp_redistribute_withdraw(struct bgp *, afi_t, int, unsigned short); extern void bgp_static_add(struct bgp *); extern void bgp_static_delete(struct bgp *); @@ -384,13 +383,12 @@ extern int bgp_static_unset_safi(afi_t afi, safi_t safi, struct vty *, const char *, const char *, const char *); /* this is primarily for MPLS-VPN */ -extern int bgp_update(struct peer *, struct prefix *, u_int32_t, struct attr *, +extern int bgp_update(struct peer *, struct prefix *, uint32_t, struct attr *, afi_t, safi_t, int, int, struct prefix_rd *, - mpls_label_t *, u_int32_t, int, struct bgp_route_evpn *); -extern int bgp_withdraw(struct peer *, struct prefix *, u_int32_t, - struct attr *, afi_t, safi_t, int, int, - struct prefix_rd *, mpls_label_t *, u_int32_t, - struct bgp_route_evpn *); + mpls_label_t *, uint32_t, int, struct bgp_route_evpn *); +extern int bgp_withdraw(struct peer *, struct prefix *, uint32_t, struct attr *, + afi_t, safi_t, int, int, struct prefix_rd *, + mpls_label_t *, uint32_t, struct bgp_route_evpn *); /* for bgp_nexthop and bgp_damp */ extern void bgp_process(struct bgp *, struct bgp_node *, afi_t, safi_t); @@ -411,22 +409,22 @@ extern void bgp_aggregate_increment(struct bgp *, struct prefix *, extern void bgp_aggregate_decrement(struct bgp *, struct prefix *, struct bgp_info *, afi_t, safi_t); -extern u_char bgp_distance_apply(struct prefix *, struct bgp_info *, afi_t, - safi_t, struct bgp *); +extern uint8_t bgp_distance_apply(struct prefix *, struct bgp_info *, afi_t, + safi_t, struct bgp *); extern afi_t bgp_node_afi(struct vty *); extern safi_t bgp_node_safi(struct vty *); -extern struct bgp_info *info_make(int type, int sub_type, u_short instance, - struct peer *peer, struct attr *attr, - struct bgp_node *rn); +extern struct bgp_info *info_make(int type, int sub_type, + unsigned short instance, struct peer *peer, + struct attr *attr, struct bgp_node *rn); extern void route_vty_out(struct vty *, struct prefix *, struct bgp_info *, int, safi_t, json_object *); extern void route_vty_out_tag(struct vty *, struct prefix *, struct bgp_info *, int, safi_t, json_object *); extern void route_vty_out_tmp(struct vty *, struct prefix *, struct attr *, - safi_t, u_char, json_object *); + safi_t, uint8_t, json_object *); extern void route_vty_out_overlay(struct vty *vty, struct prefix *p, struct bgp_info *binfo, int display, json_object *json); @@ -434,7 +432,7 @@ extern void route_vty_out_overlay(struct vty *vty, struct prefix *p, extern int subgroup_process_announce_selected(struct update_subgroup *subgrp, struct bgp_info *selected, struct bgp_node *rn, - u_int32_t addpath_tx_id); + uint32_t addpath_tx_id); extern int subgroup_announce_check(struct bgp_node *rn, struct bgp_info *ri, struct update_subgroup *subgrp, @@ -474,5 +472,5 @@ extern void route_vty_out_detail(struct vty *vty, struct bgp *bgp, extern int bgp_show_table_rd(struct vty *vty, struct bgp *bgp, safi_t safi, struct bgp_table *table, struct prefix_rd *prd, enum bgp_show_type type, void *output_arg, - u_char use_json); + uint8_t use_json); #endif /* _QUAGGA_BGP_ROUTE_H */ diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index 5a265b6c9..4cc889286 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -122,12 +122,12 @@ o Local extensions #define RMAP_VALUE_SUB 2 struct rmap_value { - u_int8_t action; - u_int8_t variable; - u_int32_t value; + uint8_t action; + uint8_t variable; + uint32_t value; }; -static int route_value_match(struct rmap_value *rv, u_int32_t value) +static int route_value_match(struct rmap_value *rv, uint32_t value) { if (rv->variable == 0 && value == rv->value) return RMAP_MATCH; @@ -135,10 +135,10 @@ static int route_value_match(struct rmap_value *rv, u_int32_t value) return RMAP_NOMATCH; } -static u_int32_t route_value_adjust(struct rmap_value *rv, u_int32_t current, - struct peer *peer) +static uint32_t route_value_adjust(struct rmap_value *rv, uint32_t current, + struct peer *peer) { - u_int32_t value; + uint32_t value; switch (rv->variable) { case 1: @@ -165,7 +165,7 @@ static u_int32_t route_value_adjust(struct rmap_value *rv, u_int32_t current, static void *route_value_compile(const char *arg) { - u_int8_t action = RMAP_VALUE_SET, var = 0; + uint8_t action = RMAP_VALUE_SET, var = 0; unsigned long larg = 0; char *endptr = NULL; struct rmap_value *rv; @@ -723,10 +723,10 @@ static route_map_result_t route_match_evpn_route_type(void *rule, route_map_object_t type, void *object) { - u_char route_type = 0; + uint8_t route_type = 0; if (type == RMAP_BGP) { - route_type = *((u_char *)rule); + route_type = *((uint8_t *)rule); if (route_type == prefix->u.prefix_evpn.route_type) return RMAP_MATCH; @@ -738,9 +738,9 @@ static route_map_result_t route_match_evpn_route_type(void *rule, /* Route map `route-type' match statement. */ static void *route_match_evpn_route_type_compile(const char *arg) { - u_char *route_type = NULL; + uint8_t *route_type = NULL; - route_type = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(u_char)); + route_type = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(uint8_t)); if (strncmp(arg, "ma", 2) == 0) *route_type = BGP_EVPN_MAC_IP_ROUTE; @@ -771,7 +771,7 @@ static route_map_result_t route_match_local_pref(void *rule, route_map_object_t type, void *object) { - u_int32_t *local_pref; + uint32_t *local_pref; struct bgp_info *bgp_info; if (type == RMAP_BGP) { @@ -790,7 +790,7 @@ static route_map_result_t route_match_local_pref(void *rule, `arg' is local-pref value */ static void *route_match_local_pref_compile(const char *arg) { - u_int32_t *local_pref; + uint32_t *local_pref; char *endptr = NULL; unsigned long tmpval; @@ -803,7 +803,7 @@ static void *route_match_local_pref_compile(const char *arg) if (*endptr != '\0' || errno || tmpval > UINT32_MAX) return NULL; - local_pref = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(u_int32_t)); + local_pref = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(uint32_t)); if (!local_pref) return local_pref; @@ -1073,7 +1073,7 @@ static route_map_result_t route_match_origin(void *rule, struct prefix *prefix, route_map_object_t type, void *object) { - u_char *origin; + uint8_t *origin; struct bgp_info *bgp_info; if (type == RMAP_BGP) { @@ -1089,9 +1089,9 @@ static route_map_result_t route_match_origin(void *rule, struct prefix *prefix, static void *route_match_origin_compile(const char *arg) { - u_char *origin; + uint8_t *origin; - origin = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(u_char)); + origin = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(uint8_t)); if (strcmp(arg, "igp") == 0) *origin = 0; @@ -1362,7 +1362,7 @@ static route_map_result_t route_set_local_pref(void *rule, { struct rmap_value *rv; struct bgp_info *bgp_info; - u_int32_t locpref = 0; + uint32_t locpref = 0; if (type == RMAP_BGP) { /* Fetch routemap's rule information. */ @@ -1424,7 +1424,7 @@ static route_map_result_t route_set_metric(void *rule, struct prefix *prefix, { struct rmap_value *rv; struct bgp_info *bgp_info; - u_int32_t med = 0; + uint32_t med = 0; if (type == RMAP_BGP) { /* Fetch routemap's rule information. */ @@ -2035,7 +2035,7 @@ static route_map_result_t route_set_origin(void *rule, struct prefix *prefix, route_map_object_t type, void *object) { - u_char *origin; + uint8_t *origin; struct bgp_info *bgp_info; if (type == RMAP_BGP) { @@ -2051,9 +2051,9 @@ static route_map_result_t route_set_origin(void *rule, struct prefix *prefix, /* Compile function for origin set. */ static void *route_set_origin_compile(const char *arg) { - u_char *origin; + uint8_t *origin; - origin = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(u_char)); + origin = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(uint8_t)); if (strcmp(arg, "igp") == 0) *origin = 0; @@ -2205,7 +2205,7 @@ static route_map_result_t route_set_label_index(void *rule, { struct rmap_value *rv; struct bgp_info *bgp_info; - u_int32_t label_index; + uint32_t label_index; if (type == RMAP_BGP) { /* Fetch routemap's rule information. */ diff --git a/bgpd/bgp_rpki.c b/bgpd/bgp_rpki.c index 7c9a134b0..75ba1609d 100644 --- a/bgpd/bgp_rpki.c +++ b/bgpd/bgp_rpki.c @@ -179,7 +179,7 @@ static void *route_match_compile(const char *arg) { int *rpki_status; - rpki_status = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(u_char)); + rpki_status = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(uint8_t)); if (strcmp(arg, "valid") == 0) *rpki_status = RPKI_VALID; diff --git a/bgpd/bgp_snmp.c b/bgpd/bgp_snmp.c index 90ffa9da3..2c7e4e043 100644 --- a/bgpd/bgp_snmp.c +++ b/bgpd/bgp_snmp.c @@ -125,19 +125,19 @@ static oid bgp_trap_oid[] = {BGP4MIB, 0}; static struct in_addr bgp_empty_addr = {.s_addr = 0}; /* Hook functions. */ -static u_char *bgpVersion(struct variable *, oid[], size_t *, int, size_t *, - WriteMethod **); -static u_char *bgpLocalAs(struct variable *, oid[], size_t *, int, size_t *, - WriteMethod **); -static u_char *bgpPeerTable(struct variable *, oid[], size_t *, int, size_t *, - WriteMethod **); -static u_char *bgpRcvdPathAttrTable(struct variable *, oid[], size_t *, int, - size_t *, WriteMethod **); -static u_char *bgpIdentifier(struct variable *, oid[], size_t *, int, size_t *, +static uint8_t *bgpVersion(struct variable *, oid[], size_t *, int, size_t *, + WriteMethod **); +static uint8_t *bgpLocalAs(struct variable *, oid[], size_t *, int, size_t *, + WriteMethod **); +static uint8_t *bgpPeerTable(struct variable *, oid[], size_t *, int, size_t *, WriteMethod **); -static u_char *bgp4PathAttrTable(struct variable *, oid[], size_t *, int, - size_t *, WriteMethod **); -/* static u_char *bgpTraps (); */ +static uint8_t *bgpRcvdPathAttrTable(struct variable *, oid[], size_t *, int, + size_t *, WriteMethod **); +static uint8_t *bgpIdentifier(struct variable *, oid[], size_t *, int, size_t *, + WriteMethod **); +static uint8_t *bgp4PathAttrTable(struct variable *, oid[], size_t *, int, + size_t *, WriteMethod **); +/* static uint8_t *bgpTraps (); */ static struct variable bgp_variables[] = { /* BGP version. */ @@ -315,11 +315,11 @@ static struct variable bgp_variables[] = { }; -static u_char *bgpVersion(struct variable *v, oid name[], size_t *length, - int exact, size_t *var_len, - WriteMethod **write_method) +static uint8_t *bgpVersion(struct variable *v, oid name[], size_t *length, + int exact, size_t *var_len, + WriteMethod **write_method) { - static u_char version; + static uint8_t version; if (smux_header_generic(v, name, length, exact, var_len, write_method) == MATCH_FAILED) @@ -330,12 +330,12 @@ static u_char *bgpVersion(struct variable *v, oid name[], size_t *length, /* Return octet string length 1. */ *var_len = 1; - return (u_char *)&version; + return (uint8_t *)&version; } -static u_char *bgpLocalAs(struct variable *v, oid name[], size_t *length, - int exact, size_t *var_len, - WriteMethod **write_method) +static uint8_t *bgpLocalAs(struct variable *v, oid name[], size_t *length, + int exact, size_t *var_len, + WriteMethod **write_method) { struct bgp *bgp; @@ -443,9 +443,9 @@ static struct peer *bgpPeerTable_lookup(struct variable *v, oid name[], } /* BGP write methods. */ -static int write_bgpPeerTable(int action, u_char *var_val, u_char var_val_type, - size_t var_val_len, u_char *statP, oid *name, - size_t length) +static int write_bgpPeerTable(int action, uint8_t *var_val, + uint8_t var_val_type, size_t var_val_len, + uint8_t *statP, oid *name, size_t length) { struct in_addr addr; struct peer *peer; @@ -506,9 +506,9 @@ static int write_bgpPeerTable(int action, u_char *var_val, u_char var_val_type, return SNMP_ERR_NOERROR; } -static u_char *bgpPeerTable(struct variable *v, oid name[], size_t *length, - int exact, size_t *var_len, - WriteMethod **write_method) +static uint8_t *bgpPeerTable(struct variable *v, oid name[], size_t *length, + int exact, size_t *var_len, + WriteMethod **write_method) { static struct in_addr addr; struct peer *peer; @@ -588,11 +588,11 @@ static u_char *bgpPeerTable(struct variable *v, oid name[], size_t *length, return SNMP_INTEGER(PEER_TOTAL_TX(peer)); break; case BGPPEERLASTERROR: { - static u_char lasterror[2]; + static uint8_t lasterror[2]; lasterror[0] = peer->notify.code; lasterror[1] = peer->notify.subcode; *var_len = 2; - return (u_char *)&lasterror; + return (uint8_t *)&lasterror; } break; case BGPPEERFSMESTABLISHEDTRANSITIONS: return SNMP_INTEGER(peer->established); @@ -644,9 +644,9 @@ static u_char *bgpPeerTable(struct variable *v, oid name[], size_t *length, return NULL; } -static u_char *bgpIdentifier(struct variable *v, oid name[], size_t *length, - int exact, size_t *var_len, - WriteMethod **write_method) +static uint8_t *bgpIdentifier(struct variable *v, oid name[], size_t *length, + int exact, size_t *var_len, + WriteMethod **write_method) { struct bgp *bgp; @@ -661,9 +661,9 @@ static u_char *bgpIdentifier(struct variable *v, oid name[], size_t *length, return SNMP_IPADDRESS(bgp->router_id); } -static u_char *bgpRcvdPathAttrTable(struct variable *v, oid name[], - size_t *length, int exact, size_t *var_len, - WriteMethod **write_method) +static uint8_t *bgpRcvdPathAttrTable(struct variable *v, oid name[], + size_t *length, int exact, size_t *var_len, + WriteMethod **write_method) { /* Received Path Attribute Table. This table contains, one entry per path to a network, path attributes received from all peers @@ -805,9 +805,9 @@ static struct bgp_info *bgp4PathAttrLookup(struct variable *v, oid name[], return NULL; } -static u_char *bgp4PathAttrTable(struct variable *v, oid name[], size_t *length, - int exact, size_t *var_len, - WriteMethod **write_method) +static uint8_t *bgp4PathAttrTable(struct variable *v, oid name[], + size_t *length, int exact, size_t *var_len, + WriteMethod **write_method) { struct bgp *bgp; struct bgp_info *binfo; diff --git a/bgpd/bgp_table.h b/bgpd/bgp_table.h index a4f3b604c..9afc2adbb 100644 --- a/bgpd/bgp_table.h +++ b/bgpd/bgp_table.h @@ -58,7 +58,7 @@ struct bgp_node { mpls_label_t local_label; uint64_t version; - u_char flags; + uint8_t flags; #define BGP_NODE_PROCESS_SCHEDULED (1 << 0) #define BGP_NODE_USER_CLEAR (1 << 1) #define BGP_NODE_LABEL_CHANGED (1 << 2) diff --git a/bgpd/bgp_updgrp.h b/bgpd/bgp_updgrp.h index 233fe5d14..c1cbca6dc 100644 --- a/bgpd/bgp_updgrp.h +++ b/bgpd/bgp_updgrp.h @@ -77,7 +77,7 @@ typedef enum { BGP_ATTR_VEC_NH = 0, BGP_ATTR_VEC_MAX } bpacket_attr_vec_type; typedef struct { - u_int32_t flags; + uint32_t flags; unsigned long offset; } bpacket_attr_vec; @@ -139,19 +139,19 @@ struct update_group { uint64_t id; time_t uptime; - u_int32_t join_events; - u_int32_t prune_events; - u_int32_t merge_events; - u_int32_t updgrp_switch_events; - u_int32_t peer_refreshes_combined; - u_int32_t adj_count; - u_int32_t split_events; - u_int32_t merge_checks_triggered; + uint32_t join_events; + uint32_t prune_events; + uint32_t merge_events; + uint32_t updgrp_switch_events; + uint32_t peer_refreshes_combined; + uint32_t adj_count; + uint32_t split_events; + uint32_t merge_checks_triggered; - u_int32_t subgrps_created; - u_int32_t subgrps_deleted; + uint32_t subgrps_created; + uint32_t subgrps_deleted; - u_int32_t num_dbg_en_peers; + uint32_t num_dbg_en_peers; }; /* @@ -214,7 +214,7 @@ struct update_subgroup { struct hash *hash; struct thread *t_coalesce; - u_int32_t v_coalesce; + uint32_t v_coalesce; struct thread *t_merge_check; @@ -236,25 +236,25 @@ struct update_subgroup { uint64_t subgroup_id; } split_from; - u_int32_t join_events; - u_int32_t prune_events; + uint32_t join_events; + uint32_t prune_events; /* * This is bumped up when another subgroup merges into this one. */ - u_int32_t merge_events; - u_int32_t updgrp_switch_events; - u_int32_t peer_refreshes_combined; - u_int32_t adj_count; - u_int32_t split_events; - u_int32_t merge_checks_triggered; + uint32_t merge_events; + uint32_t updgrp_switch_events; + uint32_t peer_refreshes_combined; + uint32_t adj_count; + uint32_t split_events; + uint32_t merge_checks_triggered; uint64_t id; - u_int16_t sflags; + uint16_t sflags; /* Subgroup flags, see below */ - u_int16_t flags; + uint16_t flags; }; /* @@ -302,7 +302,7 @@ struct updwalk_context { int policy_route_update; updgrp_walkcb cb; void *context; - u_int8_t flags; + uint8_t flags; #define UPDWALK_FLAGS_ADVQUEUE (1 << 0) #define UPDWALK_FLAGS_ADVERTISED (1 << 1) @@ -449,7 +449,7 @@ extern void update_group_announce_rrclients(struct bgp *bgp); extern void peer_af_announce_route(struct peer_af *paf, int combine); extern struct bgp_adj_out *bgp_adj_out_alloc(struct update_subgroup *subgrp, struct bgp_node *rn, - u_int32_t addpath_tx_id); + uint32_t addpath_tx_id); extern void bgp_adj_out_remove_subgroup(struct bgp_node *rn, struct bgp_adj_out *adj, struct update_subgroup *subgrp); @@ -458,7 +458,7 @@ extern void bgp_adj_out_set_subgroup(struct bgp_node *rn, struct attr *attr, struct bgp_info *binfo); extern void bgp_adj_out_unset_subgroup(struct bgp_node *rn, struct update_subgroup *subgrp, - char withdraw, u_int32_t addpath_tx_id); + char withdraw, uint32_t addpath_tx_id); void subgroup_announce_table(struct update_subgroup *subgrp, struct bgp_table *table); extern void subgroup_trigger_write(struct update_subgroup *subgrp); diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c index e66e5a540..d55500657 100644 --- a/bgpd/bgp_updgrp_adv.c +++ b/bgpd/bgp_updgrp_adv.c @@ -57,7 +57,7 @@ static inline struct bgp_adj_out *adj_lookup(struct bgp_node *rn, struct update_subgroup *subgrp, - u_int32_t addpath_tx_id) + uint32_t addpath_tx_id) { struct bgp_adj_out *adj; struct peer *peer; @@ -207,7 +207,7 @@ static int group_announce_route_walkcb(struct update_group *updgrp, void *arg) } static void subgrp_show_adjq_vty(struct update_subgroup *subgrp, - struct vty *vty, u_int8_t flags) + struct vty *vty, uint8_t flags) { struct bgp_table *table; struct bgp_adj_out *adj; @@ -280,7 +280,7 @@ static int updgrp_show_adj_walkcb(struct update_group *updgrp, void *arg) } static void updgrp_show_adj(struct bgp *bgp, afi_t afi, safi_t safi, - struct vty *vty, uint64_t id, u_int8_t flags) + struct vty *vty, uint64_t id, uint8_t flags) { struct updwalk_context ctx; memset(&ctx, 0, sizeof(ctx)); @@ -370,7 +370,7 @@ static int update_group_announce_rrc_walkcb(struct update_group *updgrp, */ struct bgp_adj_out *bgp_adj_out_alloc(struct update_subgroup *subgrp, struct bgp_node *rn, - u_int32_t addpath_tx_id) + uint32_t addpath_tx_id) { struct bgp_adj_out *adj; @@ -487,7 +487,7 @@ void bgp_adj_out_set_subgroup(struct bgp_node *rn, */ void bgp_adj_out_unset_subgroup(struct bgp_node *rn, struct update_subgroup *subgrp, char withdraw, - u_int32_t addpath_tx_id) + uint32_t addpath_tx_id) { struct bgp_adj_out *adj; struct bgp_advertise *adv; diff --git a/bgpd/bgp_updgrp_packet.c b/bgpd/bgp_updgrp_packet.c index 1d50cb1ca..8ba7902a5 100644 --- a/bgpd/bgp_updgrp_packet.c +++ b/bgpd/bgp_updgrp_packet.c @@ -396,7 +396,7 @@ struct stream *bpacket_reformat_for_peer(struct bpacket *pkt, vec = &pkt->arr.entries[BGP_ATTR_VEC_NH]; if (CHECK_FLAG(vec->flags, BPKT_ATTRVEC_FLAGS_UPDATED)) { - u_int8_t nhlen; + uint8_t nhlen; afi_t nhafi = AFI_MAX; /* NH AFI is based on nhlen! */ int route_map_sets_nh; nhlen = stream_getc_from(s, vec->offset); @@ -699,10 +699,10 @@ struct bpacket *subgroup_update_packet(struct update_subgroup *subgrp) int num_pfx = 0; int addpath_encode = 0; int addpath_overhead = 0; - u_int32_t addpath_tx_id = 0; + uint32_t addpath_tx_id = 0; struct prefix_rd *prd = NULL; mpls_label_t label = MPLS_INVALID_LABEL, *label_pnt = NULL; - u_int32_t num_labels = 0; + uint32_t num_labels = 0; if (!subgrp) return NULL; @@ -937,7 +937,7 @@ struct bpacket *subgroup_withdraw_packet(struct update_subgroup *subgrp) size_t mp_start = 0; size_t attrlen_pos = 0; size_t mplen_pos = 0; - u_char first_time = 1; + uint8_t first_time = 1; afi_t afi; safi_t safi; int space_remaining = 0; @@ -945,7 +945,7 @@ struct bpacket *subgroup_withdraw_packet(struct update_subgroup *subgrp) int num_pfx = 0; int addpath_encode = 0; int addpath_overhead = 0; - u_int32_t addpath_tx_id = 0; + uint32_t addpath_tx_id = 0; struct prefix_rd *prd = NULL; diff --git a/bgpd/bgp_vpn.c b/bgpd/bgp_vpn.c index 4661e195a..80bd2cd79 100644 --- a/bgpd/bgp_vpn.c +++ b/bgpd/bgp_vpn.c @@ -32,7 +32,7 @@ int show_adj_route_vpn(struct vty *vty, struct peer *peer, struct prefix_rd *prd, afi_t afi, safi_t safi, - u_char use_json) + uint8_t use_json) { struct bgp *bgp; struct bgp_table *table; @@ -124,14 +124,14 @@ int show_adj_route_vpn(struct vty *vty, struct peer *peer, } if (rd_header) { - u_int16_t type; + uint16_t type; struct rd_as rd_as; struct rd_ip rd_ip = {0}; #if ENABLE_BGP_VNC struct rd_vnc_eth rd_vnc_eth = { 0}; #endif - u_char *pnt; + uint8_t *pnt; pnt = rn->p.u.val; diff --git a/bgpd/bgp_vpn.h b/bgpd/bgp_vpn.h index d2a2cb4a5..98b4d9f18 100644 --- a/bgpd/bgp_vpn.h +++ b/bgpd/bgp_vpn.h @@ -25,6 +25,6 @@ extern int show_adj_route_vpn(struct vty *vty, struct peer *peer, struct prefix_rd *prd, afi_t afi, safi_t safi, - u_char use_json); + uint8_t use_json); #endif /* _QUAGGA_BGP_VPN_H */ diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index ad6f1a558..528cdeae5 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -1111,11 +1111,11 @@ DEFUN (no_bgp_confederation_peers, * @set: 1 for setting values, 0 for removing the max-paths config. */ static int bgp_maxpaths_config_vty(struct vty *vty, int peer_type, - const char *mpaths, u_int16_t options, + const char *mpaths, uint16_t options, int set) { VTY_DECLVAR_CONTEXT(bgp, bgp); - u_int16_t maxpaths = 0; + uint16_t maxpaths = 0; int ret; afi_t afi; safi_t safi; @@ -1257,8 +1257,8 @@ static int bgp_update_delay_config_vty(struct vty *vty, const char *delay, const char *wait) { VTY_DECLVAR_CONTEXT(bgp, bgp); - u_int16_t update_delay; - u_int16_t establish_wait; + uint16_t update_delay; + uint16_t establish_wait; update_delay = strtoul(delay, NULL, 10); @@ -1779,7 +1779,7 @@ DEFUN (bgp_graceful_restart_stalepath_time, { VTY_DECLVAR_CONTEXT(bgp, bgp); int idx_number = 3; - u_int32_t stalepath; + uint32_t stalepath; stalepath = strtoul(argv[idx_number]->arg, NULL, 10); bgp->stalepath_time = stalepath; @@ -1796,7 +1796,7 @@ DEFUN (bgp_graceful_restart_restart_time, { VTY_DECLVAR_CONTEXT(bgp, bgp); int idx_number = 3; - u_int32_t restart; + uint32_t restart; restart = strtoul(argv[idx_number]->arg, NULL, 10); bgp->restart_time = restart; @@ -2292,7 +2292,7 @@ DEFUN (bgp_default_local_preference, { VTY_DECLVAR_CONTEXT(bgp, bgp); int idx_number = 3; - u_int32_t local_pref; + uint32_t local_pref; local_pref = strtoul(argv[idx_number]->arg, NULL, 10); @@ -2329,7 +2329,7 @@ DEFUN (bgp_default_subgroup_pkt_queue_max, { VTY_DECLVAR_CONTEXT(bgp, bgp); int idx_number = 3; - u_int32_t max_size; + uint32_t max_size; max_size = strtoul(argv[idx_number]->arg, NULL, 10); @@ -3404,7 +3404,7 @@ ALIAS_HIDDEN(no_neighbor_set_peer_group, no_neighbor_set_peer_group_hidden_cmd, "Peer-group name\n") static int peer_flag_modify_vty(struct vty *vty, const char *ip_str, - u_int16_t flag, int set) + uint16_t flag, int set) { int ret; struct peer *peer; @@ -3436,14 +3436,13 @@ static int peer_flag_modify_vty(struct vty *vty, const char *ip_str, return bgp_vty_return(vty, ret); } -static int peer_flag_set_vty(struct vty *vty, const char *ip_str, - u_int16_t flag) +static int peer_flag_set_vty(struct vty *vty, const char *ip_str, uint16_t flag) { return peer_flag_modify_vty(vty, ip_str, flag, 1); } static int peer_flag_unset_vty(struct vty *vty, const char *ip_str, - u_int16_t flag) + uint16_t flag) { return peer_flag_modify_vty(vty, ip_str, flag, 0); } @@ -3608,7 +3607,7 @@ DEFUN (no_neighbor_capability_enhe, } static int peer_af_flag_modify_vty(struct vty *vty, const char *peer_str, - afi_t afi, safi_t safi, u_int32_t flag, + afi_t afi, safi_t safi, uint32_t flag, int set) { int ret; @@ -3627,13 +3626,13 @@ static int peer_af_flag_modify_vty(struct vty *vty, const char *peer_str, } static int peer_af_flag_set_vty(struct vty *vty, const char *peer_str, - afi_t afi, safi_t safi, u_int32_t flag) + afi_t afi, safi_t safi, uint32_t flag) { return peer_af_flag_modify_vty(vty, peer_str, afi, safi, flag, 1); } static int peer_af_flag_unset_vty(struct vty *vty, const char *peer_str, - afi_t afi, safi_t safi, u_int32_t flag) + afi_t afi, safi_t safi, uint32_t flag) { return peer_af_flag_modify_vty(vty, peer_str, afi, safi, flag, 0); } @@ -3653,7 +3652,7 @@ DEFUN (neighbor_capability_orf_prefix, { int idx_peer = 1; int idx_send_recv = 5; - u_int16_t flag = 0; + uint16_t flag = 0; if (strmatch(argv[idx_send_recv]->text, "send")) flag = PEER_FLAG_ORF_PREFIX_SM; @@ -3697,7 +3696,7 @@ DEFUN (no_neighbor_capability_orf_prefix, { int idx_peer = 2; int idx_send_recv = 6; - u_int16_t flag = 0; + uint16_t flag = 0; if (strmatch(argv[idx_send_recv]->text, "send")) flag = PEER_FLAG_ORF_PREFIX_SM; @@ -4072,7 +4071,7 @@ DEFUN (neighbor_send_community_type, "Send Large Community attributes\n") { int idx = 0; - u_int32_t flag = 0; + uint32_t flag = 0; char *peer = argv[1]->arg; @@ -4338,7 +4337,7 @@ DEFUN (neighbor_attr_unchanged, int idx = 0; char *peer_str = argv[1]->arg; struct peer *peer; - u_int16_t flags = 0; + uint16_t flags = 0; afi_t afi = bgp_node_afi(vty); safi_t safi = bgp_node_safi(vty); @@ -4408,7 +4407,7 @@ DEFUN (no_neighbor_attr_unchanged, { int idx = 0; char *peer = argv[2]->arg; - u_int16_t flags = 0; + uint16_t flags = 0; if (argv_find(argv, argc, "as-path", &idx)) SET_FLAG(flags, PEER_FLAG_AS_PATH_UNCHANGED); @@ -4747,7 +4746,7 @@ static int peer_port_vty(struct vty *vty, const char *ip_str, int afi, const char *port_str) { struct peer *peer; - u_int16_t port; + uint16_t port; struct servent *sp; peer = peer_lookup_vty(vty, ip_str); @@ -4924,8 +4923,8 @@ static int peer_timers_set_vty(struct vty *vty, const char *ip_str, { int ret; struct peer *peer; - u_int32_t keepalive; - u_int32_t holdtime; + uint32_t keepalive; + uint32_t holdtime; peer = peer_and_group_lookup_vty(vty, ip_str); if (!peer) @@ -4990,7 +4989,7 @@ static int peer_timers_connect_set_vty(struct vty *vty, const char *ip_str, { int ret; struct peer *peer; - u_int32_t connect; + uint32_t connect; peer = peer_and_group_lookup_vty(vty, ip_str); if (!peer) @@ -5052,7 +5051,7 @@ static int peer_advertise_interval_vty(struct vty *vty, const char *ip_str, { int ret; struct peer *peer; - u_int32_t routeadv = 0; + uint32_t routeadv = 0; peer = peer_and_group_lookup_vty(vty, ip_str); if (!peer) @@ -5107,7 +5106,7 @@ DEFUN (bgp_set_route_map_delay_timer, "0 disables the timer, no route updates happen when route-maps change\n") { int idx_number = 3; - u_int32_t rmap_delay_timer; + uint32_t rmap_delay_timer; if (argv[idx_number]->arg) { rmap_delay_timer = strtoul(argv[idx_number]->arg, NULL, 10); @@ -5658,9 +5657,9 @@ static int peer_maximum_prefix_set_vty(struct vty *vty, const char *ip_str, { int ret; struct peer *peer; - u_int32_t max; - u_char threshold; - u_int16_t restart; + uint32_t max; + uint8_t threshold; + uint16_t restart; peer = peer_and_group_lookup_vty(vty, ip_str); if (!peer) @@ -6969,7 +6968,7 @@ DEFUN (show_bgp_vrfs, struct list *inst = bm->bgp; struct listnode *node; struct bgp *bgp; - u_char uj = use_json(argc, argv); + uint8_t uj = use_json(argc, argv); json_object *json = NULL; json_object *json_vrfs = NULL; int count = 0; @@ -7290,7 +7289,7 @@ static void bgp_show_bestpath_json(struct bgp *bgp, json_object *json) /* Show BGP peer's summary information. */ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi, - u_char use_json, json_object *json) + uint8_t use_json, json_object *json) { struct peer *peer; struct listnode *node, *nnode; @@ -7705,7 +7704,7 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi, } static void bgp_show_summary_afi_safi(struct vty *vty, struct bgp *bgp, int afi, - int safi, u_char use_json, + int safi, uint8_t use_json, json_object *json) { int is_first = 1; @@ -7767,7 +7766,7 @@ static void bgp_show_summary_afi_safi(struct vty *vty, struct bgp *bgp, int afi, } static void bgp_show_all_instances_summary_vty(struct vty *vty, afi_t afi, - safi_t safi, u_char use_json) + safi_t safi, uint8_t use_json) { struct listnode *node, *nnode; struct bgp *bgp; @@ -7804,7 +7803,7 @@ static void bgp_show_all_instances_summary_vty(struct vty *vty, afi_t afi, } int bgp_show_summary_vty(struct vty *vty, const char *name, afi_t afi, - safi_t safi, u_char use_json) + safi_t safi, uint8_t use_json) { struct bgp *bgp; @@ -7942,9 +7941,9 @@ enum show_type { show_all, show_peer }; static void bgp_show_peer_afi_orf_cap(struct vty *vty, struct peer *p, afi_t afi, safi_t safi, - u_int16_t adv_smcap, u_int16_t adv_rmcap, - u_int16_t rcv_smcap, u_int16_t rcv_rmcap, - u_char use_json, json_object *json_pref) + uint16_t adv_smcap, uint16_t adv_rmcap, + uint16_t rcv_smcap, uint16_t rcv_rmcap, + uint8_t use_json, json_object *json_pref) { /* Send-Mode */ if (CHECK_FLAG(p->af_cap[afi][safi], adv_smcap) @@ -8004,7 +8003,7 @@ static void bgp_show_peer_afi_orf_cap(struct vty *vty, struct peer *p, } static void bgp_show_peer_afi(struct vty *vty, struct peer *p, afi_t afi, - safi_t safi, u_char use_json, + safi_t safi, uint8_t use_json, json_object *json_neigh) { struct bgp_filter *filter; @@ -8579,7 +8578,7 @@ static void bgp_show_peer_afi(struct vty *vty, struct peer *p, afi_t afi, } } -static void bgp_show_peer(struct vty *vty, struct peer *p, u_char use_json, +static void bgp_show_peer(struct vty *vty, struct peer *p, uint8_t use_json, json_object *json) { struct bgp *bgp; @@ -8590,8 +8589,8 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, u_char use_json, const char *code_str; afi_t afi; safi_t safi; - u_int16_t i; - u_char *msg; + uint16_t i; + uint8_t *msg; json_object *json_neigh = NULL; time_t epoch_tbuf; @@ -10026,7 +10025,7 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, u_char use_json, msg_str = bgp_notify_admin_message( msgbuf, sizeof(msgbuf), - (u_char *)p->notify.data, + (uint8_t *)p->notify.data, p->notify.length); if (msg_str) json_object_string_add( @@ -10062,7 +10061,7 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, u_char use_json, msg_str = bgp_notify_admin_message( msgbuf, sizeof(msgbuf), - (u_char *)p->notify.data, + (uint8_t *)p->notify.data, p->notify.length); if (msg_str) vty_out(vty, @@ -10316,7 +10315,7 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, u_char use_json, static int bgp_show_neighbor(struct vty *vty, struct bgp *bgp, enum show_type type, union sockunion *su, - const char *conf_if, u_char use_json, + const char *conf_if, uint8_t use_json, json_object *json) { struct listnode *node, *nnode; @@ -10373,7 +10372,7 @@ static int bgp_show_neighbor(struct vty *vty, struct bgp *bgp, static void bgp_show_all_instances_neighbors_vty(struct vty *vty, enum show_type type, const char *ip_str, - u_char use_json) + uint8_t use_json) { struct listnode *node, *nnode; struct bgp *bgp; @@ -10440,7 +10439,7 @@ static void bgp_show_all_instances_neighbors_vty(struct vty *vty, static int bgp_show_neighbor_vty(struct vty *vty, const char *name, enum show_type type, const char *ip_str, - u_char use_json) + uint8_t use_json) { int ret; struct bgp *bgp; @@ -10515,7 +10514,7 @@ DEFUN (show_ip_bgp_neighbors, char *sh_arg = NULL; enum show_type sh_type; - u_char uj = use_json(argc, argv); + uint8_t uj = use_json(argc, argv); int idx = 0; @@ -11027,7 +11026,7 @@ DEFUN (bgp_redistribute_ipv4_metric, int idx_protocol = 1; int idx_number = 3; int type; - u_int32_t metric; + uint32_t metric; struct bgp_redist *red; type = proto_redistnum(AFI_IP, argv[idx_protocol]->text); @@ -11064,7 +11063,7 @@ DEFUN (bgp_redistribute_ipv4_rmap_metric, int idx_word = 3; int idx_number = 5; int type; - u_int32_t metric; + uint32_t metric; struct bgp_redist *red; type = proto_redistnum(AFI_IP, argv[idx_protocol]->text); @@ -11106,7 +11105,7 @@ DEFUN (bgp_redistribute_ipv4_metric_rmap, int idx_number = 3; int idx_word = 5; int type; - u_int32_t metric; + uint32_t metric; struct bgp_redist *red; type = proto_redistnum(AFI_IP, argv[idx_protocol]->text); @@ -11144,8 +11143,8 @@ DEFUN (bgp_redistribute_ipv4_ospf, VTY_DECLVAR_CONTEXT(bgp, bgp); int idx_ospf_table = 1; int idx_number = 2; - u_short instance; - u_short protocol; + unsigned short instance; + unsigned short protocol; instance = strtoul(argv[idx_number]->arg, NULL, 10); @@ -11180,7 +11179,7 @@ DEFUN (bgp_redistribute_ipv4_ospf_rmap, int idx_number = 2; int idx_word = 4; struct bgp_redist *red; - u_short instance; + unsigned short instance; int protocol; if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0) @@ -11218,9 +11217,9 @@ DEFUN (bgp_redistribute_ipv4_ospf_metric, int idx_ospf_table = 1; int idx_number = 2; int idx_number_2 = 4; - u_int32_t metric; + uint32_t metric; struct bgp_redist *red; - u_short instance; + unsigned short instance; int protocol; if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0) @@ -11263,9 +11262,9 @@ DEFUN (bgp_redistribute_ipv4_ospf_rmap_metric, int idx_number = 2; int idx_word = 4; int idx_number_2 = 6; - u_int32_t metric; + uint32_t metric; struct bgp_redist *red; - u_short instance; + unsigned short instance; int protocol; if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0) @@ -11312,9 +11311,9 @@ DEFUN (bgp_redistribute_ipv4_ospf_metric_rmap, int idx_number = 2; int idx_number_2 = 4; int idx_word = 6; - u_int32_t metric; + uint32_t metric; struct bgp_redist *red; - u_short instance; + unsigned short instance; int protocol; if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0) @@ -11360,7 +11359,7 @@ DEFUN (no_bgp_redistribute_ipv4_ospf, VTY_DECLVAR_CONTEXT(bgp, bgp); int idx_ospf_table = 2; int idx_number = 3; - u_short instance; + unsigned short instance; int protocol; if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0) @@ -11476,7 +11475,7 @@ DEFUN (bgp_redistribute_ipv6_metric, int idx_protocol = 1; int idx_number = 3; int type; - u_int32_t metric; + uint32_t metric; struct bgp_redist *red; type = proto_redistnum(AFI_IP6, argv[idx_protocol]->text); @@ -11506,7 +11505,7 @@ DEFUN (bgp_redistribute_ipv6_rmap_metric, int idx_word = 3; int idx_number = 5; int type; - u_int32_t metric; + uint32_t metric; struct bgp_redist *red; type = proto_redistnum(AFI_IP6, argv[idx_protocol]->text); @@ -11537,7 +11536,7 @@ DEFUN (bgp_redistribute_ipv6_metric_rmap, int idx_number = 3; int idx_word = 5; int type; - u_int32_t metric; + uint32_t metric; struct bgp_redist *red; type = proto_redistnum(AFI_IP6, argv[idx_protocol]->text); diff --git a/bgpd/bgp_vty.h b/bgpd/bgp_vty.h index f77ebb610..7a9546e3e 100644 --- a/bgpd/bgp_vty.h +++ b/bgpd/bgp_vty.h @@ -70,7 +70,7 @@ extern int bgp_vty_find_and_parse_afi_safi_bgp(struct vty *vty, int argc, int *idx, afi_t *afi, safi_t *safi, struct bgp **bgp); extern int bgp_show_summary_vty(struct vty *vty, const char *name, afi_t afi, - safi_t safi, u_char use_json); + safi_t safi, uint8_t use_json); extern void bgp_vpn_policy_config_write_afi(struct vty *vty, struct bgp *bgp, afi_t afi); #endif /* _QUAGGA_BGP_VTY_H */ diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 1e3b2a4f4..77416e3cf 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -979,10 +979,10 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p, int nh_family; unsigned int valid_nh_count = 0; int has_valid_label = 0; - u_char distance; + uint8_t distance; struct peer *peer; struct bgp_info *mpinfo; - u_int32_t metric; + uint32_t metric; struct attr local_attr; struct bgp_info local_info; struct bgp_info *mpinfo_cp = &local_info; @@ -1367,8 +1367,8 @@ void bgp_zebra_withdraw(struct prefix *p, struct bgp_info *info, zclient_route_send(ZEBRA_ROUTE_DELETE, zclient, &api); } -struct bgp_redist *bgp_redist_lookup(struct bgp *bgp, afi_t afi, u_char type, - u_short instance) +struct bgp_redist *bgp_redist_lookup(struct bgp *bgp, afi_t afi, uint8_t type, + unsigned short instance) { struct list *red_list; struct listnode *node; @@ -1385,8 +1385,8 @@ struct bgp_redist *bgp_redist_lookup(struct bgp *bgp, afi_t afi, u_char type, return NULL; } -struct bgp_redist *bgp_redist_add(struct bgp *bgp, afi_t afi, u_char type, - u_short instance) +struct bgp_redist *bgp_redist_add(struct bgp *bgp, afi_t afi, uint8_t type, + unsigned short instance) { struct list *red_list; struct bgp_redist *red; @@ -1408,8 +1408,8 @@ struct bgp_redist *bgp_redist_add(struct bgp *bgp, afi_t afi, u_char type, return red; } -static void bgp_redist_del(struct bgp *bgp, afi_t afi, u_char type, - u_short instance) +static void bgp_redist_del(struct bgp *bgp, afi_t afi, uint8_t type, + unsigned short instance) { struct bgp_redist *red; @@ -1424,7 +1424,8 @@ static void bgp_redist_del(struct bgp *bgp, afi_t afi, u_char type, } /* Other routes redistribution into BGP. */ -int bgp_redistribute_set(struct bgp *bgp, afi_t afi, int type, u_short instance) +int bgp_redistribute_set(struct bgp *bgp, afi_t afi, int type, + unsigned short instance) { /* Return if already redistribute flag is set. */ @@ -1471,7 +1472,7 @@ int bgp_redistribute_set(struct bgp *bgp, afi_t afi, int type, u_short instance) } int bgp_redistribute_resend(struct bgp *bgp, afi_t afi, int type, - u_short instance) + unsigned short instance) { /* Don't try to send if we're not connected to Zebra or Zebra doesn't * know of this instance. @@ -1509,7 +1510,7 @@ int bgp_redistribute_rmap_set(struct bgp_redist *red, const char *name) /* Redistribute with metric specification. */ int bgp_redistribute_metric_set(struct bgp *bgp, struct bgp_redist *red, - afi_t afi, int type, u_int32_t metric) + afi_t afi, int type, uint32_t metric) { struct bgp_node *rn; struct bgp_info *ri; @@ -1547,7 +1548,7 @@ int bgp_redistribute_metric_set(struct bgp *bgp, struct bgp_redist *red, /* Unset redistribution. */ int bgp_redistribute_unreg(struct bgp *bgp, afi_t afi, int type, - u_short instance) + unsigned short instance) { struct bgp_redist *red; @@ -1586,7 +1587,7 @@ int bgp_redistribute_unreg(struct bgp *bgp, afi_t afi, int type, /* Unset redistribution. */ int bgp_redistribute_unset(struct bgp *bgp, afi_t afi, int type, - u_short instance) + unsigned short instance) { struct bgp_redist *red; @@ -1893,7 +1894,7 @@ static int bgp_zebra_process_local_macip(int command, struct zclient *zclient, int ipa_len; char buf[ETHER_ADDR_STRLEN]; char buf1[INET6_ADDRSTRLEN]; - u_char flags; + uint8_t flags; memset(&ip, 0, sizeof(ip)); s = zclient->ibuf; diff --git a/bgpd/bgp_zebra.h b/bgpd/bgp_zebra.h index c30f63039..68c495cf8 100644 --- a/bgpd/bgp_zebra.h +++ b/bgpd/bgp_zebra.h @@ -42,16 +42,17 @@ extern void bgp_zebra_terminate_radv(struct bgp *bgp, struct peer *peer); extern void bgp_zebra_instance_register(struct bgp *); extern void bgp_zebra_instance_deregister(struct bgp *); -extern struct bgp_redist *bgp_redist_lookup(struct bgp *, afi_t, u_char, - u_short); -extern struct bgp_redist *bgp_redist_add(struct bgp *, afi_t, u_char, u_short); -extern int bgp_redistribute_set(struct bgp *, afi_t, int, u_short); -extern int bgp_redistribute_resend(struct bgp *, afi_t, int, u_short); +extern struct bgp_redist *bgp_redist_lookup(struct bgp *, afi_t, uint8_t, + unsigned short); +extern struct bgp_redist *bgp_redist_add(struct bgp *, afi_t, uint8_t, + unsigned short); +extern int bgp_redistribute_set(struct bgp *, afi_t, int, unsigned short); +extern int bgp_redistribute_resend(struct bgp *, afi_t, int, unsigned short); extern int bgp_redistribute_rmap_set(struct bgp_redist *, const char *); extern int bgp_redistribute_metric_set(struct bgp *, struct bgp_redist *, afi_t, - int, u_int32_t); -extern int bgp_redistribute_unset(struct bgp *, afi_t, int, u_short); -extern int bgp_redistribute_unreg(struct bgp *, afi_t, int, u_short); + int, uint32_t); +extern int bgp_redistribute_unset(struct bgp *, afi_t, int, unsigned short); +extern int bgp_redistribute_unreg(struct bgp *, afi_t, int, unsigned short); extern struct interface *if_lookup_by_ipv4(struct in_addr *, vrf_id_t); extern struct interface *if_lookup_by_ipv4_exact(struct in_addr *, vrf_id_t); diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index d10358459..e7a270bcc 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -376,7 +376,7 @@ time_t bgp_clock(void) } /* BGP timer configuration. */ -int bgp_timers_set(struct bgp *bgp, u_int32_t keepalive, u_int32_t holdtime) +int bgp_timers_set(struct bgp *bgp, uint32_t keepalive, uint32_t holdtime) { bgp->default_keepalive = (keepalive < holdtime / 3 ? keepalive : holdtime / 3); @@ -589,7 +589,7 @@ int bgp_confederation_peers_remove(struct bgp *bgp, as_t as) } /* Local preference configuration. */ -int bgp_default_local_preference_set(struct bgp *bgp, u_int32_t local_pref) +int bgp_default_local_preference_set(struct bgp *bgp, uint32_t local_pref) { if (!bgp) return -1; @@ -610,8 +610,7 @@ int bgp_default_local_preference_unset(struct bgp *bgp) } /* Local preference configuration. */ -int bgp_default_subgroup_pkt_queue_max_set(struct bgp *bgp, - u_int32_t queue_size) +int bgp_default_subgroup_pkt_queue_max_set(struct bgp *bgp, uint32_t queue_size) { if (!bgp) return -1; @@ -796,15 +795,14 @@ static int peer_hash_same(const void *p1, const void *p2) == CHECK_FLAG(peer2->flags, PEER_FLAG_CONFIG_NODE)); } -int peer_af_flag_check(struct peer *peer, afi_t afi, safi_t safi, - u_int32_t flag) +int peer_af_flag_check(struct peer *peer, afi_t afi, safi_t safi, uint32_t flag) { return CHECK_FLAG(peer->af_flags[afi][safi], flag); } /* Return true if flag is set for the peer but not the peer-group */ static int peergroup_af_flag_check(struct peer *peer, afi_t afi, safi_t safi, - u_int32_t flag) + uint32_t flag) { struct peer *g_peer = NULL; @@ -1302,7 +1300,7 @@ static int bgp_peer_conf_if_to_su_update_v4(struct peer *peer, { struct connected *ifc; struct prefix p; - u_int32_t addr; + uint32_t addr; struct listnode *node; /* If our IPv4 address on the interface is /30 or /31, we can derive the @@ -3709,16 +3707,16 @@ static void peer_change_action(struct peer *peer, afi_t afi, safi_t safi, struct peer_flag_action { /* Peer's flag. */ - u_int32_t flag; + uint32_t flag; /* This flag can be set for peer-group member. */ - u_char not_for_member; + uint8_t not_for_member; /* Action when the flag is changed. */ enum peer_change_type type; /* Peer down cause */ - u_char peer_down; + uint8_t peer_down; }; static const struct peer_flag_action peer_flag_action_list[] = { @@ -3765,7 +3763,7 @@ static const struct peer_flag_action peer_af_flag_action_list[] = { /* Proper action set. */ static int peer_flag_action_set(const struct peer_flag_action *action_list, int size, struct peer_flag_action *action, - u_int32_t flag) + uint32_t flag) { int i; int found = 0; @@ -3809,7 +3807,7 @@ static int peer_flag_action_set(const struct peer_flag_action *action_list, return found; } -static void peer_flag_modify_action(struct peer *peer, u_int32_t flag) +static void peer_flag_modify_action(struct peer *peer, uint32_t flag) { if (flag == PEER_FLAG_SHUTDOWN) { if (CHECK_FLAG(peer->flags, flag)) { @@ -3840,7 +3838,7 @@ static void peer_flag_modify_action(struct peer *peer, u_int32_t flag) msglen = 128; if (msglen) { - u_char msgbuf[129]; + uint8_t msgbuf[129]; msgbuf[0] = msglen; memcpy(msgbuf + 1, msg, msglen); @@ -3874,7 +3872,7 @@ static void peer_flag_modify_action(struct peer *peer, u_int32_t flag) } /* Change specified peer flag. */ -static int peer_flag_modify(struct peer *peer, u_int32_t flag, int set) +static int peer_flag_modify(struct peer *peer, uint32_t flag, int set) { int found; int size; @@ -3947,18 +3945,18 @@ static int peer_flag_modify(struct peer *peer, u_int32_t flag, int set) return 0; } -int peer_flag_set(struct peer *peer, u_int32_t flag) +int peer_flag_set(struct peer *peer, uint32_t flag) { return peer_flag_modify(peer, flag, 1); } -int peer_flag_unset(struct peer *peer, u_int32_t flag) +int peer_flag_unset(struct peer *peer, uint32_t flag) { return peer_flag_modify(peer, flag, 0); } static int peer_af_flag_modify(struct peer *peer, afi_t afi, safi_t safi, - u_int32_t flag, int set) + uint32_t flag, int set) { int found; int size; @@ -4114,13 +4112,12 @@ static int peer_af_flag_modify(struct peer *peer, afi_t afi, safi_t safi, return 0; } -int peer_af_flag_set(struct peer *peer, afi_t afi, safi_t safi, u_int32_t flag) +int peer_af_flag_set(struct peer *peer, afi_t afi, safi_t safi, uint32_t flag) { return peer_af_flag_modify(peer, afi, safi, flag, 1); } -int peer_af_flag_unset(struct peer *peer, afi_t afi, safi_t safi, - u_int32_t flag) +int peer_af_flag_unset(struct peer *peer, afi_t afi, safi_t safi, uint32_t flag) { return peer_af_flag_modify(peer, afi, safi, flag, 0); } @@ -4552,7 +4549,7 @@ int peer_default_originate_unset(struct peer *peer, afi_t afi, safi_t safi) return 0; } -int peer_port_set(struct peer *peer, u_int16_t port) +int peer_port_set(struct peer *peer, uint16_t port) { peer->port = port; return 0; @@ -4591,7 +4588,7 @@ static void peer_on_policy_change(struct peer *peer, afi_t afi, safi_t safi, /* neighbor weight. */ -int peer_weight_set(struct peer *peer, afi_t afi, safi_t safi, u_int16_t weight) +int peer_weight_set(struct peer *peer, afi_t afi, safi_t safi, uint16_t weight) { struct peer_group *group; struct listnode *node, *nnode; @@ -4671,7 +4668,7 @@ int peer_weight_unset(struct peer *peer, afi_t afi, safi_t safi) return 0; } -int peer_timers_set(struct peer *peer, u_int32_t keepalive, u_int32_t holdtime) +int peer_timers_set(struct peer *peer, uint32_t keepalive, uint32_t holdtime) { struct peer_group *group; struct listnode *node, *nnode; @@ -4752,7 +4749,7 @@ int peer_timers_unset(struct peer *peer) return 0; } -int peer_timers_connect_set(struct peer *peer, u_int32_t connect) +int peer_timers_connect_set(struct peer *peer, uint32_t connect) { struct peer_group *group; struct listnode *node, *nnode; @@ -4805,7 +4802,7 @@ int peer_timers_connect_unset(struct peer *peer) return 0; } -int peer_advertise_interval_set(struct peer *peer, u_int32_t routeadv) +int peer_advertise_interval_set(struct peer *peer, uint32_t routeadv) { struct peer_group *group; struct listnode *node, *nnode; @@ -5872,8 +5869,8 @@ int peer_unsuppress_map_unset(struct peer *peer, afi_t afi, safi_t safi) } int peer_maximum_prefix_set(struct peer *peer, afi_t afi, safi_t safi, - u_int32_t max, u_char threshold, int warning, - u_int16_t restart) + uint32_t max, uint8_t threshold, int warning, + uint16_t restart) { struct peer_group *group; struct listnode *node, *nnode; @@ -6217,7 +6214,7 @@ int peer_clear_soft(struct peer *peer, afi_t afi, safi_t safi, || CHECK_FLAG(peer->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_OLD_RCV))) { struct bgp_filter *filter = &peer->filter[afi][safi]; - u_char prefix_type; + uint8_t prefix_type; if (CHECK_FLAG(peer->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_RCV)) @@ -6271,7 +6268,7 @@ int peer_clear_soft(struct peer *peer, afi_t afi, safi_t safi, } /* Display peer uptime.*/ -char *peer_uptime(time_t uptime2, char *buf, size_t len, u_char use_json, +char *peer_uptime(time_t uptime2, char *buf, size_t len, uint8_t use_json, json_object *json) { time_t uptime1, epoch_tbuf; @@ -6281,7 +6278,7 @@ char *peer_uptime(time_t uptime2, char *buf, size_t len, u_char use_json, if (len < BGP_UPTIME_LEN) { if (!use_json) { zlog_warn("peer_uptime (): buffer shortage %lu", - (u_long)len); + (unsigned long)len); /* XXX: should return status instead of buf... */ snprintf(buf, len, "<error> "); } diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index 79fe8c8c3..9dc398da1 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -60,9 +60,9 @@ enum { AS_UNSPECIFIED = 0, }; /* Typedef BGP specific types. */ -typedef u_int32_t as_t; -typedef u_int16_t as16_t; /* we may still encounter 16 Bit asnums */ -typedef u_int16_t bgp_size_t; +typedef uint32_t as_t; +typedef uint16_t as16_t; /* we may still encounter 16 Bit asnums */ +typedef uint16_t bgp_size_t; #define max(a, b) \ ({ \ @@ -112,7 +112,7 @@ struct bgp_master { struct list *listen_sockets; /* BGP port number. */ - u_int16_t port; + uint16_t port; /* Listener address */ char *address; @@ -121,7 +121,7 @@ struct bgp_master { time_t start_time; /* Various BGP global configuration. */ - u_char options; + uint8_t options; #define BGP_OPT_NO_FIB (1 << 0) #define BGP_OPT_MULTIPLE_INSTANCE (1 << 1) #define BGP_OPT_CONFIG_CISCO (1 << 2) @@ -132,7 +132,7 @@ struct bgp_master { /* timer to dampen route map changes */ struct thread *t_rmap_update; /* Handle route map updates */ - u_int32_t rmap_update_timer; /* Route map update timer */ + uint32_t rmap_update_timer; /* Route map update timer */ #define RMAP_DEFAULT_UPDATE_TIMER 5 /* disabled by default */ /* Id space for automatic RD derivation for an EVI/VRF */ @@ -149,11 +149,11 @@ struct bgp_rmap { }; struct bgp_redist { - u_short instance; + unsigned short instance; /* BGP redistribute metric configuration. */ - u_char redist_metric_flag; - u_int32_t redist_metric; + uint8_t redist_metric_flag; + uint32_t redist_metric; /* BGP redistribute route-map. */ struct bgp_rmap rmap; @@ -216,23 +216,23 @@ struct bgp { * Global statistics for update groups. */ struct { - u_int32_t join_events; - u_int32_t prune_events; - u_int32_t merge_events; - u_int32_t split_events; - u_int32_t updgrp_switch_events; - u_int32_t peer_refreshes_combined; - u_int32_t adj_count; - u_int32_t merge_checks_triggered; - - u_int32_t updgrps_created; - u_int32_t updgrps_deleted; - u_int32_t subgrps_created; - u_int32_t subgrps_deleted; + uint32_t join_events; + uint32_t prune_events; + uint32_t merge_events; + uint32_t split_events; + uint32_t updgrp_switch_events; + uint32_t peer_refreshes_combined; + uint32_t adj_count; + uint32_t merge_checks_triggered; + + uint32_t updgrps_created; + uint32_t updgrps_deleted; + uint32_t subgrps_created; + uint32_t subgrps_deleted; } update_group_stats; /* BGP configuration. */ - u_int16_t config; + uint16_t config; #define BGP_CONFIG_CLUSTER_ID (1 << 0) #define BGP_CONFIG_CONFEDERATION (1 << 1) @@ -252,45 +252,45 @@ struct bgp { struct thread *t_startup; /* start-up timer on only once at the beginning */ - u_int32_t v_maxmed_onstartup; /* Duration of max-med on start-up */ + uint32_t v_maxmed_onstartup; /* Duration of max-med on start-up */ #define BGP_MAXMED_ONSTARTUP_UNCONFIGURED 0 /* 0 means off, its the default */ - u_int32_t maxmed_onstartup_value; /* Max-med value when active on - start-up */ + uint32_t maxmed_onstartup_value; /* Max-med value when active on + start-up */ struct thread *t_maxmed_onstartup; /* non-null when max-med onstartup is on */ - u_char maxmed_onstartup_over; /* Flag to make it effective only once */ + uint8_t maxmed_onstartup_over; /* Flag to make it effective only once */ - u_char v_maxmed_admin; /* 1/0 if max-med administrative is on/off */ + uint8_t v_maxmed_admin; /* 1/0 if max-med administrative is on/off */ #define BGP_MAXMED_ADMIN_UNCONFIGURED 0 /* Off by default */ - u_int32_t maxmed_admin_value; /* Max-med value when administrative in on - */ + uint32_t maxmed_admin_value; /* Max-med value when administrative in on + */ #define BGP_MAXMED_VALUE_DEFAULT 4294967294 /* Maximum by default */ - u_char maxmed_active; /* 1/0 if max-med is active or not */ - u_int32_t maxmed_value; /* Max-med value when its active */ + uint8_t maxmed_active; /* 1/0 if max-med is active or not */ + uint32_t maxmed_value; /* Max-med value when its active */ /* BGP update delay on startup */ struct thread *t_update_delay; struct thread *t_establish_wait; - u_char update_delay_over; - u_char main_zebra_update_hold; - u_char main_peers_update_hold; - u_int16_t v_update_delay; - u_int16_t v_establish_wait; + uint8_t update_delay_over; + uint8_t main_zebra_update_hold; + uint8_t main_peers_update_hold; + uint16_t v_update_delay; + uint16_t v_establish_wait; char update_delay_begin_time[64]; char update_delay_end_time[64]; char update_delay_zebra_resume_time[64]; char update_delay_peers_resume_time[64]; - u_int32_t established; - u_int32_t restarted_peers; - u_int32_t implicit_eors; - u_int32_t explicit_eors; + uint32_t established; + uint32_t restarted_peers; + uint32_t implicit_eors; + uint32_t explicit_eors; #define BGP_UPDATE_DELAY_DEF 0 #define BGP_UPDATE_DELAY_MIN 0 #define BGP_UPDATE_DELAY_MAX 3600 /* BGP flags. */ - u_int32_t flags; + uint32_t flags; #define BGP_FLAG_ALWAYS_COMPARE_MED (1 << 0) #define BGP_FLAG_DETERMINISTIC_MED (1 << 1) #define BGP_FLAG_MED_MISSING_AS_WORST (1 << 2) @@ -315,7 +315,7 @@ struct bgp { #define BGP_FLAG_GRACEFUL_SHUTDOWN (1 << 21) /* BGP Per AF flags */ - u_int16_t af_flags[AFI_MAX][SAFI_MAX]; + uint16_t af_flags[AFI_MAX][SAFI_MAX]; #define BGP_CONFIG_DAMPENING (1 << 0) #define BGP_CONFIG_VRF_TO_MPLSVPN_EXPORT (1 << 1) #define BGP_CONFIG_MPLSVPN_TO_VRF_IMPORT (1 << 2) @@ -357,36 +357,36 @@ struct bgp { struct list *redist[AFI_MAX][ZEBRA_ROUTE_MAX]; /* Allocate MPLS labels */ - u_char allocate_mpls_labels[AFI_MAX][SAFI_MAX]; + uint8_t allocate_mpls_labels[AFI_MAX][SAFI_MAX]; /* timer to re-evaluate neighbor default-originate route-maps */ struct thread *t_rmap_def_originate_eval; #define RMAP_DEFAULT_ORIGINATE_EVAL_TIMER 5 /* BGP distance configuration. */ - u_char distance_ebgp[AFI_MAX][SAFI_MAX]; - u_char distance_ibgp[AFI_MAX][SAFI_MAX]; - u_char distance_local[AFI_MAX][SAFI_MAX]; + uint8_t distance_ebgp[AFI_MAX][SAFI_MAX]; + uint8_t distance_ibgp[AFI_MAX][SAFI_MAX]; + uint8_t distance_local[AFI_MAX][SAFI_MAX]; /* BGP default local-preference. */ - u_int32_t default_local_pref; + uint32_t default_local_pref; /* BGP default subgroup pkt queue max */ - u_int32_t default_subgroup_pkt_queue_max; + uint32_t default_subgroup_pkt_queue_max; /* BGP default timer. */ - u_int32_t default_holdtime; - u_int32_t default_keepalive; + uint32_t default_holdtime; + uint32_t default_keepalive; /* BGP graceful restart */ - u_int32_t restart_time; - u_int32_t stalepath_time; + uint32_t restart_time; + uint32_t stalepath_time; /* Maximum-paths configuration */ struct bgp_maxpaths_cfg { - u_int16_t maxpaths_ebgp; - u_int16_t maxpaths_ibgp; - u_int16_t ibgp_flags; + uint16_t maxpaths_ebgp; + uint16_t maxpaths_ibgp; + uint16_t ibgp_flags; #define BGP_FLAG_IBGP_MULTIPATH_SAME_CLUSTERLEN (1 << 0) } maxpaths[AFI_MAX][SAFI_MAX]; @@ -401,7 +401,7 @@ struct bgp { /* Auto-shutdown new peers */ bool autoshutdown; - u_int32_t addpath_tx_id; + uint32_t addpath_tx_id; int addpath_tx_used[AFI_MAX][SAFI_MAX]; #if ENABLE_BGP_VNC @@ -509,11 +509,11 @@ struct peer_group { /* BGP Notify message format. */ struct bgp_notify { - u_char code; - u_char subcode; + uint8_t code; + uint8_t subcode; char *data; bgp_size_t length; - u_char *raw_data; + uint8_t *raw_data; }; /* Next hop self address. */ @@ -535,7 +535,7 @@ struct bgp_nexthop { #define BGP_RD_SIZE 8 struct bgp_rd { - u_char val[BGP_RD_SIZE]; + uint8_t val[BGP_RD_SIZE]; }; #define RMAP_IN 0 @@ -719,13 +719,13 @@ struct peer { struct bgp_nexthop nexthop; /* Nexthop */ /* Peer address family configuration. */ - u_char afc[AFI_MAX][SAFI_MAX]; - u_char afc_nego[AFI_MAX][SAFI_MAX]; - u_char afc_adv[AFI_MAX][SAFI_MAX]; - u_char afc_recv[AFI_MAX][SAFI_MAX]; + uint8_t afc[AFI_MAX][SAFI_MAX]; + uint8_t afc_nego[AFI_MAX][SAFI_MAX]; + uint8_t afc_adv[AFI_MAX][SAFI_MAX]; + uint8_t afc_recv[AFI_MAX][SAFI_MAX]; /* Capability flags (reset in bgp_stop) */ - u_int32_t cap; + uint32_t cap; #define PEER_CAP_REFRESH_ADV (1 << 0) /* refresh advertised */ #define PEER_CAP_REFRESH_OLD_RCV (1 << 1) /* refresh old received */ #define PEER_CAP_REFRESH_NEW_RCV (1 << 2) /* refresh rfc received */ @@ -745,7 +745,7 @@ struct peer { #define PEER_CAP_HOSTNAME_RCV (1 << 16) /* hostname received */ /* Capability flags (reset in bgp_stop) */ - u_int32_t af_cap[AFI_MAX][SAFI_MAX]; + uint32_t af_cap[AFI_MAX][SAFI_MAX]; #define PEER_CAP_ORF_PREFIX_SM_ADV (1 << 0) /* send-mode advertised */ #define PEER_CAP_ORF_PREFIX_RM_ADV (1 << 1) /* receive-mode advertised */ #define PEER_CAP_ORF_PREFIX_SM_RCV (1 << 2) /* send-mode received */ @@ -763,7 +763,7 @@ struct peer { #define PEER_CAP_ENHE_AF_NEGO (1 << 14) /* Extended nexthop afi/safi negotiated */ /* Global configuration flags. */ - u_int32_t flags; + uint32_t flags; #define PEER_FLAG_PASSIVE (1 << 0) /* passive mode */ #define PEER_FLAG_SHUTDOWN (1 << 1) /* shutdown */ #define PEER_FLAG_DONT_CAPABILITY (1 << 2) /* dont-capability */ @@ -785,10 +785,10 @@ struct peer { char *tx_shutdown_message; /* NSF mode (graceful restart) */ - u_char nsf[AFI_MAX][SAFI_MAX]; + uint8_t nsf[AFI_MAX][SAFI_MAX]; /* Per AF configuration flags. */ - u_int32_t af_flags[AFI_MAX][SAFI_MAX]; + uint32_t af_flags[AFI_MAX][SAFI_MAX]; #define PEER_FLAG_SEND_COMMUNITY (1 << 0) /* send-community */ #define PEER_FLAG_SEND_EXT_COMMUNITY (1 << 1) /* send-community ext. */ #define PEER_FLAG_NEXTHOP_SELF (1 << 2) /* next-hop-self */ @@ -827,7 +827,7 @@ struct peer { } default_rmap[AFI_MAX][SAFI_MAX]; /* Peer status flags. */ - u_int16_t sflags; + uint16_t sflags; #define PEER_STATUS_ACCEPT_PEER (1 << 0) /* accept peer */ #define PEER_STATUS_PREFIX_OVERFLOW (1 << 1) /* prefix-overflow */ #define PEER_STATUS_CAPABILITY_OPEN (1 << 2) /* capability open send */ @@ -837,7 +837,7 @@ struct peer { #define PEER_STATUS_NSF_WAIT (1 << 6) /* wait comeback peer */ /* Peer status af flags (reset in bgp_stop) */ - u_int16_t af_sflags[AFI_MAX][SAFI_MAX]; + uint16_t af_sflags[AFI_MAX][SAFI_MAX]; #define PEER_STATUS_ORF_PREFIX_SEND (1 << 0) /* prefix-list send peer */ #define PEER_STATUS_ORF_WAIT_REFRESH (1 << 1) /* wait refresh received peer */ #define PEER_STATUS_PREFIX_THRESHOLD (1 << 2) /* exceed prefix-threshold */ @@ -846,7 +846,7 @@ struct peer { #define PEER_STATUS_EOR_RECEIVED (1 << 5) /* end-of-rib received from peer */ /* Default attribute value for the peer. */ - u_int32_t config; + uint32_t config; #define PEER_CONFIG_TIMER (1 << 0) /* keepalive & holdtime */ #define PEER_CONFIG_CONNECT (1 << 1) /* connect */ #define PEER_CONFIG_ROUTEADV (1 << 2) /* route advertise */ @@ -933,11 +933,11 @@ struct peer { _Atomic uint32_t dynamic_cap_out; /* Dynamic Capability output count. */ /* BGP state count */ - u_int32_t established; /* Established */ - u_int32_t dropped; /* Dropped */ + uint32_t established; /* Established */ + uint32_t dropped; /* Dropped */ /* Update delay related fields */ - u_char update_delay_over; /* When this is set, BGP is no more waiting + uint8_t update_delay_over; /* When this is set, BGP is no more waiting for EOR */ /* Syncronization list and time. */ @@ -971,8 +971,8 @@ struct peer { /* Max prefix count. */ unsigned long pmax[AFI_MAX][SAFI_MAX]; - u_char pmax_threshold[AFI_MAX][SAFI_MAX]; - u_int16_t pmax_restart[AFI_MAX][SAFI_MAX]; + uint8_t pmax_threshold[AFI_MAX][SAFI_MAX]; + uint16_t pmax_restart[AFI_MAX][SAFI_MAX]; #define MAXIMUM_PREFIX_THRESHOLD_DEFAULT 75 /* allowas-in. */ @@ -1010,10 +1010,10 @@ struct peer { #define PEER_DOWN_IF_DOWN 25 /* Interface down */ #define PEER_DOWN_NBR_ADDR_DEL 26 /* Peer address lost */ unsigned long last_reset_cause_size; - u_char last_reset_cause[BGP_MAX_PACKET_SIZE]; + uint8_t last_reset_cause[BGP_MAX_PACKET_SIZE]; /* The kind of route-map Flags.*/ - u_char rmap_type; + uint8_t rmap_type; #define PEER_RMAP_TYPE_IN (1 << 0) /* neighbor route-map in */ #define PEER_RMAP_TYPE_OUT (1 << 1) /* neighbor route-map out */ #define PEER_RMAP_TYPE_NETWORK (1 << 2) /* network route-map */ @@ -1052,7 +1052,7 @@ struct bgp_nlri { uint8_t safi; /* iana_safi_t */ /* Pointer to NLRI byte stream. */ - u_char *nlri; + uint8_t *nlri; /* Length of whole NLRI. */ bgp_size_t length; @@ -1353,7 +1353,7 @@ extern struct peer *peer_create(union sockunion *, const char *, struct bgp *, struct peer_group *); extern struct peer *peer_create_accept(struct bgp *); extern void peer_xfer_config(struct peer *dst, struct peer *src); -extern char *peer_uptime(time_t, char *, size_t, u_char, json_object *); +extern char *peer_uptime(time_t, char *, size_t, uint8_t, json_object *); extern int bgp_config_write(struct vty *); @@ -1394,14 +1394,13 @@ extern int bgp_confederation_peers_check(struct bgp *, as_t); extern int bgp_confederation_peers_add(struct bgp *, as_t); extern int bgp_confederation_peers_remove(struct bgp *, as_t); -extern int bgp_timers_set(struct bgp *, u_int32_t keepalive, - u_int32_t holdtime); +extern int bgp_timers_set(struct bgp *, uint32_t keepalive, uint32_t holdtime); extern int bgp_timers_unset(struct bgp *); -extern int bgp_default_local_preference_set(struct bgp *, u_int32_t); +extern int bgp_default_local_preference_set(struct bgp *, uint32_t); extern int bgp_default_local_preference_unset(struct bgp *); -extern int bgp_default_subgroup_pkt_queue_max_set(struct bgp *bgp, u_int32_t); +extern int bgp_default_subgroup_pkt_queue_max_set(struct bgp *bgp, uint32_t); extern int bgp_default_subgroup_pkt_queue_max_unset(struct bgp *bgp); extern int bgp_listen_limit_set(struct bgp *, int); @@ -1427,12 +1426,12 @@ extern int peer_group_bind(struct bgp *, union sockunion *, struct peer *, struct peer_group *, as_t *); extern int peer_group_unbind(struct bgp *, struct peer *, struct peer_group *); -extern int peer_flag_set(struct peer *, u_int32_t); -extern int peer_flag_unset(struct peer *, u_int32_t); +extern int peer_flag_set(struct peer *, uint32_t); +extern int peer_flag_unset(struct peer *, uint32_t); -extern int peer_af_flag_set(struct peer *, afi_t, safi_t, u_int32_t); -extern int peer_af_flag_unset(struct peer *, afi_t, safi_t, u_int32_t); -extern int peer_af_flag_check(struct peer *, afi_t, safi_t, u_int32_t); +extern int peer_af_flag_set(struct peer *, afi_t, safi_t, uint32_t); +extern int peer_af_flag_unset(struct peer *, afi_t, safi_t, uint32_t); +extern int peer_af_flag_check(struct peer *, afi_t, safi_t, uint32_t); extern int peer_ebgp_multihop_set(struct peer *, int); extern int peer_ebgp_multihop_unset(struct peer *); @@ -1449,20 +1448,20 @@ extern int peer_default_originate_set(struct peer *, afi_t, safi_t, const char *); extern int peer_default_originate_unset(struct peer *, afi_t, safi_t); -extern int peer_port_set(struct peer *, u_int16_t); +extern int peer_port_set(struct peer *, uint16_t); extern int peer_port_unset(struct peer *); -extern int peer_weight_set(struct peer *, afi_t, safi_t, u_int16_t); +extern int peer_weight_set(struct peer *, afi_t, safi_t, uint16_t); extern int peer_weight_unset(struct peer *, afi_t, safi_t); -extern int peer_timers_set(struct peer *, u_int32_t keepalive, - u_int32_t holdtime); +extern int peer_timers_set(struct peer *, uint32_t keepalive, + uint32_t holdtime); extern int peer_timers_unset(struct peer *); -extern int peer_timers_connect_set(struct peer *, u_int32_t); +extern int peer_timers_connect_set(struct peer *, uint32_t); extern int peer_timers_connect_unset(struct peer *); -extern int peer_advertise_interval_set(struct peer *, u_int32_t); +extern int peer_advertise_interval_set(struct peer *, uint32_t); extern int peer_advertise_interval_unset(struct peer *); extern void peer_interface_set(struct peer *, const char *); @@ -1494,8 +1493,8 @@ extern int peer_password_unset(struct peer *); extern int peer_unsuppress_map_unset(struct peer *, afi_t, safi_t); -extern int peer_maximum_prefix_set(struct peer *, afi_t, safi_t, u_int32_t, - u_char, int, u_int16_t); +extern int peer_maximum_prefix_set(struct peer *, afi_t, safi_t, uint32_t, + uint8_t, int, uint16_t); extern int peer_maximum_prefix_unset(struct peer *, afi_t, safi_t); extern int peer_clear(struct peer *, struct listnode **); diff --git a/bgpd/rfapi/rfapi_backend.h b/bgpd/rfapi/rfapi_backend.h index 4455d66a2..bcd894b88 100644 --- a/bgpd/rfapi/rfapi_backend.h +++ b/bgpd/rfapi/rfapi_backend.h @@ -37,13 +37,14 @@ void bgp_rfapi_destroy(struct bgp *bgp, struct rfapi *h); extern void rfapiProcessUpdate(struct peer *peer, void *rfd, struct prefix *p, struct prefix_rd *prd, struct attr *attr, - afi_t afi, safi_t safi, u_char type, - u_char sub_type, uint32_t *label); + afi_t afi, safi_t safi, uint8_t type, + uint8_t sub_type, uint32_t *label); extern void rfapiProcessWithdraw(struct peer *peer, void *rfd, struct prefix *p, struct prefix_rd *prd, struct attr *attr, - afi_t afi, safi_t safi, u_char type, int kill); + afi_t afi, safi_t safi, uint8_t type, + int kill); extern void rfapiProcessPeerDown(struct peer *peer); diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c index 348f1557e..d5208f696 100644 --- a/bgpd/rfapi/rfapi_import.c +++ b/bgpd/rfapi/rfapi_import.c @@ -503,7 +503,7 @@ int rfapiGetUnAddrOfVpnBi(struct bgp_info *bi, struct prefix *p) */ static struct bgp_info *rfapiBgpInfoCreate(struct attr *attr, struct peer *peer, void *rfd, struct prefix_rd *prd, - u_char type, u_char sub_type, + uint8_t type, uint8_t sub_type, uint32_t *label) { struct bgp_info *new; @@ -2879,7 +2879,7 @@ typedef void(rfapi_bi_filtered_import_f)(struct rfapi_import_table *, int, struct peer *, void *, struct prefix *, struct prefix *, afi_t, struct prefix_rd *, struct attr *, - u_char, u_char, uint32_t *); + uint8_t, uint8_t, uint32_t *); static void rfapiExpireEncapNow(struct rfapi_import_table *it, @@ -2932,8 +2932,8 @@ static void rfapiBgpInfoFilteredImportEncap( struct prefix *aux_prefix, /* Unused for encap routes */ afi_t afi, struct prefix_rd *prd, struct attr *attr, /* part of bgp_info */ - u_char type, /* part of bgp_info */ - u_char sub_type, /* part of bgp_info */ + uint8_t type, /* part of bgp_info */ + uint8_t sub_type, /* part of bgp_info */ uint32_t *label) /* part of bgp_info */ { struct route_table *rt = NULL; @@ -3391,8 +3391,8 @@ void rfapiBgpInfoFilteredImportVPN( struct prefix *aux_prefix, /* AFI_L2VPN: optional IP */ afi_t afi, struct prefix_rd *prd, struct attr *attr, /* part of bgp_info */ - u_char type, /* part of bgp_info */ - u_char sub_type, /* part of bgp_info */ + uint8_t type, /* part of bgp_info */ + uint8_t sub_type, /* part of bgp_info */ uint32_t *label) /* part of bgp_info */ { struct route_table *rt = NULL; @@ -3869,8 +3869,8 @@ static void rfapiBgpInfoFilteredImportBadSafi( struct prefix *aux_prefix, /* AFI_L2VPN: optional IP */ afi_t afi, struct prefix_rd *prd, struct attr *attr, /* part of bgp_info */ - u_char type, /* part of bgp_info */ - u_char sub_type, /* part of bgp_info */ + uint8_t type, /* part of bgp_info */ + uint8_t sub_type, /* part of bgp_info */ uint32_t *label) /* part of bgp_info */ { vnc_zlog_debug_verbose("%s: Error, bad safi", __func__); @@ -3896,8 +3896,8 @@ rfapiBgpInfoFilteredImportFunction(safi_t safi) void rfapiProcessUpdate(struct peer *peer, void *rfd, /* set when looped from RFP/RFAPI */ struct prefix *p, struct prefix_rd *prd, - struct attr *attr, afi_t afi, safi_t safi, u_char type, - u_char sub_type, uint32_t *label) + struct attr *attr, afi_t afi, safi_t safi, uint8_t type, + uint8_t sub_type, uint32_t *label) { struct bgp *bgp; struct rfapi *h; @@ -3981,7 +3981,7 @@ void rfapiProcessUpdate(struct peer *peer, void rfapiProcessWithdraw(struct peer *peer, void *rfd, struct prefix *p, struct prefix_rd *prd, struct attr *attr, afi_t afi, - safi_t safi, u_char type, int kill) + safi_t safi, uint8_t type, int kill) { struct bgp *bgp; struct rfapi *h; @@ -4232,7 +4232,7 @@ static void rfapiBgpTableFilteredImport(struct bgp *bgp, struct bgp_info *bi; for (bi = rn2->info; bi; bi = bi->next) { - u_int32_t label = 0; + uint32_t label = 0; if (CHECK_FLAG(bi->flags, BGP_INFO_REMOVED)) diff --git a/bgpd/rfapi/rfapi_import.h b/bgpd/rfapi/rfapi_import.h index fc5bb01ce..84b7ca3a7 100644 --- a/bgpd/rfapi/rfapi_import.h +++ b/bgpd/rfapi/rfapi_import.h @@ -148,8 +148,8 @@ extern void rfapiBgpInfoFilteredImportVPN( struct prefix *aux_prefix, /* AFI_ETHER: optional IP */ afi_t afi, struct prefix_rd *prd, struct attr *attr, /* part of bgp_info */ - u_char type, /* part of bgp_info */ - u_char sub_type, /* part of bgp_info */ + uint8_t type, /* part of bgp_info */ + uint8_t sub_type, /* part of bgp_info */ uint32_t *label); /* part of bgp_info */ extern struct rfapi_next_hop_entry *rfapiEthRouteNode2NextHopList( diff --git a/bgpd/rfapi/rfapi_vty.c b/bgpd/rfapi/rfapi_vty.c index c5b3094b1..5fb44bb49 100644 --- a/bgpd/rfapi/rfapi_vty.c +++ b/bgpd/rfapi/rfapi_vty.c @@ -1068,7 +1068,7 @@ static int rfapiPrintRemoteRegBi(struct bgp *bgp, void *stream, inet_ntop(pfx_vn.family, &pfx_vn.u.prefix, buf_ntop, BUFSIZ)); if (bi->extra) { - u_int32_t l = decode_label(&bi->extra->label[0]); + uint32_t l = decode_label(&bi->extra->label[0]); snprintf(buf_vn, BUFSIZ, "Label: %d", l); } else /* should never happen */ { @@ -1180,7 +1180,7 @@ static int rfapiPrintRemoteRegBi(struct bgp *bgp, void *stream, } } if (tun_type != BGP_ENCAP_TYPE_MPLS && bi->extra) { - u_int32_t l = decode_label(&bi->extra->label[0]); + uint32_t l = decode_label(&bi->extra->label[0]); if (!MPLS_LABEL_IS_NULL(l)) { fp(out, " Label: %d", l); if (nlines == 1) @@ -1631,7 +1631,7 @@ void rfapiPrintDescriptor(struct vty *vty, struct rfapi_descriptor *rfd) } for (afi = AFI_IP; afi < AFI_MAX; ++afi) { - u_char family; + uint8_t family; family = afi2family(afi); if (!family) diff --git a/bgpd/rfapi/vnc_export_table.h b/bgpd/rfapi/vnc_export_table.h index aa38233e8..3ccf8661e 100644 --- a/bgpd/rfapi/vnc_export_table.h +++ b/bgpd/rfapi/vnc_export_table.h @@ -39,8 +39,8 @@ struct vnc_export_info { struct vnc_export_info *next; struct route_node *node; struct peer *peer; - u_char type; - u_char subtype; + uint8_t type; + uint8_t subtype; uint32_t lifetime; struct thread *timer; }; diff --git a/bgpd/rfapi/vnc_import_bgp.c b/bgpd/rfapi/vnc_import_bgp.c index 4f5416643..4bc5535e1 100644 --- a/bgpd/rfapi/vnc_import_bgp.c +++ b/bgpd/rfapi/vnc_import_bgp.c @@ -124,14 +124,14 @@ struct prefix_bag { struct bgp_info *ubi; /* unicast route */ }; -static const u_char maskbit[] = {0x00, 0x80, 0xc0, 0xe0, 0xf0, - 0xf8, 0xfc, 0xfe, 0xff}; +static const uint8_t maskbit[] = {0x00, 0x80, 0xc0, 0xe0, 0xf0, + 0xf8, 0xfc, 0xfe, 0xff}; int vnc_prefix_cmp(void *pfx1, void *pfx2) { int offset; int shift; - u_char mask; + uint8_t mask; struct prefix *p1 = pfx1; struct prefix *p2 = pfx2; @@ -154,8 +154,8 @@ int vnc_prefix_cmp(void *pfx1, void *pfx2) } /* Set both prefix's head pointer. */ - const u_char *pp1 = (const u_char *)&p1->u.prefix; - const u_char *pp2 = (const u_char *)&p2->u.prefix; + const uint8_t *pp1 = (const uint8_t *)&p1->u.prefix; + const uint8_t *pp2 = (const uint8_t *)&p2->u.prefix; while (offset--) { if (*pp1 < *pp2) @@ -1762,7 +1762,7 @@ static void vnc_import_bgp_exterior_add_route_it( bi_interior = bi_interior->next) { struct prefix_rd *prd; struct attr new_attr; - u_int32_t label = 0; + uint32_t label = 0; if (!is_usable_interior_route(bi_interior)) continue; @@ -1941,7 +1941,7 @@ void vnc_import_bgp_exterior_del_route( for (bi_interior = rn->info; bi_interior; bi_interior = bi_interior->next) { struct prefix_rd *prd; - u_int32_t label = 0; + uint32_t label = 0; if (!is_usable_interior_route(bi_interior)) continue; @@ -2102,7 +2102,7 @@ void vnc_import_bgp_exterior_add_route_interior( struct prefix_rd *prd; struct attr new_attr; - u_int32_t label = 0; + uint32_t label = 0; ++count; /* debugging */ @@ -2194,7 +2194,7 @@ void vnc_import_bgp_exterior_add_route_interior( struct bgp_info *bi; struct prefix_rd *prd; struct attr new_attr; - u_int32_t label = 0; + uint32_t label = 0; /* do pull-down */ @@ -2336,7 +2336,7 @@ void vnc_import_bgp_exterior_add_route_interior( struct prefix_rd *prd; struct attr new_attr; - u_int32_t label = 0; + uint32_t label = 0; /* do pull-down */ @@ -2476,7 +2476,7 @@ void vnc_import_bgp_exterior_del_route_interior( &cursor)) { struct prefix_rd *prd; - u_int32_t label = 0; + uint32_t label = 0; if (bi_interior->extra) { prd = &bi_interior->extra->vnc.import.rd; @@ -2549,7 +2549,7 @@ void vnc_import_bgp_exterior_del_route_interior( struct prefix_rd *prd; struct attr new_attr; - u_int32_t label = 0; + uint32_t label = 0; if (bi->type == ZEBRA_ROUTE_BGP_DIRECT_EXT) continue; diff --git a/bgpd/rfapi/vnc_zebra.c b/bgpd/rfapi/vnc_zebra.c index 6afcd21a1..7d564ef11 100644 --- a/bgpd/rfapi/vnc_zebra.c +++ b/bgpd/rfapi/vnc_zebra.c @@ -58,7 +58,7 @@ static struct zclient *zclient_vnc = NULL; /* * Routes coming from zebra get added to VNC here */ -static void vnc_redistribute_add(struct prefix *p, u_int32_t metric, +static void vnc_redistribute_add(struct prefix *p, uint32_t metric, uint8_t type) { struct bgp *bgp = bgp_get_default(); @@ -436,7 +436,7 @@ static void vnc_zebra_route_msg(struct prefix *p, unsigned int nhp_count, static void -nve_list_to_nh_array(u_char family, struct list *nve_list, +nve_list_to_nh_array(uint8_t family, struct list *nve_list, unsigned int *nh_count_ret, void **nh_ary_ret, /* returned address array */ void **nhp_ary_ret) /* returned pointer array */ |