Defines | |
#define | IP_DELIMITER_PREFIX '/' |
#define | IP_DESIGNATION_ALL "all" |
#define | IP_DESIGNATION_DEFAULT "default" |
#define | IP_DESIGNATION_ANY_UNICAST "any-unicast" |
#define | IP_DESIGNATION_ANY_MULTICAST "any-multicast" |
#define | IPV4_MASK_ANY_UNICAST 0x00000001 |
#define | IPV4_MASK_ANY_MULTICAST 0x00000002 |
#define | IP_ADDR_BUFLEN (INET_ADDRSTRLEN * 2) |
IP_ADDR_BUFLEN includes NULL terminator and accomodates "255.255.255.255/32" or "255.255.255.255/255.255.255.255" | |
#define | IP_ADDR_BYTE_MAX 255 |
#define | IP_ADDR_BYTE_NUM (sizeof(struct in_addr)) |
#define | IPV6_ADDR_BUFLEN (INET6_ADDRSTRLEN * 2) |
IPv6 address buffer length. | |
#define | PIF_LEN (1<<0) |
Flags for parse_ipaddr(). Allow prefix length (see above). | |
#define | PIF_LENREQ (1<<1) |
Require prefix length. | |
#define | PIF_FULL (1<<2) |
Require full specification (implied w/IPv6). | |
#define | PIF_MASK (1<<3) |
/mask can substitute for /prefix-length | |
#define | PIF_DEFAULT (1<<4) |
"all" or "default" -> 0/0 | |
#define | PIF_AREAID (1<<5) |
OSPF area id syntax; grim. | |
#define | PIF_LENOPT (1<<6) |
Do not assume prefix length (see above). | |
#define | PIF_PREFIXONLY (1<<7) |
Prefix only: require host bits to be zero. | |
#define | PIF_MULTICAST_ONLY (1<<8) |
Allow Multicast address only. | |
#define | PIF_ANYCAST (1<<9) |
'any-unicast' | |
#define | PIF_MARTIAN (1<<10) |
check for martian addresses | |
#define | PIF_UNICASTONLY (1<<11) |
Allow Unicast address only. | |
#define | IN_ADDR_BYTE(_a, _b) (((const unsigned char *)&((_a)->s_addr))[_b]) |
#define | IN6_ADDR_HSHORT(_a, _s) ntohs(_a->__u6_addr.__u6_addr16[_s]) |
Functions | |
parse_retcode_t | parse_ipaddr (int *af, const char *str, unsigned long ipflags, void *address, size_t address_size, int *pfxseen, size_t *pfxlen, int *maskseen, void *mask, size_t mask_size, char *msg, size_t msgsize) |
Parses the various forms of IP addresses directed by ipflags (PIF_* ). | |
size_t | format_ipaddr (int af, const void *address, boolean canonicalize, int pfxseen, size_t pfxlen, int maskseen, const void *mask, char *out, size_t outsize) |
Produces textual form of address, followed by prefix or netmask. | |
size_t | format_ipv6addr_partial (const void *address, size_t pfxlen, boolean showpfxlen, char *out, size_t outsize) |
Produces textual form of address with bits masked, followed by prefix length, if required. | |
char * | format_in6_addr (const void *vaddr, int plen, char *buf, int buflen, int null_terminate) |
Formats the IPv6 address using the ::-notation for compressing away a sequence of low-order zeroes. | |
char * | format_in6_prefix (const void *vaddr, int plen, char *buf, int buflen, int null_terminate) |
Formats the IPv6 prefix into the buffer, using the ::-notation for compressing away a sequence of low-order zeroes. | |
boolean | valid_ipv4_hostaddr (const char *address) |
Verifies that the IPv4 address is a valid host address. | |
boolean | parse_ipaddr_is_unicast (int af, void *address) |
Verifies that the IP address is one of the well known unicast addresses. |
|
IPv6 address buffer length.
|
|
Flags for parse_ipaddr(). Allow prefix length (see above). PIF_LENOPT indicates that if the prefix length is not specified, then this address is not meant have a prefix associated with it: so DO NOT provide a value for prefix length. The PIF_LENOPT option has no effect on the operation of parse_ipaddr. PIF_LENOPT is used by the type conversion methods (convert.c). The type conversion methods use PIF_LEN && !PIF_LENOPT to indicate that the prefix length should always part of the result string (whether the prefix length was specified or not). The type conversion methods use PIF_LEN && PIF_LENOPT to indicate that the prefix length will be part of the result string only if it was specified to begin with. |
|
Formats the IPv6 address using the ::-notation for compressing away a sequence of low-order zeroes.
|
|
Formats the IPv6 prefix into the buffer, using the ::-notation for compressing away a sequence of low-order zeroes.
|
|
Produces textual form of address, followed by prefix or netmask.
|
|
Produces textual form of address with bits masked, followed by prefix length, if required.
|
|
Parses the various forms of IP addresses directed by ipflags (
|
|
Verifies that the IP address is one of the well known unicast addresses. The address cannot be a multicast, broadcast address or invalid.
|
|
Verifies that the IPv4 address is a valid host address. The address cannot be a multicast or broadcast address.
|