MISOCKET::ADDR Struct Reference

A generic socket address. More...

#include <mi32/socket.h>

List of all members.

Public Member Functions

 ADDR (const MISOCKET::IPADDR &ip, int port)
 ADDR ()
void GetAddress (MISTRING &mistr, bool bDoReverseDNSLookup) const
MISOCKET::FAMILY GetFamily () const
const MISOCKET::IPADDRGetIPAddress () const
const char * GetLocalName () const
int GetPort () const
void Set (const MISOCKET::IPADDR &ip, int port)
void SetFamily (MISOCKET::FAMILY family)
void SetLocalName (const char *name)

Public Attributes

INT64 __ss_align
char __ss_pad1 [6]
char __ss_pad2 [112]
unsigned short sa_family

Protected Member Functions

char * GetBytePtr (int offset)
const char * GetBytePtr (int offset) const
UINT16 GetUINT16 (int offset) const
UINT32 GetUINT32 (int offset) const
void SetUINT16 (int offset, UINT16 val)
void SetUINT32 (int offset, UINT32 val)

Detailed Description

A generic socket address.

Note: this is equivilant to struct sockaddr_storage, which can be used to represent all sockaddr types. Defining this ourselves allows us to use it without having to include winsock.h on Windows machines.

XXX THIS IS UGLY AND EVIL


Constructor & Destructor Documentation

MISOCKET::ADDR::ADDR (  ) 

Empty constructor.

MISOCKET::ADDR::ADDR ( const MISOCKET::IPADDR ip,
int  port 
)

Construct for an IP address.


Member Function Documentation

void MISOCKET::ADDR::GetAddress ( MISTRING mistr,
bool  bDoReverseDNSLookup 
) const

The the address in a humanly-readable format.

Parameters:
mistr The string to place the address in
bDoReverseDNSLookup If true, FAMILY_NET addresses will use reverse DNS to find the hostname of the address. If false, it will just use the numeric IP address. Ignored for other address families.
char* MISOCKET::ADDR::GetBytePtr ( int  offset  )  [protected]
const char* MISOCKET::ADDR::GetBytePtr ( int  offset  )  const [protected]
MISOCKET::FAMILY MISOCKET::ADDR::GetFamily (  )  const

Get the socket family.

const MISOCKET::IPADDR& MISOCKET::ADDR::GetIPAddress (  )  const

Get the IP Address (FAMILY_INET only).

const char* MISOCKET::ADDR::GetLocalName (  )  const

Get the socket name (FAMILY_LOCAL only).

int MISOCKET::ADDR::GetPort (  )  const

Get the port (FAMILY_INET only).

UINT16 MISOCKET::ADDR::GetUINT16 ( int  offset  )  const [protected]
UINT32 MISOCKET::ADDR::GetUINT32 ( int  offset  )  const [protected]
void MISOCKET::ADDR::Set ( const MISOCKET::IPADDR ip,
int  port 
)

Construct for an IP address.

void MISOCKET::ADDR::SetFamily ( MISOCKET::FAMILY  family  ) 

Set the socket family.

void MISOCKET::ADDR::SetLocalName ( const char *  name  ) 

Set the socket name (FAMILY_LOCAL only).

void MISOCKET::ADDR::SetUINT16 ( int  offset,
UINT16  val 
) [protected]
void MISOCKET::ADDR::SetUINT32 ( int  offset,
UINT32  val 
) [protected]

Member Data Documentation

unsigned short MISOCKET::ADDR::sa_family

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

Generated on Sun Oct 7 21:33:39 2012 for TNTsdk 2012 by  doxygen 1.6.1