From: Sepherosa Ziehau Date: Tue, 2 Dec 2008 12:02:55 +0000 (+0800) Subject: u_int{8,16,32,64}_t -> uint{8,16,32,64}_t X-Git-Tag: v2.3.0~245^2~26 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/ab398e4b7136c6e8582dbdcfe1ebfea0d211be65 u_int{8,16,32,64}_t -> uint{8,16,32,64}_t --- diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index c7f1ed4954..fccddacb16 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -116,7 +116,7 @@ struct carp_softc { int sc_naddrs6; int sc_advbase; /* seconds */ int sc_init_counter; - u_int64_t sc_counter; + uint64_t sc_counter; /* authentication */ #define CARP_HMAC_PAD 64 @@ -182,9 +182,9 @@ struct carp_if { } while (0) static void carp_hmac_prepare(struct carp_softc *); -static void carp_hmac_generate(struct carp_softc *, u_int32_t *, +static void carp_hmac_generate(struct carp_softc *, uint32_t *, unsigned char *); -static int carp_hmac_verify(struct carp_softc *, u_int32_t *, +static int carp_hmac_verify(struct carp_softc *, uint32_t *, unsigned char *); static void carp_setroute(struct carp_softc *, int); static void carp_input_c(struct mbuf *, struct carp_header *, sa_family_t); @@ -226,7 +226,7 @@ struct if_clone carp_cloner = IF_CLONE_INITIALIZER(CARP_IFNAME, carp_clone_creat static eventhandler_tag if_detach_event_tag; -static __inline u_int16_t +static __inline uint16_t carp_cksum(struct mbuf *m, int len) { return (in_cksum(m, len)); @@ -235,8 +235,8 @@ carp_cksum(struct mbuf *m, int len) static void carp_hmac_prepare(struct carp_softc *sc) { - u_int8_t version = CARP_VERSION, type = CARP_ADVERTISEMENT; - u_int8_t vhid = sc->sc_vhid & 0xff; + uint8_t version = CARP_VERSION, type = CARP_ADVERTISEMENT; + uint8_t vhid = sc->sc_vhid & 0xff; struct ifaddr_container *ifac; int i; #ifdef INET6 @@ -291,7 +291,7 @@ carp_hmac_prepare(struct carp_softc *sc) } static void -carp_hmac_generate(struct carp_softc *sc, u_int32_t counter[2], +carp_hmac_generate(struct carp_softc *sc, uint32_t counter[2], unsigned char md[20]) { SHA1_CTX sha1ctx; @@ -310,7 +310,7 @@ carp_hmac_generate(struct carp_softc *sc, u_int32_t counter[2], } static int -carp_hmac_verify(struct carp_softc *sc, u_int32_t counter[2], +carp_hmac_verify(struct carp_softc *sc, uint32_t counter[2], unsigned char md[20]) { unsigned char md2[20]; @@ -666,7 +666,7 @@ carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af) { struct ifnet *ifp = m->m_pkthdr.rcvif; struct carp_softc *sc; - u_int64_t tmp_counter; + uint64_t tmp_counter; struct timeval sc_tv, ch_tv; /* verify that the VHID is valid on the receiving interface */ @@ -1115,7 +1115,7 @@ carp_addrcount(struct carp_if *cif, struct in_ifaddr *ia, int type) int carp_iamatch(void *v, struct in_ifaddr *ia, - struct in_addr *isaddr, u_int8_t **enaddr) + struct in_addr *isaddr, uint8_t **enaddr) { struct carp_if *cif = v; struct carp_softc *vh; @@ -1256,7 +1256,7 @@ carp_forus(void *v, void *dhost) { struct carp_if *cif = v; struct carp_softc *vh; - u_int8_t *ena = dhost; + uint8_t *ena = dhost; /** * XXX: See here for check on MAC adr is not for virtual use @@ -1400,7 +1400,7 @@ static void carp_multicast_cleanup(struct carp_softc *sc) { struct ip_moptions *imo = &sc->sc_imo; - u_int16_t n = imo->imo_num_memberships; + uint16_t n = imo->imo_num_memberships; /* Clean up our own multicast memberships */ while (n-- > 0) { @@ -1989,7 +1989,7 @@ static int carp_looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct rtentry *rt) { - u_int32_t af; + uint32_t af; M_ASSERTPKTHDR(m); /* check if we have the packet header */ diff --git a/sys/netinet/ip_carp.h b/sys/netinet/ip_carp.h index 24945f2ef6..ffeacf8668 100644 --- a/sys/netinet/ip_carp.h +++ b/sys/netinet/ip_carp.h @@ -62,20 +62,20 @@ struct carp_header { #if BYTE_ORDER == LITTLE_ENDIAN - u_int8_t carp_type:4, + uint8_t carp_type:4, carp_version:4; #endif #if BYTE_ORDER == BIG_ENDIAN - u_int8_t carp_version:4, + uint8_t carp_version:4, carp_type:4; #endif - u_int8_t carp_vhid; /* virtual host id */ - u_int8_t carp_advskew; /* advertisement skew */ - u_int8_t carp_authlen; /* size of counter+md, 32bit chunks */ - u_int8_t carp_pad1; /* reserved */ - u_int8_t carp_advbase; /* advertisement interval */ - u_int16_t carp_cksum; - u_int32_t carp_counter[2]; + uint8_t carp_vhid; /* virtual host id */ + uint8_t carp_advskew; /* advertisement skew */ + uint8_t carp_authlen; /* size of counter+md, 32bit chunks */ + uint8_t carp_pad1; /* reserved */ + uint8_t carp_advbase; /* advertisement interval */ + uint16_t carp_cksum; + uint32_t carp_counter[2]; unsigned char carp_md[20]; /* SHA1 HMAC */ } __packed; @@ -161,9 +161,10 @@ int carp6_input (struct mbuf **, int *, int); int carp_output (struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *); int carp_iamatch (void *, struct in_ifaddr *, struct in_addr *, - u_int8_t **); + uint8_t **); struct ifaddr *carp_iamatch6(void *, struct in6_addr *); void *carp_macmatch6(void *, struct mbuf *, const struct in6_addr *); struct ifnet *carp_forus (void *, void *); -#endif +#endif /* _KERNEL */ + #endif /* _IP_CARP_H */