#include "netdissect.h"
#include "addrtoname.h"
+#include "addrtostr.h"
#include "llc.h"
#include "setsignal.h"
#include "extract.h"
static struct hnamemem dnaddrtable[HASHNAMESIZE];
static struct hnamemem ipxsaptable[HASHNAMESIZE];
-#if defined(INET6) && defined(_WIN32)
+#ifdef _WIN32
/*
* fake gethostbyaddr for Win2k/XP
* gethostbyaddr() returns incorrect value when AF_INET6 is passed
}
}
#define gethostbyaddr win32_gethostbyaddr
-#endif /* INET6 & _WIN32 */
+#endif /* _WIN32 */
-#ifdef INET6
struct h6namemem {
struct in6_addr addr;
char *name;
};
static struct h6namemem h6nametable[HASHNAMESIZE];
-#endif /* INET6 */
struct enamemem {
u_short e_addr0;
return (p->name);
}
-#ifdef INET6
/*
* Return a name for the IP6 address pointed to by ap. This address
* is assumed to be in network byte order.
return (p->name);
}
}
- cp = inet_ntop(AF_INET6, &addr, ntop_buf, sizeof(ntop_buf));
+ cp = addrtostr6(ap, ntop_buf, sizeof(ntop_buf));
p->name = strdup(cp);
if (p->name == NULL)
(*ndo->ndo_error)(ndo, "getname6: strdup(cp)");
return (p->name);
}
-#endif /* INET6 */
static const char hex[] = "0123456789abcdef";
return (p);
}
-#ifdef INET6
/* Return a zero'ed h6namemem struct and cuts down on calloc() overhead */
struct h6namemem *
newh6namemem(netdissect_options *ndo)
p = ptr++;
return (p);
}
-#endif /* INET6 */
/* Represent TCI part of the 802.1Q 4-octet tag as text. */
const char *