VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Functions
vlInetAddrUtils.h File Reference

This file declares useful defaults constants and static methods for IP address handling. More...

Go to the source code of this file.

Namespaces

 DtInetUtils
 Utility functions for manipulating IP addresses.
 

Macros

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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#define DtINET_IPv4_LINK_LOCAL_MASK   0xa9fe0000
 Useful bitmasks. More...
 
#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. More...
 
#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. More...
 

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. More...
 
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. More...
 
bool DtInetUtils::isIpv6AddrString (const DtString &addrString)
 Accepts a string representing an IPv6 address either standalone or as part of a network resource locator string. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
bool DtInetUtils::isBroadcastAddrString (const DtString &addrString, const DtString &netmaskString="")
 Accepts a string representing an IPv4 address (dotted decimal) or IPv6 address, either standalone or as part of a network resource locator string. More...
 
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. More...
 
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. More...
 
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. More...
 
DtU32 DtInetUtils::prefixLenToIpv4Netmask (DtU32 prefixLen)
 Convert a CIDR prefix length value to an IPv4 netmask in host byte order. More...
 
DtU32 DtInetUtils::netmaskToPrefixLen (DtU32 netmask)
 Convert an IPv4 netmask in host byte order to a CIDR prefix length value. More...
 
DtU32 DtInetUtils::convertStringToNetmask (DtString maskString)
 Accept a string reference representing either an IPv4 netmask in dotted decimal notation or a CIDR prefix length (eg. More...
 
DtU32 DtInetUtils::convertStringToPrefixLen (DtString maskString)
 Accept a string reference representing either an IPv4 or IPv6 netmask prefix length (eg. More...
 
DtInetAddrDtInetUtils::getPrimaryBroadcastAddress (bool preferIpv6=false)
 Attempts to find the primary device capable of broadcast and returns the broadcast address of the device. More...
 
const char * DtInetUtils::removeZoneIndex (char *addrStr)
 Attempts to remove the zone index from the end of an IP string. More...
 

Detailed Description

This file declares useful defaults constants and static methods for IP address handling.

Macro Definition Documentation

#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.


Document ID: Generated on Wed Mar 27 02:04:30 EDT 2024 from SVN revision 264570
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)