![]() |
VR-Link API Documentation for HLA 1.3
|
This file declares useful defaults constants and static methods for IP address handling. More...
Go to the source code of this file.
Namespaces | |
| namespace | DtInetUtils |
| Utility functions for manipulating IP addresses. | |
Defines | |
InetAddrUtils Macros | |
Default IP address is protocol-dependent, IPv4 or IPv6 | |
| #define | DtUSE_DEFAULT_INET_ADDR 0 |
| Addresses supplied in string format may be expressed using "network
resource locator" notation which list the address and a possible modifier such as a port or netmask. | |
| #define | DtINET_IGMPv4_MGMT_GROUP_ADDR 0xE0000001 |
| Addresses supplied in string format may be expressed using "network
resource locator" notation which list the address and a possible modifier such as a port or netmask. | |
| #define | DtInet_IPv4_ADDR_LEN sizeof( struct in_addr ) |
| Addresses supplied in string format may be expressed using "network
resource locator" notation which list the address and a possible modifier such as a port or netmask. | |
| #define | DtInet_IPv6_ADDR_LEN sizeof( struct in6_addr ) |
| Addresses supplied in string format may be expressed using "network
resource locator" notation which list the address and a possible modifier such as a port or netmask. | |
| #define | DtNetResLocType_NONE 0 |
| Addresses supplied in string format may be expressed using "network
resource locator" notation which list the address and a possible modifier such as a port or netmask. | |
| #define | DtNetResLocType_PORT 1 |
| Addresses supplied in string format may be expressed using "network
resource locator" notation which list the address and a possible modifier such as a port or netmask. | |
| #define | DtNetResLocType_NETMASK 2 |
| Addresses supplied in string format may be expressed using "network
resource locator" notation which list the address and a possible modifier such as a port or netmask. | |
| #define | DtNetResLocType_PREFIXLEN 3 |
| Addresses supplied in string format may be expressed using "network
resource locator" notation which list the address and a possible modifier such as a port or netmask. | |
| #define | DtINET_IPv4_LINK_LOCAL_MASK 0xa9fe0000 |
| Useful bitmasks. | |
| #define | DtINET_IPv4_LOOPBACK_MASK 0x7f000001 |
| Addresses supplied in string format may be expressed using "network
resource locator" notation which list the address and a possible modifier such as a port or netmask. | |
| #define | DtINET_IPv6_LINK_LOCAL_MASK 0xfe80 |
| Addresses supplied in string format may be expressed using "network
resource locator" notation which list the address and a possible modifier such as a port or netmask. | |
Enumerations | |
InetAddrUtils Types | |
| enum | DtInetUtils::DtInetAddrFamily { DtInetUtils::DtInetAddrFamily_INVALID = 0, DtInetUtils::DtInetAddrFamily_IPv4 = 4, DtInetUtils::DtInetAddrFamily_IPv6 = 6, DtInetUtils::DtInetAddrFamily_Both = 99 } |
Functions | |
| bool | DtInetUtils::IN6_IS_ADDR_BROADCAST (const struct in6_addr *a) |
InetAddrUtils Static Functions | |
Accepts a string representing an IPv4 address or IPv6 address, either standalone or as part of a network resource locator string. Returns the equivalent DtInetAddrFamily if the notation conforms to a valid form for the address type. Returns DtInetAddrFamily_INVALID otherwise. Note that if the string is a network resource locator string with a valid address part but an invalid modifier the whole string will be considered invalid. | |
| DtInetAddrFamily | DtInetUtils::addrStringFamily (const DtString &addrString) |
| Accepts a string representing an IPv4 address (dotted decimal) either standalone or as part of a network resource locator string. | |
| bool | DtInetUtils::isIpv4AddrString (const DtString &addrString) |
| Accepts a string representing an IPv4 address (dotted decimal) either standalone or as part of a network resource locator string. | |
| bool | DtInetUtils::isIpv6AddrString (const DtString &addrString) |
| Accepts a string representing an IPv6 address either standalone or as part of a network resource locator string. | |
| bool | DtInetUtils::isLoopbackAddrString (const DtString &addrString) |
| Accepts a string representing an IPv4 address (dotted decimal) or IPv6 address, either standalone or as part of a network resource locator string. | |
| bool | DtInetUtils::isLocalhostAddrString (const DtString &addrString) |
| Accepts a string representing an IPv4 address (dotted decimal) or IPv6 address, either standalone or as part of a network resource locator string. | |
| bool | DtInetUtils::isLinkLocalAddrString (const DtString &addrString) |
| Accepts a string representing an IPv4 address (dotted decimal) or IPv6 address, either standalone or as part of a network resource locator string. | |
| bool | DtInetUtils::isMulticastAddrString (const DtString &addrString) |
| Accepts a string representing an IPv4 address (dotted decimal) or IPv6 address, either standalone or as part of a network resource locator string. | |
| bool | DtInetUtils::isBroadcastAddrString (const DtString &addrString) |
| Accepts a string representing an IPv4 address (dotted decimal) or IPv6 address, either standalone or as part of a network resource locator string. | |
| DtInetAddrFamily | DtInetUtils::parseNetResLoc (const DtString &nrl, DtString &parsedNrl, DtString &modifier, int &modifierType) |
| Accept a string reference representing either a network resource locator and parses the string into the hostname, device name, or address with any optional modifier components and indicates what type of modifier was found. | |
| bool | DtInetUtils::parseIpv4NetResLoc (const DtString &nrl, DtString &parsedNrl, DtString &modifier, int &modifierType) |
| Accept a string representing either an IPv4 address in dotted decimal format or an IPv6 address in hexadecimal format with or without modifiers. | |
| bool | DtInetUtils::parseIpv6NetResLoc (const DtString &nrl, DtString &parsedNrl, DtString &modifier, int &modifierType) |
| Accepts a string representing an IPv4 address (dotted decimal) either standalone or as part of a network resource locator string. | |
| DtU32 | DtInetUtils::prefixLenToIpv4Netmask (DtU32 prefixLen) |
| Convert a CIDR prefix length value to an IPv4 netmask in host byte order. | |
| DtU32 | DtInetUtils::netmaskToPrefixLen (DtU32 netmask) |
| Convert an IPv4 netmask in host byte order to a CIDR prefix length value. | |
| DtU32 | DtInetUtils::convertStringToNetmask (DtString maskString) |
| Accept a string reference representing either an IPv4 netmask in dotted decimal notation or a CIDR prefix length (eg. | |
| DtU32 | DtInetUtils::convertStringToPrefixLen (DtString maskString) |
| Accept a string reference representing either an IPv4 or IPv6 netmask prefix length (eg. | |
| DtInetAddr * | DtInetUtils::getPrimaryBroadcastAddress (bool preferIpv6=false) |
| Attempts to find the primary device capable of broadcast and returns the broadcast address of the device. | |
| const char * | DtInetUtils::removeZoneIndex (char *addrStr) |
| Attempts to remove the zone index from the end of an IP string. | |
This file declares useful defaults constants and static methods for IP address handling.
| #define DtINET_IGMPv4_MGMT_GROUP_ADDR 0xE0000001 |
Addresses supplied in string format may be expressed using "network resource locator" notation which list the address and a possible modifier such as a port or netmask.
| #define DtInet_IPv4_ADDR_LEN sizeof( struct in_addr ) |
Addresses supplied in string format may be expressed using "network resource locator" notation which list the address and a possible modifier such as a port or netmask.
| #define DtINET_IPv4_LINK_LOCAL_MASK 0xa9fe0000 |
Useful bitmasks.
| #define DtINET_IPv4_LOOPBACK_MASK 0x7f000001 |
Addresses supplied in string format may be expressed using "network resource locator" notation which list the address and a possible modifier such as a port or netmask.
| #define DtInet_IPv6_ADDR_LEN sizeof( struct in6_addr ) |
Addresses supplied in string format may be expressed using "network resource locator" notation which list the address and a possible modifier such as a port or netmask.
| #define DtINET_IPv6_LINK_LOCAL_MASK 0xfe80 |
Addresses supplied in string format may be expressed using "network resource locator" notation which list the address and a possible modifier such as a port or netmask.
| #define DtNetResLocType_NETMASK 2 |
Addresses supplied in string format may be expressed using "network resource locator" notation which list the address and a possible modifier such as a port or netmask.
| #define DtNetResLocType_NONE 0 |
Addresses supplied in string format may be expressed using "network resource locator" notation which list the address and a possible modifier such as a port or netmask.
| #define DtNetResLocType_PORT 1 |
Addresses supplied in string format may be expressed using "network resource locator" notation which list the address and a possible modifier such as a port or netmask.
| #define DtNetResLocType_PREFIXLEN 3 |
Addresses supplied in string format may be expressed using "network resource locator" notation which list the address and a possible modifier such as a port or netmask.
| #define DtUSE_DEFAULT_INET_ADDR 0 |
Addresses supplied in string format may be expressed using "network resource locator" notation which list the address and a possible modifier such as a port or netmask.