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
} 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);
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));
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
}
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;
}
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];
{
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 */
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;
{
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
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) {
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 */
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;
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 */