#include <XrdNetAddrInfo.hh>
|
static const int | noPort = 0x0000001 |
| Do not add port number. More...
|
|
static const int | noPortRaw = 0x0000002 |
| Use raw address format (no port) More...
|
|
static const int | old6Map4 = 0x0000004 |
| Use deprecated IPV6 mapped format. More...
|
|
static const int | prefipv4 = 0x0000008 |
| Use if mapped IPV4 actual format. More...
|
|
Format our address into a supplied buffer with one of the following layouts (the ':<port>' or ':/path' can be omitted if desired, see fmtOpts param): IP.xx: host_name:<port> IP.v4: a.b.c.d:<port> IP.4to6: [::ffff:a.b.c.d]:<port> | [::a.b.c.d]:<port> IP.v6: [a:b:c:d:e:f:g:h]:<port> IP.Unix: localhost:/<path>
- Parameters
-
bAddr | address of buffer for result |
bLen | length of buffer |
fmtType | specifies the type of format desired via fmtUse enum. |
fmtOpts | additional formatting options (can be or'd): noPort - do not append the port number to the address. noPortRaw - no port and no brackets for IPv6. old6Map4 - use deprecated IPV6 mapped format '[::x.x.x.x]' |
- Returns
- Success: The number of characters (less null) in Buff.
-
Failure: 0 (buffer is too small or not a valid address). However, if bLen > 0 the buffer will contain a null terminated string of up to 8 question marks.
Enumerator |
---|
fmtAuto |
Hostname if already resolved o/w use fmtAddr.
|
fmtName |
Hostname if it is resolvable o/w use fmtAddr.
|
fmtAddr |
Address using suitable ipv4 or ipv6 format.
|
fmtAdv6 |
|
Indicate whether or not our address is if the desired type.
- Parameters
-
ipType | The IP address version to test (see enum below). |
- Returns
- True: This is the address version of ipType.
-
False: This is not the address version of ipType.
XrdNetAddrInfo::XrdNetAddrInfo |
( |
| ) |
|
|
inline |
XrdNetAddrInfo::~XrdNetAddrInfo |
( |
| ) |
|
|
inline |
int XrdNetAddrInfo::Family |
( |
| ) |
const |
|
inline |
Provide our address family.
- Returns
- Success: Returns AF_INET, AF_INET6, or AF_UNIX. Failure: Returns 0, address is not valid.
References XrdNetSockAddr::Addr, and IP.
int XrdNetAddrInfo::Format |
( |
char * |
bAddr, |
|
|
int |
bLen, |
|
|
fmtUse |
fmtType = fmtAuto , |
|
|
int |
fmtOpts = 0 |
|
) |
| |
static bool XrdNetAddrInfo::isHostName |
( |
const char * |
name | ) |
|
|
static |
Indicate whether or not a string is a possible hostname and not IP address. The return value does not aimply any kind of validity. For instance, a false return indicates this is not a valid hostname does not mean it is a valid IP address.
- Parameters
-
- Returns
- True: This is a possible hostname (i.e. not IP address).
-
False: This is not a possible hostname.
bool XrdNetAddrInfo::isIPType |
( |
IPType |
ipType | ) |
const |
|
inline |
bool XrdNetAddrInfo::isLoopback |
( |
| ) |
|
Indicate whether or not our address is the loopback address. Use this method to gaurd against UDP packet spoofing.
- Returns
- True: This is the loopback address.
-
False: This is not the loopback address.
bool XrdNetAddrInfo::isMapped |
( |
| ) |
const |
|
inline |
Indicate whether or not our address is an IPv4 mapped to IPv6 address.
- Returns
- True: The address is a mapped IPv4 address. False: The address is not a mapped IPv4 address.
References XrdNetSockAddr::Addr, IP, and XrdNetSockAddr::v6.
bool XrdNetAddrInfo::isPrivate |
( |
| ) |
|
Indicate whether or not our address is private.
- Returns
- True: This address is private. False: This address is not private.
bool XrdNetAddrInfo::isRegistered |
( |
| ) |
|
Indicate whether or not our address is registered in the DNS.
- Returns
- True: This address is registered. False: This address is not registered.
struct LocInfo* XrdNetAddrInfo::Location |
( |
| ) |
|
|
inline |
char* XrdNetAddrInfo::LowCase |
( |
char * |
str | ) |
|
|
protected |
const char* XrdNetAddrInfo::Name |
( |
const char * |
eName = 0 , |
|
|
const char ** |
eText = 0 |
|
) |
| |
Convert our IP address to the corresponding [host] name.
- Parameters
-
eName | value to return when the name cannot be determined. |
eText | when not null, the reason for a failure is returned. |
- Returns
- Success: Pointer to the name or ip address with eText, if supplied, set to zero. The memory is owned by the object and is deleted when the object is deleted or Set() is called. Failure: eName param and if eText is not zero, returns a pointer to a message describing the reason for the failure. The message is in persistent storage and cannot be modified.
Provide a pointer to our socket address suitable for use in calls to methods that require our internal format of sock addr. A value is only returned for IPV6/4 addresses and is nill otherwise. The pointer refers to memory allocated by this object and becomes invalid should the object be deleted. Use SockSize() to get its logical length.
References IP, and sockAddr.
int XrdNetAddrInfo::Port |
( |
| ) |
|
Return the port number for our address.
- Returns
- Success: The port number, which may be 0 if not set. Failure: -1 address is not an internet address or port is invalid.
int XrdNetAddrInfo::Protocol |
( |
| ) |
|
|
inline |
Provide our protocol family.
- Returns
- Success: Returns PF_INET, PF_INET6, or PF_UNIX. Failure: Returns 0, address is not valid.
References protType.
int XrdNetAddrInfo::QFill |
( |
char * |
bAddr, |
|
|
int |
bLen |
|
) |
| |
|
protected |
int XrdNetAddrInfo::Resolve |
( |
| ) |
|
|
protected |
int XrdNetAddrInfo::Same |
( |
const XrdNetAddrInfo * |
ipAddr, |
|
|
bool |
plusPort = false |
|
) |
| |
Check if the IP address in this object is the same as the one passed.
- Parameters
-
ipAddr | points to the network address object to compare. |
plusPort | when true, port values must also match. In any case, both addresses must be of the same address family. |
- Returns
- Success: True (addresses are the same). Failure: False (addresses are not the same).
Referenced by XrdCmsNode::isNode().
const sockaddr* XrdNetAddrInfo::SockAddr |
( |
| ) |
|
|
inline |
Provide a pointer to our socket address suitable for use in calls to functions that require one (e.g. bind() etc). The pointer refers to memory allocated by this object and becomes invalid should the object be deleted or when Set() is called. Use SockSize() to get its length.
References sockAddr.
int XrdNetAddrInfo::SockFD |
( |
| ) |
|
|
inline |
Get the associated file descriptor.
- Returns
- The associated file descriptor. If negative, no association exists.
References sockNum.
Provide the length of our socket adress. Useful for system calls needing it.
- Returns
- Success: Returns the length of the address returned by SockAddr(). Failure: Returns 0, address is not valid.
References addrSize.
char* XrdNetAddrInfo::hostName |
|
protected |
const int XrdNetAddrInfo::noPort = 0x0000001 |
|
static |
const int XrdNetAddrInfo::noPortRaw = 0x0000002 |
|
static |
Use raw address format (no port)
const int XrdNetAddrInfo::old6Map4 = 0x0000004 |
|
static |
Use deprecated IPV6 mapped format.
const int XrdNetAddrInfo::prefipv4 = 0x0000008 |
|
static |
Use if mapped IPV4 actual format.
short XrdNetAddrInfo::protType |
|
protected |
struct sockaddr* XrdNetAddrInfo::sockAddr |
unsigned short XrdNetAddrInfo::sockNum |
|
protected |
struct sockaddr_un* XrdNetAddrInfo::unixPipe |
The documentation for this class was generated from the following file: