XPMP2
X-Plane multiplayer library 2 - using instancing
XPMP2::SockAddrTy Struct Reference

Helper definition for all these IPv4/6 differences. More...

#include <Network.h>

Public Member Functions

 SockAddrTy ()
 Constructor zeroes out everying.
 
 SockAddrTy (const sockaddr *pSa)
 Constructor copies given socket info.
 
bool operator< (const SockAddrTy &o) const
 Comparison bases solely on memory compare, order isn't important, just that there is order.
 
bool operator== (const SockAddrTy &o) const
 Comparison bases solely on memory compare, order isn't important, just that there is order.
 
uint8_t family () const
 return the protocol famaily
 
bool isIp4 () const
 is this an IPv4 address?
 
bool isIp6 () const
 is this an IPv6 address?
 
socklen_t size () const
 < expected structure size as per protocol family
 
uint16_t port () const
 Get the port number.
 
void setPort (uint16_t port)
 Set the port number.
 

Public Attributes

union { 
 
sockaddr sa
 
sockaddr_in sa_in
 
sockaddr_in6 sa_in6
 
};  
 

Detailed Description

Helper definition for all these IPv4/6 differences.

Constructor & Destructor Documentation

◆ SockAddrTy() [1/2]

XPMP2::SockAddrTy::SockAddrTy ( )
inline

Constructor zeroes out everying.

◆ SockAddrTy() [2/2]

XPMP2::SockAddrTy::SockAddrTy ( const sockaddr * pSa)

Constructor copies given socket info.

Member Function Documentation

◆ family()

uint8_t XPMP2::SockAddrTy::family ( ) const
inline

return the protocol famaily

◆ isIp4()

bool XPMP2::SockAddrTy::isIp4 ( ) const
inline

is this an IPv4 address?

◆ isIp6()

bool XPMP2::SockAddrTy::isIp6 ( ) const
inline

is this an IPv6 address?

◆ operator<()

bool XPMP2::SockAddrTy::operator< ( const SockAddrTy & o) const
inline

Comparison bases solely on memory compare, order isn't important, just that there is order.

◆ operator==()

bool XPMP2::SockAddrTy::operator== ( const SockAddrTy & o) const
inline

Comparison bases solely on memory compare, order isn't important, just that there is order.

◆ port()

uint16_t XPMP2::SockAddrTy::port ( ) const
inline

Get the port number.

◆ setPort()

void XPMP2::SockAddrTy::setPort ( uint16_t port)
inline

Set the port number.

◆ size()

socklen_t XPMP2::SockAddrTy::size ( ) const
inline

< expected structure size as per protocol family

Member Data Documentation

◆ [union]

union { ... } XPMP2::SockAddrTy

The documentation for this struct was generated from the following files: