summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorLou Berger <lberger@labn.net>2018-03-28 16:30:54 +0200
committerGitHub <noreply@github.com>2018-03-28 16:30:54 +0200
commit615e608d76bd3e1acf1769c914142210ac88e3f7 (patch)
tree1159398cc86aa18901a73480303fb52e09b1f9cc /zebra
parentMerge pull request #1928 from pguibert6WIND/flowspec_get_vrf_from_rt (diff)
parent*: use C99 standard fixed-width integer types (diff)
downloadfrr-615e608d76bd3e1acf1769c914142210ac88e3f7.tar.xz
frr-615e608d76bd3e1acf1769c914142210ac88e3f7.zip
Merge pull request #1854 from qlyoung/integer-standards-compliance
*: use C99 standard fixed-width integer types
Diffstat (limited to 'zebra')
-rw-r--r--zebra/client_main.c4
-rw-r--r--zebra/connected.c8
-rw-r--r--zebra/connected.h8
-rw-r--r--zebra/if_ioctl.c2
-rw-r--r--zebra/if_ioctl_solaris.c2
-rw-r--r--zebra/if_netlink.c19
-rw-r--r--zebra/interface.c18
-rw-r--r--zebra/interface.h19
-rw-r--r--zebra/ioctl.c8
-rw-r--r--zebra/ioctl.h6
-rw-r--r--zebra/ioctl_solaris.c8
-rw-r--r--zebra/irdp.h8
-rw-r--r--zebra/irdp_interface.c6
-rw-r--r--zebra/irdp_main.c10
-rw-r--r--zebra/irdp_packet.c12
-rw-r--r--zebra/kernel_netlink.c25
-rw-r--r--zebra/kernel_netlink.h8
-rw-r--r--zebra/kernel_socket.c4
-rw-r--r--zebra/label_manager.c17
-rw-r--r--zebra/label_manager.h15
-rw-r--r--zebra/main.c2
-rw-r--r--zebra/redistribute.c15
-rw-r--r--zebra/redistribute.h4
-rw-r--r--zebra/rib.h39
-rw-r--r--zebra/rt.h2
-rw-r--r--zebra/rt_netlink.c50
-rw-r--r--zebra/rt_socket.c2
-rw-r--r--zebra/rtadv.c16
-rw-r--r--zebra/rtadv.h14
-rw-r--r--zebra/rtread_getmsg.c2
-rw-r--r--zebra/zebra_fpm_dt.c2
-rw-r--r--zebra/zebra_fpm_netlink.c12
-rw-r--r--zebra/zebra_l2.h2
-rw-r--r--zebra/zebra_mpls.c38
-rw-r--r--zebra/zebra_mpls.h32
-rw-r--r--zebra/zebra_mpls_openbsd.c2
-rw-r--r--zebra/zebra_mpls_vty.c12
-rw-r--r--zebra/zebra_netns_id.c2
-rw-r--r--zebra/zebra_ns.c2
-rw-r--r--zebra/zebra_ns.h2
-rw-r--r--zebra/zebra_ptm.c12
-rw-r--r--zebra/zebra_ptm.h2
-rw-r--r--zebra/zebra_rib.c77
-rw-r--r--zebra/zebra_rnh.c2
-rw-r--r--zebra/zebra_rnh.h2
-rw-r--r--zebra/zebra_routemap.c24
-rw-r--r--zebra/zebra_snmp.c108
-rw-r--r--zebra/zebra_static.c8
-rw-r--r--zebra/zebra_static.h14
-rw-r--r--zebra/zebra_vrf.c4
-rw-r--r--zebra/zebra_vrf.h16
-rw-r--r--zebra/zebra_vty.c69
-rw-r--r--zebra/zebra_vxlan.c144
-rw-r--r--zebra/zebra_vxlan.h43
-rw-r--r--zebra/zebra_vxlan_null.c32
-rw-r--r--zebra/zebra_vxlan_private.h18
-rw-r--r--zebra/zserv.c51
-rw-r--r--zebra/zserv.h78
58 files changed, 587 insertions, 576 deletions
diff --git a/zebra/client_main.c b/zebra/client_main.c
index 9b82e4826..4035e53f7 100644
--- a/zebra/client_main.c
+++ b/zebra/client_main.c
@@ -39,7 +39,7 @@ int sock;
/* IPv4 route add and delete test. */
void zebra_test_ipv4(int command, int type, char *prefix, char *gateway,
- u_char distance)
+ uint8_t distance)
{
struct zapi_ipv4 api;
struct prefix_ipv4 p;
@@ -119,7 +119,7 @@ void zebra_sim(FILE *fp)
{
char buf[BUFSIZ];
char distance_str[BUFSIZ];
- u_char distance;
+ uint8_t distance;
while (fgets(buf, sizeof buf, fp)) {
int i;
diff --git a/zebra/connected.c b/zebra/connected.c
index 94b56c897..2198ddf5e 100644
--- a/zebra/connected.c
+++ b/zebra/connected.c
@@ -273,7 +273,7 @@ void connected_up(struct interface *ifp, struct connected *ifc)
/* Add connected IPv4 route to the interface. */
void connected_add_ipv4(struct interface *ifp, int flags, struct in_addr *addr,
- u_char prefixlen, struct in_addr *broad,
+ uint8_t prefixlen, struct in_addr *broad,
const char *label)
{
struct prefix_ipv4 *p;
@@ -469,7 +469,7 @@ static void connected_delete_helper(struct connected *ifc, struct prefix *p)
/* Delete connected IPv4 route to the interface. */
void connected_delete_ipv4(struct interface *ifp, int flags,
- struct in_addr *addr, u_char prefixlen,
+ struct in_addr *addr, uint8_t prefixlen,
struct in_addr *broad)
{
struct prefix p, d;
@@ -495,7 +495,7 @@ void connected_delete_ipv4(struct interface *ifp, int flags,
/* Add connected IPv6 route to the interface. */
void connected_add_ipv6(struct interface *ifp, int flags, struct in6_addr *addr,
- u_char prefixlen, const char *label)
+ uint8_t prefixlen, const char *label)
{
struct prefix_ipv6 *p;
struct connected *ifc;
@@ -536,7 +536,7 @@ void connected_add_ipv6(struct interface *ifp, int flags, struct in6_addr *addr,
}
void connected_delete_ipv6(struct interface *ifp, struct in6_addr *address,
- u_char prefixlen)
+ uint8_t prefixlen)
{
struct prefix p;
struct connected *ifc;
diff --git a/zebra/connected.h b/zebra/connected.h
index d10a09298..9b69a3f24 100644
--- a/zebra/connected.h
+++ b/zebra/connected.h
@@ -29,11 +29,11 @@ extern struct connected *connected_check_ptp(struct interface *ifp,
union prefixconstptr d);
extern void connected_add_ipv4(struct interface *ifp, int flags,
- struct in_addr *addr, u_char prefixlen,
+ struct in_addr *addr, uint8_t prefixlen,
struct in_addr *broad, const char *label);
extern void connected_delete_ipv4(struct interface *ifp, int flags,
- struct in_addr *addr, u_char prefixlen,
+ struct in_addr *addr, uint8_t prefixlen,
struct in_addr *broad);
extern void connected_delete_ipv4_unnumbered(struct connected *ifc);
@@ -42,10 +42,10 @@ extern void connected_up(struct interface *ifp, struct connected *ifc);
extern void connected_down(struct interface *ifp, struct connected *ifc);
extern void connected_add_ipv6(struct interface *ifp, int flags,
- struct in6_addr *address, u_char prefixlen,
+ struct in6_addr *address, uint8_t prefixlen,
const char *label);
extern void connected_delete_ipv6(struct interface *ifp,
- struct in6_addr *address, u_char prefixlen);
+ struct in6_addr *address, uint8_t prefixlen);
extern int connected_is_unnumbered(struct interface *);
diff --git a/zebra/if_ioctl.c b/zebra/if_ioctl.c
index 09fc08501..b506315eb 100644
--- a/zebra/if_ioctl.c
+++ b/zebra/if_ioctl.c
@@ -242,7 +242,7 @@ static int if_getaddrs(void)
#if defined(KAME)
if (IN6_IS_ADDR_LINKLOCAL(&addr->sin6_addr)) {
addr->sin6_scope_id =
- ntohs(*(u_int16_t *)&addr->sin6_addr
+ ntohs(*(uint16_t *)&addr->sin6_addr
.s6_addr[2]);
addr->sin6_addr.s6_addr[2] =
addr->sin6_addr.s6_addr[3] = 0;
diff --git a/zebra/if_ioctl_solaris.c b/zebra/if_ioctl_solaris.c
index 94738664b..e9182304d 100644
--- a/zebra/if_ioctl_solaris.c
+++ b/zebra/if_ioctl_solaris.c
@@ -252,7 +252,7 @@ static int if_get_addr(struct interface *ifp, struct sockaddr *addr,
struct lifreq lifreq;
struct sockaddr_storage mask, dest;
char *dest_pnt = NULL;
- u_char prefixlen = 0;
+ uint8_t prefixlen = 0;
afi_t af;
int flags = 0;
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c
index a37d74416..c8a6bedec 100644
--- a/zebra/if_netlink.c
+++ b/zebra/if_netlink.c
@@ -271,7 +271,7 @@ static void netlink_vrf_change(struct nlmsghdr *h, struct rtattr *tb,
struct rtattr *attr[IFLA_VRF_MAX + 1];
struct vrf *vrf;
struct zebra_vrf *zvrf;
- u_int32_t nl_table_id;
+ uint32_t nl_table_id;
ifi = NLMSG_DATA(h);
@@ -296,7 +296,7 @@ static void netlink_vrf_change(struct nlmsghdr *h, struct rtattr *tb,
return;
}
- nl_table_id = *(u_int32_t *)RTA_DATA(attr[IFLA_VRF_TABLE]);
+ nl_table_id = *(uint32_t *)RTA_DATA(attr[IFLA_VRF_TABLE]);
if (h->nlmsg_type == RTM_NEWLINK) {
if (IS_ZEBRA_DEBUG_KERNEL)
@@ -409,7 +409,7 @@ static int netlink_extract_bridge_info(struct rtattr *link_data,
parse_rtattr_nested(attr, IFLA_BR_MAX, link_data);
if (attr[IFLA_BR_VLAN_FILTERING])
bridge_info->vlan_aware =
- *(u_char *)RTA_DATA(attr[IFLA_BR_VLAN_FILTERING]);
+ *(uint8_t *)RTA_DATA(attr[IFLA_BR_VLAN_FILTERING]);
return 0;
}
@@ -503,8 +503,8 @@ static int netlink_bridge_interface(struct nlmsghdr *h, int len, ns_id_t ns_id,
struct interface *ifp;
struct rtattr *aftb[IFLA_BRIDGE_MAX + 1];
struct {
- u_int16_t flags;
- u_int16_t vid;
+ uint16_t flags;
+ uint16_t vid;
} * vinfo;
vlanid_t access_vlan;
@@ -631,7 +631,7 @@ static int netlink_interface(struct sockaddr_nl *snl, struct nlmsghdr *h,
if (slave_kind && (strcmp(slave_kind, "vrf") == 0)
&& !vrf_is_backend_netns()) {
zif_slave_type = ZEBRA_IF_SLAVE_VRF;
- vrf_id = *(u_int32_t *)RTA_DATA(tb[IFLA_MASTER]);
+ vrf_id = *(uint32_t *)RTA_DATA(tb[IFLA_MASTER]);
} else if (slave_kind && (strcmp(slave_kind, "bridge") == 0)) {
zif_slave_type = ZEBRA_IF_SLAVE_BRIDGE;
bridge_ifindex =
@@ -683,7 +683,7 @@ static int netlink_interface(struct sockaddr_nl *snl, struct nlmsghdr *h,
/* Request for specific interface or address information from the kernel */
static int netlink_request_intf_addr(struct zebra_ns *zns, int family, int type,
- u_int32_t filter_mask)
+ uint32_t filter_mask)
{
struct {
struct nlmsghdr n;
@@ -876,7 +876,7 @@ int netlink_interface_addr(struct sockaddr_nl *snl, struct nlmsghdr *h,
struct interface *ifp;
void *addr;
void *broad;
- u_char flags = 0;
+ uint8_t flags = 0;
char *label = NULL;
struct zebra_ns *zns;
@@ -1109,8 +1109,7 @@ int netlink_link_change(struct sockaddr_nl *snl, struct nlmsghdr *h,
if (slave_kind && (strcmp(slave_kind, "vrf") == 0)
&& !vrf_is_backend_netns()) {
zif_slave_type = ZEBRA_IF_SLAVE_VRF;
- vrf_id =
- *(u_int32_t *)RTA_DATA(tb[IFLA_MASTER]);
+ vrf_id = *(uint32_t *)RTA_DATA(tb[IFLA_MASTER]);
} else if (slave_kind
&& (strcmp(slave_kind, "bridge") == 0)) {
zif_slave_type = ZEBRA_IF_SLAVE_BRIDGE;
diff --git a/zebra/interface.c b/zebra/interface.c
index 7795d34d0..a011efd28 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -181,7 +181,7 @@ static int if_zebra_delete_hook(struct interface *ifp)
}
/* Build the table key */
-static void if_build_key(u_int32_t ifindex, struct prefix *p)
+static void if_build_key(uint32_t ifindex, struct prefix *p)
{
p->family = AF_INET;
p->prefixlen = IPV4_MAX_BITLEN;
@@ -221,7 +221,7 @@ void if_unlink_per_ns(struct interface *ifp)
/* Look up an interface by identifier within a NS */
struct interface *if_lookup_by_index_per_ns(struct zebra_ns *ns,
- u_int32_t ifindex)
+ uint32_t ifindex)
{
struct prefix p;
struct route_node *rn;
@@ -787,7 +787,7 @@ void if_handle_vrf_change(struct interface *ifp, vrf_id_t vrf_id)
rib_update(ifp->vrf_id, RIB_UPDATE_IF_CHANGE);
}
-static void ipv6_ll_address_to_mac(struct in6_addr *address, u_char *mac)
+static void ipv6_ll_address_to_mac(struct in6_addr *address, uint8_t *mac)
{
mac[0] = address->s6_addr[8] ^ 0x02;
mac[1] = address->s6_addr[9];
@@ -808,7 +808,7 @@ void if_nbr_ipv6ll_to_ipv4ll_neigh_update(struct interface *ifp,
inet_pton(AF_INET, buf, &ipv4_ll);
- ipv6_ll_address_to_mac(address, (u_char *)mac);
+ ipv6_ll_address_to_mac(address, (uint8_t *)mac);
ns_id = zvrf->zns->ns_id;
/*
@@ -1857,7 +1857,7 @@ DEFUN (link_params_metric,
int idx_number = 1;
VTY_DECLVAR_CONTEXT(interface, ifp);
struct if_link_params *iflp = if_link_params_get(ifp);
- u_int32_t metric;
+ uint32_t metric;
metric = strtoul(argv[idx_number]->arg, NULL, 10);
@@ -2045,7 +2045,7 @@ DEFUN (link_params_inter_as,
VTY_DECLVAR_CONTEXT(interface, ifp);
struct if_link_params *iflp = if_link_params_get(ifp);
struct in_addr addr;
- u_int32_t as;
+ uint32_t as;
if (!inet_aton(argv[idx_ipv4]->arg, &addr)) {
vty_out(vty, "Please specify Router-Addr by A.B.C.D\n");
@@ -2104,7 +2104,7 @@ DEFUN (link_params_delay,
"Maximum delay in micro-second as decimal (0...16777215)\n")
{
/* Get and Check new delay values */
- u_int32_t delay = 0, low = 0, high = 0;
+ uint32_t delay = 0, low = 0, high = 0;
delay = strtoul(argv[1]->arg, NULL, 10);
if (argc == 6) {
low = strtoul(argv[3]->arg, NULL, 10);
@@ -2113,7 +2113,7 @@ DEFUN (link_params_delay,
VTY_DECLVAR_CONTEXT(interface, ifp);
struct if_link_params *iflp = if_link_params_get(ifp);
- u_int8_t update = 0;
+ uint8_t update = 0;
if (argc == 2) {
/* Check new delay value against old Min and Max delays if set
@@ -2199,7 +2199,7 @@ DEFUN (link_params_delay_var,
int idx_number = 1;
VTY_DECLVAR_CONTEXT(interface, ifp);
struct if_link_params *iflp = if_link_params_get(ifp);
- u_int32_t value;
+ uint32_t value;
value = strtoul(argv[idx_number]->arg, NULL, 10);
diff --git a/zebra/interface.h b/zebra/interface.h
index 9f109fc05..7a776f5e3 100644
--- a/zebra/interface.h
+++ b/zebra/interface.h
@@ -93,7 +93,7 @@ struct rtadvconf {
milliseconds (1 hour).
Default: 0 */
- u_int32_t AdvReachableTime;
+ uint32_t AdvReachableTime;
#define RTADV_MAX_REACHABLE_TIME 3600000
/* The value to be placed in the Retrans Timer field in the Router
@@ -167,10 +167,10 @@ struct rtadvconf {
int DefaultPreference;
#define RTADV_PREF_MEDIUM 0x0 /* Per RFC4191. */
- u_char inFastRexmit; /* True if we're rexmits faster than usual */
+ uint8_t inFastRexmit; /* True if we're rexmits faster than usual */
/* Track if RA was configured by BGP or by the Operator or both */
- u_char ra_configured; /* Was RA configured? */
+ uint8_t ra_configured; /* Was RA configured? */
#define BGP_RA_CONFIGURED (1<<0) /* BGP configured RA? */
#define VTY_RA_CONFIGURED (1<<1) /* Operator configured RA? */
#define VTY_RA_INTERVAL_CONFIGURED (1<<2) /* Operator configured RA interval */
@@ -206,13 +206,13 @@ struct irdp_interface;
/* `zebra' daemon local interface structure. */
struct zebra_if {
/* Shutdown configuration. */
- u_char shutdown;
+ uint8_t shutdown;
/* Multicast configuration. */
- u_char multicast;
+ uint8_t multicast;
/* Router advertise configuration. */
- u_char rtadv_enable;
+ uint8_t rtadv_enable;
/* Installed addresses chains tree. */
struct route_table *ipv4_subnets;
@@ -248,11 +248,11 @@ struct zebra_if {
* down (but primary still plumbed) and primary having gone
* ~IFF_UP, and all addresses gone.
*/
- u_char primary_state;
+ uint8_t primary_state;
#endif /* SUNOS_5 */
/* ptm enable configuration */
- u_char ptm_enable;
+ uint8_t ptm_enable;
/* Zebra interface and "slave" interface type */
zebra_iftype_t zif_type;
@@ -314,8 +314,7 @@ static inline void zebra_if_set_ziftype(struct interface *ifp,
extern void zebra_if_init(void);
-extern struct interface *if_lookup_by_index_per_ns(struct zebra_ns *,
- u_int32_t);
+extern struct interface *if_lookup_by_index_per_ns(struct zebra_ns *, uint32_t);
extern struct interface *if_lookup_by_name_per_ns(struct zebra_ns *,
const char *);
extern struct interface *if_link_per_ns(struct zebra_ns *, struct interface *);
diff --git a/zebra/ioctl.c b/zebra/ioctl.c
index a95d5d4e1..a577b008d 100644
--- a/zebra/ioctl.c
+++ b/zebra/ioctl.c
@@ -48,7 +48,7 @@ void ifreq_set_name(struct ifreq *ifreq, struct interface *ifp)
}
/* call ioctl system call */
-int if_ioctl(u_long request, caddr_t buffer)
+int if_ioctl(unsigned long request, caddr_t buffer)
{
int sock;
int ret;
@@ -80,7 +80,7 @@ int if_ioctl(u_long request, caddr_t buffer)
}
/* call ioctl system call */
-int vrf_if_ioctl(u_long request, caddr_t buffer, vrf_id_t vrf_id)
+int vrf_if_ioctl(unsigned long request, caddr_t buffer, vrf_id_t vrf_id)
{
int sock;
int ret;
@@ -113,7 +113,7 @@ int vrf_if_ioctl(u_long request, caddr_t buffer, vrf_id_t vrf_id)
}
#ifndef HAVE_NETLINK
-static int if_ioctl_ipv6(u_long request, caddr_t buffer)
+static int if_ioctl_ipv6(unsigned long request, caddr_t buffer)
{
int sock;
int ret;
@@ -493,7 +493,7 @@ int if_unset_flags(struct interface *ifp, uint64_t flags)
/* linux/include/net/ipv6.h */
struct in6_ifreq {
struct in6_addr ifr6_addr;
- u_int32_t ifr6_prefixlen;
+ uint32_t ifr6_prefixlen;
int ifr6_ifindex;
};
#endif /* _LINUX_IN6_H */
diff --git a/zebra/ioctl.h b/zebra/ioctl.h
index 1a6e14ed4..2a8ea7790 100644
--- a/zebra/ioctl.h
+++ b/zebra/ioctl.h
@@ -24,8 +24,8 @@
/* Prototypes. */
extern void ifreq_set_name(struct ifreq *, struct interface *);
-extern int if_ioctl(u_long, caddr_t);
-extern int vrf_if_ioctl(u_long request, caddr_t buffer, vrf_id_t vrf_id);
+extern int if_ioctl(unsigned long, caddr_t);
+extern int vrf_if_ioctl(unsigned long request, caddr_t buffer, vrf_id_t vrf_id);
extern int if_set_flags(struct interface *, uint64_t);
extern int if_unset_flags(struct interface *, uint64_t);
@@ -41,7 +41,7 @@ extern int if_prefix_add_ipv6(struct interface *, struct connected *);
extern int if_prefix_delete_ipv6(struct interface *, struct connected *);
#ifdef SOLARIS_IPV6
-extern int if_ioctl_ipv6(u_long, caddr_t);
+extern int if_ioctl_ipv6(unsigned long, caddr_t);
extern struct connected *if_lookup_linklocal(struct interface *);
#define AF_IOCTL(af, request, buffer) \
diff --git a/zebra/ioctl_solaris.c b/zebra/ioctl_solaris.c
index f429c4244..eb68451f7 100644
--- a/zebra/ioctl_solaris.c
+++ b/zebra/ioctl_solaris.c
@@ -45,13 +45,13 @@ void lifreq_set_name(struct lifreq *lifreq, const char *ifname)
strncpy(lifreq->lifr_name, ifname, IFNAMSIZ);
}
-int vrf_if_ioctl(u_long request, caddr_t buffer, vrf_id_t vrf_id)
+int vrf_if_ioctl(unsigned long request, caddr_t buffer, vrf_id_t vrf_id)
{
return if_ioctl(request, buffer);
}
/* call ioctl system call */
-int if_ioctl(u_long request, caddr_t buffer)
+int if_ioctl(unsigned long request, caddr_t buffer)
{
int sock;
int ret;
@@ -86,7 +86,7 @@ int if_ioctl(u_long request, caddr_t buffer)
}
-int if_ioctl_ipv6(u_long request, caddr_t buffer)
+int if_ioctl_ipv6(unsigned long request, caddr_t buffer)
{
int sock;
int ret;
@@ -155,7 +155,7 @@ void if_get_mtu(struct interface *ifp)
{
struct lifreq lifreq;
int ret;
- u_char changed = 0;
+ uint8_t changed = 0;
if (ifp->flags & IFF_IPV4) {
lifreq_set_name(&lifreq, ifp->name);
diff --git a/zebra/irdp.h b/zebra/irdp.h
index 8aa9f3e4b..4800e75be 100644
--- a/zebra/irdp.h
+++ b/zebra/irdp.h
@@ -117,7 +117,7 @@ struct irdp_interface {
unsigned long MinAdvertInterval;
unsigned long Preference;
- u_int32_t flags;
+ uint32_t flags;
#define IF_ACTIVE (1<<0) /* ICMP Active */
#define IF_BROADCAST (1<<1) /* 255.255.255.255 */
@@ -130,7 +130,7 @@ struct irdp_interface {
struct interface *ifp;
struct thread *t_advertise;
unsigned long irdp_sent;
- u_int16_t Lifetime;
+ uint16_t Lifetime;
struct list *AdvPrefList;
};
@@ -147,8 +147,8 @@ extern int irdp_send_thread(struct thread *t_advert);
extern void irdp_advert_off(struct interface *ifp);
extern void process_solicit(struct interface *ifp);
extern int irdp_read_raw(struct thread *r);
-extern void send_packet(struct interface *ifp, struct stream *s, u_int32_t dst,
- struct prefix *p, u_int32_t ttl);
+extern void send_packet(struct interface *ifp, struct stream *s, uint32_t dst,
+ struct prefix *p, uint32_t ttl);
#endif /* _IRDP_H */
diff --git a/zebra/irdp_interface.c b/zebra/irdp_interface.c
index 2c10ce86a..ca7840479 100644
--- a/zebra/irdp_interface.c
+++ b/zebra/irdp_interface.c
@@ -97,7 +97,7 @@ static int irdp_if_delete(struct interface *ifp)
return 0;
}
-static const char *inet_2a(u_int32_t a, char *b)
+static const char *inet_2a(uint32_t a, char *b)
{
sprintf(b, "%u.%u.%u.%u", (a)&0xFF, (a >> 8) & 0xFF, (a >> 16) & 0xFF,
(a >> 24) & 0xFF);
@@ -118,7 +118,7 @@ static struct prefix *irdp_get_prefix(struct interface *ifp)
}
/* Join to the add/leave multicast group. */
-static int if_group(struct interface *ifp, int sock, u_int32_t group,
+static int if_group(struct interface *ifp, int sock, uint32_t group,
int add_leave)
{
struct ip_mreq m;
@@ -216,7 +216,7 @@ static void irdp_if_start(struct interface *ifp, int multicast,
struct irdp_interface *irdp = zi->irdp;
struct listnode *node;
struct connected *ifc;
- u_int32_t timer, seed;
+ uint32_t timer, seed;
assert(irdp);
diff --git a/zebra/irdp_main.c b/zebra/irdp_main.c
index 39e04480c..c2411d083 100644
--- a/zebra/irdp_main.c
+++ b/zebra/irdp_main.c
@@ -146,7 +146,7 @@ static int make_advertisement_packet(struct interface *ifp, struct prefix *p,
struct irdp_interface *irdp = zi->irdp;
int size;
int pref;
- u_int16_t checksum;
+ uint16_t checksum;
pref = get_pref(irdp, p);
@@ -177,8 +177,8 @@ static void irdp_send(struct interface *ifp, struct prefix *p, struct stream *s)
struct zebra_if *zi = ifp->info;
struct irdp_interface *irdp = zi->irdp;
char buf[PREFIX_STRLEN];
- u_int32_t dst;
- u_int32_t ttl = 1;
+ uint32_t dst;
+ uint32_t ttl = 1;
if (!irdp)
return;
@@ -210,7 +210,7 @@ static void irdp_advertisement(struct interface *ifp, struct prefix *p)
int irdp_send_thread(struct thread *t_advert)
{
- u_int32_t timer, tmp;
+ uint32_t timer, tmp;
struct interface *ifp = THREAD_ARG(t_advert);
struct zebra_if *zi = ifp->info;
struct irdp_interface *irdp = zi->irdp;
@@ -288,7 +288,7 @@ void process_solicit(struct interface *ifp)
{
struct zebra_if *zi = ifp->info;
struct irdp_interface *irdp = zi->irdp;
- u_int32_t timer;
+ uint32_t timer;
if (!irdp)
return;
diff --git a/zebra/irdp_packet.c b/zebra/irdp_packet.c
index 11bc9b044..b0dde96cc 100644
--- a/zebra/irdp_packet.c
+++ b/zebra/irdp_packet.c
@@ -175,7 +175,7 @@ static void parse_irdp_packet(char *p, int len, struct interface *ifp)
}
}
-static int irdp_recvmsg(int sock, u_char *buf, int size, int *ifindex)
+static int irdp_recvmsg(int sock, uint8_t *buf, int size, int *ifindex)
{
struct msghdr msg;
struct iovec iov;
@@ -226,7 +226,7 @@ int irdp_read_raw(struct thread *r)
thread_add_read(zebrad.master, irdp_read_raw, NULL, irdp_sock,
&t_irdp_raw);
- ret = irdp_recvmsg(irdp_sock, (u_char *)buf, IRDP_RX_BUF, &ifindex);
+ ret = irdp_recvmsg(irdp_sock, (uint8_t *)buf, IRDP_RX_BUF, &ifindex);
if (ret < 0)
zlog_warn("IRDP: RX Error length = %d", ret);
@@ -263,8 +263,8 @@ int irdp_read_raw(struct thread *r)
return ret;
}
-void send_packet(struct interface *ifp, struct stream *s, u_int32_t dst,
- struct prefix *p, u_int32_t ttl)
+void send_packet(struct interface *ifp, struct stream *s, uint32_t dst,
+ struct prefix *p, uint32_t ttl)
{
static struct sockaddr_in sockdst = {AF_INET};
struct ip *ip;
@@ -275,8 +275,8 @@ void send_packet(struct interface *ifp, struct stream *s, u_int32_t dst,
char msgbuf[256];
char buf[256];
struct in_pktinfo *pktinfo;
- u_long src;
- u_char on;
+ unsigned long src;
+ uint8_t on;
if (!(ifp->flags & IFF_UP))
return;
diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c
index 52b269209..db4f19460 100644
--- a/zebra/kernel_netlink.c
+++ b/zebra/kernel_netlink.c
@@ -58,12 +58,13 @@
#ifndef NLMSG_TAIL
#define NLMSG_TAIL(nmsg) \
- ((struct rtattr *)(((u_char *)(nmsg)) + NLMSG_ALIGN((nmsg)->nlmsg_len)))
+ ((struct rtattr *)(((uint8_t *)(nmsg)) \
+ + NLMSG_ALIGN((nmsg)->nlmsg_len)))
#endif
#ifndef RTA_TAIL
#define RTA_TAIL(rta) \
- ((struct rtattr *)(((u_char *)(rta)) + RTA_ALIGN((rta)->rta_len)))
+ ((struct rtattr *)(((uint8_t *)(rta)) + RTA_ALIGN((rta)->rta_len)))
#endif
#ifndef RTNL_FAMILY_IP6MR
@@ -123,7 +124,7 @@ static const struct message rttype_str[] = {{RTN_UNICAST, "unicast"},
{0}};
extern struct thread_master *master;
-extern u_int32_t nl_rcvbufsize;
+extern uint32_t nl_rcvbufsize;
extern struct zebra_privs_t zserv_privs;
@@ -137,7 +138,7 @@ int netlink_talk_filter(struct sockaddr_nl *snl, struct nlmsghdr *h,
static int netlink_recvbuf(struct nlsock *nl, uint32_t newsize)
{
- u_int32_t oldsize;
+ uint32_t oldsize;
socklen_t newlen = sizeof(newsize);
socklen_t oldlen = sizeof(oldsize);
int ret;
@@ -380,14 +381,14 @@ int rta_addattr_l(struct rtattr *rta, unsigned int maxlen, int type, void *data,
return 0;
}
-int addattr16(struct nlmsghdr *n, unsigned int maxlen, int type, u_int16_t data)
+int addattr16(struct nlmsghdr *n, unsigned int maxlen, int type, uint16_t data)
{
- return addattr_l(n, maxlen, type, &data, sizeof(u_int16_t));
+ return addattr_l(n, maxlen, type, &data, sizeof(uint16_t));
}
int addattr32(struct nlmsghdr *n, unsigned int maxlen, int type, int data)
{
- return addattr_l(n, maxlen, type, &data, sizeof(u_int32_t));
+ return addattr_l(n, maxlen, type, &data, sizeof(uint32_t));
}
struct rtattr *addattr_nest(struct nlmsghdr *n, int maxlen, int type)
@@ -400,7 +401,7 @@ struct rtattr *addattr_nest(struct nlmsghdr *n, int maxlen, int type)
int addattr_nest_end(struct nlmsghdr *n, struct rtattr *nest)
{
- nest->rta_len = (u_char *)NLMSG_TAIL(n) - (u_char *)nest;
+ nest->rta_len = (uint8_t *)NLMSG_TAIL(n) - (uint8_t *)nest;
return n->nlmsg_len;
}
@@ -414,7 +415,7 @@ struct rtattr *rta_nest(struct rtattr *rta, int maxlen, int type)
int rta_nest_end(struct rtattr *rta, struct rtattr *nest)
{
- nest->rta_len = (u_char *)RTA_TAIL(rta) - (u_char *)nest;
+ nest->rta_len = (uint8_t *)RTA_TAIL(rta) - (uint8_t *)nest;
return rta->rta_len;
}
@@ -423,17 +424,17 @@ const char *nl_msg_type_to_str(uint16_t msg_type)
return lookup_msg(nlmsg_str, msg_type, "");
}
-const char *nl_rtproto_to_str(u_char rtproto)
+const char *nl_rtproto_to_str(uint8_t rtproto)
{
return lookup_msg(rtproto_str, rtproto, "");
}
-const char *nl_family_to_str(u_char family)
+const char *nl_family_to_str(uint8_t family)
{
return lookup_msg(family_str, family, "");
}
-const char *nl_rttype_to_str(u_char rttype)
+const char *nl_rttype_to_str(uint8_t rttype)
{
return lookup_msg(rttype_str, rttype, "");
}
diff --git a/zebra/kernel_netlink.h b/zebra/kernel_netlink.h
index e5a079af5..8441eeac7 100644
--- a/zebra/kernel_netlink.h
+++ b/zebra/kernel_netlink.h
@@ -32,7 +32,7 @@ extern int addattr_l(struct nlmsghdr *n, unsigned int maxlen, int type,
extern int rta_addattr_l(struct rtattr *rta, unsigned int maxlen, int type,
void *data, unsigned int alen);
extern int addattr16(struct nlmsghdr *n, unsigned int maxlen, int type,
- u_int16_t data);
+ uint16_t data);
extern int addattr32(struct nlmsghdr *n, unsigned int maxlen, int type,
int data);
extern struct rtattr *addattr_nest(struct nlmsghdr *n, int maxlen, int type);
@@ -40,9 +40,9 @@ extern int addattr_nest_end(struct nlmsghdr *n, struct rtattr *nest);
extern struct rtattr *rta_nest(struct rtattr *rta, int maxlen, int type);
extern int rta_nest_end(struct rtattr *rta, struct rtattr *nest);
extern const char *nl_msg_type_to_str(uint16_t msg_type);
-extern const char *nl_rtproto_to_str(u_char rtproto);
-extern const char *nl_family_to_str(u_char family);
-extern const char *nl_rttype_to_str(u_char rttype);
+extern const char *nl_rtproto_to_str(uint8_t rtproto);
+extern const char *nl_family_to_str(uint8_t family);
+extern const char *nl_rttype_to_str(uint8_t rttype);
extern int netlink_parse_info(int (*filter)(struct sockaddr_nl *,
struct nlmsghdr *, ns_id_t, int),
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c
index eba4270ef..4ac3bed4b 100644
--- a/zebra/kernel_socket.c
+++ b/zebra/kernel_socket.c
@@ -168,7 +168,7 @@ static inline void rta_copy(union sockunion *dest, caddr_t src)
#define RTA_NAME_GET(DEST, RTA, RTMADDRS, PNT, LEN) \
if ((RTMADDRS) & (RTA)) { \
- u_char *pdest = (u_char *)(DEST); \
+ uint8_t *pdest = (uint8_t *)(DEST); \
int len = SAROUNDUP((PNT)); \
struct sockaddr_dl *sdl = (struct sockaddr_dl *)(PNT); \
if (IS_ZEBRA_DEBUG_KERNEL) \
@@ -864,7 +864,7 @@ static int rtm_read_mesg(struct rt_msghdr *rtm, union sockunion *dest,
void rtm_read(struct rt_msghdr *rtm)
{
int flags;
- u_char zebra_flags;
+ uint8_t zebra_flags;
union sockunion dest, mask, gate;
char ifname[INTERFACE_NAMSIZ + 1];
short ifnlen = 0;
diff --git a/zebra/label_manager.c b/zebra/label_manager.c
index b58f0c9ff..ad881b819 100644
--- a/zebra/label_manager.c
+++ b/zebra/label_manager.c
@@ -64,11 +64,11 @@ static int relay_response_back(struct zserv *zserv)
{
int ret = 0;
struct stream *src, *dst;
- u_int16_t size = 0;
- u_char marker;
- u_char version;
+ uint16_t size = 0;
+ uint8_t marker;
+ uint8_t version;
vrf_id_t vrf_id;
- u_int16_t resp_cmd;
+ uint16_t resp_cmd;
src = zclient->ibuf;
dst = obuf;
@@ -269,8 +269,9 @@ void label_manager_init(char *lm_zserv_path)
* @para size Size of the label chunk
* @return Pointer to the assigned label chunk
*/
-struct label_manager_chunk *assign_label_chunk(u_char proto, u_short instance,
- u_char keep, uint32_t size)
+struct label_manager_chunk *assign_label_chunk(uint8_t proto,
+ unsigned short instance,
+ uint8_t keep, uint32_t size)
{
struct label_manager_chunk *lmc;
struct listnode *node;
@@ -321,7 +322,7 @@ struct label_manager_chunk *assign_label_chunk(u_char proto, u_short instance,
* @param end Last label of the chunk
* @return 0 on success, -1 otherwise
*/
-int release_label_chunk(u_char proto, u_short instance, uint32_t start,
+int release_label_chunk(uint8_t proto, unsigned short instance, uint32_t start,
uint32_t end)
{
struct listnode *node;
@@ -362,7 +363,7 @@ int release_label_chunk(u_char proto, u_short instance, uint32_t start,
* @param instance Instance, to identify the owner
* @return Number of chunks released
*/
-int release_daemon_chunks(u_char proto, u_short instance)
+int release_daemon_chunks(uint8_t proto, unsigned short instance)
{
struct listnode *node;
struct label_manager_chunk *lmc;
diff --git a/zebra/label_manager.h b/zebra/label_manager.h
index 875698362..a26e195b7 100644
--- a/zebra/label_manager.h
+++ b/zebra/label_manager.h
@@ -44,9 +44,9 @@
* the same proto and instance values)
*/
struct label_manager_chunk {
- u_char proto;
- u_short instance;
- u_char keep;
+ uint8_t proto;
+ unsigned short instance;
+ uint8_t keep;
uint32_t start; /* First label of the chunk */
uint32_t end; /* Last label of the chunk */
};
@@ -64,11 +64,12 @@ bool lm_is_external;
int zread_relay_label_manager_request(int cmd, struct zserv *zserv,
vrf_id_t vrf_id);
void label_manager_init(char *lm_zserv_path);
-struct label_manager_chunk *assign_label_chunk(u_char proto, u_short instance,
- u_char keep, uint32_t size);
-int release_label_chunk(u_char proto, u_short instance, uint32_t start,
+struct label_manager_chunk *assign_label_chunk(uint8_t proto,
+ unsigned short instance,
+ uint8_t keep, uint32_t size);
+int release_label_chunk(uint8_t proto, unsigned short instance, uint32_t start,
uint32_t end);
-int release_daemon_chunks(u_char proto, u_short instance);
+int release_daemon_chunks(uint8_t proto, unsigned short instance);
void label_manager_close(void);
#endif /* _LABEL_MANAGER_H */
diff --git a/zebra/main.c b/zebra/main.c
index b0a19c5aa..c8d7f83fb 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -75,7 +75,7 @@ int keep_kernel_mode = 0;
#ifdef HAVE_NETLINK
/* Receive buffer size for netlink socket */
-u_int32_t nl_rcvbufsize = 4194304;
+uint32_t nl_rcvbufsize = 4194304;
#endif /* HAVE_NETLINK */
/* Command line options. */
diff --git a/zebra/redistribute.c b/zebra/redistribute.c
index 89c17b069..15e7d4437 100644
--- a/zebra/redistribute.c
+++ b/zebra/redistribute.c
@@ -48,9 +48,9 @@
/* array holding redistribute info about table redistribution */
/* bit AFI is set if that AFI is redistributing routes from this table */
static int zebra_import_table_used[AFI_MAX][ZEBRA_KERNEL_TABLE_MAX];
-static u_int32_t zebra_import_table_distance[AFI_MAX][ZEBRA_KERNEL_TABLE_MAX];
+static uint32_t zebra_import_table_distance[AFI_MAX][ZEBRA_KERNEL_TABLE_MAX];
-int is_zebra_import_table_enabled(afi_t afi, u_int32_t table_id)
+int is_zebra_import_table_enabled(afi_t afi, uint32_t table_id)
{
/*
* Make sure that what we are called with actualy makes sense
@@ -98,8 +98,9 @@ static void zebra_redistribute_default(struct zserv *client, vrf_id_t vrf_id)
}
/* Redistribute routes. */
-static void zebra_redistribute(struct zserv *client, int type, u_short instance,
- vrf_id_t vrf_id, int afi)
+static void zebra_redistribute(struct zserv *client, int type,
+ unsigned short instance, vrf_id_t vrf_id,
+ int afi)
{
struct route_entry *newre;
struct route_table *table;
@@ -249,7 +250,7 @@ void zebra_redistribute_add(ZAPI_HANDLER_ARGS)
{
afi_t afi = 0;
int type = 0;
- u_short instance;
+ unsigned short instance;
STREAM_GETC(msg, afi);
STREAM_GETC(msg, type);
@@ -301,7 +302,7 @@ void zebra_redistribute_delete(ZAPI_HANDLER_ARGS)
{
afi_t afi = 0;
int type = 0;
- u_short instance;
+ unsigned short instance;
STREAM_GETC(msg, afi);
STREAM_GETC(msg, type);
@@ -582,7 +583,7 @@ int zebra_del_import_table_entry(struct route_node *rn, struct route_entry *re)
}
/* Assuming no one calls this with the main routing table */
-int zebra_import_table(afi_t afi, u_int32_t table_id, u_int32_t distance,
+int zebra_import_table(afi_t afi, uint32_t table_id, uint32_t distance,
const char *rmap_name, int add)
{
struct route_table *table;
diff --git a/zebra/redistribute.h b/zebra/redistribute.h
index e551f820c..c78480d9a 100644
--- a/zebra/redistribute.h
+++ b/zebra/redistribute.h
@@ -55,7 +55,7 @@ extern void zebra_interface_vrf_update_del(struct interface *,
extern void zebra_interface_vrf_update_add(struct interface *,
vrf_id_t old_vrf_id);
-extern int zebra_import_table(afi_t afi, u_int32_t table_id, u_int32_t distance,
+extern int zebra_import_table(afi_t afi, uint32_t table_id, uint32_t distance,
const char *rmap_name, int add);
extern int zebra_add_import_table_entry(struct route_node *rn,
@@ -63,7 +63,7 @@ extern int zebra_add_import_table_entry(struct route_node *rn,
const char *rmap_name);
extern int zebra_del_import_table_entry(struct route_node *rn,
struct route_entry *re);
-extern int is_zebra_import_table_enabled(afi_t, u_int32_t table_id);
+extern int is_zebra_import_table_enabled(afi_t, uint32_t table_id);
extern int zebra_import_table_config(struct vty *);
diff --git a/zebra/rib.h b/zebra/rib.h
index 0562d544e..d68bf787c 100644
--- a/zebra/rib.h
+++ b/zebra/rib.h
@@ -56,7 +56,7 @@ struct route_entry {
int type;
/* Source protocol instance */
- u_short instance;
+ unsigned short instance;
/* VRF identifier. */
vrf_id_t vrf_id;
@@ -65,11 +65,11 @@ struct route_entry {
uint32_t table;
/* Metric */
- u_int32_t metric;
+ uint32_t metric;
/* MTU */
- u_int32_t mtu;
- u_int32_t nexthop_mtu;
+ uint32_t mtu;
+ uint32_t nexthop_mtu;
/* Distance. */
uint8_t distance;
@@ -78,10 +78,10 @@ struct route_entry {
* This flag's definition is in lib/zebra.h ZEBRA_FLAG_* and is exposed
* to clients via Zserv
*/
- u_int32_t flags;
+ uint32_t flags;
/* RIB internal status */
- u_char status;
+ uint8_t status;
#define ROUTE_ENTRY_REMOVED 0x1
/* to simplify NHT logic when NHs change, instead of doing a NH by NH cmp */
#define ROUTE_ENTRY_NEXTHOPS_CHANGED 0x2
@@ -89,8 +89,8 @@ struct route_entry {
#define ROUTE_ENTRY_LABELS_CHANGED 0x8
/* Nexthop information. */
- u_char nexthop_num;
- u_char nexthop_active_num;
+ uint8_t nexthop_num;
+ uint8_t nexthop_active_num;
};
/* meta-queue structure:
@@ -103,7 +103,7 @@ struct route_entry {
#define MQ_SIZE 5
struct meta_queue {
struct list *subq[MQ_SIZE];
- u_int32_t size; /* sum of lengths of all subqueues */
+ uint32_t size; /* sum of lengths of all subqueues */
};
/*
@@ -127,7 +127,7 @@ typedef struct rib_dest_t_ {
/*
* Flags, see below.
*/
- u_int32_t flags;
+ uint32_t flags;
/*
* Linkage to put dest on the FPM processing queue.
@@ -287,8 +287,8 @@ extern int rib_lookup_ipv4_route(struct prefix_ipv4 *p, union sockunion *qgate,
#define ZEBRA_RIB_FOUND_CONNECTED 2
#define ZEBRA_RIB_NOTFOUND 3
-extern int is_zebra_valid_kernel_table(u_int32_t table_id);
-extern int is_zebra_main_routing_table(u_int32_t table_id);
+extern int is_zebra_valid_kernel_table(uint32_t table_id);
+extern int is_zebra_main_routing_table(uint32_t table_id);
extern int zebra_check_addr(struct prefix *p);
extern void rib_addnode(struct route_node *rn, struct route_entry *re,
@@ -302,18 +302,18 @@ extern void rib_uninstall_kernel(struct route_node *rn, struct route_entry *re);
* All rib_add function will not just add prefix into RIB, but
* also implicitly withdraw equal prefix of same type. */
extern int rib_add(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
- u_short instance, int flags, struct prefix *p,
+ unsigned short instance, int flags, struct prefix *p,
struct prefix_ipv6 *src_p, const struct nexthop *nh,
- u_int32_t table_id, u_int32_t metric, u_int32_t mtu,
+ uint32_t table_id, uint32_t metric, uint32_t mtu,
uint8_t distance, route_tag_t tag);
extern int rib_add_multipath(afi_t afi, safi_t safi, struct prefix *p,
struct prefix_ipv6 *src_p, struct route_entry *re);
extern void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
- u_short instance, int flags, struct prefix *p,
+ unsigned short instance, int flags, struct prefix *p,
struct prefix_ipv6 *src_p, const struct nexthop *nh,
- u_int32_t table_id, u_int32_t metric, bool fromkernel,
+ uint32_t table_id, uint32_t metric, bool fromkernel,
struct ethaddr *rmac);
extern struct route_entry *rib_match(afi_t afi, safi_t safi, vrf_id_t vrf_id,
@@ -331,8 +331,9 @@ extern void rib_sweep_route(void);
extern void rib_sweep_table(struct route_table *table);
extern void rib_close_table(struct route_table *table);
extern void rib_init(void);
-extern unsigned long rib_score_proto(u_char proto, u_short instance);
-extern unsigned long rib_score_proto_table(u_char proto, u_short instance,
+extern unsigned long rib_score_proto(uint8_t proto, unsigned short instance);
+extern unsigned long rib_score_proto_table(uint8_t proto,
+ unsigned short instance,
struct route_table *table);
extern void rib_queue_add(struct route_node *rn);
extern void meta_queue_free(struct meta_queue *mq);
@@ -395,7 +396,7 @@ static inline struct prefix *rib_dest_prefix(rib_dest_t *dest)
*
* Returns the address family that the destination is for.
*/
-static inline u_char rib_dest_af(rib_dest_t *dest)
+static inline uint8_t rib_dest_af(rib_dest_t *dest)
{
return dest->rnode->p.family;
}
diff --git a/zebra/rt.h b/zebra/rt.h
index 399f6e845..fd298fd23 100644
--- a/zebra/rt.h
+++ b/zebra/rt.h
@@ -107,7 +107,7 @@ extern int kernel_del_vtep(vni_t vni, struct interface *ifp,
struct in_addr *vtep_ip);
extern int kernel_add_mac(struct interface *ifp, vlanid_t vid,
struct ethaddr *mac, struct in_addr vtep_ip,
- u_char sticky);
+ uint8_t sticky);
extern int kernel_del_mac(struct interface *ifp, vlanid_t vid,
struct ethaddr *mac, struct in_addr vtep_ip,
int local);
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 2b758c58d..521b4011d 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -72,8 +72,8 @@
static vlanid_t filter_vlan = 0;
struct gw_family_t {
- u_int16_t filler;
- u_int16_t family;
+ uint16_t filler;
+ uint16_t family;
union g_addr gate;
};
@@ -194,7 +194,7 @@ static inline int proto2zebra(int proto, int family)
/*
Pending: create an efficient table_id (in a tree/hash) based lookup)
*/
-static vrf_id_t vrf_lookup_by_table(u_int32_t table_id, ns_id_t ns_id)
+static vrf_id_t vrf_lookup_by_table(uint32_t table_id, ns_id_t ns_id)
{
struct vrf *vrf;
struct zebra_vrf *zvrf;
@@ -226,7 +226,7 @@ static int netlink_route_change_read_unicast(struct sockaddr_nl *snl,
int len;
struct rtmsg *rtm;
struct rtattr *tb[RTA_MAX + 1];
- u_char flags = 0;
+ uint8_t flags = 0;
struct prefix p;
struct prefix_ipv6 src_p = {};
vrf_id_t vrf_id;
@@ -237,7 +237,7 @@ static int netlink_route_change_read_unicast(struct sockaddr_nl *snl,
int index = 0;
int table;
int metric = 0;
- u_int32_t mtu = 0;
+ uint32_t mtu = 0;
uint8_t distance = 0;
route_tag_t tag = 0;
@@ -344,7 +344,7 @@ static int netlink_route_change_read_unicast(struct sockaddr_nl *snl,
RTA_PAYLOAD(tb[RTA_METRICS]));
if (mxrta[RTAX_MTU])
- mtu = *(u_int32_t *)RTA_DATA(mxrta[RTAX_MTU]);
+ mtu = *(uint32_t *)RTA_DATA(mxrta[RTAX_MTU]);
}
if (rtm->rtm_family == AF_INET) {
@@ -772,8 +772,8 @@ int netlink_route_read(struct zebra_ns *zns)
return 0;
}
-static void _netlink_route_nl_add_gateway_info(u_char route_family,
- u_char gw_family,
+static void _netlink_route_nl_add_gateway_info(uint8_t route_family,
+ uint8_t gw_family,
struct nlmsghdr *nlmsg,
size_t req_size, int bytelen,
struct nexthop *nexthop)
@@ -798,8 +798,8 @@ static void _netlink_route_nl_add_gateway_info(u_char route_family,
}
}
-static void _netlink_route_rta_add_gateway_info(u_char route_family,
- u_char gw_family,
+static void _netlink_route_rta_add_gateway_info(uint8_t route_family,
+ uint8_t gw_family,
struct rtattr *rta,
struct rtnexthop *rtnh,
size_t req_size, int bytelen,
@@ -896,10 +896,10 @@ static void _netlink_route_build_singlepath(const char *routedesc, int bytelen,
num_labels * sizeof(mpls_lse_t));
else {
struct rtattr *nest;
- u_int16_t encap = LWTUNNEL_ENCAP_MPLS;
+ uint16_t encap = LWTUNNEL_ENCAP_MPLS;
addattr_l(nlmsg, req_size, RTA_ENCAP_TYPE, &encap,
- sizeof(u_int16_t));
+ sizeof(uint16_t));
nest = addattr_nest(nlmsg, req_size, RTA_ENCAP);
addattr_l(nlmsg, req_size, MPLS_IPTUNNEL_DST, &out_lse,
num_labels * sizeof(mpls_lse_t));
@@ -1108,11 +1108,11 @@ static void _netlink_route_build_multipath(const char *routedesc, int bytelen,
RTA_LENGTH(num_labels * sizeof(mpls_lse_t));
} else {
struct rtattr *nest;
- u_int16_t encap = LWTUNNEL_ENCAP_MPLS;
+ uint16_t encap = LWTUNNEL_ENCAP_MPLS;
int len = rta->rta_len;
rta_addattr_l(rta, NL_PKT_BUF_SIZE, RTA_ENCAP_TYPE,
- &encap, sizeof(u_int16_t));
+ &encap, sizeof(uint16_t));
nest = rta_nest(rta, NL_PKT_BUF_SIZE, RTA_ENCAP);
rta_addattr_l(rta, NL_PKT_BUF_SIZE, MPLS_IPTUNNEL_DST,
&out_lse,
@@ -1224,7 +1224,7 @@ static inline void _netlink_mpls_build_singlepath(const char *routedesc,
size_t req_size, int cmd)
{
int bytelen;
- u_char family;
+ uint8_t family;
family = NHLFE_FAMILY(nhlfe);
bytelen = (family == AF_INET ? 4 : 16);
@@ -1239,7 +1239,7 @@ _netlink_mpls_build_multipath(const char *routedesc, zebra_nhlfe_t *nhlfe,
struct rtmsg *rtmsg, union g_addr **src)
{
int bytelen;
- u_char family;
+ uint8_t family;
family = NHLFE_FAMILY(nhlfe);
bytelen = (family == AF_INET ? 4 : 16);
@@ -1272,7 +1272,7 @@ static void _netlink_route_debug(int cmd, struct prefix *p,
}
}
-static void _netlink_mpls_debug(int cmd, u_int32_t label, const char *routedesc)
+static void _netlink_mpls_debug(int cmd, uint32_t label, const char *routedesc)
{
if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug("netlink_mpls_multipath() (%s): %s %u/20", routedesc,
@@ -1385,7 +1385,7 @@ static int netlink_route_multipath(int cmd, struct prefix *p,
if (re->mtu || re->nexthop_mtu) {
char buf[NL_PKT_BUF_SIZE];
struct rtattr *rta = (void *)buf;
- u_int32_t mtu = re->mtu;
+ uint32_t mtu = re->mtu;
if (!mtu || (re->nexthop_mtu && re->nexthop_mtu < mtu))
mtu = re->nexthop_mtu;
rta->rta_type = RTA_METRICS;
@@ -1724,7 +1724,7 @@ static int netlink_vxlan_flood_list_update(struct interface *ifp,
struct ndmsg ndm;
char buf[256];
} req;
- u_char dst_mac[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
+ uint8_t dst_mac[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
struct zebra_vrf *zvrf = zebra_vrf_lookup_by_id(ifp->vrf_id);
zns = zvrf->zns;
@@ -1797,7 +1797,7 @@ static int netlink_macfdb_change(struct sockaddr_nl *snl, struct nlmsghdr *h,
char buf[ETHER_ADDR_STRLEN];
char vid_buf[20];
char dst_buf[30];
- u_char sticky = 0;
+ uint8_t sticky = 0;
ndm = NLMSG_DATA(h);
@@ -1854,7 +1854,7 @@ static int netlink_macfdb_change(struct sockaddr_nl *snl, struct nlmsghdr *h,
if ((NDA_VLAN <= NDA_MAX) && tb[NDA_VLAN]) {
vid_present = 1;
- vid = *(u_int16_t *)RTA_DATA(tb[NDA_VLAN]);
+ vid = *(uint16_t *)RTA_DATA(tb[NDA_VLAN]);
sprintf(vid_buf, " VLAN %u", vid);
}
@@ -2017,7 +2017,7 @@ int netlink_macfdb_read_for_bridge(struct zebra_ns *zns, struct interface *ifp,
static int netlink_macfdb_update(struct interface *ifp, vlanid_t vid,
struct ethaddr *mac, struct in_addr vtep_ip,
- int local, int cmd, u_char sticky)
+ int local, int cmd, uint8_t sticky)
{
struct zebra_ns *zns;
struct {
@@ -2107,7 +2107,7 @@ static int netlink_ipneigh_change(struct sockaddr_nl *snl, struct nlmsghdr *h,
char buf[ETHER_ADDR_STRLEN];
char buf2[INET6_ADDRSTRLEN];
int mac_present = 0;
- u_char ext_learned;
+ uint8_t ext_learned;
ndm = NLMSG_DATA(h);
@@ -2329,7 +2329,7 @@ int netlink_neigh_change(struct sockaddr_nl *snl, struct nlmsghdr *h,
}
static int netlink_neigh_update2(struct interface *ifp, struct ipaddr *ip,
- struct ethaddr *mac, u_int32_t flags, int cmd)
+ struct ethaddr *mac, uint32_t flags, int cmd)
{
struct {
struct nlmsghdr n;
@@ -2377,7 +2377,7 @@ static int netlink_neigh_update2(struct interface *ifp, struct ipaddr *ip,
}
int kernel_add_mac(struct interface *ifp, vlanid_t vid, struct ethaddr *mac,
- struct in_addr vtep_ip, u_char sticky)
+ struct in_addr vtep_ip, uint8_t sticky)
{
return netlink_macfdb_update(ifp, vid, mac, vtep_ip, 0, RTM_NEWNEIGH,
sticky);
diff --git a/zebra/rt_socket.c b/zebra/rt_socket.c
index 433faf789..f9cd1cbab 100644
--- a/zebra/rt_socket.c
+++ b/zebra/rt_socket.c
@@ -444,7 +444,7 @@ int kernel_del_vtep(vni_t vni, struct interface *ifp, struct in_addr *vtep_ip)
}
int kernel_add_mac(struct interface *ifp, vlanid_t vid, struct ethaddr *mac,
- struct in_addr vtep_ip, u_char sticky)
+ struct in_addr vtep_ip, uint8_t sticky)
{
return 0;
}
diff --git a/zebra/rtadv.c b/zebra/rtadv.c
index d0b821bfd..c695b6566 100644
--- a/zebra/rtadv.c
+++ b/zebra/rtadv.c
@@ -95,7 +95,7 @@ static int rtadv_increment_received(struct zebra_ns *zns, ifindex_t *ifindex)
return ret;
}
-static int rtadv_recv_packet(struct zebra_ns *zns, int sock, u_char *buf,
+static int rtadv_recv_packet(struct zebra_ns *zns, int sock, uint8_t *buf,
int buflen, struct sockaddr_in6 *from,
ifindex_t *ifindex, int *hoplimit)
{
@@ -164,10 +164,10 @@ static void rtadv_send_packet(int sock, struct interface *ifp)
int len = 0;
struct zebra_if *zif;
struct rtadv_prefix *rprefix;
- u_char all_nodes_addr[] = {0xff, 0x02, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1};
+ uint8_t all_nodes_addr[] = {0xff, 0x02, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1};
struct listnode *node;
- u_int16_t pkt_RouterLifetime;
+ uint16_t pkt_RouterLifetime;
/*
* Allocate control message bufffer. This is dynamic because
@@ -315,7 +315,7 @@ static void rtadv_send_packet(int sock, struct interface *ifp)
#ifdef DEBUG
{
- u_char buf[INET6_ADDRSTRLEN];
+ uint8_t buf[INET6_ADDRSTRLEN];
zlog_debug("DEBUG %s",
inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix,
@@ -452,7 +452,7 @@ static void rtadv_process_solicit(struct interface *ifp)
rtadv_send_packet(zns->rtadv.sock, ifp);
}
-static void rtadv_process_advert(u_char *msg, unsigned int len,
+static void rtadv_process_advert(uint8_t *msg, unsigned int len,
struct interface *ifp,
struct sockaddr_in6 *addr)
{
@@ -526,7 +526,7 @@ static void rtadv_process_advert(u_char *msg, unsigned int len,
}
-static void rtadv_process_packet(u_char *buf, unsigned int len,
+static void rtadv_process_packet(uint8_t *buf, unsigned int len,
ifindex_t ifindex, int hoplimit,
struct sockaddr_in6 *from,
struct zebra_ns *zns)
@@ -596,7 +596,7 @@ static int rtadv_read(struct thread *thread)
{
int sock;
int len;
- u_char buf[RTADV_MSG_SIZE];
+ uint8_t buf[RTADV_MSG_SIZE];
struct sockaddr_in6 from;
ifindex_t ifindex = 0;
int hoplimit = -1;
diff --git a/zebra/rtadv.h b/zebra/rtadv.h
index 8fd67c8a6..03db13fd6 100644
--- a/zebra/rtadv.h
+++ b/zebra/rtadv.h
@@ -34,7 +34,7 @@ struct rtadv_prefix {
struct prefix_ipv6 prefix;
/* The value to be placed in the Valid Lifetime in the Prefix */
- u_int32_t AdvValidLifetime;
+ uint32_t AdvValidLifetime;
#define RTADV_VALID_LIFETIME 2592000
/* The value to be placed in the on-link flag */
@@ -42,7 +42,7 @@ struct rtadv_prefix {
/* The value to be placed in the Preferred Lifetime in the Prefix
Information option, in seconds.*/
- u_int32_t AdvPreferredLifetime;
+ uint32_t AdvPreferredLifetime;
#define RTADV_PREFERRED_LIFETIME 604800
/* The value to be placed in the Autonomous Flag. */
@@ -83,11 +83,11 @@ struct nd_opt_adv_interval { /* Advertisement interval option */
#ifndef HAVE_STRUCT_ND_OPT_HOMEAGENT_INFO
struct nd_opt_homeagent_info { /* Home Agent info */
- u_int8_t nd_opt_hai_type;
- u_int8_t nd_opt_hai_len;
- u_int16_t nd_opt_hai_reserved;
- u_int16_t nd_opt_hai_preference;
- u_int16_t nd_opt_hai_lifetime;
+ uint8_t nd_opt_hai_type;
+ uint8_t nd_opt_hai_len;
+ uint16_t nd_opt_hai_reserved;
+ uint16_t nd_opt_hai_preference;
+ uint16_t nd_opt_hai_lifetime;
} __attribute__((__packed__));
#endif
diff --git a/zebra/rtread_getmsg.c b/zebra/rtread_getmsg.c
index 38321bc41..b3aeaf2f7 100644
--- a/zebra/rtread_getmsg.c
+++ b/zebra/rtread_getmsg.c
@@ -77,7 +77,7 @@ static void handle_route_entry(mib2_ipRouteEntry_t *routeEntry)
struct prefix prefix;
struct in_addr tmpaddr;
struct nexthop nh;
- u_char zebra_flags = 0;
+ uint8_t zebra_flags = 0;
if (routeEntry->ipRouteInfo.re_ire_type & IRE_CACHETABLE)
return;
diff --git a/zebra/zebra_fpm_dt.c b/zebra/zebra_fpm_dt.c
index 48db246bc..e87fa0ad7 100644
--- a/zebra/zebra_fpm_dt.c
+++ b/zebra/zebra_fpm_dt.c
@@ -176,7 +176,7 @@ static void zfpm_dt_log_fpm_message(Fpm__Message *msg)
Fpm__AddRoute *add_route;
Fpm__Nexthop *nexthop;
struct prefix prefix;
- u_char family, nh_family;
+ uint8_t family, nh_family;
uint if_index;
char *if_name;
size_t i;
diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c
index 97a0e142f..c27884ec4 100644
--- a/zebra/zebra_fpm_netlink.c
+++ b/zebra/zebra_fpm_netlink.c
@@ -45,7 +45,7 @@
*
* Returns string representation of an address of the given AF.
*/
-static inline const char *addr_to_a(u_char af, void *addr)
+static inline const char *addr_to_a(uint8_t af, void *addr)
{
if (!addr)
return "<No address>";
@@ -83,7 +83,7 @@ static const char *prefix_addr_to_a(struct prefix *prefix)
*
* The size of an address in a given address family.
*/
-static size_t af_addr_size(u_char af)
+static size_t af_addr_size(uint8_t af)
{
switch (af) {
@@ -125,10 +125,10 @@ typedef struct netlink_nh_info_t_ {
*/
typedef struct netlink_route_info_t_ {
uint16_t nlmsg_type;
- u_char rtm_type;
+ uint8_t rtm_type;
uint32_t rtm_table;
- u_char rtm_protocol;
- u_char af;
+ uint8_t rtm_protocol;
+ uint8_t af;
struct prefix *prefix;
uint32_t *metric;
unsigned int num_nhs;
@@ -199,7 +199,7 @@ static int netlink_route_info_add_nh(netlink_route_info_t *ri,
/*
* netlink_proto_from_route_type
*/
-static u_char netlink_proto_from_route_type(int type)
+static uint8_t netlink_proto_from_route_type(int type)
{
switch (type) {
case ZEBRA_ROUTE_KERNEL:
diff --git a/zebra/zebra_l2.h b/zebra/zebra_l2.h
index 0d0c5aaf2..db6cb0e53 100644
--- a/zebra/zebra_l2.h
+++ b/zebra/zebra_l2.h
@@ -37,7 +37,7 @@ struct zebra_l2info_brslave {
/* zebra L2 interface information - bridge interface */
struct zebra_l2info_bridge {
- u_char vlan_aware; /* VLAN-aware bridge? */
+ uint8_t vlan_aware; /* VLAN-aware bridge? */
};
/* zebra L2 interface information - VLAN interface */
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c
index 8375d45d2..3cc1848ee 100644
--- a/zebra/zebra_mpls.c
+++ b/zebra/zebra_mpls.c
@@ -60,8 +60,8 @@ extern struct zebra_t zebrad;
/* static function declarations */
static void fec_evaluate(struct zebra_vrf *zvrf);
-static u_int32_t fec_derive_label_from_index(struct zebra_vrf *vrf,
- zebra_fec_t *fec);
+static uint32_t fec_derive_label_from_index(struct zebra_vrf *vrf,
+ zebra_fec_t *fec);
static int lsp_install(struct zebra_vrf *zvrf, mpls_label_t label,
struct route_node *rn, struct route_entry *re);
static int lsp_uninstall(struct zebra_vrf *zvrf, mpls_label_t label);
@@ -72,8 +72,8 @@ static void fec_update_clients(zebra_fec_t *fec);
static void fec_print(zebra_fec_t *fec, struct vty *vty);
static zebra_fec_t *fec_find(struct route_table *table, struct prefix *p);
static zebra_fec_t *fec_add(struct route_table *table, struct prefix *p,
- mpls_label_t label, u_int32_t flags,
- u_int32_t label_index);
+ mpls_label_t label, uint32_t flags,
+ uint32_t label_index);
static int fec_del(zebra_fec_t *fec);
static unsigned int label_hash(void *p);
@@ -330,7 +330,7 @@ static void fec_evaluate(struct zebra_vrf *zvrf)
{
struct route_node *rn;
zebra_fec_t *fec;
- u_int32_t old_label, new_label;
+ uint32_t old_label, new_label;
int af;
char buf[BUFSIZ];
@@ -382,10 +382,10 @@ static void fec_evaluate(struct zebra_vrf *zvrf)
* its label index. The index is "acceptable" if it falls within the
* globally configured label block (SRGB).
*/
-static u_int32_t fec_derive_label_from_index(struct zebra_vrf *zvrf,
- zebra_fec_t *fec)
+static uint32_t fec_derive_label_from_index(struct zebra_vrf *zvrf,
+ zebra_fec_t *fec)
{
- u_int32_t label;
+ uint32_t label;
if (fec->label_index != MPLS_INVALID_LABEL_INDEX
&& zvrf->mpls_srgb.start_label
@@ -532,8 +532,8 @@ static zebra_fec_t *fec_find(struct route_table *table, struct prefix *p)
* or when a binding is configured.
*/
static zebra_fec_t *fec_add(struct route_table *table, struct prefix *p,
- mpls_label_t label, u_int32_t flags,
- u_int32_t label_index)
+ mpls_label_t label, uint32_t flags,
+ uint32_t label_index)
{
struct route_node *rn;
zebra_fec_t *fec;
@@ -1734,7 +1734,7 @@ void kernel_lsp_pass_fail(zebra_lsp_t *lsp, enum southbound_results res)
* -2 if a label was inside the reserved range (0-15)
* -3 if the number of labels given exceeds MPLS_MAX_LABELS
*/
-int mpls_str2label(const char *label_str, u_int8_t *num_labels,
+int mpls_str2label(const char *label_str, uint8_t *num_labels,
mpls_label_t *labels)
{
char *ostr; // copy of label string (start)
@@ -1779,7 +1779,7 @@ int mpls_str2label(const char *label_str, u_int8_t *num_labels,
/*
* Label to string conversion, labels in string separated by '/'.
*/
-char *mpls_label2str(u_int8_t num_labels, mpls_label_t *labels, char *buf,
+char *mpls_label2str(uint8_t num_labels, mpls_label_t *labels, char *buf,
int len, int pretty)
{
char label_buf[BUFSIZ];
@@ -1860,14 +1860,14 @@ int zebra_mpls_lsp_uninstall(struct zebra_vrf *zvrf, struct route_node *rn,
* is acceptable.
*/
int zebra_mpls_fec_register(struct zebra_vrf *zvrf, struct prefix *p,
- u_int32_t label_index, struct zserv *client)
+ uint32_t label_index, struct zserv *client)
{
struct route_table *table;
zebra_fec_t *fec;
char buf[BUFSIZ];
int new_client;
int label_change = 0;
- u_int32_t old_label;
+ uint32_t old_label;
table = zvrf->fec_table[family2afi(PREFIX_FAMILY(p))];
if (!table)
@@ -2272,7 +2272,7 @@ static bool mpls_ftn_update_nexthop(int add, struct nexthop *nexthop,
*/
int mpls_ftn_update(int add, struct zebra_vrf *zvrf, enum lsp_types_t type,
struct prefix *prefix, enum nexthop_types_t gtype,
- union g_addr *gate, ifindex_t ifindex, u_int8_t distance,
+ union g_addr *gate, ifindex_t ifindex, uint8_t distance,
mpls_label_t out_label)
{
struct route_table *table;
@@ -2742,7 +2742,7 @@ void zebra_mpls_lsp_schedule(struct zebra_vrf *zvrf)
* (VTY command handler).
*/
void zebra_mpls_print_lsp(struct vty *vty, struct zebra_vrf *zvrf,
- mpls_label_t label, u_char use_json)
+ mpls_label_t label, uint8_t use_json)
{
struct hash *lsp_table;
zebra_lsp_t *lsp;
@@ -2773,7 +2773,7 @@ void zebra_mpls_print_lsp(struct vty *vty, struct zebra_vrf *zvrf,
* Display MPLS label forwarding table (VTY command handler).
*/
void zebra_mpls_print_lsp_table(struct vty *vty, struct zebra_vrf *zvrf,
- u_char use_json)
+ uint8_t use_json)
{
char buf[BUFSIZ];
json_object *json = NULL;
@@ -2893,8 +2893,8 @@ int zebra_mpls_write_lsp_config(struct vty *vty, struct zebra_vrf *zvrf)
/*
* Add/update global label block.
*/
-int zebra_mpls_label_block_add(struct zebra_vrf *zvrf, u_int32_t start_label,
- u_int32_t end_label)
+int zebra_mpls_label_block_add(struct zebra_vrf *zvrf, uint32_t start_label,
+ uint32_t end_label)
{
zvrf->mpls_srgb.start_label = start_label;
zvrf->mpls_srgb.end_label = end_label;
diff --git a/zebra/zebra_mpls.h b/zebra/zebra_mpls.h
index fd14b29ca..2637327a7 100644
--- a/zebra/zebra_mpls.h
+++ b/zebra/zebra_mpls.h
@@ -91,7 +91,7 @@ struct zebra_nhlfe_t_ {
zebra_lsp_t *lsp;
/* Runtime info - flags, pointers etc. */
- u_int32_t flags;
+ uint32_t flags;
#define NHLFE_FLAG_CHANGED (1 << 0)
#define NHLFE_FLAG_SELECTED (1 << 1)
#define NHLFE_FLAG_MULTIPATH (1 << 2)
@@ -100,7 +100,7 @@ struct zebra_nhlfe_t_ {
zebra_nhlfe_t *next;
zebra_nhlfe_t *prev;
- u_char distance;
+ uint8_t distance;
};
/*
@@ -131,17 +131,17 @@ struct zebra_lsp_t_ {
/* List of NHLFE, pointer to best and num equal-cost. */
zebra_nhlfe_t *nhlfe_list;
zebra_nhlfe_t *best_nhlfe;
- u_int32_t num_ecmp;
+ uint32_t num_ecmp;
/* Flags */
- u_int32_t flags;
+ uint32_t flags;
#define LSP_FLAG_SCHEDULED (1 << 0)
#define LSP_FLAG_INSTALLED (1 << 1)
#define LSP_FLAG_CHANGED (1 << 2)
/* Address-family of NHLFE - saved here for delete. All NHLFEs */
/* have to be of the same AF */
- u_char addr_family;
+ uint8_t addr_family;
};
/*
@@ -155,10 +155,10 @@ struct zebra_fec_t_ {
mpls_label_t label;
/* Label index (into global label block), if valid */
- u_int32_t label_index;
+ uint32_t label_index;
/* Flags. */
- u_int32_t flags;
+ uint32_t flags;
#define FEC_FLAG_CONFIGURED (1 << 0)
/* Clients interested in this FEC. */
@@ -170,20 +170,20 @@ struct zebra_fec_t_ {
/*
* String to label conversion, labels separated by '/'.
*/
-int mpls_str2label(const char *label_str, u_int8_t *num_labels,
+int mpls_str2label(const char *label_str, uint8_t *num_labels,
mpls_label_t *labels);
/*
* Label to string conversion, labels in string separated by '/'.
*/
-char *mpls_label2str(u_int8_t num_labels, mpls_label_t *labels, char *buf,
+char *mpls_label2str(uint8_t num_labels, mpls_label_t *labels, char *buf,
int len, int pretty);
/*
* Add/update global label block.
*/
-int zebra_mpls_label_block_add(struct zebra_vrf *zvrf, u_int32_t start_label,
- u_int32_t end_label);
+int zebra_mpls_label_block_add(struct zebra_vrf *zvrf, uint32_t start_label,
+ uint32_t end_label);
/*
* Delete global label block.
@@ -216,7 +216,7 @@ int zebra_mpls_lsp_uninstall(struct zebra_vrf *zvrf, struct route_node *rn,
* is acceptable.
*/
int zebra_mpls_fec_register(struct zebra_vrf *zvrf, struct prefix *p,
- u_int32_t label_index, struct zserv *client);
+ uint32_t label_index, struct zserv *client);
/*
* Deregistration from a client for the label binding for a FEC. The FEC
@@ -284,7 +284,7 @@ void zebra_mpls_print_fec(struct vty *vty, struct zebra_vrf *zvrf,
*/
int mpls_ftn_update(int add, struct zebra_vrf *zvrf, enum lsp_types_t type,
struct prefix *prefix, enum nexthop_types_t gtype,
- union g_addr *gate, ifindex_t ifindex, u_int8_t distance,
+ union g_addr *gate, ifindex_t ifindex, uint8_t distance,
mpls_label_t out_label);
/*
@@ -371,13 +371,13 @@ void zebra_mpls_lsp_schedule(struct zebra_vrf *zvrf);
* (VTY command handler).
*/
void zebra_mpls_print_lsp(struct vty *vty, struct zebra_vrf *zvrf,
- mpls_label_t label, u_char use_json);
+ mpls_label_t label, uint8_t use_json);
/*
* Display MPLS label forwarding table (VTY command handler).
*/
void zebra_mpls_print_lsp_table(struct vty *vty, struct zebra_vrf *zvrf,
- u_char use_json);
+ uint8_t use_json);
/*
* Display MPLS LSP configuration of all static LSPs (VTY command handler).
@@ -419,7 +419,7 @@ void zebra_mpls_vty_init(void);
/*
* Distance (priority) definition for LSP NHLFE.
*/
-static inline u_char lsp_distance(enum lsp_types_t type)
+static inline uint8_t lsp_distance(enum lsp_types_t type)
{
switch (type) {
case ZEBRA_LSP_STATIC:
diff --git a/zebra/zebra_mpls_openbsd.c b/zebra/zebra_mpls_openbsd.c
index 2c7fe577e..2d75353c7 100644
--- a/zebra/zebra_mpls_openbsd.c
+++ b/zebra/zebra_mpls_openbsd.c
@@ -35,7 +35,7 @@
extern struct zebra_privs_t zserv_privs;
struct {
- u_int32_t rtseq;
+ uint32_t rtseq;
int fd;
int ioctl_fd;
} kr_state;
diff --git a/zebra/zebra_mpls_vty.c b/zebra/zebra_mpls_vty.c
index 0d922830c..01bc66e5c 100644
--- a/zebra/zebra_mpls_vty.c
+++ b/zebra/zebra_mpls_vty.c
@@ -198,7 +198,7 @@ static int zebra_mpls_bind(struct vty *vty, int add_cmd, const char *prefix,
{
struct zebra_vrf *zvrf;
struct prefix p;
- u_int32_t label;
+ uint32_t label;
int ret;
zvrf = vrf_info_lookup(VRF_DEFAULT);
@@ -340,7 +340,7 @@ DEFUN (show_mpls_table,
JSON_STR)
{
struct zebra_vrf *zvrf;
- u_char uj = use_json(argc, argv);
+ uint8_t uj = use_json(argc, argv);
zvrf = vrf_info_lookup(VRF_DEFAULT);
zebra_mpls_print_lsp_table(vty, zvrf, uj);
@@ -356,9 +356,9 @@ DEFUN (show_mpls_table_lsp,
"LSP to display information about\n"
JSON_STR)
{
- u_int32_t label;
+ uint32_t label;
struct zebra_vrf *zvrf;
- u_char uj = use_json(argc, argv);
+ uint8_t uj = use_json(argc, argv);
zvrf = vrf_info_lookup(VRF_DEFAULT);
label = atoi(argv[3]->arg);
@@ -384,8 +384,8 @@ static int zebra_mpls_global_block(struct vty *vty, int add_cmd,
const char *end_label_str)
{
int ret;
- u_int32_t start_label;
- u_int32_t end_label;
+ uint32_t start_label;
+ uint32_t end_label;
struct zebra_vrf *zvrf;
zvrf = zebra_vrf_lookup_by_id(VRF_DEFAULT);
diff --git a/zebra/zebra_netns_id.c b/zebra/zebra_netns_id.c
index 57f311aac..317b02f60 100644
--- a/zebra/zebra_netns_id.c
+++ b/zebra/zebra_netns_id.c
@@ -143,7 +143,7 @@ static ns_id_t extract_nsid(struct nlmsghdr *nlh, char *buf)
attr += NETLINK_ALIGN(attr->nla_len)) {
curr_length += attr->nla_len;
if ((attr->nla_type & NLA_TYPE_MASK) == NETNSA_NSID) {
- u_int32_t *ptr = (u_int32_t *)(attr);
+ uint32_t *ptr = (uint32_t *)(attr);
ns_id = ptr[1];
break;
diff --git a/zebra/zebra_ns.c b/zebra/zebra_ns.c
index d841bdeec..66b1131e3 100644
--- a/zebra/zebra_ns.c
+++ b/zebra/zebra_ns.c
@@ -167,7 +167,7 @@ struct route_table *zebra_ns_find_table(struct zebra_ns *zns, uint32_t tableid,
return NULL;
}
-unsigned long zebra_ns_score_proto(u_char proto, u_short instance)
+unsigned long zebra_ns_score_proto(uint8_t proto, unsigned short instance)
{
struct zebra_ns *zns;
struct zebra_ns_table *znst;
diff --git a/zebra/zebra_ns.h b/zebra/zebra_ns.h
index 6655e5c01..66b73148d 100644
--- a/zebra/zebra_ns.h
+++ b/zebra/zebra_ns.h
@@ -91,6 +91,6 @@ extern struct route_table *zebra_ns_get_table(struct zebra_ns *zns,
uint32_t tableid, afi_t afi);
int zebra_ns_config_write(struct vty *vty, struct ns *ns);
-unsigned long zebra_ns_score_proto(u_char proto, u_short instance);
+unsigned long zebra_ns_score_proto(uint8_t proto, unsigned short instance);
void zebra_ns_sweep_route(void);
#endif
diff --git a/zebra/zebra_ptm.c b/zebra/zebra_ptm.c
index 67c7220b6..2fe6797ee 100644
--- a/zebra/zebra_ptm.c
+++ b/zebra/zebra_ptm.c
@@ -666,13 +666,13 @@ void zebra_ptm_bfd_dst_register(ZAPI_HANDLER_ARGS)
struct stream *s;
struct prefix src_p;
struct prefix dst_p;
- u_char multi_hop;
- u_char multi_hop_cnt;
- u_char detect_mul;
+ uint8_t multi_hop;
+ uint8_t multi_hop_cnt;
+ uint8_t detect_mul;
unsigned int min_rx_timer;
unsigned int min_tx_timer;
char if_name[INTERFACE_NAMSIZ];
- u_char len;
+ uint8_t len;
void *out_ctxt;
char buf[INET6_ADDRSTRLEN];
char tmp_buf[64];
@@ -827,9 +827,9 @@ void zebra_ptm_bfd_dst_deregister(ZAPI_HANDLER_ARGS)
struct stream *s;
struct prefix src_p;
struct prefix dst_p;
- u_char multi_hop;
+ uint8_t multi_hop;
char if_name[INTERFACE_NAMSIZ];
- u_char len;
+ uint8_t len;
char buf[INET6_ADDRSTRLEN];
char tmp_buf[64];
int data_len = ZEBRA_PTM_SEND_MAX_SOCKBUF;
diff --git a/zebra/zebra_ptm.h b/zebra/zebra_ptm.h
index 0b41410be..937c2584f 100644
--- a/zebra/zebra_ptm.h
+++ b/zebra/zebra_ptm.h
@@ -46,7 +46,7 @@ struct zebra_ptm_cb {
int ptm_enable;
int pid;
- u_int8_t client_flags[ZEBRA_ROUTE_MAX];
+ uint8_t client_flags[ZEBRA_ROUTE_MAX];
};
#define ZEBRA_PTM_STATUS_DOWN 0
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 69cd6697d..effe672a9 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -137,7 +137,7 @@ uint8_t route_distance(int type)
return distance;
}
-int is_zebra_valid_kernel_table(u_int32_t table_id)
+int is_zebra_valid_kernel_table(uint32_t table_id)
{
#ifdef linux
if ((table_id == RT_TABLE_UNSPEC) || (table_id == RT_TABLE_LOCAL)
@@ -148,7 +148,7 @@ int is_zebra_valid_kernel_table(u_int32_t table_id)
return 1;
}
-int is_zebra_main_routing_table(u_int32_t table_id)
+int is_zebra_main_routing_table(uint32_t table_id)
{
if ((table_id == RT_TABLE_MAIN)
|| (table_id == zebrad.rtm_table_default))
@@ -159,7 +159,7 @@ int is_zebra_main_routing_table(u_int32_t table_id)
int zebra_check_addr(struct prefix *p)
{
if (p->family == AF_INET) {
- u_int32_t addr;
+ uint32_t addr;
addr = p->u.prefix4.s_addr;
addr = ntohl(addr);
@@ -1736,7 +1736,7 @@ static void rib_process(struct route_node *rn)
* picked from it and processed by rib_process(). Don't process more,
* than one RN record; operate only in the specified sub-queue.
*/
-static unsigned int process_subq(struct list *subq, u_char qindex)
+static unsigned int process_subq(struct list *subq, uint8_t qindex)
{
struct listnode *lnode = listhead(subq);
struct route_node *rnode;
@@ -1839,31 +1839,31 @@ static wq_item_status meta_queue_process(struct work_queue *dummy, void *data)
/*
* Map from rib types to queue type (priority) in meta queue
*/
-static const u_char meta_queue_map[ZEBRA_ROUTE_MAX] = {
- [ZEBRA_ROUTE_SYSTEM] = 4,
- [ZEBRA_ROUTE_KERNEL] = 0,
- [ZEBRA_ROUTE_CONNECT] = 0,
- [ZEBRA_ROUTE_STATIC] = 1,
- [ZEBRA_ROUTE_RIP] = 2,
- [ZEBRA_ROUTE_RIPNG] = 2,
- [ZEBRA_ROUTE_OSPF] = 2,
- [ZEBRA_ROUTE_OSPF6] = 2,
- [ZEBRA_ROUTE_ISIS] = 2,
- [ZEBRA_ROUTE_BGP] = 3,
- [ZEBRA_ROUTE_PIM] = 4, // Shouldn't happen but for safety
- [ZEBRA_ROUTE_EIGRP] = 2,
- [ZEBRA_ROUTE_NHRP] = 2,
- [ZEBRA_ROUTE_HSLS] = 4,
- [ZEBRA_ROUTE_OLSR] = 4,
- [ZEBRA_ROUTE_TABLE] = 1,
- [ZEBRA_ROUTE_LDP] = 4,
- [ZEBRA_ROUTE_VNC] = 3,
- [ZEBRA_ROUTE_VNC_DIRECT] = 3,
- [ZEBRA_ROUTE_VNC_DIRECT_RH] = 3,
- [ZEBRA_ROUTE_BGP_DIRECT] = 3,
- [ZEBRA_ROUTE_BGP_DIRECT_EXT] = 3,
- [ZEBRA_ROUTE_BABEL] = 2,
- [ZEBRA_ROUTE_ALL] = 4, // Shouldn't happen but for safety
+static const uint8_t meta_queue_map[ZEBRA_ROUTE_MAX] = {
+ [ZEBRA_ROUTE_SYSTEM] = 4,
+ [ZEBRA_ROUTE_KERNEL] = 0,
+ [ZEBRA_ROUTE_CONNECT] = 0,
+ [ZEBRA_ROUTE_STATIC] = 1,
+ [ZEBRA_ROUTE_RIP] = 2,
+ [ZEBRA_ROUTE_RIPNG] = 2,
+ [ZEBRA_ROUTE_OSPF] = 2,
+ [ZEBRA_ROUTE_OSPF6] = 2,
+ [ZEBRA_ROUTE_ISIS] = 2,
+ [ZEBRA_ROUTE_BGP] = 3,
+ [ZEBRA_ROUTE_PIM] = 4, // Shouldn't happen but for safety
+ [ZEBRA_ROUTE_EIGRP] = 2,
+ [ZEBRA_ROUTE_NHRP] = 2,
+ [ZEBRA_ROUTE_HSLS] = 4,
+ [ZEBRA_ROUTE_OLSR] = 4,
+ [ZEBRA_ROUTE_TABLE] = 1,
+ [ZEBRA_ROUTE_LDP] = 4,
+ [ZEBRA_ROUTE_VNC] = 3,
+ [ZEBRA_ROUTE_VNC_DIRECT] = 3,
+ [ZEBRA_ROUTE_VNC_DIRECT_RH] = 3,
+ [ZEBRA_ROUTE_BGP_DIRECT] = 3,
+ [ZEBRA_ROUTE_BGP_DIRECT_EXT] = 3,
+ [ZEBRA_ROUTE_BABEL] = 2,
+ [ZEBRA_ROUTE_ALL] = 4, // Shouldn't happen but for safety
};
/* Look into the RN and queue it into one or more priority queues,
@@ -1874,7 +1874,7 @@ static void rib_meta_queue_add(struct meta_queue *mq, struct route_node *rn)
struct route_entry *re;
RNODE_FOREACH_RE (rn, re) {
- u_char qindex = meta_queue_map[re->type];
+ uint8_t qindex = meta_queue_map[re->type];
struct zebra_vrf *zvrf;
/* Invariant: at this point we always have rn->info set. */
@@ -2392,9 +2392,9 @@ int rib_add_multipath(afi_t afi, safi_t safi, struct prefix *p,
}
void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
- u_short instance, int flags, struct prefix *p,
+ unsigned short instance, int flags, struct prefix *p,
struct prefix_ipv6 *src_p, const struct nexthop *nh,
- u_int32_t table_id, u_int32_t metric, bool fromkernel,
+ uint32_t table_id, uint32_t metric, bool fromkernel,
struct ethaddr *rmac)
{
struct route_table *table;
@@ -2582,10 +2582,11 @@ void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
}
-int rib_add(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type, u_short instance,
- int flags, struct prefix *p, struct prefix_ipv6 *src_p,
- const struct nexthop *nh, u_int32_t table_id, u_int32_t metric,
- u_int32_t mtu, uint8_t distance, route_tag_t tag)
+int rib_add(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
+ unsigned short instance, int flags, struct prefix *p,
+ struct prefix_ipv6 *src_p, const struct nexthop *nh,
+ uint32_t table_id, uint32_t metric, uint32_t mtu, uint8_t distance,
+ route_tag_t tag)
{
struct route_entry *re;
struct nexthop *nexthop;
@@ -2769,7 +2770,7 @@ void rib_sweep_route(void)
}
/* Remove specific by protocol routes from 'table'. */
-unsigned long rib_score_proto_table(u_char proto, u_short instance,
+unsigned long rib_score_proto_table(uint8_t proto, unsigned short instance,
struct route_table *table)
{
struct route_node *rn;
@@ -2792,7 +2793,7 @@ unsigned long rib_score_proto_table(u_char proto, u_short instance,
}
/* Remove specific by protocol routes. */
-unsigned long rib_score_proto(u_char proto, u_short instance)
+unsigned long rib_score_proto(uint8_t proto, unsigned short instance)
{
struct vrf *vrf;
struct zebra_vrf *zvrf;
diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c
index 48f9f4f36..65df4e15a 100644
--- a/zebra/zebra_rnh.c
+++ b/zebra/zebra_rnh.c
@@ -985,7 +985,7 @@ static int send_client(struct rnh *rnh, struct zserv *client, rnh_type_t type,
struct stream *s;
struct route_entry *re;
unsigned long nump;
- u_char num;
+ uint8_t num;
struct nexthop *nh;
struct route_node *rn;
int cmd = (type == RNH_IMPORT_CHECK_TYPE) ? ZEBRA_IMPORT_CHECK_UPDATE
diff --git a/zebra/zebra_rnh.h b/zebra/zebra_rnh.h
index 7af1dbeaf..f783696c0 100644
--- a/zebra/zebra_rnh.h
+++ b/zebra/zebra_rnh.h
@@ -27,7 +27,7 @@
/* Nexthop structure. */
struct rnh {
- u_char flags;
+ uint8_t flags;
#define ZEBRA_NHT_CONNECTED 0x1
#define ZEBRA_NHT_DELETED 0x2
diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c
index 64c38635f..013e841a5 100644
--- a/zebra/zebra_routemap.c
+++ b/zebra/zebra_routemap.c
@@ -38,7 +38,7 @@
#include "zebra/zebra_rnh.h"
#include "zebra/zebra_routemap.h"
-static u_int32_t zebra_rmap_update_timer = ZEBRA_RMAP_DEFAULT_UPDATE_TIMER;
+static uint32_t zebra_rmap_update_timer = ZEBRA_RMAP_DEFAULT_UPDATE_TIMER;
static struct thread *zebra_t_rmap_update = NULL;
char *proto_rm[AFI_MAX][ZEBRA_ROUTE_MAX + 1]; /* "any" == ZEBRA_ROUTE_MAX */
/* NH Tracking route map */
@@ -48,12 +48,12 @@ char *zebra_import_table_routemap[AFI_MAX][ZEBRA_KERNEL_TABLE_MAX];
struct nh_rmap_obj {
struct nexthop *nexthop;
vrf_id_t vrf_id;
- u_int32_t source_protocol;
+ uint32_t source_protocol;
int metric;
route_tag_t tag;
};
-static void zebra_route_map_set_delay_timer(u_int32_t value);
+static void zebra_route_map_set_delay_timer(uint32_t value);
/* Add zebra route map rule */
@@ -424,7 +424,7 @@ DEFUN (zebra_route_map_timer,
"0 means event-driven updates are disabled\n")
{
int idx_number = 3;
- u_int32_t rmap_delay_timer;
+ uint32_t rmap_delay_timer;
rmap_delay_timer = strtoul(argv[idx_number]->arg, NULL, 10);
zebra_route_map_set_delay_timer(rmap_delay_timer);
@@ -1041,7 +1041,7 @@ static route_map_result_t
route_match_address_prefix_len(void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
- u_int32_t *prefixlen = (u_int32_t *)rule;
+ uint32_t *prefixlen = (uint32_t *)rule;
if (type == RMAP_ZEBRA) {
return ((prefix->prefixlen == *prefixlen) ? RMAP_MATCH
@@ -1052,7 +1052,7 @@ route_match_address_prefix_len(void *rule, struct prefix *prefix,
static void *route_match_address_prefix_len_compile(const char *arg)
{
- u_int32_t *prefix_len;
+ uint32_t *prefix_len;
char *endptr = NULL;
unsigned long tmpval;
@@ -1065,7 +1065,7 @@ static void *route_match_address_prefix_len_compile(const char *arg)
if (*endptr != '\0' || errno || tmpval > UINT32_MAX)
return NULL;
- prefix_len = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(u_int32_t));
+ prefix_len = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(uint32_t));
if (!prefix_len)
return prefix_len;
@@ -1095,7 +1095,7 @@ static route_map_result_t
route_match_ip_nexthop_prefix_len(void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
- u_int32_t *prefixlen = (u_int32_t *)rule;
+ uint32_t *prefixlen = (uint32_t *)rule;
struct nh_rmap_obj *nh_data;
struct prefix_ipv4 p;
@@ -1136,7 +1136,7 @@ static route_map_result_t route_match_source_protocol(void *rule,
route_map_object_t type,
void *object)
{
- u_int32_t *rib_type = (u_int32_t *)rule;
+ uint32_t *rib_type = (uint32_t *)rule;
struct nh_rmap_obj *nh_data;
if (type == RMAP_ZEBRA) {
@@ -1152,11 +1152,11 @@ static route_map_result_t route_match_source_protocol(void *rule,
static void *route_match_source_protocol_compile(const char *arg)
{
- u_int32_t *rib_type;
+ uint32_t *rib_type;
int i;
i = proto_name2num(arg);
- rib_type = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(u_int32_t));
+ rib_type = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(uint32_t));
*rib_type = i;
@@ -1232,7 +1232,7 @@ static int zebra_route_map_update_timer(struct thread *thread)
return (0);
}
-static void zebra_route_map_set_delay_timer(u_int32_t value)
+static void zebra_route_map_set_delay_timer(uint32_t value)
{
zebra_rmap_update_timer = value;
if (!value && zebra_t_rmap_update) {
diff --git a/zebra/zebra_snmp.c b/zebra/zebra_snmp.c
index 3ab208d30..74eab765c 100644
--- a/zebra/zebra_snmp.c
+++ b/zebra/zebra_snmp.c
@@ -89,14 +89,14 @@
static oid ipfw_oid[] = {IPFWMIB};
/* Hook functions. */
-static u_char *ipFwNumber(struct variable *, oid[], size_t *, int, size_t *,
+static uint8_t *ipFwNumber(struct variable *, oid[], size_t *, int, size_t *,
+ WriteMethod **);
+static uint8_t *ipFwTable(struct variable *, oid[], size_t *, int, size_t *,
WriteMethod **);
-static u_char *ipFwTable(struct variable *, oid[], size_t *, int, size_t *,
- WriteMethod **);
-static u_char *ipCidrNumber(struct variable *, oid[], size_t *, int, size_t *,
+static uint8_t *ipCidrNumber(struct variable *, oid[], size_t *, int, size_t *,
+ WriteMethod **);
+static uint8_t *ipCidrTable(struct variable *, oid[], size_t *, int, size_t *,
WriteMethod **);
-static u_char *ipCidrTable(struct variable *, oid[], size_t *, int, size_t *,
- WriteMethod **);
static struct variable zebra_variables[] = {
{0, GAUGE32, RONLY, ipFwNumber, 1, {1}},
@@ -134,9 +134,9 @@ static struct variable zebra_variables[] = {
{IPCIDRROUTESTATUS, ROWSTATUS, RONLY, ipCidrTable, 3, {4, 1, 16}}};
-static u_char *ipFwNumber(struct variable *v, oid objid[], size_t *objid_len,
- int exact, size_t *val_len,
- WriteMethod **write_method)
+static uint8_t *ipFwNumber(struct variable *v, oid objid[], size_t *objid_len,
+ int exact, size_t *val_len,
+ WriteMethod **write_method)
{
static int result;
struct route_table *table;
@@ -159,12 +159,12 @@ static u_char *ipFwNumber(struct variable *v, oid objid[], size_t *objid_len,
result++;
}
- return (u_char *)&result;
+ return (uint8_t *)&result;
}
-static u_char *ipCidrNumber(struct variable *v, oid objid[], size_t *objid_len,
- int exact, size_t *val_len,
- WriteMethod **write_method)
+static uint8_t *ipCidrNumber(struct variable *v, oid objid[], size_t *objid_len,
+ int exact, size_t *val_len,
+ WriteMethod **write_method)
{
static int result;
struct route_table *table;
@@ -187,10 +187,10 @@ static u_char *ipCidrNumber(struct variable *v, oid objid[], size_t *objid_len,
result++;
}
- return (u_char *)&result;
+ return (uint8_t *)&result;
}
-static int in_addr_cmp(u_char *p1, u_char *p2)
+static int in_addr_cmp(uint8_t *p1, uint8_t *p2)
{
int i;
@@ -205,7 +205,7 @@ static int in_addr_cmp(u_char *p1, u_char *p2)
return 0;
}
-static int in_addr_add(u_char *p, int num)
+static int in_addr_add(uint8_t *p, int num)
{
int i, ip0;
@@ -285,8 +285,8 @@ static void check_replace(struct route_node *np2, struct route_entry *re2,
return;
}
- if (in_addr_cmp((u_char *)&(*re)->ng.nexthop->gate.ipv4,
- (u_char *)&re2->ng.nexthop->gate.ipv4)
+ if (in_addr_cmp((uint8_t *)&(*re)->ng.nexthop->gate.ipv4,
+ (uint8_t *)&re2->ng.nexthop->gate.ipv4)
<= 0)
return;
@@ -307,16 +307,16 @@ static void get_fwtable_route_node(struct variable *v, oid objid[],
int proto;
int policy;
struct in_addr nexthop;
- u_char *pnt;
+ uint8_t *pnt;
int i;
/* Init index variables */
- pnt = (u_char *)&dest;
+ pnt = (uint8_t *)&dest;
for (i = 0; i < 4; i++)
*pnt++ = 0;
- pnt = (u_char *)&nexthop;
+ pnt = (uint8_t *)&nexthop;
for (i = 0; i < 4; i++)
*pnt++ = 0;
@@ -358,7 +358,7 @@ static void get_fwtable_route_node(struct variable *v, oid objid[],
/* Apply GETNEXT on not exact search */
if (!exact && (*objid_len >= (unsigned)v->namelen + 10)) {
- if (!in_addr_add((u_char *)&nexthop, 1))
+ if (!in_addr_add((uint8_t *)&nexthop, 1))
return;
}
@@ -368,12 +368,13 @@ static void get_fwtable_route_node(struct variable *v, oid objid[],
if (policy) /* Not supported (yet?) */
return;
for (*np = route_top(table); *np; *np = route_next(*np)) {
- if (!in_addr_cmp(&(*np)->p.u.prefix, (u_char *)&dest)) {
+ if (!in_addr_cmp(&(*np)->p.u.prefix,
+ (uint8_t *)&dest)) {
RNODE_FOREACH_RE (*np, *re) {
- if (!in_addr_cmp(
- (u_char *)&(*re)
- ->ng.nexthop->gate.ipv4,
- (u_char *)&nexthop))
+ if (!in_addr_cmp((uint8_t *)&(*re)
+ ->ng.nexthop
+ ->gate.ipv4,
+ (uint8_t *)&nexthop))
if (proto
== proto_trans((*re)->type))
return;
@@ -388,12 +389,12 @@ static void get_fwtable_route_node(struct variable *v, oid objid[],
for (np2 = route_top(table); np2; np2 = route_next(np2)) {
/* Check destination first */
- if (in_addr_cmp(&np2->p.u.prefix, (u_char *)&dest) > 0)
+ if (in_addr_cmp(&np2->p.u.prefix, (uint8_t *)&dest) > 0)
RNODE_FOREACH_RE (np2, re2) {
check_replace(np2, re2, np, re);
}
- if (in_addr_cmp(&np2->p.u.prefix, (u_char *)&dest)
+ if (in_addr_cmp(&np2->p.u.prefix, (uint8_t *)&dest)
== 0) { /* have to look at each re individually */
RNODE_FOREACH_RE (np2, re2) {
int proto2, policy2;
@@ -405,9 +406,9 @@ static void get_fwtable_route_node(struct variable *v, oid objid[],
|| ((policy == policy2) && (proto < proto2))
|| ((policy == policy2) && (proto == proto2)
&& (in_addr_cmp(
- (u_char *)&re2->ng.nexthop
- ->gate.ipv4,
- (u_char *)&nexthop)
+ (uint8_t *)&re2->ng.nexthop
+ ->gate.ipv4,
+ (uint8_t *)&nexthop)
>= 0)))
check_replace(np2, re2, np, re);
}
@@ -421,7 +422,7 @@ static void get_fwtable_route_node(struct variable *v, oid objid[],
proto = proto_trans((*re)->type);
*objid_len = v->namelen + 10;
- pnt = (u_char *)&(*np)->p.u.prefix;
+ pnt = (uint8_t *)&(*np)->p.u.prefix;
for (i = 0; i < 4; i++)
objid[v->namelen + i] = *pnt++;
@@ -433,7 +434,7 @@ static void get_fwtable_route_node(struct variable *v, oid objid[],
nexthop = (*re)->ng.nexthop;
if (nexthop) {
- pnt = (u_char *)&nexthop->gate.ipv4;
+ pnt = (uint8_t *)&nexthop->gate.ipv4;
for (i = 0; i < 4; i++)
objid[i + v->namelen + 6] = *pnt++;
}
@@ -442,8 +443,9 @@ static void get_fwtable_route_node(struct variable *v, oid objid[],
return;
}
-static u_char *ipFwTable(struct variable *v, oid objid[], size_t *objid_len,
- int exact, size_t *val_len, WriteMethod **write_method)
+static uint8_t *ipFwTable(struct variable *v, oid objid[], size_t *objid_len,
+ int exact, size_t *val_len,
+ WriteMethod **write_method)
{
struct route_node *np;
struct route_entry *re;
@@ -472,20 +474,20 @@ static u_char *ipFwTable(struct variable *v, oid objid[], size_t *objid_len,
case IPFORWARDMASK:
masklen2ip(np->p.prefixlen, &netmask);
*val_len = 4;
- return (u_char *)&netmask;
+ return (uint8_t *)&netmask;
break;
case IPFORWARDPOLICY:
result = 0;
*val_len = sizeof(int);
- return (u_char *)&result;
+ return (uint8_t *)&result;
break;
case IPFORWARDNEXTHOP:
*val_len = 4;
- return (u_char *)&nexthop->gate.ipv4;
+ return (uint8_t *)&nexthop->gate.ipv4;
break;
case IPFORWARDIFINDEX:
*val_len = sizeof(int);
- return (u_char *)&nexthop->ifindex;
+ return (uint8_t *)&nexthop->ifindex;
break;
case IPFORWARDTYPE:
if (nexthop->type == NEXTHOP_TYPE_IFINDEX)
@@ -493,53 +495,53 @@ static u_char *ipFwTable(struct variable *v, oid objid[], size_t *objid_len,
else
result = 4;
*val_len = sizeof(int);
- return (u_char *)&result;
+ return (uint8_t *)&result;
break;
case IPFORWARDPROTO:
result = proto_trans(re->type);
*val_len = sizeof(int);
- return (u_char *)&result;
+ return (uint8_t *)&result;
break;
case IPFORWARDAGE:
result = 0;
*val_len = sizeof(int);
- return (u_char *)&result;
+ return (uint8_t *)&result;
break;
case IPFORWARDINFO:
resarr[0] = 0;
resarr[1] = 0;
*val_len = 2 * sizeof(int);
- return (u_char *)resarr;
+ return (uint8_t *)resarr;
break;
case IPFORWARDNEXTHOPAS:
result = -1;
*val_len = sizeof(int);
- return (u_char *)&result;
+ return (uint8_t *)&result;
break;
case IPFORWARDMETRIC1:
result = 0;
*val_len = sizeof(int);
- return (u_char *)&result;
+ return (uint8_t *)&result;
break;
case IPFORWARDMETRIC2:
result = 0;
*val_len = sizeof(int);
- return (u_char *)&result;
+ return (uint8_t *)&result;
break;
case IPFORWARDMETRIC3:
result = 0;
*val_len = sizeof(int);
- return (u_char *)&result;
+ return (uint8_t *)&result;
break;
case IPFORWARDMETRIC4:
result = 0;
*val_len = sizeof(int);
- return (u_char *)&result;
+ return (uint8_t *)&result;
break;
case IPFORWARDMETRIC5:
result = 0;
*val_len = sizeof(int);
- return (u_char *)&result;
+ return (uint8_t *)&result;
break;
default:
return NULL;
@@ -548,9 +550,9 @@ static u_char *ipFwTable(struct variable *v, oid objid[], size_t *objid_len,
return NULL;
}
-static u_char *ipCidrTable(struct variable *v, oid objid[], size_t *objid_len,
- int exact, size_t *val_len,
- WriteMethod **write_method)
+static uint8_t *ipCidrTable(struct variable *v, oid objid[], size_t *objid_len,
+ int exact, size_t *val_len,
+ WriteMethod **write_method)
{
if (smux_header_table(v, objid, objid_len, exact, val_len, write_method)
== MATCH_FAILED)
diff --git a/zebra/zebra_static.c b/zebra/zebra_static.c
index f3921790a..82b3ee974 100644
--- a/zebra/zebra_static.c
+++ b/zebra/zebra_static.c
@@ -376,10 +376,10 @@ void static_uninstall_route(afi_t afi, safi_t safi, struct prefix *p,
route_unlock_node(rn);
}
-int static_add_route(afi_t afi, safi_t safi, u_char type, struct prefix *p,
+int static_add_route(afi_t afi, safi_t safi, uint8_t type, struct prefix *p,
struct prefix_ipv6 *src_p, union g_addr *gate,
const char *ifname, enum static_blackhole_type bh_type,
- route_tag_t tag, u_char distance, struct zebra_vrf *zvrf,
+ route_tag_t tag, uint8_t distance, struct zebra_vrf *zvrf,
struct zebra_vrf *nh_zvrf,
struct static_nh_label *snh_label)
{
@@ -507,9 +507,9 @@ int static_add_route(afi_t afi, safi_t safi, u_char type, struct prefix *p,
return 1;
}
-int static_delete_route(afi_t afi, safi_t safi, u_char type, struct prefix *p,
+int static_delete_route(afi_t afi, safi_t safi, uint8_t type, struct prefix *p,
struct prefix_ipv6 *src_p, union g_addr *gate,
- const char *ifname, route_tag_t tag, u_char distance,
+ const char *ifname, route_tag_t tag, uint8_t distance,
struct zebra_vrf *zvrf,
struct static_nh_label *snh_label)
{
diff --git a/zebra/zebra_static.h b/zebra/zebra_static.h
index 234e3e403..a12e465e7 100644
--- a/zebra/zebra_static.h
+++ b/zebra/zebra_static.h
@@ -26,8 +26,8 @@
/* Static route label information */
struct static_nh_label {
- u_int8_t num_labels;
- u_int8_t reserved[3];
+ uint8_t num_labels;
+ uint8_t reserved[3];
mpls_label_t label[MPLS_MAX_LABELS];
};
@@ -57,7 +57,7 @@ struct static_route {
vrf_id_t nh_vrf_id;
/* Administrative distance. */
- u_char distance;
+ uint8_t distance;
/* Tag */
route_tag_t tag;
@@ -85,18 +85,18 @@ extern void static_uninstall_route(afi_t afi, safi_t safi, struct prefix *p,
struct prefix_ipv6 *src_p,
struct static_route *si);
-extern int static_add_route(afi_t, safi_t safi, u_char type, struct prefix *p,
+extern int static_add_route(afi_t, safi_t safi, uint8_t type, struct prefix *p,
struct prefix_ipv6 *src_p, union g_addr *gate,
const char *ifname,
enum static_blackhole_type bh_type, route_tag_t tag,
- u_char distance, struct zebra_vrf *zvrf,
+ uint8_t distance, struct zebra_vrf *zvrf,
struct zebra_vrf *nh_zvrf,
struct static_nh_label *snh_label);
-extern int static_delete_route(afi_t, safi_t safi, u_char type,
+extern int static_delete_route(afi_t, safi_t safi, uint8_t type,
struct prefix *p, struct prefix_ipv6 *src_p,
union g_addr *gate, const char *ifname,
- route_tag_t tag, u_char distance,
+ route_tag_t tag, uint8_t distance,
struct zebra_vrf *zvrf,
struct static_nh_label *snh_label);
diff --git a/zebra/zebra_vrf.c b/zebra/zebra_vrf.c
index f7877f71b..dfb02f15a 100644
--- a/zebra/zebra_vrf.c
+++ b/zebra/zebra_vrf.c
@@ -372,7 +372,7 @@ int zebra_vrf_has_config(struct zebra_vrf *zvrf)
*/
struct route_table *zebra_vrf_table_with_table_id(afi_t afi, safi_t safi,
vrf_id_t vrf_id,
- u_int32_t table_id)
+ uint32_t table_id)
{
struct route_table *table = NULL;
@@ -526,7 +526,7 @@ struct route_table *zebra_vrf_static_table(afi_t afi, safi_t safi,
return zvrf->stable[afi][safi];
}
-struct route_table *zebra_vrf_other_route_table(afi_t afi, u_int32_t table_id,
+struct route_table *zebra_vrf_other_route_table(afi_t afi, uint32_t table_id,
vrf_id_t vrf_id)
{
struct zebra_vrf *zvrf;
diff --git a/zebra/zebra_vrf.h b/zebra/zebra_vrf.h
index 4c12d7dee..5c5d2f522 100644
--- a/zebra/zebra_vrf.h
+++ b/zebra/zebra_vrf.h
@@ -28,8 +28,8 @@
/* MPLS (Segment Routing) global block */
typedef struct mpls_srgb_t_ {
- u_int32_t start_label;
- u_int32_t end_label;
+ uint32_t start_label;
+ uint32_t end_label;
} mpls_srgb_t;
/* Routing table instance. */
@@ -41,14 +41,14 @@ struct zebra_vrf {
char *desc;
/* FIB identifier. */
- u_char fib_id;
+ uint8_t fib_id;
/* Flags. */
- u_int16_t flags;
+ uint16_t flags;
#define ZEBRA_VRF_RIB_SCHEDULED (1 << 0)
#define ZEBRA_VRF_RETAIN (2 << 0)
- u_int32_t table_id;
+ uint32_t table_id;
/* Routing table. */
struct route_table *table[AFI_MAX][SAFI_MAX];
@@ -96,7 +96,7 @@ struct zebra_vrf {
struct zebra_static_pw_head static_pseudowires;
/* MPLS processing flags */
- u_int16_t mpls_flags;
+ uint16_t mpls_flags;
#define MPLS_FLAG_SCHEDULE_LSPS (1 << 0)
/*
@@ -152,7 +152,7 @@ static inline bool zvrf_is_active(struct zebra_vrf *zvrf)
struct route_table *zebra_vrf_table_with_table_id(afi_t afi, safi_t safi,
vrf_id_t vrf_id,
- u_int32_t table_id);
+ uint32_t table_id);
extern void zebra_vrf_update_all(struct zserv *client);
extern struct zebra_vrf *zebra_vrf_lookup_by_id(vrf_id_t vrf_id);
@@ -162,7 +162,7 @@ extern struct route_table *zebra_vrf_table(afi_t, safi_t, vrf_id_t);
extern struct route_table *zebra_vrf_static_table(afi_t, safi_t,
struct zebra_vrf *zvrf);
extern struct route_table *
-zebra_vrf_other_route_table(afi_t afi, u_int32_t table_id, vrf_id_t vrf_id);
+zebra_vrf_other_route_table(afi_t afi, uint32_t table_id, vrf_id_t vrf_id);
extern int zebra_vrf_has_config(struct zebra_vrf *zvrf);
extern void zebra_vrf_init(void);
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 328517610..ea35c782f 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -55,11 +55,11 @@
extern int allow_delete;
static int do_show_ip_route(struct vty *vty, const char *vrf_name, afi_t afi,
- safi_t safi, bool use_fib, u_char use_json,
+ safi_t safi, bool use_fib, uint8_t use_json,
route_tag_t tag,
const struct prefix *longer_prefix_p,
bool supernets_only, int type,
- u_short ospf_instance_id);
+ unsigned short ospf_instance_id);
static void vty_show_ip_route_detail(struct vty *vty, struct route_node *rn,
int mcast);
static void vty_show_ip_route_summary(struct vty *vty,
@@ -273,7 +273,7 @@ static int zebra_static_route_leak(
const char *distance_str, const char *label_str)
{
int ret;
- u_char distance;
+ uint8_t distance;
struct prefix p, src;
struct prefix_ipv6 *src_p = NULL;
union g_addr gate;
@@ -281,7 +281,7 @@ static int zebra_static_route_leak(
struct in_addr mask;
enum static_blackhole_type bh_type = 0;
route_tag_t tag = 0;
- u_char type;
+ uint8_t type;
struct static_nh_label snh_label;
ret = str2prefix(dest_str, &p);
@@ -1528,7 +1528,8 @@ static void do_show_route_helper(struct vty *vty, struct zebra_vrf *zvrf,
bool use_fib, route_tag_t tag,
const struct prefix *longer_prefix_p,
bool supernets_only, int type,
- u_short ospf_instance_id, u_char use_json)
+ unsigned short ospf_instance_id,
+ uint8_t use_json)
{
struct route_node *rn;
struct route_entry *re;
@@ -1617,11 +1618,11 @@ static void do_show_route_helper(struct vty *vty, struct zebra_vrf *zvrf,
}
static int do_show_ip_route(struct vty *vty, const char *vrf_name, afi_t afi,
- safi_t safi, bool use_fib, u_char use_json,
+ safi_t safi, bool use_fib, uint8_t use_json,
route_tag_t tag,
const struct prefix *longer_prefix_p,
bool supernets_only, int type,
- u_short ospf_instance_id)
+ unsigned short ospf_instance_id)
{
struct route_table *table;
struct zebra_vrf *zvrf = NULL;
@@ -2060,10 +2061,10 @@ static void vty_show_ip_route_summary(struct vty *vty,
struct route_entry *re;
#define ZEBRA_ROUTE_IBGP ZEBRA_ROUTE_MAX
#define ZEBRA_ROUTE_TOTAL (ZEBRA_ROUTE_IBGP + 1)
- u_int32_t rib_cnt[ZEBRA_ROUTE_TOTAL + 1];
- u_int32_t fib_cnt[ZEBRA_ROUTE_TOTAL + 1];
- u_int32_t i;
- u_int32_t is_ibgp;
+ uint32_t rib_cnt[ZEBRA_ROUTE_TOTAL + 1];
+ uint32_t fib_cnt[ZEBRA_ROUTE_TOTAL + 1];
+ uint32_t i;
+ uint32_t is_ibgp;
memset(&rib_cnt, 0, sizeof(rib_cnt));
memset(&fib_cnt, 0, sizeof(fib_cnt));
@@ -2129,9 +2130,9 @@ static void vty_show_ip_route_summary_prefix(struct vty *vty,
struct nexthop *nexthop;
#define ZEBRA_ROUTE_IBGP ZEBRA_ROUTE_MAX
#define ZEBRA_ROUTE_TOTAL (ZEBRA_ROUTE_IBGP + 1)
- u_int32_t rib_cnt[ZEBRA_ROUTE_TOTAL + 1];
- u_int32_t fib_cnt[ZEBRA_ROUTE_TOTAL + 1];
- u_int32_t i;
+ uint32_t rib_cnt[ZEBRA_ROUTE_TOTAL + 1];
+ uint32_t fib_cnt[ZEBRA_ROUTE_TOTAL + 1];
+ uint32_t i;
int cnt;
memset(&rib_cnt, 0, sizeof(rib_cnt));
@@ -2824,7 +2825,7 @@ DEFUN (show_vrf_vni,
struct zebra_vrf *zvrf;
json_object *json = NULL;
json_object *json_vrfs = NULL;
- u_char uj = use_json(argc, argv);
+ uint8_t uj = use_json(argc, argv);
if (uj) {
json = json_object_new_object();
@@ -2860,7 +2861,7 @@ DEFUN (show_evpn_global,
"EVPN\n"
JSON_STR)
{
- u_char uj = use_json(argc, argv);
+ uint8_t uj = use_json(argc, argv);
zebra_vxlan_print_evpn(vty, uj);
return CMD_SUCCESS;
@@ -2875,7 +2876,7 @@ DEFUN (show_evpn_vni,
JSON_STR)
{
struct zebra_vrf *zvrf;
- u_char uj = use_json(argc, argv);
+ uint8_t uj = use_json(argc, argv);
zvrf = vrf_info_lookup(VRF_DEFAULT);
zebra_vxlan_print_vnis(vty, zvrf, uj);
@@ -2893,7 +2894,7 @@ DEFUN (show_evpn_vni_vni,
{
struct zebra_vrf *zvrf;
vni_t vni;
- u_char uj = use_json(argc, argv);
+ uint8_t uj = use_json(argc, argv);
vni = strtoul(argv[3]->arg, NULL, 10);
zvrf = vrf_info_lookup(VRF_DEFAULT);
@@ -2915,7 +2916,7 @@ DEFUN (show_evpn_rmac_vni_mac,
{
vni_t l3vni = 0;
struct ethaddr mac;
- u_char uj = use_json(argc, argv);
+ uint8_t uj = use_json(argc, argv);
l3vni = strtoul(argv[4]->arg, NULL, 10);
if (!prefix_str2mac(argv[6]->arg, &mac)) {
@@ -2937,7 +2938,7 @@ DEFUN (show_evpn_rmac_vni,
JSON_STR)
{
vni_t l3vni = 0;
- u_char uj = use_json(argc, argv);
+ uint8_t uj = use_json(argc, argv);
l3vni = strtoul(argv[4]->arg, NULL, 10);
zebra_vxlan_print_rmacs_l3vni(vty, l3vni, uj);
@@ -2955,7 +2956,7 @@ DEFUN (show_evpn_rmac_vni_all,
"All VNIs\n"
JSON_STR)
{
- u_char uj = use_json(argc, argv);
+ uint8_t uj = use_json(argc, argv);
zebra_vxlan_print_rmacs_all_l3vni(vty, uj);
@@ -2976,7 +2977,7 @@ DEFUN (show_evpn_nh_vni_ip,
{
vni_t l3vni;
struct ipaddr ip;
- u_char uj = use_json(argc, argv);
+ uint8_t uj = use_json(argc, argv);
l3vni = strtoul(argv[4]->arg, NULL, 10);
if (str2ipaddr(argv[6]->arg, &ip) != 0) {
@@ -3000,7 +3001,7 @@ DEFUN (show_evpn_nh_vni,
JSON_STR)
{
vni_t l3vni;
- u_char uj = use_json(argc, argv);
+ uint8_t uj = use_json(argc, argv);
l3vni = strtoul(argv[4]->arg, NULL, 10);
zebra_vxlan_print_nh_l3vni(vty, l3vni, uj);
@@ -3018,7 +3019,7 @@ DEFUN (show_evpn_nh_vni_all,
"All VNIs\n"
JSON_STR)
{
- u_char uj = use_json(argc, argv);
+ uint8_t uj = use_json(argc, argv);
zebra_vxlan_print_nh_all_l3vni(vty, uj);
@@ -3037,7 +3038,7 @@ DEFUN (show_evpn_mac_vni,
{
struct zebra_vrf *zvrf;
vni_t vni;
- u_char uj = use_json(argc, argv);
+ uint8_t uj = use_json(argc, argv);
vni = strtoul(argv[4]->arg, NULL, 10);
zvrf = vrf_info_lookup(VRF_DEFAULT);
@@ -3056,7 +3057,7 @@ DEFUN (show_evpn_mac_vni_all,
JSON_STR)
{
struct zebra_vrf *zvrf;
- u_char uj = use_json(argc, argv);
+ uint8_t uj = use_json(argc, argv);
zvrf = vrf_info_lookup(VRF_DEFAULT);
zebra_vxlan_print_macs_all_vni(vty, zvrf, uj);
@@ -3077,7 +3078,7 @@ DEFUN (show_evpn_mac_vni_all_vtep,
{
struct zebra_vrf *zvrf;
struct in_addr vtep_ip;
- u_char uj = use_json(argc, argv);
+ uint8_t uj = use_json(argc, argv);
if (!inet_aton(argv[6]->arg, &vtep_ip)) {
if (!uj)
@@ -3131,7 +3132,7 @@ DEFUN (show_evpn_mac_vni_vtep,
struct zebra_vrf *zvrf;
vni_t vni;
struct in_addr vtep_ip;
- u_char uj = use_json(argc, argv);
+ uint8_t uj = use_json(argc, argv);
vni = strtoul(argv[4]->arg, NULL, 10);
if (!inet_aton(argv[6]->arg, &vtep_ip)) {
@@ -3157,7 +3158,7 @@ DEFUN (show_evpn_neigh_vni,
{
struct zebra_vrf *zvrf;
vni_t vni;
- u_char uj = use_json(argc, argv);
+ uint8_t uj = use_json(argc, argv);
vni = strtoul(argv[4]->arg, NULL, 10);
zvrf = vrf_info_lookup(VRF_DEFAULT);
@@ -3176,7 +3177,7 @@ DEFUN (show_evpn_neigh_vni_all,
JSON_STR)
{
struct zebra_vrf *zvrf;
- u_char uj = use_json(argc, argv);
+ uint8_t uj = use_json(argc, argv);
zvrf = vrf_info_lookup(VRF_DEFAULT);
zebra_vxlan_print_neigh_all_vni(vty, zvrf, uj);
@@ -3198,7 +3199,7 @@ DEFUN (show_evpn_neigh_vni_neigh,
struct zebra_vrf *zvrf;
vni_t vni;
struct ipaddr ip;
- u_char uj = use_json(argc, argv);
+ uint8_t uj = use_json(argc, argv);
vni = strtoul(argv[4]->arg, NULL, 10);
if (str2ipaddr(argv[6]->arg, &ip) != 0) {
@@ -3226,7 +3227,7 @@ DEFUN (show_evpn_neigh_vni_vtep,
struct zebra_vrf *zvrf;
vni_t vni;
struct in_addr vtep_ip;
- u_char uj = use_json(argc, argv);
+ uint8_t uj = use_json(argc, argv);
vni = strtoul(argv[4]->arg, NULL, 10);
if (!inet_aton(argv[6]->arg, &vtep_ip)) {
@@ -3261,7 +3262,7 @@ DEFUN (ip_zebra_import_table_distance,
"route-map for filtering\n"
"route-map name\n")
{
- u_int32_t table_id = 0;
+ uint32_t table_id = 0;
table_id = strtoul(argv[2]->arg, NULL, 10);
int distance = ZEBRA_TABLE_DISTANCE_DEFAULT;
@@ -3364,7 +3365,7 @@ DEFUN (no_ip_zebra_import_table,
"route-map for filtering\n"
"route-map name\n")
{
- u_int32_t table_id = 0;
+ uint32_t table_id = 0;
table_id = strtoul(argv[3]->arg, NULL, 10);
if (!is_zebra_valid_kernel_table(table_id)) {
diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c
index 256fa9e4b..7784403ff 100644
--- a/zebra/zebra_vxlan.c
+++ b/zebra/zebra_vxlan.c
@@ -75,8 +75,8 @@ static void zvni_print(zebra_vni_t *zvni, void **ctxt);
static void zvni_print_hash(struct hash_backet *backet, void *ctxt[]);
static int zvni_macip_send_msg_to_client(vni_t vni, struct ethaddr *macaddr,
- struct ipaddr *ip, u_char flags,
- u_int16_t cmd);
+ struct ipaddr *ip, uint8_t flags,
+ uint16_t cmd);
static unsigned int neigh_hash_keymake(void *p);
static int neigh_cmp(const void *p1, const void *p2);
static void *zvni_neigh_alloc(void *p);
@@ -87,12 +87,14 @@ static int zvni_neigh_del_hash_entry(struct hash_backet *backet, void *arg);
static void zvni_neigh_del_from_vtep(zebra_vni_t *zvni, int uninstall,
struct in_addr *r_vtep_ip);
static void zvni_neigh_del_all(zebra_vni_t *zvni, int uninstall, int upd_client,
- u_int32_t flags);
+ uint32_t flags);
static zebra_neigh_t *zvni_neigh_lookup(zebra_vni_t *zvni, struct ipaddr *ip);
static int zvni_neigh_send_add_to_client(vni_t vni, struct ipaddr *ip,
- struct ethaddr *macaddr, u_char flags);
+ struct ethaddr *macaddr,
+ uint8_t flags);
static int zvni_neigh_send_del_to_client(vni_t vni, struct ipaddr *ip,
- struct ethaddr *macaddr, u_char flags);
+ struct ethaddr *macaddr,
+ uint8_t flags);
static int zvni_neigh_install(zebra_vni_t *zvni, zebra_neigh_t *n);
static int zvni_neigh_uninstall(zebra_vni_t *zvni, zebra_neigh_t *n);
static zebra_vni_t *zvni_from_svi(struct interface *ifp,
@@ -141,12 +143,12 @@ static int zvni_mac_del_hash_entry(struct hash_backet *backet, void *arg);
static void zvni_mac_del_from_vtep(zebra_vni_t *zvni, int uninstall,
struct in_addr *r_vtep_ip);
static void zvni_mac_del_all(zebra_vni_t *zvni, int uninstall, int upd_client,
- u_int32_t flags);
+ uint32_t flags);
static zebra_mac_t *zvni_mac_lookup(zebra_vni_t *zvni, struct ethaddr *macaddr);
static int zvni_mac_send_add_to_client(vni_t vni, struct ethaddr *macaddr,
- u_char flags);
+ uint8_t flags);
static int zvni_mac_send_del_to_client(vni_t vni, struct ethaddr *macaddr,
- u_char flags);
+ uint8_t flags);
static zebra_vni_t *zvni_map_vlan(struct interface *ifp,
struct interface *br_if, vlanid_t vid);
static int zvni_mac_install(zebra_vni_t *zvni, zebra_mac_t *mac);
@@ -186,10 +188,10 @@ static void zvni_deref_ip2mac(zebra_vni_t *zvni, zebra_mac_t *mac,
* Return number of valid MACs in a VNI's MAC hash table - all
* remote MACs and non-internal (auto) local MACs count.
*/
-static u_int32_t num_valid_macs(zebra_vni_t *zvni)
+static uint32_t num_valid_macs(zebra_vni_t *zvni)
{
unsigned int i;
- u_int32_t num_macs = 0;
+ uint32_t num_macs = 0;
struct hash *hash;
struct hash_backet *hb;
zebra_mac_t *mac;
@@ -378,7 +380,7 @@ static void zvni_print_neigh_hash_all_vni(struct hash_backet *backet,
struct vty *vty;
json_object *json = NULL, *json_vni = NULL;
zebra_vni_t *zvni;
- u_int32_t num_neigh;
+ uint32_t num_neigh;
struct neigh_walk_ctx wctx;
char vni_str[VNI_STR_LEN];
@@ -673,7 +675,7 @@ static void zvni_print_mac_hash_all_vni(struct hash_backet *backet, void *ctxt)
json_object *json = NULL, *json_vni = NULL;
json_object *json_mac = NULL;
zebra_vni_t *zvni;
- u_int32_t num_macs;
+ uint32_t num_macs;
struct mac_walk_ctx *wctx = ctxt;
char vni_str[VNI_STR_LEN];
@@ -810,7 +812,7 @@ static void zl3vni_print_rmac_hash_all_vni(struct hash_backet *backet,
json_object *json = NULL;
json_object *json_vni = NULL;
zebra_l3vni_t *zl3vni = NULL;
- u_int32_t num_rmacs;
+ uint32_t num_rmacs;
struct rmac_walk_ctx wctx;
char vni_str[VNI_STR_LEN];
@@ -953,8 +955,8 @@ static void zvni_print(zebra_vni_t *zvni, void **ctxt)
{
struct vty *vty;
zebra_vtep_t *zvtep;
- u_int32_t num_macs;
- u_int32_t num_neigh;
+ uint32_t num_macs;
+ uint32_t num_neigh;
json_object *json = NULL;
json_object *json_vtep_list = NULL;
json_object *json_ip_str = NULL;
@@ -1081,9 +1083,9 @@ static void zvni_print_hash(struct hash_backet *backet, void *ctxt[])
struct vty *vty;
zebra_vni_t *zvni;
zebra_vtep_t *zvtep;
- u_int32_t num_vteps = 0;
- u_int32_t num_macs = 0;
- u_int32_t num_neigh = 0;
+ uint32_t num_vteps = 0;
+ uint32_t num_macs = 0;
+ uint32_t num_neigh = 0;
json_object *json = NULL;
json_object *json_vni = NULL;
json_object *json_ip_str = NULL;
@@ -1143,8 +1145,8 @@ static void zvni_print_hash(struct hash_backet *backet, void *ctxt[])
* Inform BGP about local MACIP.
*/
static int zvni_macip_send_msg_to_client(vni_t vni, struct ethaddr *macaddr,
- struct ipaddr *ip, u_char flags,
- u_int16_t cmd)
+ struct ipaddr *ip, uint8_t flags,
+ uint16_t cmd)
{
char buf[ETHER_ADDR_STRLEN];
char buf2[INET6_ADDRSTRLEN];
@@ -1343,7 +1345,7 @@ static void zvni_neigh_del_from_vtep(zebra_vni_t *zvni, int uninstall,
* Delete all neighbor entries for this VNI.
*/
static void zvni_neigh_del_all(zebra_vni_t *zvni, int uninstall, int upd_client,
- u_int32_t flags)
+ uint32_t flags)
{
struct neigh_walk_ctx wctx;
@@ -1512,9 +1514,9 @@ static void zvni_process_neigh_on_remote_mac_del(zebra_vni_t *zvni,
*/
static int zvni_neigh_send_add_to_client(vni_t vni, struct ipaddr *ip,
struct ethaddr *macaddr,
- u_char neigh_flags)
+ uint8_t neigh_flags)
{
- u_char flags = 0;
+ uint8_t flags = 0;
if (CHECK_FLAG(neigh_flags, ZEBRA_NEIGH_DEF_GW))
SET_FLAG(flags, ZEBRA_MACIP_TYPE_GW);
@@ -1527,7 +1529,7 @@ static int zvni_neigh_send_add_to_client(vni_t vni, struct ipaddr *ip,
* Inform BGP about local neighbor deletion.
*/
static int zvni_neigh_send_del_to_client(vni_t vni, struct ipaddr *ip,
- struct ethaddr *macaddr, u_char flags)
+ struct ethaddr *macaddr, uint8_t flags)
{
return zvni_macip_send_msg_to_client(vni, macaddr, ip, flags,
ZEBRA_MACIP_DEL);
@@ -2062,7 +2064,7 @@ static void zvni_mac_del_from_vtep(zebra_vni_t *zvni, int uninstall,
* Delete all MAC entries for this VNI.
*/
static void zvni_mac_del_all(zebra_vni_t *zvni, int uninstall, int upd_client,
- u_int32_t flags)
+ uint32_t flags)
{
struct mac_walk_ctx wctx;
@@ -2099,9 +2101,9 @@ static zebra_mac_t *zvni_mac_lookup(zebra_vni_t *zvni, struct ethaddr *mac)
* Inform BGP about local MAC addition.
*/
static int zvni_mac_send_add_to_client(vni_t vni, struct ethaddr *macaddr,
- u_char mac_flags)
+ uint8_t mac_flags)
{
- u_char flags = 0;
+ uint8_t flags = 0;
if (CHECK_FLAG(mac_flags, ZEBRA_MAC_STICKY))
SET_FLAG(flags, ZEBRA_MACIP_TYPE_STICKY);
@@ -2116,9 +2118,9 @@ static int zvni_mac_send_add_to_client(vni_t vni, struct ethaddr *macaddr,
* Inform BGP about local MAC deletion.
*/
static int zvni_mac_send_del_to_client(vni_t vni, struct ethaddr *macaddr,
- u_char mac_flags)
+ uint8_t mac_flags)
{
- u_char flags = 0;
+ uint8_t flags = 0;
if (CHECK_FLAG(mac_flags, ZEBRA_MAC_STICKY))
SET_FLAG(flags, ZEBRA_MACIP_TYPE_STICKY);
@@ -2142,7 +2144,7 @@ static zebra_vni_t *zvni_map_vlan(struct interface *ifp,
struct zebra_if *zif;
struct zebra_l2info_bridge *br;
struct zebra_l2info_vxlan *vxl = NULL;
- u_char bridge_vlan_aware;
+ uint8_t bridge_vlan_aware;
zebra_vni_t *zvni;
int found = 0;
@@ -2195,7 +2197,7 @@ static zebra_vni_t *zvni_from_svi(struct interface *ifp,
struct zebra_if *zif;
struct zebra_l2info_bridge *br;
struct zebra_l2info_vxlan *vxl = NULL;
- u_char bridge_vlan_aware;
+ uint8_t bridge_vlan_aware;
vlanid_t vid = 0;
zebra_vni_t *zvni;
int found = 0;
@@ -2269,7 +2271,7 @@ static struct interface *zvni_map_to_svi(vlanid_t vid, struct interface *br_if)
struct zebra_if *zif;
struct zebra_l2info_bridge *br;
struct zebra_l2info_vlan *vl;
- u_char bridge_vlan_aware;
+ uint8_t bridge_vlan_aware;
int found = 0;
/* Defensive check, caller expected to invoke only with valid bridge. */
@@ -2316,7 +2318,7 @@ static int zvni_mac_install(zebra_vni_t *zvni, zebra_mac_t *mac)
{
struct zebra_if *zif;
struct zebra_l2info_vxlan *vxl;
- u_char sticky;
+ uint8_t sticky;
if (!(mac->flags & ZEBRA_MAC_REMOTE))
return 0;
@@ -3241,7 +3243,7 @@ static int zl3vni_remote_nh_del(zebra_l3vni_t *zl3vni, struct ipaddr *vtep_ip,
* readd stale entries.
*/
static int zl3vni_local_nh_add_update(zebra_l3vni_t *zl3vni, struct ipaddr *ip,
- u_int16_t state)
+ uint16_t state)
{
#ifdef GNU_LINUX
zebra_neigh_t *n = NULL;
@@ -3466,7 +3468,7 @@ static zebra_l3vni_t *zl3vni_from_svi(struct interface *ifp,
{
int found = 0;
vlanid_t vid = 0;
- u_char bridge_vlan_aware = 0;
+ uint8_t bridge_vlan_aware = 0;
zebra_l3vni_t *zl3vni = NULL;
struct zebra_ns *zns = NULL;
struct route_node *rn = NULL;
@@ -3811,7 +3813,7 @@ void zebra_vxlan_evpn_vrf_route_del(vrf_id_t vrf_id, struct ethaddr *rmac,
void zebra_vxlan_print_specific_rmac_l3vni(struct vty *vty, vni_t l3vni,
struct ethaddr *rmac,
- u_char use_json)
+ uint8_t use_json)
{
zebra_l3vni_t *zl3vni = NULL;
zebra_mac_t *zrmac = NULL;
@@ -3856,10 +3858,10 @@ void zebra_vxlan_print_specific_rmac_l3vni(struct vty *vty, vni_t l3vni,
}
void zebra_vxlan_print_rmacs_l3vni(struct vty *vty, vni_t l3vni,
- u_char use_json)
+ uint8_t use_json)
{
zebra_l3vni_t *zl3vni;
- u_int32_t num_rmacs;
+ uint32_t num_rmacs;
struct rmac_walk_ctx wctx;
json_object *json = NULL;
@@ -3900,7 +3902,7 @@ void zebra_vxlan_print_rmacs_l3vni(struct vty *vty, vni_t l3vni,
}
}
-void zebra_vxlan_print_rmacs_all_l3vni(struct vty *vty, u_char use_json)
+void zebra_vxlan_print_rmacs_all_l3vni(struct vty *vty, uint8_t use_json)
{
struct zebra_ns *zns = NULL;
json_object *json = NULL;
@@ -3937,7 +3939,7 @@ void zebra_vxlan_print_rmacs_all_l3vni(struct vty *vty, u_char use_json)
}
void zebra_vxlan_print_specific_nh_l3vni(struct vty *vty, vni_t l3vni,
- struct ipaddr *ip, u_char use_json)
+ struct ipaddr *ip, uint8_t use_json)
{
zebra_l3vni_t *zl3vni = NULL;
zebra_neigh_t *n = NULL;
@@ -3981,9 +3983,9 @@ void zebra_vxlan_print_specific_nh_l3vni(struct vty *vty, vni_t l3vni,
}
}
-void zebra_vxlan_print_nh_l3vni(struct vty *vty, vni_t l3vni, u_char use_json)
+void zebra_vxlan_print_nh_l3vni(struct vty *vty, vni_t l3vni, uint8_t use_json)
{
- u_int32_t num_nh;
+ uint32_t num_nh;
struct nh_walk_ctx wctx;
json_object *json = NULL;
zebra_l3vni_t *zl3vni = NULL;
@@ -4025,7 +4027,7 @@ void zebra_vxlan_print_nh_l3vni(struct vty *vty, vni_t l3vni, u_char use_json)
}
}
-void zebra_vxlan_print_nh_all_l3vni(struct vty *vty, u_char use_json)
+void zebra_vxlan_print_nh_all_l3vni(struct vty *vty, uint8_t use_json)
{
struct zebra_ns *zns = NULL;
json_object *json = NULL;
@@ -4062,7 +4064,7 @@ void zebra_vxlan_print_nh_all_l3vni(struct vty *vty, u_char use_json)
/*
* Display L3 VNI information (VTY command handler).
*/
-void zebra_vxlan_print_l3vni(struct vty *vty, vni_t vni, u_char use_json)
+void zebra_vxlan_print_l3vni(struct vty *vty, vni_t vni, uint8_t use_json)
{
void *args[2];
json_object *json = NULL;
@@ -4135,10 +4137,10 @@ void zebra_vxlan_print_vrf_vni(struct vty *vty, struct zebra_vrf *zvrf,
* Display Neighbors for a VNI (VTY command handler).
*/
void zebra_vxlan_print_neigh_vni(struct vty *vty, struct zebra_vrf *zvrf,
- vni_t vni, u_char use_json)
+ vni_t vni, uint8_t use_json)
{
zebra_vni_t *zvni;
- u_int32_t num_neigh;
+ uint32_t num_neigh;
struct neigh_walk_ctx wctx;
json_object *json = NULL;
@@ -4191,7 +4193,7 @@ void zebra_vxlan_print_neigh_vni(struct vty *vty, struct zebra_vrf *zvrf,
* Display neighbors across all VNIs (VTY command handler).
*/
void zebra_vxlan_print_neigh_all_vni(struct vty *vty, struct zebra_vrf *zvrf,
- u_char use_json)
+ uint8_t use_json)
{
json_object *json = NULL;
void *args[2];
@@ -4220,7 +4222,7 @@ void zebra_vxlan_print_neigh_all_vni(struct vty *vty, struct zebra_vrf *zvrf,
*/
void zebra_vxlan_print_specific_neigh_vni(struct vty *vty,
struct zebra_vrf *zvrf, vni_t vni,
- struct ipaddr *ip, u_char use_json)
+ struct ipaddr *ip, uint8_t use_json)
{
zebra_vni_t *zvni;
zebra_neigh_t *n;
@@ -4262,10 +4264,10 @@ void zebra_vxlan_print_specific_neigh_vni(struct vty *vty,
*/
void zebra_vxlan_print_neigh_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf,
vni_t vni, struct in_addr vtep_ip,
- u_char use_json)
+ uint8_t use_json)
{
zebra_vni_t *zvni;
- u_int32_t num_neigh;
+ uint32_t num_neigh;
struct neigh_walk_ctx wctx;
json_object *json = NULL;
@@ -4302,10 +4304,10 @@ void zebra_vxlan_print_neigh_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf,
* Display MACs for a VNI (VTY command handler).
*/
void zebra_vxlan_print_macs_vni(struct vty *vty, struct zebra_vrf *zvrf,
- vni_t vni, u_char use_json)
+ vni_t vni, uint8_t use_json)
{
zebra_vni_t *zvni;
- u_int32_t num_macs;
+ uint32_t num_macs;
struct mac_walk_ctx wctx;
json_object *json = NULL;
json_object *json_mac = NULL;
@@ -4357,7 +4359,7 @@ void zebra_vxlan_print_macs_vni(struct vty *vty, struct zebra_vrf *zvrf,
* Display MACs for all VNIs (VTY command handler).
*/
void zebra_vxlan_print_macs_all_vni(struct vty *vty, struct zebra_vrf *zvrf,
- u_char use_json)
+ uint8_t use_json)
{
struct mac_walk_ctx wctx;
json_object *json = NULL;
@@ -4388,7 +4390,7 @@ void zebra_vxlan_print_macs_all_vni(struct vty *vty, struct zebra_vrf *zvrf,
void zebra_vxlan_print_macs_all_vni_vtep(struct vty *vty,
struct zebra_vrf *zvrf,
struct in_addr vtep_ip,
- u_char use_json)
+ uint8_t use_json)
{
struct mac_walk_ctx wctx;
json_object *json = NULL;
@@ -4444,10 +4446,10 @@ void zebra_vxlan_print_specific_mac_vni(struct vty *vty, struct zebra_vrf *zvrf,
*/
void zebra_vxlan_print_macs_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf,
vni_t vni, struct in_addr vtep_ip,
- u_char use_json)
+ uint8_t use_json)
{
zebra_vni_t *zvni;
- u_int32_t num_macs;
+ uint32_t num_macs;
struct mac_walk_ctx wctx;
json_object *json = NULL;
json_object *json_mac = NULL;
@@ -4494,7 +4496,7 @@ void zebra_vxlan_print_macs_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf,
* Display VNI information (VTY command handler).
*/
void zebra_vxlan_print_vni(struct vty *vty, struct zebra_vrf *zvrf, vni_t vni,
- u_char use_json)
+ uint8_t use_json)
{
json_object *json = NULL;
void *args[2];
@@ -4533,7 +4535,7 @@ void zebra_vxlan_print_vni(struct vty *vty, struct zebra_vrf *zvrf, vni_t vni,
}
/* Display all global details for EVPN */
-void zebra_vxlan_print_evpn(struct vty *vty, u_char uj)
+void zebra_vxlan_print_evpn(struct vty *vty, uint8_t uj)
{
int num_l2vnis = 0;
int num_l3vnis = 0;
@@ -4582,7 +4584,7 @@ void zebra_vxlan_print_evpn(struct vty *vty, u_char uj)
* Display VNI hash table (VTY command handler).
*/
void zebra_vxlan_print_vnis(struct vty *vty, struct zebra_vrf *zvrf,
- u_char use_json)
+ uint8_t use_json)
{
json_object *json = NULL;
struct zebra_ns *zns = NULL;
@@ -4712,8 +4714,8 @@ int zebra_vxlan_local_neigh_del(struct interface *ifp,
int zebra_vxlan_local_neigh_add_update(struct interface *ifp,
struct interface *link_if,
struct ipaddr *ip,
- struct ethaddr *macaddr, u_int16_t state,
- u_char ext_learned)
+ struct ethaddr *macaddr, uint16_t state,
+ uint8_t ext_learned)
{
char buf[ETHER_ADDR_STRLEN];
char buf2[INET6_ADDRSTRLEN];
@@ -4762,7 +4764,7 @@ int zebra_vxlan_local_neigh_add_update(struct interface *ifp,
}
memset(&zmac->fwd_info, 0, sizeof(zmac->fwd_info));
- memset(&zmac->flags, 0, sizeof(u_int32_t));
+ memset(&zmac->flags, 0, sizeof(uint32_t));
SET_FLAG(zmac->flags, ZEBRA_MAC_AUTO);
}
@@ -4868,7 +4870,7 @@ void zebra_vxlan_remote_macip_del(ZAPI_HANDLER_ARGS)
zebra_vni_t *zvni;
zebra_mac_t *mac;
zebra_neigh_t *n;
- u_short l = 0, ipa_len;
+ unsigned short l = 0, ipa_len;
char buf[ETHER_ADDR_STRLEN];
char buf1[INET6_ADDRSTRLEN];
struct interface *ifp = NULL;
@@ -5021,12 +5023,12 @@ void zebra_vxlan_remote_macip_add(ZAPI_HANDLER_ARGS)
zebra_vtep_t *zvtep;
zebra_mac_t *mac, *old_mac;
zebra_neigh_t *n;
- u_short l = 0, ipa_len;
+ unsigned short l = 0, ipa_len;
int update_mac = 0, update_neigh = 0;
char buf[ETHER_ADDR_STRLEN];
char buf1[INET6_ADDRSTRLEN];
- u_char sticky = 0;
- u_char flags = 0;
+ uint8_t sticky = 0;
+ uint8_t flags = 0;
struct interface *ifp = NULL;
struct zebra_if *zif = NULL;
@@ -5414,13 +5416,13 @@ int zebra_vxlan_local_mac_del(struct interface *ifp, struct interface *br_if,
int zebra_vxlan_local_mac_add_update(struct interface *ifp,
struct interface *br_if,
struct ethaddr *macaddr, vlanid_t vid,
- u_char sticky)
+ uint8_t sticky)
{
zebra_vni_t *zvni;
zebra_mac_t *mac;
char buf[ETHER_ADDR_STRLEN];
int add = 1;
- u_char mac_sticky;
+ uint8_t mac_sticky;
/* We are interested in MACs only on ports or (port, VLAN) that
* map to a VNI.
@@ -5539,7 +5541,7 @@ int zebra_vxlan_local_mac_add_update(struct interface *ifp,
void zebra_vxlan_remote_vtep_del(ZAPI_HANDLER_ARGS)
{
struct stream *s;
- u_short l = 0;
+ unsigned short l = 0;
vni_t vni;
struct in_addr vtep_ip;
zebra_vni_t *zvni;
@@ -5624,7 +5626,7 @@ stream_failure:
void zebra_vxlan_remote_vtep_add(ZAPI_HANDLER_ARGS)
{
struct stream *s;
- u_short l = 0;
+ unsigned short l = 0;
vni_t vni;
struct in_addr vtep_ip;
zebra_vni_t *zvni;
@@ -6114,7 +6116,7 @@ int zebra_vxlan_if_del(struct interface *ifp)
/*
* Handle VxLAN interface update - change to tunnel IP, master or VLAN.
*/
-int zebra_vxlan_if_update(struct interface *ifp, u_int16_t chgflags)
+int zebra_vxlan_if_update(struct interface *ifp, uint16_t chgflags)
{
vni_t vni;
struct zebra_if *zif = NULL;
diff --git a/zebra/zebra_vxlan.h b/zebra/zebra_vxlan.h
index 6f25ad1e2..16b01e6ac 100644
--- a/zebra/zebra_vxlan.h
+++ b/zebra/zebra_vxlan.h
@@ -68,52 +68,53 @@ extern int zebra_vxlan_vrf_enable(struct zebra_vrf *zvrf);
extern int zebra_vxlan_vrf_disable(struct zebra_vrf *zvrf);
extern int zebra_vxlan_vrf_delete(struct zebra_vrf *zvrf);
extern void zebra_vxlan_print_specific_nh_l3vni(struct vty *vty, vni_t l3vni,
- struct ipaddr *ip, u_char uj);
-extern void zebra_vxlan_print_evpn(struct vty *vty, u_char uj);
+ struct ipaddr *ip, uint8_t uj);
+extern void zebra_vxlan_print_evpn(struct vty *vty, uint8_t uj);
extern void zebra_vxlan_print_specific_rmac_l3vni(struct vty *vty, vni_t l3vni,
struct ethaddr *rmac,
- u_char use_json);
+ uint8_t use_json);
extern void zebra_vxlan_print_macs_vni(struct vty *vty, struct zebra_vrf *zvrf,
- vni_t vni, u_char use_json);
+ vni_t vni, uint8_t use_json);
extern void zebra_vxlan_print_macs_all_vni(struct vty *vty,
struct zebra_vrf *zvrf,
- u_char use_json);
+ uint8_t use_json);
extern void zebra_vxlan_print_macs_all_vni_vtep(struct vty *vty,
struct zebra_vrf *zvrf,
struct in_addr vtep_ip,
- u_char use_json);
+ uint8_t use_json);
extern void zebra_vxlan_print_specific_mac_vni(struct vty *vty,
struct zebra_vrf *zvrf,
vni_t vni, struct ethaddr *mac);
extern void zebra_vxlan_print_macs_vni_vtep(struct vty *vty,
struct zebra_vrf *zvrf, vni_t vni,
struct in_addr vtep_ip,
- u_char use_json);
+ uint8_t use_json);
extern void zebra_vxlan_print_neigh_vni(struct vty *vty, struct zebra_vrf *zvrf,
- vni_t vni, u_char use_json);
+ vni_t vni, uint8_t use_json);
extern void zebra_vxlan_print_neigh_all_vni(struct vty *vty,
struct zebra_vrf *zvrf,
- u_char use_json);
+ uint8_t use_json);
extern void zebra_vxlan_print_specific_neigh_vni(struct vty *vty,
struct zebra_vrf *zvrf,
vni_t vni, struct ipaddr *ip,
- u_char use_json);
+ uint8_t use_json);
extern void zebra_vxlan_print_neigh_vni_vtep(struct vty *vty,
struct zebra_vrf *zvrf, vni_t vni,
struct in_addr vtep_ip,
- u_char use_json);
+ uint8_t use_json);
extern void zebra_vxlan_print_vni(struct vty *vty, struct zebra_vrf *zvrf,
- vni_t vni, u_char use_json);
+ vni_t vni, uint8_t use_json);
extern void zebra_vxlan_print_vnis(struct vty *vty, struct zebra_vrf *zvrf,
- u_char use_json);
+ uint8_t use_json);
extern void zebra_vxlan_print_rmacs_l3vni(struct vty *vty, vni_t vni,
- u_char use_json);
-extern void zebra_vxlan_print_rmacs_all_l3vni(struct vty *vty, u_char use_json);
+ uint8_t use_json);
+extern void zebra_vxlan_print_rmacs_all_l3vni(struct vty *vty,
+ uint8_t use_json);
extern void zebra_vxlan_print_nh_l3vni(struct vty *vty, vni_t vni,
- u_char use_json);
-extern void zebra_vxlan_print_nh_all_l3vni(struct vty *vty, u_char use_json);
+ uint8_t use_json);
+extern void zebra_vxlan_print_nh_all_l3vni(struct vty *vty, uint8_t use_json);
extern void zebra_vxlan_print_l3vni(struct vty *vty, vni_t vni,
- u_char use_json);
+ uint8_t use_json);
extern void zebra_vxlan_print_vrf_vni(struct vty *vty, struct zebra_vrf *zvrf,
json_object *json_vrfs);
extern int zebra_vxlan_add_del_gw_macip(struct interface *ifp, struct prefix *p,
@@ -123,14 +124,14 @@ extern int zebra_vxlan_svi_down(struct interface *ifp,
struct interface *link_if);
extern int zebra_vxlan_local_neigh_add_update(
struct interface *ifp, struct interface *link_if, struct ipaddr *ip,
- struct ethaddr *macaddr, u_int16_t state, u_char ext_learned);
+ struct ethaddr *macaddr, uint16_t state, uint8_t ext_learned);
extern int zebra_vxlan_local_neigh_del(struct interface *ifp,
struct interface *link_if,
struct ipaddr *ip);
extern int zebra_vxlan_local_mac_add_update(struct interface *ifp,
struct interface *br_if,
struct ethaddr *mac, vlanid_t vid,
- u_char sticky);
+ uint8_t sticky);
extern int zebra_vxlan_local_mac_del(struct interface *ifp,
struct interface *br_if,
struct ethaddr *mac, vlanid_t vid);
@@ -144,7 +145,7 @@ extern int zebra_vxlan_check_del_local_mac(struct interface *ifp,
extern int zebra_vxlan_if_up(struct interface *ifp);
extern int zebra_vxlan_if_down(struct interface *ifp);
extern int zebra_vxlan_if_add(struct interface *ifp);
-extern int zebra_vxlan_if_update(struct interface *ifp, u_int16_t chgflags);
+extern int zebra_vxlan_if_update(struct interface *ifp, uint16_t chgflags);
extern int zebra_vxlan_if_del(struct interface *ifp);
extern int zebra_vxlan_process_vrf_vni_cmd(struct zebra_vrf *zvrf, vni_t vni,
char *err, int err_str_sz,
diff --git a/zebra/zebra_vxlan_null.c b/zebra/zebra_vxlan_null.c
index 1bac2cafb..afc59774c 100644
--- a/zebra/zebra_vxlan_null.c
+++ b/zebra/zebra_vxlan_null.c
@@ -83,23 +83,23 @@ void zebra_vxlan_print_vnis(struct vty *vty, struct zebra_vrf *zvrf)
{
}
-void zebra_vxlan_print_evpn(struct vty *vty, u_char uj)
+void zebra_vxlan_print_evpn(struct vty *vty, uint8_t uj)
{
}
-void zebra_vxlan_print_rmacs_l3vni(struct vty *, vni_t, u_char)
+void zebra_vxlan_print_rmacs_l3vni(struct vty *, vni_t, uint8_t)
{
}
-void zebra_vxlan_print_rmacs_all_l3vni(struct vty *, u_char)
+void zebra_vxlan_print_rmacs_all_l3vni(struct vty *, uint8_t)
{
}
-void zebra_vxlan_print_nh_l3vni(struct vty *, vni_t, u_char)
+void zebra_vxlan_print_nh_l3vni(struct vty *, vni_t, uint8_t)
{
}
-void zebra_vxlan_print_nh_all_l3vni(struct vty *, u_char)
+void zebra_vxlan_print_nh_all_l3vni(struct vty *, uint8_t)
{
}
@@ -117,14 +117,14 @@ int zebra_vxlan_svi_down(struct interface *ifp, struct interface *link_if)
return 0;
}
-int zebra_vxlan_remote_macip_add(struct zserv *client, int sock, u_short length,
- struct zebra_vrf *zvrf)
+int zebra_vxlan_remote_macip_add(struct zserv *client, int sock,
+ unsigned short length, struct zebra_vrf *zvrf)
{
return 0;
}
-int zebra_vxlan_remote_macip_del(struct zserv *client, int sock, u_short length,
- struct zebra_vrf *zvrf)
+int zebra_vxlan_remote_macip_del(struct zserv *client, int sock,
+ unsigned short length, struct zebra_vrf *zvrf)
{
return 0;
}
@@ -132,7 +132,7 @@ int zebra_vxlan_remote_macip_del(struct zserv *client, int sock, u_short length,
int zebra_vxlan_local_mac_add_update(struct interface *ifp,
struct interface *br_if,
struct ethaddr *mac, vlanid_t vid,
- u_char sticky)
+ uint8_t sticky)
{
return 0;
}
@@ -172,7 +172,7 @@ int zebra_vxlan_if_add(struct interface *ifp)
return 0;
}
-int zebra_vxlan_if_update(struct interface *ifp, u_int16_t chgflags)
+int zebra_vxlan_if_update(struct interface *ifp, uint16_t chgflags)
{
return 0;
}
@@ -182,20 +182,20 @@ int zebra_vxlan_if_del(struct interface *ifp)
return 0;
}
-int zebra_vxlan_remote_vtep_add(struct zserv *client, int sock, u_short length,
- struct zebra_vrf *zvrf)
+int zebra_vxlan_remote_vtep_add(struct zserv *client, int sock,
+ unsigned short length, struct zebra_vrf *zvrf)
{
return 0;
}
-int zebra_vxlan_remote_vtep_del(struct zserv *client, int sock, u_short length,
- struct zebra_vrf *zvrf)
+int zebra_vxlan_remote_vtep_del(struct zserv *client, int sock,
+ unsigned short length, struct zebra_vrf *zvrf)
{
return 0;
}
int zebra_vxlan_advertise_all_vni(struct zserv *client, int sock,
- u_short length, struct zebra_vrf *zvrf)
+ unsigned short length, struct zebra_vrf *zvrf)
{
return 0;
}
diff --git a/zebra/zebra_vxlan_private.h b/zebra/zebra_vxlan_private.h
index 6174c6a56..b4a8b5d48 100644
--- a/zebra/zebra_vxlan_private.h
+++ b/zebra/zebra_vxlan_private.h
@@ -68,10 +68,10 @@ struct zebra_vni_t_ {
vni_t vni;
/* Flag for advertising gw macip */
- u_int8_t advertise_gw_macip;
+ uint8_t advertise_gw_macip;
/* Flag for advertising gw macip */
- u_int8_t advertise_subnet;
+ uint8_t advertise_subnet;
/* Corresponding VxLAN interface. */
struct interface *vxlan_if;
@@ -231,7 +231,7 @@ struct zebra_mac_t_ {
/* MAC address. */
struct ethaddr macaddr;
- u_int32_t flags;
+ uint32_t flags;
#define ZEBRA_MAC_LOCAL 0x01
#define ZEBRA_MAC_REMOTE 0x02
#define ZEBRA_MAC_AUTO 0x04 /* Auto created for neighbor. */
@@ -265,7 +265,7 @@ struct mac_walk_ctx {
int uninstall; /* uninstall from kernel? */
int upd_client; /* uninstall from client? */
- u_int32_t flags;
+ uint32_t flags;
#define DEL_LOCAL_MAC 0x1
#define DEL_REMOTE_MAC 0x2
#define DEL_ALL_MAC (DEL_LOCAL_MAC | DEL_REMOTE_MAC)
@@ -275,7 +275,7 @@ struct mac_walk_ctx {
struct in_addr r_vtep_ip; /* To walk MACs from specific VTEP */
struct vty *vty; /* Used by VTY handlers */
- u_int32_t count; /* Used by VTY handlers */
+ uint32_t count; /* Used by VTY handlers */
struct json_object *json; /* Used for JSON Output */
};
@@ -315,7 +315,7 @@ struct zebra_neigh_t_ {
/* Underlying interface. */
ifindex_t ifindex;
- u_int32_t flags;
+ uint32_t flags;
#define ZEBRA_NEIGH_LOCAL 0x01
#define ZEBRA_NEIGH_REMOTE 0x02
#define ZEBRA_NEIGH_REMOTE_NH 0x04 /* neigh entry for remote vtep */
@@ -339,7 +339,7 @@ struct neigh_walk_ctx {
int uninstall; /* uninstall from kernel? */
int upd_client; /* uninstall from client? */
- u_int32_t flags;
+ uint32_t flags;
#define DEL_LOCAL_NEIGH 0x1
#define DEL_REMOTE_NEIGH 0x2
#define DEL_ALL_NEIGH (DEL_LOCAL_NEIGH | DEL_REMOTE_NEIGH)
@@ -349,8 +349,8 @@ struct neigh_walk_ctx {
struct in_addr r_vtep_ip; /* To walk neighbors from specific VTEP */
struct vty *vty; /* Used by VTY handlers */
- u_int32_t count; /* Used by VTY handlers */
- u_char addr_width; /* Used by VTY handlers */
+ uint32_t count; /* Used by VTY handlers */
+ uint8_t addr_width; /* Used by VTY handlers */
struct json_object *json; /* Used for JSON Output */
};
diff --git a/zebra/zserv.c b/zebra/zserv.c
index f11c0dd2f..538487a9c 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -631,7 +631,7 @@ static int zsend_ipv4_nexthop_lookup_mrib(struct zserv *client,
{
struct stream *s;
unsigned long nump;
- u_char num;
+ uint8_t num;
struct nexthop *nexthop;
/* Get output stream. */
@@ -828,7 +828,8 @@ static int zsend_assign_label_chunk_response(struct zserv *client,
/* Send response to a label manager connect request to client */
static int zsend_label_manager_connect_response(struct zserv *client,
- vrf_id_t vrf_id, u_short result)
+ vrf_id_t vrf_id,
+ unsigned short result)
{
int ret;
struct stream *s = stream_new(ZEBRA_MAX_PACKET_SIZ);
@@ -862,8 +863,8 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
struct rnh *rnh;
struct stream *s;
struct prefix p;
- u_short l = 0;
- u_char flags = 0;
+ unsigned short l = 0;
+ uint8_t flags = 0;
uint16_t type = cmd2type[hdr->command];
if (IS_ZEBRA_DEBUG_NHT)
@@ -939,7 +940,7 @@ static void zread_rnh_unregister(ZAPI_HANDLER_ARGS)
struct rnh *rnh;
struct stream *s;
struct prefix p;
- u_short l = 0;
+ unsigned short l = 0;
uint16_t type = cmd2type[hdr->command];
if (IS_ZEBRA_DEBUG_NHT)
@@ -1000,7 +1001,7 @@ stream_failure:
static void zread_fec_register(ZAPI_HANDLER_ARGS)
{
struct stream *s;
- u_short l = 0;
+ unsigned short l = 0;
struct prefix p;
uint16_t flags;
uint32_t label_index = MPLS_INVALID_LABEL_INDEX;
@@ -1059,7 +1060,7 @@ stream_failure:
static void zread_fec_unregister(ZAPI_HANDLER_ARGS)
{
struct stream *s;
- u_short l = 0;
+ unsigned short l = 0;
struct prefix p;
uint16_t flags;
@@ -1432,10 +1433,10 @@ static void zread_ipv4_add(ZAPI_HANDLER_ARGS)
int i;
struct route_entry *re;
struct prefix p;
- u_char message;
+ uint8_t message;
struct in_addr nhop_addr;
- u_char nexthop_num;
- u_char nexthop_type;
+ uint8_t nexthop_num;
+ uint8_t nexthop_type;
struct stream *s;
ifindex_t ifindex;
safi_t safi;
@@ -1585,7 +1586,7 @@ static void zread_ipv4_delete(ZAPI_HANDLER_ARGS)
struct stream *s;
struct zapi_ipv4 api;
struct prefix p;
- u_int32_t table_id;
+ uint32_t table_id;
s = msg;
@@ -1638,9 +1639,9 @@ static void zread_ipv4_route_ipv6_nexthop_add(ZAPI_HANDLER_ARGS)
struct stream *s;
struct in6_addr nhop_addr;
struct route_entry *re;
- u_char message;
- u_char nexthop_num;
- u_char nexthop_type;
+ uint8_t message;
+ uint8_t nexthop_num;
+ uint8_t nexthop_type;
struct prefix p;
safi_t safi;
static struct in6_addr nexthops[MULTIPATH_NUM];
@@ -1810,9 +1811,9 @@ static void zread_ipv6_add(ZAPI_HANDLER_ARGS)
struct in6_addr nhop_addr;
ifindex_t ifindex;
struct route_entry *re;
- u_char message;
- u_char nexthop_num;
- u_char nexthop_type;
+ uint8_t message;
+ uint8_t nexthop_num;
+ uint8_t nexthop_type;
struct prefix p;
struct prefix_ipv6 src_p, *src_pp;
safi_t safi;
@@ -2060,9 +2061,9 @@ static void zread_router_id_delete(ZAPI_HANDLER_ARGS)
static void zread_hello(ZAPI_HANDLER_ARGS)
{
/* type of protocol (lib/zebra.h) */
- u_char proto;
- u_short instance;
- u_char notify;
+ uint8_t proto;
+ unsigned short instance;
+ uint8_t notify;
STREAM_GETC(msg, proto);
STREAM_GETW(msg, instance);
@@ -2110,7 +2111,7 @@ static void zread_mpls_labels(ZAPI_HANDLER_ARGS)
union g_addr gate;
ifindex_t ifindex;
mpls_label_t in_label, out_label;
- u_int8_t distance;
+ uint8_t distance;
/* Get input stream. */
s = msg;
@@ -2190,8 +2191,8 @@ static void zread_label_manager_connect(struct zserv *client,
{
struct stream *s;
/* type of protocol (lib/zebra.h) */
- u_char proto;
- u_short instance;
+ uint8_t proto;
+ unsigned short instance;
/* Get input stream. */
s = msg;
@@ -2232,7 +2233,7 @@ static void zread_get_label_chunk(struct zserv *client, struct stream *msg,
vrf_id_t vrf_id)
{
struct stream *s;
- u_char keep;
+ uint8_t keep;
uint32_t size;
struct label_manager_chunk *lmc;
@@ -3319,7 +3320,7 @@ static void zebra_show_client_brief(struct vty *vty, struct zserv *client)
client->v6_route_del_cnt);
}
-struct zserv *zebra_find_client(u_char proto, u_short instance)
+struct zserv *zebra_find_client(uint8_t proto, unsigned short instance)
{
struct listnode *node, *nnode;
struct zserv *client;
diff --git a/zebra/zserv.h b/zebra/zserv.h
index 62707510c..947e11e35 100644
--- a/zebra/zserv.h
+++ b/zebra/zserv.h
@@ -83,44 +83,44 @@ struct zserv {
bool notify_owner;
/* client's protocol */
- u_char proto;
- u_short instance;
- u_char is_synchronous;
+ uint8_t proto;
+ unsigned short instance;
+ uint8_t is_synchronous;
/* Statistics */
- u_int32_t redist_v4_add_cnt;
- u_int32_t redist_v4_del_cnt;
- u_int32_t redist_v6_add_cnt;
- u_int32_t redist_v6_del_cnt;
- u_int32_t v4_route_add_cnt;
- u_int32_t v4_route_upd8_cnt;
- u_int32_t v4_route_del_cnt;
- u_int32_t v6_route_add_cnt;
- u_int32_t v6_route_del_cnt;
- u_int32_t v6_route_upd8_cnt;
- u_int32_t connected_rt_add_cnt;
- u_int32_t connected_rt_del_cnt;
- u_int32_t ifup_cnt;
- u_int32_t ifdown_cnt;
- u_int32_t ifadd_cnt;
- u_int32_t ifdel_cnt;
- u_int32_t if_bfd_cnt;
- u_int32_t bfd_peer_add_cnt;
- u_int32_t bfd_peer_upd8_cnt;
- u_int32_t bfd_peer_del_cnt;
- u_int32_t bfd_peer_replay_cnt;
- u_int32_t vrfadd_cnt;
- u_int32_t vrfdel_cnt;
- u_int32_t if_vrfchg_cnt;
- u_int32_t bfd_client_reg_cnt;
- u_int32_t vniadd_cnt;
- u_int32_t vnidel_cnt;
- u_int32_t l3vniadd_cnt;
- u_int32_t l3vnidel_cnt;
- u_int32_t macipadd_cnt;
- u_int32_t macipdel_cnt;
- u_int32_t prefixadd_cnt;
- u_int32_t prefixdel_cnt;
+ uint32_t redist_v4_add_cnt;
+ uint32_t redist_v4_del_cnt;
+ uint32_t redist_v6_add_cnt;
+ uint32_t redist_v6_del_cnt;
+ uint32_t v4_route_add_cnt;
+ uint32_t v4_route_upd8_cnt;
+ uint32_t v4_route_del_cnt;
+ uint32_t v6_route_add_cnt;
+ uint32_t v6_route_del_cnt;
+ uint32_t v6_route_upd8_cnt;
+ uint32_t connected_rt_add_cnt;
+ uint32_t connected_rt_del_cnt;
+ uint32_t ifup_cnt;
+ uint32_t ifdown_cnt;
+ uint32_t ifadd_cnt;
+ uint32_t ifdel_cnt;
+ uint32_t if_bfd_cnt;
+ uint32_t bfd_peer_add_cnt;
+ uint32_t bfd_peer_upd8_cnt;
+ uint32_t bfd_peer_del_cnt;
+ uint32_t bfd_peer_replay_cnt;
+ uint32_t vrfadd_cnt;
+ uint32_t vrfdel_cnt;
+ uint32_t if_vrfchg_cnt;
+ uint32_t bfd_client_reg_cnt;
+ uint32_t vniadd_cnt;
+ uint32_t vnidel_cnt;
+ uint32_t l3vniadd_cnt;
+ uint32_t l3vnidel_cnt;
+ uint32_t macipadd_cnt;
+ uint32_t macipdel_cnt;
+ uint32_t prefixadd_cnt;
+ uint32_t prefixdel_cnt;
time_t connect_time;
time_t last_read_time;
@@ -144,7 +144,7 @@ struct zebra_t {
struct list *client_list;
/* default table */
- u_int32_t rtm_table_default;
+ uint32_t rtm_table_default;
/* rib work queue */
#define ZEBRA_RIB_PROCESS_HOLD_TIME 10
@@ -155,7 +155,7 @@ struct zebra_t {
struct work_queue *lsp_process_q;
#define ZEBRA_ZAPI_PACKETS_TO_PROCESS 10
- u_int32_t packets_to_process;
+ uint32_t packets_to_process;
};
extern struct zebra_t zebrad;
extern unsigned int multipath_num;
@@ -195,7 +195,7 @@ extern void zserv_nexthop_num_warn(const char *, const struct prefix *,
const unsigned int);
extern int zebra_server_send_message(struct zserv *client, struct stream *msg);
-extern struct zserv *zebra_find_client(u_char proto, u_short instance);
+extern struct zserv *zebra_find_client(uint8_t proto, unsigned short instance);
#if defined(HANDLE_ZAPI_FUZZING)
extern void zserv_read_file(char *input);