1 #ifndef CONNECT___NCBI_IPV6__H
2 #define CONNECT___NCBI_IPV6__H
47 unsigned char octet[16];
108 unsigned int ipv4,
size_t pfxlen);
124 const char*
str,
size_t len);
137 const char*
str,
size_t len);
150 const char*
str,
size_t len);
162 const char*
str,
size_t len);
176 const char*
str,
size_t len);
#define NCBI_XCONNECT_EXPORT
int NcbiIsEmptyIPv6(const TNCBI_IPv6Addr *addr)
Return non-zero if the address is empty (either as IPv6 or IPv4); return zero otherwise.
const char * NcbiStringToIPv6(TNCBI_IPv6Addr *addr, const char *str, size_t len)
Convert into an IPv6 address, the first "len" (or "strlen(str)" if "len" is 0) bytes of "str" from a ...
const char * NcbiDNSIPToAddr(TNCBI_IPv6Addr *addr, const char *str, size_t len)
Convert into an IPv6 address, the first "len" (or "strlen(str)" if "len" is 0) bytes of "str",...
unsigned int NcbiIPv6ToIPv4(const TNCBI_IPv6Addr *addr, size_t pfxlen)
Extract and return a network byte order IPv4 embedded address from an IPv6 address,...
char * NcbiAddrToString(char *buf, size_t bufsize, const TNCBI_IPv6Addr *addr)
Convert an IPv6 address into either a full-quad text IPv4 (for IPv4-mapped IPv6 addresses) or a hex c...
int NcbiIPv6Suffix(TNCBI_IPv6Addr *addr, unsigned int bits)
Retain last "bits" in a given "addr", resetting all remaining bits to 0.
char * NcbiIPv6ToString(char *buf, size_t bufsize, const TNCBI_IPv6Addr *addr)
Convert an IPv6 address into a hex colon-separated text form and store the result in the "buf" of siz...
int NcbiIsIPv4(const TNCBI_IPv6Addr *addr)
Return non-zero(true) if the address is a true IPv4 address (a mapped IPv4 address); return zero(fals...
const char * NcbiStringToIPv4(unsigned int *addr, const char *str, size_t len)
Convert into a network byte order IPv4 address, the first "len" (or "strlen(str)" if "len" is 0) byte...
int NcbiIsIPv4Ex(const TNCBI_IPv6Addr *addr, int compat)
Return non-zero(true) if the address is either a mapped IPv4 address or (optionally) an IPv4-compatib...
char * NcbiIPv4ToString(char *buf, size_t bufsize, unsigned int addr)
Convert a network byte order IPv4 into a full-quad text form and store the result in the "buf" of siz...
int NcbiIPv6Subnet(TNCBI_IPv6Addr *addr, unsigned int bits)
Retain first "bits" in a given "addr", resetting all remaining bits to 0.
const char * NcbiStringToAddr(TNCBI_IPv6Addr *addr, const char *str, size_t len)
Convert into an IPv6 address, the first "len" (or "strlen(str)" if "len" is 0) bytes of "str",...
int NcbiIsInIPv6Network(const TNCBI_IPv6Addr *base, unsigned int bits, const TNCBI_IPv6Addr *addr)
Return non-zero(true) if "addr" belongs to the network specified as CIDR "base/bits"; return a zero(f...
const char * NcbiAddrToDNS(char *buf, size_t bufsize, const TNCBI_IPv6Addr *addr)
Convert an IPv6 address into either .in-addr.arpa domain (for IPv4-mapped IPv6 addresses) or ....
int NcbiIPv4ToIPv6(TNCBI_IPv6Addr *addr, unsigned int ipv4, size_t pfxlen)
Embed a passed network byte order IPv4 address into an IPv6 address using the specified prefix length...
const char * NcbiIPToAddr(TNCBI_IPv6Addr *addr, const char *str, size_t len)
Convert into an IPv6 address, the first "len" (or "strlen(str)" if "len" is 0) bytes of "str" from ei...
static const char * str(char *buf, int n)