Generic structure to contain a network address. More...
Public Types | |
enum | eAddressType { TYPE_UNKNOWN , TYPE_IPV4 , TYPE_IPV6 , TYPE_IPX , TYPE_APPLETALK , TYPE_COUNT } |
Enumeration of supported network addressing types. More... | |
Public Member Functions | |
eError | ToSocketAddr (sockaddr *pOutput) const |
Convert a NetAddr_t into a sockaddr. | |
eError | ToSocketAddr (sockaddr_in *pOutput) const |
Calls ToSocketAddr(sockaddr *) const. | |
eError | ToSocketAddr (sockaddr_at *pOutput) const |
Calls ToSocketAddr(sockaddr *) const. | |
eError | ToSocketAddr (sockaddr_ipx *pOutput) const |
Calls ToSocketAddr(sockaddr *) const. | |
eError | ToSocketAddr (sockaddr_in6 *pOutput) const |
Calls ToSocketAddr(sockaddr *) const. | |
eError | ToSocketAddr (sockaddr_storage *pOutput) const |
Calls ToSocketAddr(sockaddr *) const. | |
eError | FromSocketAddr (const sockaddr *pInput) |
Convert a sockaddr into a NetAddr_t. | |
eError | FromSocketAddr (const sockaddr_in *pInput) |
Calls FromSocketAddr(const sockaddr *) | |
eError | FromSocketAddr (const sockaddr_at *pInput) |
Calls FromSocketAddr(const sockaddr *) | |
eError | FromSocketAddr (const sockaddr_ipx *pInput) |
Calls FromSocketAddr(const sockaddr *) | |
eError | FromSocketAddr (const sockaddr_in6 *pInput) |
Calls FromSocketAddr(const sockaddr *) | |
eError | FromSocketAddr (const sockaddr_storage *pInput) |
Calls FromSocketAddr(const sockaddr *) | |
uint_t | ToOTAddress (OTAddress *pOutput) const |
Convert a NetAddr_t into a OTAddress. | |
uint_t | FromOTAddress (const OTAddress *pInput) |
Convert a OTAddress into a NetAddr_t. | |
eError | ToString (String *pOutput, uint_t bAppendPort=0) const noexcept |
Given a network address, convert it into a readable string. | |
uint_t | Compare (const NetAddr_t *pInput) const noexcept |
Compare two network addresses for equality. | |
uint_t | operator== (const NetAddr_t &rInput) const noexcept |
Return TRUE if they are equal. | |
uint_t | operator!= (const NetAddr_t &rInput) const noexcept |
Return TRUE if they are not equal. | |
uint_t | IsBroadcast (void) const noexcept |
Test if the address is a broadcast address. | |
uint_t | IsUnspecified (void) const noexcept |
Test if the address is an unspecified address. | |
Public Attributes | ||
eAddressType | m_uType | |
Type of network address. | ||
union { | ||
struct { | ||
uint_t m_uPort | ||
TCP/IP, UDP Port (Is valid for both IPv4 and IPv6) More... | ||
uint32_t m_uIP | ||
IPv4 Internet IP. More... | ||
} IPv4 | ||
IPv4 address. More... | ||
struct { | ||
uint_t m_uPort | ||
TCP/IP, UDP Port (Is valid for both IPv4 and IPv6) More... | ||
uint8_t m_IP [16] | ||
IPv6 Internet IP (64 bit aligned) More... | ||
} IPv6 | ||
IPv6 address. More... | ||
struct { | ||
uint_t m_uSocket | ||
IPX/SPX Socket (Port) More... | ||
uint8_t m_Net [4] | ||
IPX/SPX Network. More... | ||
uint8_t m_Node [6] | ||
IPX/SPX Node address. More... | ||
} IPX | ||
IPX/SPX address. More... | ||
struct { | ||
uint_t m_uSocket | ||
Appletalk socket (Port) More... | ||
uint_t m_uNetwork | ||
Appletalk network. More... | ||
uint_t m_uNodeID | ||
Appletalk node. More... | ||
uint_t m_uDDPType | ||
Appletalk protocol ID. More... | ||
} APPLETALK | ||
Appletalk address. More... | ||
} | U | |
Generic structure to contain a network address.
This structure is a union that contains all supported network address types for all supported network protocols.
The member m_uType denotes the actual protocol contained and then only the union member that matches the the protocol type is valid.
Enumeration of supported network addressing types.
There are four address types supported, IPv4, IPv6, AppleTalk and IPX
|
noexcept |
Compare two network addresses for equality.
Test of two NetAddr_t structures are effectively equal
uint_t BURGER_API Burger::NetAddr_t::FromOTAddress | ( | const OTAddress * | pInput | ) |
Convert a OTAddress into a NetAddr_t.
Convert a OTAddress into a NetAddr_t structure.
Supports AppleTalk and IPv4
pInput | Pointer to a OTAddress to read the socket address from |
Burger::eError BURGER_API Burger::NetAddr_t::FromSocketAddr | ( | const sockaddr * | pInput | ) |
Convert a sockaddr into a NetAddr_t.
Convert a sockaddr into a NetAddr_t structure.
Supports AppleTalk, IPX, IPv4 and IPv6
pInput | Pointer to a sockaddr to read the socket address from |
|
inline |
Calls FromSocketAddr(const sockaddr *)
Convenience routine to map a sockaddr_at to a sockaddr to call FromSocketAddr(const sockaddr *)
pInput | Pointer to a sockaddr_at to read the socket address from |
|
inline |
Calls FromSocketAddr(const sockaddr *)
Convenience routine to map a sockaddr_in to a sockaddr to call FromSocketAddr(const sockaddr *)
pInput | Pointer to a sockaddr_in to read the socket address from |
|
inline |
Calls FromSocketAddr(const sockaddr *)
Convenience routine to map a sockaddr_in6 to a sockaddr to call FromSocketAddr(const sockaddr *)
pInput | Pointer to a sockaddr_in6 to read the socket address from |
|
inline |
Calls FromSocketAddr(const sockaddr *)
Convenience routine to map a sockaddr_ipx to a sockaddr to call FromSocketAddr(const sockaddr *)
pInput | Pointer to a sockaddr_ipx to read the socket address from |
|
inline |
Calls FromSocketAddr(const sockaddr *)
Convenience routine to map a sockaddr_storage to a sockaddr to call FromSocketAddr(const sockaddr *)
pInput | Pointer to a sockaddr_storage to read the socket address from |
|
noexcept |
|
noexcept |
Return TRUE if they are not equal.
rInput | Reference to a valid NetAddr_t structure |
Return TRUE if they are equal.
rInput | Reference to a valid NetAddr_t structure |
uint_t BURGER_API Burger::NetAddr_t::ToOTAddress | ( | OTAddress * | pOutput | ) | const |
Convert a NetAddr_t into a OTAddress.
Convert a NetAddr_t into a OTAddress structure.
Supports AppleTalk or IPv4
pOutput | Pointer to a OTAddress to receive the socket address |
Burger::eError BURGER_API Burger::NetAddr_t::ToSocketAddr | ( | sockaddr * | pOutput | ) | const |
Convert a NetAddr_t into a sockaddr.
Convert a NetAddr_t into a sockaddr structure.
Supports AppleTalk, IPX, IPv4 and IPv6
pOutput | Pointer to a sockaddr to receive the socket address |
|
inline |
Calls ToSocketAddr(sockaddr *) const.
Convenience routine to map a sockaddr_at to a sockaddr to call ToSocketAddr(sockaddr *) const
pOutput | Pointer to a sockaddr_at to receive the socket address |
|
inline |
Calls ToSocketAddr(sockaddr *) const.
Convenience routine to map a sockaddr_in to a sockaddr to call ToSocketAddr(sockaddr *) const
pOutput | Pointer to a sockaddr_in to receive the socket address |
|
inline |
Calls ToSocketAddr(sockaddr *) const.
Convenience routine to map a sockaddr_in6 to a sockaddr to call ToSocketAddr(sockaddr *) const
pOutput | Pointer to a sockaddr_in6 to receive the socket address |
|
inline |
Calls ToSocketAddr(sockaddr *) const.
Convenience routine to map a sockaddr_ipx to a sockaddr to call ToSocketAddr(sockaddr *) const
pOutput | Pointer to a sockaddr_ipx to receive the socket address |
|
inline |
Calls ToSocketAddr(sockaddr *) const.
Convenience routine to map a sockaddr_storage to a sockaddr to call ToSocketAddr(sockaddr *) const
pOutput | Pointer to a sockaddr_storage to receive the socket address |
|
noexcept |
Given a network address, convert it into a readable string.
If PortFlag is TRUE then append the port address.
If TCP/IP = "206.55.132.145:80" If IPX "12341234:123412341234:1234" If APPLETALK 10.1.50
struct { ... } Burger::NetAddr_t::APPLETALK |
Appletalk address.
struct { ... } Burger::NetAddr_t::IPv4 |
IPv4 address.
struct { ... } Burger::NetAddr_t::IPv6 |
IPv6 address.
struct { ... } Burger::NetAddr_t::IPX |
IPX/SPX address.
uint8_t Burger::NetAddr_t::m_IP[16] |
IPv6 Internet IP (64 bit aligned)
uint8_t Burger::NetAddr_t::m_Net[4] |
IPX/SPX Network.
uint8_t Burger::NetAddr_t::m_Node[6] |
IPX/SPX Node address.
uint_t Burger::NetAddr_t::m_uDDPType |
Appletalk protocol ID.
uint32_t Burger::NetAddr_t::m_uIP |
IPv4 Internet IP.
uint_t Burger::NetAddr_t::m_uNetwork |
Appletalk network.
uint_t Burger::NetAddr_t::m_uNodeID |
Appletalk node.
uint_t Burger::NetAddr_t::m_uPort |
TCP/IP, UDP Port (Is valid for both IPv4 and IPv6)
uint_t Burger::NetAddr_t::m_uSocket |
IPX/SPX Socket (Port)
Appletalk socket (Port)
eAddressType Burger::NetAddr_t::m_uType |
Type of network address.
union { ... } Burger::NetAddr_t::U |