33#define V4MAPPREFIX "::ffff:"
34#define HOSTNAMELEN 1025
37#define MTUSIZE IP6MLMTU
46#define FMT_IP4 IP4_FMT
47#define FMT_IP6 IP6_FMT
52#define ip_address ip4_address
55unsigned int ip4_cidr(
char *,
char [4],
unsigned long *);
56unsigned int ip4_fmt(
char *,
char [4]);
57unsigned int ip4_scan(
const char *,
char [4]);
59unsigned int ia4_fmt(
char *,
char [4]);
61const static char V4loopback[4] = {127,0,0,1};
62const static char V4localnet[4] = {0,0,0,0};
63const static char V4broadcast[4] = {-1,-1,-1,-1};
88unsigned int ip6_cidr(
char *,
char [16],
unsigned long *);
89unsigned int ip6_fmt(
char *,
char [16]);
92unsigned int ip6_scan(
const char *,
char [16]);
95unsigned int ia6_fmt(
char *,
char [16]);
97static const char V4mappedprefix[12] = {0,0,0,0, 0,0,0,0, 0,0,0xff,0xff};
98static const char V46loopback[16] = {0,0,0,0, 0,0,0,0, 0,0,0xff,0xff, 127,0,0,1};
99static const char V6loopback[16] = {0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1};
100static const char V6localnet[16] = {0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0};
101static const char V6linklocal[2] = {0xfe,0x80};
106#define V6any V6localnet
107#define ip6_isv4mapped(ip) (byte_equal(ip,12,V4mappedprefix))
unsigned int ip4_scanbracket(const char *, char[4])
ip4_scanbracket parse IPv4 address string enclosed in brackets and convert to IP address array
unsigned int ip4_fmt(char *, char[4])
ip4_fmt converts IPv4 address to dotted decimal string format
unsigned int ip6_bytestring(stralloc *, char[16], int)
ip6_bytestring parse IPv6 address and represent as char string with length prefix
unsigned int ip4_scan(const char *, char[4])
ip4_scan parse IPv4 address string and convert to IP address array
unsigned int ip6_scan(const char *, char[16])
ip6_scan parse compactified IPv6 address string and convert to IPv6 address array
unsigned int ip4_bytestring(stralloc *, char[4], int)
ip4_bytestring parse IPv4 address and represent as char string with length prefix
unsigned int ip6_scanbracket(const char *, char[16])
ip6_scanbracket parse IPv6 string address enclosed in brackets
unsigned int ip6_ifscan(char *, char[16], stralloc *)
ip6_ifscan parse compactified IPv6 address string concatinated with the interface name: fe80::1eth0
unsigned int ia6_fmt(char *, char[16])
ia6_fmt convert IPv6 address to inverse DNS nibble format 1.2.3.4.5.6.7.8.9.a.b.c....
unsigned int ip6_cidr(char *, char[16], unsigned long *)
ip6_cidr parse compactified IPv6 address string concatinated with the prefix length: fe80::1/64
unsigned int ip4_cidr(char *, char[4], unsigned long *)
ip4_cidr parse IPv4 address string concatinated with the prefix length: 192.168.1/24
unsigned int ip6_fmt(char *, char[16])
ip6_fmt convert IPv6 address to compactified IPv6 address string
int fromhex(unsigned char)
unsigned int ia4_fmt(char *, char[4])
ia4_fmt converts IPv4 address into DNS inverse nibble format
unsigned int ip6_scan_flat(const char *, char[16])
ip6_scan_flat convert IPv6 address string to IPv6 address array
unsigned int ip6_fmt_flat(char *, char[16])
ip6_fmt_flat convert IPv6 address to IPv6 address string