14 #ifdef DtUSE_UTILITIES_NAMESPACE
15 namespace DtUSE_UTILITIES_NAMESPACE
28 #define DtUSE_DEFAULT_INET_ADDR 0
29 #define DtINET_IGMPv4_MGMT_GROUP_ADDR 0xE0000001 // == 224.0.0.1
31 #define DtInet_IPv4_ADDR_LEN sizeof( struct in_addr )
32 #define DtInet_IPv6_ADDR_LEN sizeof( struct in6_addr )
37 #define DtNetResLocType_NONE 0
38 #define DtNetResLocType_PORT 1
39 #define DtNetResLocType_NETMASK 2
40 #define DtNetResLocType_PREFIXLEN 3
44 #define DtINET_IPv4_LINK_LOCAL_MASK 0xa9fe0000 // == 169.254.0.0/16
45 #define DtINET_IPv4_LOOPBACK_MASK 0x7f000001 // == 127.0.0.1
46 #define DtINET_IPv6_LINK_LOCAL_MASK 0xfe80 // uppermost 10 bits of address
141 DtString& modifier,
int& modifierType);
150 DtString& modifier,
int& modifierType);
152 DtString& modifier,
int& modifierType);
187 return ( IN6_IS_ADDR_MC_LINKLOCAL(a)
188 && ((a->s6_bytes[2] & 0xf) == 0) && ((a->s6_bytes[3] & 0xf) == 0)
189 && ((a->s6_bytes[4] & 0xf) == 0) && ((a->s6_bytes[5] & 0xf) == 0)
190 && ((a->s6_bytes[6] & 0xf) == 0) && ((a->s6_bytes[7] & 0xf) == 0)
191 && ((a->s6_bytes[8] & 0xf) == 0) && ((a->s6_bytes[9] & 0xf) == 0)
192 && ((a->s6_bytes[10] & 0xf) == 0) && ((a->s6_bytes[11] & 0xf) == 0)
193 && ((a->s6_bytes[12] & 0xf) == 0) && ((a->s6_bytes[13] & 0xf) == 0)
194 && ((a->s6_bytes[14] & 0xf) == 0) && ((a->s6_bytes[15] & 0xf) == 1) );
199 return ( IN6_IS_ADDR_MC_LINKLOCAL(a)
200 && ((a->s6_addr[2] & 0xf) == 0) && ((a->s6_addr[3] & 0xf) == 0)
201 && ((a->s6_addr[4] & 0xf) == 0) && ((a->s6_addr[5] & 0xf) == 0)
202 && ((a->s6_addr[6] & 0xf) == 0) && ((a->s6_addr[7] & 0xf) == 0)
203 && ((a->s6_addr[8] & 0xf) == 0) && ((a->s6_addr[9] & 0xf) == 0)
204 && ((a->s6_addr[10] & 0xf) == 0) && ((a->s6_addr[11] & 0xf) == 0)
205 && ((a->s6_addr[12] & 0xf) == 0) && ((a->s6_addr[13] & 0xf) == 0)
206 && ((a->s6_addr[14] & 0xf) == 0) && ((a->s6_addr[15] & 0xf) == 1) );
212 #ifdef DtUSE_UTILITIES_NAMESPACE
bool isIpv6AddrString(const DtString &addrString)
Accepts a string representing an IPv6 address either standalone or as part of a network resource loca...
DtInetAddrFamily addrStringFamily(const DtString &addrString)
Accepts a string representing an IPv4 address (dotted decimal) either standalone or as part of a netw...
Definition: vlInetAddrUtils.h:58
bool isLoopbackAddrString(const DtString &addrString)
Accepts a string representing an IPv4 address (dotted decimal) or IPv6 address, either standalone or ...
Definition: vlInetAddrUtils.h:60
Contains the DtString class declaration.
bool IN6_IS_ADDR_BROADCAST(const struct in6_addr *a)
Definition: vlInetAddrUtils.h:197
bool isLocalhostAddrString(const DtString &addrString)
Accepts a string representing an IPv4 address (dotted decimal) or IPv6 address, either standalone or ...
bool 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 he...
DtU32 prefixLenToIpv4Netmask(DtU32 prefixLen)
Convert a CIDR prefix length value to an IPv4 netmask in host byte order.
Definition: vlInetAddrUtils.h:59
bool 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 netw...
Definition: vlInetAddrUtils.h:57
DtInetAddrFamily
Definition: vlInetAddrUtils.h:55
DtInetAddrFamily 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 t...
DtInetAddr * getPrimaryBroadcastAddress(bool preferIpv6=false)
Attempts to find the primary device capable of broadcast and returns the broadcast address of the dev...
Represents a IPv4 or IPv6 address.
Definition: vlInetAddr.h:36
const char * removeZoneIndex(char *addrStr)
Attempts to remove the zone index from the end of an IP string.
DtU32 netmaskToPrefixLen(DtU32 netmask)
Convert an IPv4 netmask in host byte order to a CIDR prefix length value.
DtU32 convertStringToPrefixLen(DtString maskString)
Accept a string reference representing either an IPv4 or IPv6 netmask prefix length (eg...
bool isMulticastAddrString(const DtString &addrString)
Accepts a string representing an IPv4 address (dotted decimal) or IPv6 address, either standalone or ...
DtU32 convertStringToNetmask(DtString maskString)
Accept a string reference representing either an IPv4 netmask in dotted decimal notation or a CIDR pr...
bool isIpv4AddrString(const DtString &addrString)
Accepts a string representing an IPv4 address (dotted decimal) either standalone or as part of a netw...
bool isBroadcastAddrString(const DtString &addrString, const DtString &netmaskString="")
Accepts a string representing an IPv4 address (dotted decimal) or IPv6 address, either standalone or ...
unsigned long DtU32
A 32 bit unsigned integer value.
Definition: vlMachineTypes.h:153
bool isLinkLocalAddrString(const DtString &addrString)
Accepts a string representing an IPv4 address (dotted decimal) or IPv6 address, either standalone or ...
Instances of DtString are used to represent strings.
Definition: vlString.h:36
This file declares useful defaults constants and static methods employed with the networking abstract...
#define DT_DLL_VLUTIL
Definition: vlMachineTypes.h:109