#endif /* _WIN32 */
struct h6namemem {
- struct in6_addr addr;
+ nd_ipv6 addr;
char *name;
struct h6namemem *nxt;
};
{
struct hostent *hp;
union {
- struct in6_addr addr;
+ nd_ipv6 addr;
struct for_hash_addr {
char fill[14];
uint16_t d;
if (memcmp(&p->addr, &addr, sizeof(addr)) == 0)
return (p->name);
}
- p->addr = addr.addr;
+ memcpy(p->addr, addr.addr, sizeof(nd_ipv6));
p->nxt = newh6namemem(ndo);
/*
decode_prefix6(netdissect_options *ndo,
const u_char *pd, u_int itemlen, char *buf, size_t buflen)
{
- struct in6_addr addr;
+ nd_ipv6 addr;
u_int plen, plenbytes;
ND_TCHECK_1(pd);
ITEMCHECK(plenbytes);
memcpy(&addr, pd + 1, plenbytes);
if (plen % 8) {
- addr.s6_addr[plenbytes - 1] &=
+ addr[plenbytes - 1] &=
((0xff00 >> (plen % 8)) & 0xff);
}
nd_snprintf(buf, buflen, "%s/%u", ip6addr_string(ndo, (const u_char *)&addr), plen);
decode_labeled_prefix6(netdissect_options *ndo,
const u_char *pptr, u_int itemlen, char *buf, size_t buflen)
{
- struct in6_addr addr;
+ nd_ipv6 addr;
u_int plen, plenbytes;
/* prefix length and label = 4 bytes */
ND_TCHECK_LEN(pptr + 4, plenbytes);
memcpy(&addr, pptr + 4, plenbytes);
if (plen % 8) {
- addr.s6_addr[plenbytes - 1] &=
+ addr[plenbytes - 1] &=
((0xff00 >> (plen % 8)) & 0xff);
}
/* the label may get offsetted by 4 bits so lets shift it right */
decode_labeled_vpn_prefix6(netdissect_options *ndo,
const u_char *pptr, char *buf, size_t buflen)
{
- struct in6_addr addr;
+ nd_ipv6 addr;
u_int plen;
ND_TCHECK_1(pptr);
ND_TCHECK_LEN(pptr + 12, (plen + 7) / 8);
memcpy(&addr, pptr + 12, (plen + 7) / 8);
if (plen % 8) {
- addr.s6_addr[(plen + 7) / 8 - 1] &=
+ addr[(plen + 7) / 8 - 1] &=
((0xff00 >> (plen % 8)) & 0xff);
}
/* the label may get offsetted by 4 bits so lets shift it right */
case T_A6:
{
- struct in6_addr a;
+ nd_ipv6 a;
int pbit, pbyte;
char ntop_buf[INET6_ADDRSTRLEN];
} else if (pbit < 128) {
if (!ND_TTEST_LEN(cp + 1, sizeof(a) - pbyte))
return(NULL);
- memset(&a, 0, sizeof(a));
- memcpy(&a.s6_addr[pbyte], cp + 1, sizeof(a) - pbyte);
+ memset(a, 0, sizeof(a));
+ memcpy(a + pbyte, cp + 1, sizeof(a) - pbyte);
ND_PRINT(" %u %s", pbit,
addrtostr6(&a, ntop_buf, sizeof(ntop_buf)));
}
#ifdef HAVE_LIBCRYPTO
union inaddr_u {
nd_ipv4 in4;
- struct in6_addr in6;
+ nd_ipv6 in6;
};
struct sa_list {
struct sa_list *next;
const struct nd_opt_homeagent_info *oph;
const struct nd_opt_route_info *opri;
const u_char *cp, *ep, *domp;
- struct in6_addr in6;
+ nd_ipv6 in6;
size_t l;
u_int i;
* calculation.
*/
static void
-ip6_finddst(netdissect_options *ndo, struct in6_addr *dst,
+ip6_finddst(netdissect_options *ndo, nd_ipv6 *dst,
const struct ip6_hdr *ip6)
{
const u_char *cp;
u_int len, u_int covlen, uint8_t next_proto)
{
struct {
- struct in6_addr ph_src;
- struct in6_addr ph_dst;
+ nd_ipv6 ph_src;
+ nd_ipv6 ph_dst;
uint32_t ph_len;
uint8_t ph_zero[3];
uint8_t ph_nxt;
/* pseudo-header */
memset(&ph, 0, sizeof(ph));
- UNALIGNED_MEMCPY(&ph.ph_src, ip6->ip6_src, sizeof (struct in6_addr));
+ UNALIGNED_MEMCPY(&ph.ph_src, ip6->ip6_src, sizeof (nd_ipv6));
nh = GET_U_1(ip6->ip6_nxt);
switch (nh) {
default:
UNALIGNED_MEMCPY(&ph.ph_dst, ip6->ip6_dst,
- sizeof (struct in6_addr));
+ sizeof (nd_ipv6));
break;
}
ph.ph_len = htonl(len);
static int ninitiator = 0;
union inaddr_u {
nd_ipv4 in4;
- struct in6_addr in6;
+ nd_ipv6 in6;
};
static struct {
cookie_t initiator;
struct xid_map_entry {
uint32_t xid; /* transaction ID (net order) */
int ipver; /* IP version (4 or 6) */
- struct in6_addr client; /* client IP address (net order) */
- struct in6_addr server; /* server IP address (net order) */
+ nd_ipv6 client; /* client IP address (net order) */
+ nd_ipv6 server; /* server IP address (net order) */
uint32_t proc; /* call proc number (host order) */
uint32_t vers; /* program version (host order) */
};
};
struct tha6 {
- struct in6_addr src;
- struct in6_addr dst;
+ nd_ipv6 src;
+ nd_ipv6 dst;
u_int port;
};