OverSim
|
A simple wrapper around an IPvXAddress and a port. More...
#include <I3IPAddress.h>
Public Member Functions | |
I3IPAddress () | |
Constructor. | |
I3IPAddress (IPvXAddress add, int port) | |
Constructor. | |
bool | operator< (const I3IPAddress &a) const |
"Less than" operator | |
bool | operator== (const I3IPAddress &a) const |
"Equals" operator (takes port in account) | |
bool | operator> (const I3IPAddress &a) const |
"Greater than" operator (takes port in account) | |
int | length () const |
Public Member Functions inherited from TransportAddress | |
TransportAddress () | |
Constructs a unspecified TransportAddress. | |
virtual | ~TransportAddress () |
Standard destructor. | |
TransportAddress (const TransportAddress &handle) | |
Copy constructor. | |
TransportAddress (const IPvXAddress &ip, int port=-1, NatType natType=UNKNOWN_NAT) | |
Complete constructor. | |
bool | operator== (const TransportAddress &rhs) const |
compares this to a given TransportAddress | |
bool | operator!= (const TransportAddress &rhs) const |
compares this to a given TransportAddress | |
bool | operator< (const TransportAddress &rhs) const |
compares this to a given TransportAddress | |
bool | operator> (const TransportAddress &rhs) const |
compares this to a given TransportAddress | |
bool | operator<= (const TransportAddress &rhs) const |
compares this to a given TransportAddress | |
bool | operator>= (const TransportAddress &rhs) const |
compares this to a given TransportAddress | |
TransportAddress & | operator= (const TransportAddress &rhs) |
assigns ip and port of rhs to this->ip and this->port | |
void | setIp (const IPvXAddress &ip, int port=-1, NatType natType=UNKNOWN_NAT) |
Sets the ip address, port and NAT type. | |
void | setAddress (const IPvXAddress &ip, int port=-1, NatType natType=UNKNOWN_NAT) __attribute((deprecated)) |
Sets the ip address, port and NAT type. | |
void | appendSourceRoute (const TransportAddress &sourceRoute) |
Appends a source route to this TransportAddress. | |
void | clearSourceRoute () |
Clears the source route of this TransportAddress. | |
void | setPort (int port) |
sets this->port to the given port | |
const IPvXAddress & | getIp () const |
returns ip address | |
const IPvXAddress & | getAddress () const __attribute((deprecated)) |
returns ip address. | |
int | getPort () const |
returns port | |
NatType | getNatType () const |
returns the type of NAT this node is behind | |
size_t | getSourceRouteSize () const |
Returns the length of the source route to reach this node. | |
const TransportAddressVector & | getSourceRoute () const |
Returns source route used to reach this node. | |
bool | isUnspecified () const |
indicates if TransportAddress is specified | |
size_t | hash () const |
creates a hash value of ip and port | |
virtual TransportAddress * | dup () const |
returns a copy of the TransportAddress |
Friends | |
std::ostream & | operator<< (std::ostream &os, const I3IPAddress &ip) |
String stream output operation. |
Additional Inherited Members | |
Public Types inherited from TransportAddress | |
enum | NatType { UNKNOWN_NAT = 0, NO_NAT = 1, FULL_CONE_NAT = 2, PORT_RESTRICTED_NAT = 3, SYMMETRIC_NAT = 4 } |
typedef UNORDERED_SET < TransportAddress, hashFcn > | Set |
a hashed set of TransportAddresses | |
Static Public Attributes inherited from TransportAddress | |
static const TransportAddress | UNSPECIFIED_NODE |
TransportAddress without specified ip and port. | |
static const TransportAddressVector | UNSPECIFIED_NODES |
Protected Attributes inherited from TransportAddress | |
IPvXAddress | ip |
the ip of this TransportAddress object | |
int | port |
the port of this TransportAddress object |
A simple wrapper around an IPvXAddress and a port.
Definition at line 32 of file I3IPAddress.h.
I3IPAddress::I3IPAddress | ( | ) |
I3IPAddress::I3IPAddress | ( | IPvXAddress | add, |
int | port | ||
) |
int I3IPAddress::length | ( | ) | const |
Definition at line 52 of file I3IPAddress.cc.
Referenced by I3SubIdentifier::length().
bool I3IPAddress::operator< | ( | const I3IPAddress & | a | ) | const |
bool I3IPAddress::operator== | ( | const I3IPAddress & | a | ) | const |
bool I3IPAddress::operator> | ( | const I3IPAddress & | a | ) | const |
"Greater than" operator (takes port in account)
a | Address to be compared |
Definition at line 47 of file I3IPAddress.cc.
|
friend |
String stream output operation.
os | String stream |
ip | Address to be output |
Definition at line 57 of file I3IPAddress.cc.