31#define V4MAPPREFIX "::ffff:"
32#define HOSTNAMELEN 1025
35#define MTUSIZE IP6MLMTU
44#define FMT_IP4 IP4_FMT
45#define FMT_IP6 IP6_FMT
50#define ip_address ip4_address
53unsigned int ip4_cidr(
char *,
char [4],
unsigned long *);
54unsigned int ip4_fmt(
char *,
char [4]);
55unsigned int ip4_scan(
const char *,
char [4]);
57unsigned int ia4_fmt(
char *,
char [4]);
59const static char V4loopback[4] = {127,0,0,1};
60const static char V4localnet[4] = {0,0,0,0};
61const static char V4broadcast[4] = {-1,-1,-1,-1};
86unsigned int ip6_cidr(
char *,
char [16],
unsigned long *);
87unsigned int ip6_fmt(
char *,
char [16]);
90unsigned int ip6_scan(
const char *,
char [16]);
93unsigned int ia6_fmt(
char *,
char [16]);
95static const unsigned char V4mappedprefix[12] = {0,0,0,0, 0,0,0,0, 0,0,0xff,0xff};
96static const unsigned char V46loopback[16] = {0,0,0,0, 0,0,0,0, 0,0,0xff,0xff, 127,0,0,1};
97static const unsigned char V6loopback[16] = {0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1};
98static const unsigned char V6localnet[16] = {0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0};
99static const unsigned char V6linklocal[2] = {0xfe,0x80};
104#define V6any V6localnet
105#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 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 ip6_bytestring(stralloc *, char *, int)
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