diff options
Diffstat (limited to 'ripd/ripd.c')
| -rw-r--r-- | ripd/ripd.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/ripd/ripd.c b/ripd/ripd.c index 86c0348b94..ecc4027008 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -64,7 +64,7 @@ long rip_global_queries = 0; /* Prototypes. */ static void rip_event(enum rip_event, int); static void rip_output_process(struct connected *, struct sockaddr_in *, int, - u_char); + uint8_t); static int rip_triggered_update(struct thread *); static int rip_update_jitter(unsigned long); @@ -675,8 +675,8 @@ static void rip_packet_dump(struct rip_packet *packet, int size, struct rte *rte; const char *command_str; char pbuf[BUFSIZ], nbuf[BUFSIZ]; - u_char netmask = 0; - u_char *p; + uint8_t netmask = 0; + uint8_t *p; /* Set command string. */ if (packet->command > 0 && packet->command < RIP_COMMAND_MAX) @@ -698,7 +698,7 @@ static void rip_packet_dump(struct rip_packet *packet, int size, if (rte->family == htons(RIP_FAMILY_AUTH)) { if (rte->tag == htons(RIP_AUTH_SIMPLE_PASSWORD)) { - p = (u_char *)&rte->prefix; + p = (uint8_t *)&rte->prefix; zlog_debug( " family 0x%X type %d auth string: %s", @@ -719,11 +719,11 @@ static void rip_packet_dump(struct rip_packet *packet, int size, " Auth Data len %d", ntohs(md5->packet_len), md5->keyid, md5->auth_len); - zlog_debug( - " Sequence Number %ld", - (u_long)ntohl(md5->sequence)); + zlog_debug(" Sequence Number %ld", + (unsigned long)ntohl( + md5->sequence)); } else if (rte->tag == htons(RIP_AUTH_DATA)) { - p = (u_char *)&rte->prefix; + p = (uint8_t *)&rte->prefix; zlog_debug( " family 0x%X type %d (MD5 data)", @@ -753,7 +753,7 @@ static void rip_packet_dump(struct rip_packet *packet, int size, BUFSIZ), ntohs(rte->family), (route_tag_t)ntohs(rte->tag), - (u_long)ntohl(rte->metric)); + (unsigned long)ntohl(rte->metric)); } else { zlog_debug( " %s family %d tag %" ROUTE_TAG_PRI @@ -761,7 +761,7 @@ static void rip_packet_dump(struct rip_packet *packet, int size, inet_ntop(AF_INET, &rte->prefix, pbuf, BUFSIZ), ntohs(rte->family), (route_tag_t)ntohs(rte->tag), - (u_long)ntohl(rte->metric)); + (unsigned long)ntohl(rte->metric)); } } } @@ -771,7 +771,7 @@ static void rip_packet_dump(struct rip_packet *packet, int size, check net 0 because we accept default route. */ static int rip_destination_check(struct in_addr addr) { - u_int32_t destination; + uint32_t destination; /* Convert to host byte order. */ destination = ntohl(addr.s_addr); @@ -848,8 +848,8 @@ static int rip_auth_md5(struct rip_packet *packet, struct sockaddr_in *from, struct keychain *keychain; struct key *key; MD5_CTX ctx; - u_char digest[RIP_AUTH_MD5_SIZE]; - u_int16_t packet_len; + uint8_t digest[RIP_AUTH_MD5_SIZE]; + uint16_t packet_len; char auth_str[RIP_AUTH_MD5_SIZE]; if (IS_RIP_DEBUG_EVENT) @@ -892,7 +892,7 @@ static int rip_auth_md5(struct rip_packet *packet, struct sockaddr_in *from, } /* retrieve authentication data */ - md5data = (struct rip_md5_data *)(((u_char *)packet) + packet_len); + md5data = (struct rip_md5_data *)(((uint8_t *)packet) + packet_len); memset(auth_str, 0, RIP_AUTH_MD5_SIZE); @@ -1179,7 +1179,7 @@ static void rip_response_process(struct rip_packet *packet, int size, the received Next Hop is not directly reachable, it should be treated as 0.0.0.0. */ if (packet->version == RIPv2 && rte->nexthop.s_addr != 0) { - u_int32_t addrval; + uint32_t addrval; /* Multicast address check. */ addrval = ntohl(rte->nexthop.s_addr); @@ -1245,7 +1245,7 @@ static void rip_response_process(struct rip_packet *packet, int size, || (packet->version == RIPv2 && (rte->prefix.s_addr != 0 && rte->mask.s_addr == 0))) { - u_int32_t destination; + uint32_t destination; if (subnetted == -1) { memcpy(&ifaddr, ifc->address, @@ -1382,7 +1382,7 @@ static int rip_create_socket(void) * by connected argument. NULL to argument denotes destination should be * should be RIP multicast group */ -static int rip_send_packet(u_char *buf, int size, struct sockaddr_in *to, +static int rip_send_packet(uint8_t *buf, int size, struct sockaddr_in *to, struct connected *ifc) { int ret; @@ -1641,7 +1641,7 @@ static void rip_request_process(struct rip_packet *packet, int size, } packet->command = RIP_RESPONSE; - rip_send_packet((u_char *)packet, size, from, ifc); + rip_send_packet((uint8_t *)packet, size, from, ifc); } rip_global_queries++; } @@ -1661,7 +1661,7 @@ static int setsockopt_pktinfo(int sock) } /* Read RIP packet by recvmsg function. */ -int rip_recvmsg(int sock, u_char *buf, int size, struct sockaddr_in *from, +int rip_recvmsg(int sock, uint8_t *buf, int size, struct sockaddr_in *from, ifindex_t *ifindex) { int ret; @@ -2009,7 +2009,7 @@ static int rip_read(struct thread *t) /* Write routing table entry to the stream and return next index of the routing table entry in the stream. */ static int rip_write_rte(int num, struct stream *s, struct prefix_ipv4 *p, - u_char version, struct rip_info *rinfo) + uint8_t version, struct rip_info *rinfo) { struct in_addr mask; @@ -2037,7 +2037,7 @@ static int rip_write_rte(int num, struct stream *s, struct prefix_ipv4 *p, /* Send update to the ifp or spcified neighbor. */ void rip_output_process(struct connected *ifc, struct sockaddr_in *to, - int route_type, u_char version) + int route_type, uint8_t version) { int ret; struct stream *s; @@ -2400,7 +2400,7 @@ void rip_output_process(struct connected *ifc, struct sockaddr_in *to, } /* Send RIP packet to the interface. */ -static void rip_update_interface(struct connected *ifc, u_char version, +static void rip_update_interface(struct connected *ifc, uint8_t version, int route_type) { struct interface *ifp = ifc->ifp; @@ -2702,7 +2702,7 @@ static int rip_create(void) /* Sned RIP request to the destination. */ int rip_request_send(struct sockaddr_in *to, struct interface *ifp, - u_char version, struct connected *connected) + uint8_t version, struct connected *connected) { struct rte *rte; struct rip_packet rip_packet; @@ -2721,7 +2721,7 @@ int rip_request_send(struct sockaddr_in *to, struct interface *ifp, * interface does not support multicast. Caller loops * over each connected address for this case. */ - if (rip_send_packet((u_char *)&rip_packet, sizeof(rip_packet), + if (rip_send_packet((uint8_t *)&rip_packet, sizeof(rip_packet), to, connected) != sizeof(rip_packet)) return -1; @@ -2738,7 +2738,7 @@ int rip_request_send(struct sockaddr_in *to, struct interface *ifp, if (p->family != AF_INET) continue; - if (rip_send_packet((u_char *)&rip_packet, sizeof(rip_packet), + if (rip_send_packet((uint8_t *)&rip_packet, sizeof(rip_packet), to, connected) != sizeof(rip_packet)) return -1; @@ -3060,7 +3060,7 @@ struct route_table *rip_distance_table; struct rip_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; @@ -3081,7 +3081,7 @@ static int rip_distance_set(struct vty *vty, const char *distance_str, { int ret; struct prefix_ipv4 p; - u_char distance; + uint8_t distance; struct route_node *rn; struct rip_distance *rdistance; @@ -3166,7 +3166,7 @@ static void rip_distance_reset(void) } /* Apply RIP information to distance method. */ -u_char rip_distance_apply(struct rip_info *rinfo) +uint8_t rip_distance_apply(struct rip_info *rinfo) { struct route_node *rn; struct prefix_ipv4 p; |
