Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Burger::NetAddr_t Struct Reference

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 
 

Detailed Description

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.

Member Enumeration Documentation

◆ eAddressType

Enumeration of supported network addressing types.


There are four address types supported, IPv4, IPv6, AppleTalk and IPX

See also
NetAddr_t
Enumerator
TYPE_UNKNOWN 

Unknown format.

TYPE_IPV4 

TCP/UDP IPv4 address.

TYPE_IPV6 

TCP/UDP IPv6 address.

TYPE_IPX 

IPX/SPX address.

TYPE_APPLETALK 

Appletalk address.

TYPE_COUNT 

Number of supported types.

Member Function Documentation

◆ Compare()

uint_t BURGER_API Burger::NetAddr_t::Compare ( const NetAddr_t * pInput) const
noexcept

Compare two network addresses for equality.


Test of two NetAddr_t structures are effectively equal

Note
Do not use this routine to test for less/greater.
Returns
FALSE (like MemoryCompare()) for equality and TRUE if not equal.

◆ FromOTAddress()

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

Note
This is only available on Mac OS 7.5-9.9.2 or Carbon
Parameters
pInputPointer to a OTAddress to read the socket address from
Returns
Zero if no error, non-zero if not supported or unimplemented protocol

◆ FromSocketAddr() [1/6]

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

Note
This is only available on Windows
Parameters
pInputPointer to a sockaddr to read the socket address from
Returns
Zero if no error, non-zero if not supported or unimplemented protocol
See also
ToSocketAddr(sockaddr *) const, FromSocketAddr(const sockaddr_at*), FromSocketAddr(const sockaddr_ipx *), FromSocketAddr( const sockaddr_in*) or FromSocketAddr(const sockaddr_in6 *)

◆ FromSocketAddr() [2/6]

eError Burger::NetAddr_t::FromSocketAddr ( const sockaddr_at * pInput)
inline

Calls FromSocketAddr(const sockaddr *)


Convenience routine to map a sockaddr_at to a sockaddr to call FromSocketAddr(const sockaddr *)

Note
This is only available on Windows
Parameters
pInputPointer to a sockaddr_at to read the socket address from
Returns
Zero if no error, non-zero if not supported or unimplemented protocol
See also
FromSocketAddr(const sockaddr *)

◆ FromSocketAddr() [3/6]

eError Burger::NetAddr_t::FromSocketAddr ( const sockaddr_in * pInput)
inline

Calls FromSocketAddr(const sockaddr *)


Convenience routine to map a sockaddr_in to a sockaddr to call FromSocketAddr(const sockaddr *)

Note
This is only available on Windows
Parameters
pInputPointer to a sockaddr_in to read the socket address from
Returns
Zero if no error, non-zero if not supported or unimplemented protocol
See also
FromSocketAddr(const sockaddr *)

◆ FromSocketAddr() [4/6]

eError Burger::NetAddr_t::FromSocketAddr ( const sockaddr_in6 * pInput)
inline

Calls FromSocketAddr(const sockaddr *)


Convenience routine to map a sockaddr_in6 to a sockaddr to call FromSocketAddr(const sockaddr *)

Note
This is only available on Windows
Parameters
pInputPointer to a sockaddr_in6 to read the socket address from
Returns
Zero if no error, non-zero if not supported or unimplemented protocol
See also
FromSocketAddr(const sockaddr *)

◆ FromSocketAddr() [5/6]

eError Burger::NetAddr_t::FromSocketAddr ( const sockaddr_ipx * pInput)
inline

Calls FromSocketAddr(const sockaddr *)


Convenience routine to map a sockaddr_ipx to a sockaddr to call FromSocketAddr(const sockaddr *)

Note
This is only available on Windows
Parameters
pInputPointer to a sockaddr_ipx to read the socket address from
Returns
Zero if no error, non-zero if not supported or unimplemented protocol
See also
FromSocketAddr(const sockaddr *)

◆ FromSocketAddr() [6/6]

eError Burger::NetAddr_t::FromSocketAddr ( const sockaddr_storage * pInput)
inline

Calls FromSocketAddr(const sockaddr *)


Convenience routine to map a sockaddr_storage to a sockaddr to call FromSocketAddr(const sockaddr *)

Note
This is only available on Windows
Parameters
pInputPointer to a sockaddr_storage to read the socket address from
Returns
Zero if no error, non-zero if not supported or unimplemented protocol
See also
FromSocketAddr(const sockaddr *)

◆ IsBroadcast()

uint_t BURGER_API Burger::NetAddr_t::IsBroadcast ( void ) const
noexcept

Test if the address is a broadcast address.


If the address is a type used for broadcasting, return TRUE.

Returns
TRUE if it's a broadcast address, FALSE if not.

◆ IsUnspecified()

uint_t BURGER_API Burger::NetAddr_t::IsUnspecified ( void ) const
noexcept

Test if the address is an unspecified address.


If the address is a type used for attaching to all local IP addresses, return TRUE.

Returns
TRUE if it's an unspecified address, FALSE if not.

◆ operator!=()

uint_t Burger::NetAddr_t::operator!= ( const NetAddr_t & rInput) const
inlinenoexcept

Return TRUE if they are not equal.


Parameters
rInputReference to a valid NetAddr_t structure
Returns
TRUE if not equal, FALSE if equal
See also
Compare(const NetAddr_t *) const

◆ operator==()

uint_t Burger::NetAddr_t::operator== ( const NetAddr_t & rInput) const
inlinenoexcept

Return TRUE if they are equal.


Parameters
rInputReference to a valid NetAddr_t structure
Returns
TRUE if equal, FALSE if not equal
See also
Compare(const NetAddr_t *) const

◆ ToOTAddress()

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

Note
This is only available on Mac OS 7.5-9.9.2 or Carbon
Parameters
pOutputPointer to a OTAddress to receive the socket address
Returns
Zero if no error, non-zero if not supported or unimplemented protocol

◆ ToSocketAddr() [1/6]

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

Note
This is only available on Windows
Parameters
pOutputPointer to a sockaddr to receive the socket address
Returns
Zero if no error, non-zero if not supported or unimplemented protocol
See also
FromSocketAddr(const sockaddr *), ToSocketAddr(sockaddr_at *) const, ToSocketAddr(sockaddr_ipx *) const, ToSocketAddr(sockaddr_in *) const or ToSocketAddr(sockaddr_in6 *) const

◆ ToSocketAddr() [2/6]

eError Burger::NetAddr_t::ToSocketAddr ( sockaddr_at * pOutput) const
inline

Calls ToSocketAddr(sockaddr *) const.


Convenience routine to map a sockaddr_at to a sockaddr to call ToSocketAddr(sockaddr *) const

Note
This is only available on Windows
Parameters
pOutputPointer to a sockaddr_at to receive the socket address
Returns
Zero if no error, non-zero if not supported or unimplemented protocol
See also
ToSocketAddr(sockaddr *) const

◆ ToSocketAddr() [3/6]

eError Burger::NetAddr_t::ToSocketAddr ( sockaddr_in * pOutput) const
inline

Calls ToSocketAddr(sockaddr *) const.


Convenience routine to map a sockaddr_in to a sockaddr to call ToSocketAddr(sockaddr *) const

Note
This is only available on Windows
Parameters
pOutputPointer to a sockaddr_in to receive the socket address
Returns
Zero if no error, non-zero if not supported or unimplemented protocol
See also
ToSocketAddr(sockaddr *) const

◆ ToSocketAddr() [4/6]

eError Burger::NetAddr_t::ToSocketAddr ( sockaddr_in6 * pOutput) const
inline

Calls ToSocketAddr(sockaddr *) const.


Convenience routine to map a sockaddr_in6 to a sockaddr to call ToSocketAddr(sockaddr *) const

Note
This is only available on Windows
Parameters
pOutputPointer to a sockaddr_in6 to receive the socket address
Returns
Zero if no error, non-zero if not supported or unimplemented protocol
See also
ToSocketAddr(sockaddr *) const

◆ ToSocketAddr() [5/6]

eError Burger::NetAddr_t::ToSocketAddr ( sockaddr_ipx * pOutput) const
inline

Calls ToSocketAddr(sockaddr *) const.


Convenience routine to map a sockaddr_ipx to a sockaddr to call ToSocketAddr(sockaddr *) const

Note
This is only available on Windows
Parameters
pOutputPointer to a sockaddr_ipx to receive the socket address
Returns
Zero if no error, non-zero if not supported or unimplemented protocol
See also
ToSocketAddr(sockaddr *) const

◆ ToSocketAddr() [6/6]

eError Burger::NetAddr_t::ToSocketAddr ( sockaddr_storage * pOutput) const
inline

Calls ToSocketAddr(sockaddr *) const.


Convenience routine to map a sockaddr_storage to a sockaddr to call ToSocketAddr(sockaddr *) const

Note
This is only available on Windows
Parameters
pOutputPointer to a sockaddr_storage to receive the socket address
Returns
Zero if no error, non-zero if not supported or unimplemented protocol
See also
ToSocketAddr(sockaddr *) const

◆ ToString()

Burger::eError BURGER_API Burger::NetAddr_t::ToString ( String * pOutput,
uint_t bAppendPort = 0 ) const
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

Member Data Documentation

◆ [struct]

struct { ... } Burger::NetAddr_t::APPLETALK

Appletalk address.

◆ [struct]

struct { ... } Burger::NetAddr_t::IPv4

IPv4 address.

◆ [struct]

struct { ... } Burger::NetAddr_t::IPv6

IPv6 address.

◆ [struct]

struct { ... } Burger::NetAddr_t::IPX

IPX/SPX address.

◆ m_IP

uint8_t Burger::NetAddr_t::m_IP[16]

IPv6 Internet IP (64 bit aligned)

◆ m_Net

uint8_t Burger::NetAddr_t::m_Net[4]

IPX/SPX Network.

◆ m_Node

uint8_t Burger::NetAddr_t::m_Node[6]

IPX/SPX Node address.

◆ m_uDDPType

uint_t Burger::NetAddr_t::m_uDDPType

Appletalk protocol ID.

◆ m_uIP

uint32_t Burger::NetAddr_t::m_uIP

IPv4 Internet IP.

◆ m_uNetwork

uint_t Burger::NetAddr_t::m_uNetwork

Appletalk network.

◆ m_uNodeID

uint_t Burger::NetAddr_t::m_uNodeID

Appletalk node.

◆ m_uPort

uint_t Burger::NetAddr_t::m_uPort

TCP/IP, UDP Port (Is valid for both IPv4 and IPv6)

◆ m_uSocket

uint_t Burger::NetAddr_t::m_uSocket

IPX/SPX Socket (Port)

Appletalk socket (Port)

◆ m_uType

eAddressType Burger::NetAddr_t::m_uType

Type of network address.

◆ [union]

union { ... } Burger::NetAddr_t::U