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 /ripngd | |
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 'ripngd')
-rw-r--r-- | ripngd/ripng_offset.c | 4 | ||||
-rw-r--r-- | ripngd/ripng_peer.c | 2 | ||||
-rw-r--r-- | ripngd/ripng_route.h | 10 | ||||
-rw-r--r-- | ripngd/ripng_routemap.c | 8 | ||||
-rw-r--r-- | ripngd/ripng_zebra.c | 2 | ||||
-rw-r--r-- | ripngd/ripngd.c | 8 | ||||
-rw-r--r-- | ripngd/ripngd.h | 58 |
7 files changed, 46 insertions, 46 deletions
diff --git a/ripngd/ripng_offset.c b/ripngd/ripng_offset.c index 82f8a7aa6..f8d73250b 100644 --- a/ripngd/ripng_offset.c +++ b/ripngd/ripng_offset.c @@ -194,7 +194,7 @@ static int ripng_offset_list_unset(struct vty *vty, const char *alist, /* If metric is modifed return 1. */ int ripng_offset_list_apply_in(struct prefix_ipv6 *p, struct interface *ifp, - u_char *metric) + uint8_t *metric) { struct ripng_offset_list *offset; struct access_list *alist; @@ -232,7 +232,7 @@ int ripng_offset_list_apply_in(struct prefix_ipv6 *p, struct interface *ifp, /* If metric is modifed return 1. */ int ripng_offset_list_apply_out(struct prefix_ipv6 *p, struct interface *ifp, - u_char *metric) + uint8_t *metric) { struct ripng_offset_list *offset; struct access_list *alist; diff --git a/ripngd/ripng_peer.c b/ripngd/ripng_peer.c index cd46d9740..2f7589848 100644 --- a/ripngd/ripng_peer.c +++ b/ripngd/ripng_peer.c @@ -113,7 +113,7 @@ static struct ripng_peer *ripng_peer_get(struct in6_addr *addr) return peer; } -void ripng_peer_update(struct sockaddr_in6 *from, u_char version) +void ripng_peer_update(struct sockaddr_in6 *from, uint8_t version) { struct ripng_peer *peer; peer = ripng_peer_get(&from->sin6_addr); diff --git a/ripngd/ripng_route.h b/ripngd/ripng_route.h index 3db1279b5..dc7d422d1 100644 --- a/ripngd/ripng_route.h +++ b/ripngd/ripng_route.h @@ -30,16 +30,16 @@ struct ripng_aggregate { unsigned int suppress; /* Metric of this route. */ - u_char metric; + uint8_t metric; /* Tag field of RIPng packet.*/ - u_int16_t tag; + uint16_t tag; /* Route-map futures - this variables can be changed. */ struct in6_addr nexthop_out; - u_char metric_set; - u_char metric_out; - u_int16_t tag_out; + uint8_t metric_set; + uint8_t metric_out; + uint16_t tag_out; }; extern void ripng_aggregate_increment(struct route_node *rp, diff --git a/ripngd/ripng_routemap.c b/ripngd/ripng_routemap.c index e518585c7..e9a38d137 100644 --- a/ripngd/ripng_routemap.c +++ b/ripngd/ripng_routemap.c @@ -33,7 +33,7 @@ struct rip_metric_modifier { enum { metric_increment, metric_decrement, metric_absolute } type; bool used; - u_int8_t metric; + uint8_t metric; }; /* `match metric METRIC' */ @@ -42,7 +42,7 @@ static route_map_result_t route_match_metric(void *rule, struct prefix *prefix, route_map_object_t type, void *object) { - u_int32_t *metric; + uint32_t *metric; struct ripng_info *rinfo; if (type == RMAP_RIPNG) { @@ -60,9 +60,9 @@ static route_map_result_t route_match_metric(void *rule, struct prefix *prefix, /* Route map `match metric' match statement. `arg' is METRIC value */ static void *route_match_metric_compile(const char *arg) { - u_int32_t *metric; + uint32_t *metric; - metric = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(u_int32_t)); + metric = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(uint32_t)); *metric = atoi(arg); if (*metric > 0) diff --git a/ripngd/ripng_zebra.c b/ripngd/ripng_zebra.c index 6c9d911a6..6830e0e92 100644 --- a/ripngd/ripng_zebra.c +++ b/ripngd/ripng_zebra.c @@ -37,7 +37,7 @@ struct zclient *zclient = NULL; /* Send ECMP routes to zebra. */ -static void ripng_zebra_ipv6_send(struct route_node *rp, u_char cmd) +static void ripng_zebra_ipv6_send(struct route_node *rp, uint8_t cmd) { struct list *list = (struct list *)rp->info; struct zapi_route api; diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c index 673f0637c..840157516 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -214,7 +214,7 @@ int ripng_send_packet(caddr_t buf, int bufsize, struct sockaddr_in6 *to, } /* Receive UDP RIPng packet from socket. */ -static int ripng_recv_packet(int sock, u_char *buf, int bufsize, +static int ripng_recv_packet(int sock, uint8_t *buf, int bufsize, struct sockaddr_in6 *from, ifindex_t *ifindex, int *hoplimit) { @@ -1506,7 +1506,7 @@ int ripng_triggered_update(struct thread *t) /* Write routing table entry to the stream and return next index of the routing table entry in the stream. */ int ripng_write_rte(int num, struct stream *s, struct prefix_ipv6 *p, - struct in6_addr *nexthop, u_int16_t tag, u_char metric) + struct in6_addr *nexthop, uint16_t tag, uint8_t metric) { /* RIPng packet header. */ if (num == 0) { @@ -1517,9 +1517,9 @@ int ripng_write_rte(int num, struct stream *s, struct prefix_ipv6 *p, /* Write routing table entry. */ if (!nexthop) - stream_write(s, (u_char *)&p->prefix, sizeof(struct in6_addr)); + stream_write(s, (uint8_t *)&p->prefix, sizeof(struct in6_addr)); else - stream_write(s, (u_char *)nexthop, sizeof(struct in6_addr)); + stream_write(s, (uint8_t *)nexthop, sizeof(struct in6_addr)); stream_putw(s, tag); if (p) stream_putc(s, p->prefixlen); diff --git a/ripngd/ripngd.h b/ripngd/ripngd.h index 25a5b46c0..534905d89 100644 --- a/ripngd/ripngd.h +++ b/ripngd/ripngd.h @@ -95,8 +95,8 @@ struct ripng { int sock; /* RIPng Parameters.*/ - u_char command; - u_char version; + uint8_t command; + uint8_t version; unsigned long update_time; unsigned long timeout_time; unsigned long garbage_time; @@ -137,35 +137,35 @@ struct ripng { char *name; struct route_map *map; int metric_config; - u_int32_t metric; + uint32_t metric; } route_map[ZEBRA_ROUTE_MAX]; }; /* Routing table entry. */ struct rte { struct in6_addr addr; /* RIPng destination prefix */ - u_int16_t tag; /* RIPng tag */ - u_char prefixlen; /* Length of the RIPng prefix */ - u_char metric; /* Metric of the RIPng route */ + uint16_t tag; /* RIPng tag */ + uint8_t prefixlen; /* Length of the RIPng prefix */ + uint8_t metric; /* Metric of the RIPng route */ /* The nexthop is stored by the structure * ripng_nexthop within ripngd.c */ }; /* RIPNG send packet. */ struct ripng_packet { - u_char command; - u_char version; - u_int16_t zero; + uint8_t command; + uint8_t version; + uint16_t zero; struct rte rte[1]; }; /* Each route's information. */ struct ripng_info { /* This route's type. Static, ripng or aggregate. */ - u_char type; + uint8_t type; /* Sub type for static route. */ - u_char sub_type; + uint8_t sub_type; /* RIPng specific information */ struct in6_addr nexthop; @@ -175,10 +175,10 @@ struct ripng_info { ifindex_t ifindex; /* Metric of this route. */ - u_char metric; + uint8_t metric; /* Tag field of RIPng packet.*/ - u_int16_t tag; + uint16_t tag; /* For aggregation. */ unsigned int suppress; @@ -186,7 +186,7 @@ struct ripng_info { /* Flags of RIPng route. */ #define RIPNG_RTF_FIB 1 #define RIPNG_RTF_CHANGED 2 - u_char flags; + uint8_t flags; /* Garbage collect timer. */ struct thread *t_timeout; @@ -194,9 +194,9 @@ struct ripng_info { /* Route-map features - this variables can be changed. */ struct in6_addr nexthop_out; - u_char metric_set; - u_char metric_out; - u_int16_t tag_out; + uint8_t metric_set; + uint8_t metric_out; + uint16_t tag_out; struct route_node *rp; }; @@ -207,10 +207,10 @@ struct ripng_info { struct ripng_tag { /* Tag value. */ - u_int16_t tag; + uint16_t tag; /* Port. */ - u_int16_t port; + uint16_t port; /* Multicast group. */ struct in6_addr maddr; @@ -222,10 +222,10 @@ struct ripng_tag int distance; /* Split horizon. */ - u_char split_horizon; + uint8_t split_horizon; /* Poison reverse. */ - u_char poison_reverse; + uint8_t poison_reverse; }; #endif /* 0 */ #endif /* not yet */ @@ -271,10 +271,10 @@ struct ripng_interface { #endif /* notyet */ /* Default information originate. */ - u_char default_originate; + uint8_t default_originate; /* Default information only. */ - u_char default_only; + uint8_t default_only; /* Wake up thread. */ struct thread *t_wakeup; @@ -295,7 +295,7 @@ struct ripng_peer { time_t uptime; /* Peer RIP version. */ - u_char version; + uint8_t version; /* Statistics. */ int recv_badpackets; @@ -351,7 +351,7 @@ extern void ripng_offset_init(void); extern int config_write_ripng_offset_list(struct vty *); extern void ripng_peer_init(void); -extern void ripng_peer_update(struct sockaddr_in6 *, u_char); +extern void ripng_peer_update(struct sockaddr_in6 *, uint8_t); extern void ripng_peer_bad_route(struct sockaddr_in6 *); extern void ripng_peer_bad_packet(struct sockaddr_in6 *); extern void ripng_peer_display(struct vty *); @@ -359,9 +359,9 @@ extern struct ripng_peer *ripng_peer_lookup(struct in6_addr *); extern struct ripng_peer *ripng_peer_lookup_next(struct in6_addr *); extern int ripng_offset_list_apply_in(struct prefix_ipv6 *, struct interface *, - u_char *); + uint8_t *); extern int ripng_offset_list_apply_out(struct prefix_ipv6 *, struct interface *, - u_char *); + uint8_t *); extern void ripng_offset_clean(void); extern struct ripng_info *ripng_info_new(void); @@ -385,8 +385,8 @@ extern int ripng_redistribute_check(int); extern void ripng_redistribute_write(struct vty *, int); extern int ripng_write_rte(int num, struct stream *s, struct prefix_ipv6 *p, - struct in6_addr *nexthop, u_int16_t tag, - u_char metric); + struct in6_addr *nexthop, uint16_t tag, + uint8_t metric); extern int ripng_send_packet(caddr_t buf, int bufsize, struct sockaddr_in6 *to, struct interface *ifp); |