MISOCKET::IPADDR Struct Reference

An Internet Protocol address. More...

#include <mi32/socket.h>

List of all members.

Public Member Functions

 IPADDR (UINT32 addr)
 IPADDR ()
int Compare (const MISOCKET::IPADDR &rhs) const
void GetString (MISTRING &mistr, bool bDoReverseDNSLookup) const
bool IsLoopbackAddr () const
bool IsRoutable () const
bool SetByName (const char *name)

Static Public Member Functions

static void GetAddressList (IPADDRLIST &AddrList, bool OnlyRoutable=false)

Public Attributes

union {
   UINT32   S_addr
   struct {
      UINT8   s_b1
      UINT8   s_b2
      UINT8   s_b3
      UINT8   s_b4
   }   S_un_b
S_un

Detailed Description

An Internet Protocol address.

Note: this is equivilant to struct in_addr the member names are the same for compatibility reasons.


Constructor & Destructor Documentation

MISOCKET::IPADDR::IPADDR (  ) 

Empty constructor.

MISOCKET::IPADDR::IPADDR ( UINT32  addr  ) 

Initialize with a known address.

Address must be in network byte order (hi-lo) XXX ?maybe?


Member Function Documentation

int MISOCKET::IPADDR::Compare ( const MISOCKET::IPADDR rhs  )  const

Compare two IPADDR's.

Returns:
-1 if lhs < rhs, 0 if equal, 1 if lhs > rhs
static void MISOCKET::IPADDR::GetAddressList ( IPADDRLIST &  AddrList,
bool  OnlyRoutable = false 
) [static]

Get the list of available IP addresses for this machine NOTE: Only implemented for Windows.

Parameters:
AddrList List of IP addresses RETURNED
OnlyRoutable Only list routable addresses
void MISOCKET::IPADDR::GetString ( MISTRING mistr,
bool  bDoReverseDNSLookup 
) const
bool MISOCKET::IPADDR::IsLoopbackAddr (  )  const

Is 'this' a lookback address according to RFC1918 and RFC3330 ?

Returns:
'True' if the address is a loopback address (127.0.0.0 - 127.255.255.255)
bool MISOCKET::IPADDR::IsRoutable (  )  const

Is 'this' a routable address according to RFC1918 and RFC3330 ? Basically, the address is not in the 10 A class private range, the 192.168 B class private range the 172.16 - 172.31 B class private ranges, the 169.254 class B autoconfiguration range, the 127 class A loopback range, and the 224 - 239 class A multicast ranges.

Returns:
'True' if the address is not in the ranges listed above, 'false' it the address is.
bool MISOCKET::IPADDR::SetByName ( const char *  name  ) 

Set the address by looking up a host name.

Returns:
true if the name could be resolved, false if not.

Member Data Documentation

union { ... } MISOCKET::IPADDR::S_un
struct { ... } MISOCKET::IPADDR::S_un_b

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