summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_attr.h
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2018-03-27 21:13:34 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-03-27 21:13:34 +0200
commitd7c0a89a3a5697783a6dd89333ab660074790890 (patch)
treeeefa73e502f919b524b8a345437260d4acc23083 /bgpd/bgp_attr.h
parenttools, doc: update checkpatch for u_int_* (diff)
downloadfrr-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/bgp_attr.h')
-rw-r--r--bgpd/bgp_attr.h54
1 files changed, 26 insertions, 28 deletions
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;
}