#include <XrdNetAddrInfo.hh>
|
static const int | noPort = 0x0000001 |
| Do not add port number.
|
|
static const int | noPortRaw = 0x0000002 |
| Use raw address format (no port)
|
|
static const int | old6Map4 = 0x0000004 |
| Use deprecated IPV6 mapped format.
|
|
static const int | prefipv4 = 0x0000008 |
| Use if mapped IPV4 actual format.
|
|
◆ fmtUse
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 | |
◆ IPType
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() [1/3]
◆ XrdNetAddrInfo() [2/3]
XrdNetAddrInfo::XrdNetAddrInfo |
( |
| ) |
|
|
inline |
◆ XrdNetAddrInfo() [3/3]
◆ ~XrdNetAddrInfo()
XrdNetAddrInfo::~XrdNetAddrInfo |
( |
| ) |
|
|
inline |
◆ Dialect()
const char * XrdNetAddrInfo::Dialect |
( |
| ) |
|
|
inline |
Provide the protocol languag being spoken (e.g. xroot, http, etc).
- Returns
- Pointer to the protocol language being used. If unknown, nil ia returned. Use the isUsingTLS() method to see if a secure version of the protocol is being used.
References protName.
◆ Family()
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.
◆ Format()
int XrdNetAddrInfo::Format |
( |
char * |
bAddr, |
|
|
int |
bLen, |
|
|
fmtUse |
fmtType = fmtAuto , |
|
|
int |
fmtOpts = 0 |
|
) |
| |
◆ isHostName()
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.
◆ isIPType()
bool XrdNetAddrInfo::isIPType |
( |
IPType |
ipType | ) |
const |
|
inline |
◆ isLoopback()
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.
◆ isMapped()
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.
◆ isPrivate()
bool XrdNetAddrInfo::isPrivate |
( |
| ) |
|
Indicate whether or not our address is private.
- Returns
- True: This address is private. False: This address is not private.
◆ isRegistered()
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.
◆ isUsingTLS()
bool XrdNetAddrInfo::isUsingTLS |
( |
| ) |
|
Indicate whether or not the endpoint is using TLS for communications.
- Returns
- True: This address is using TLS. False: This address is not using TLS.
◆ Location()
const struct LocInfo * XrdNetAddrInfo::Location |
( |
| ) |
|
|
inline |
◆ LowCase()
char * XrdNetAddrInfo::LowCase |
( |
char * |
str | ) |
|
|
protected |
◆ Name()
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.
◆ NetAddr()
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.
◆ operator=()
Assignment operator.
References XrdNetSockAddr::Addr, addrLoc, addrSize, hostName, IP, protFlgs, protName, protType, sockAddr, sockNum, and unixPipe.
◆ Port()
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.
◆ Protocol()
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.
◆ QFill()
int XrdNetAddrInfo::QFill |
( |
char * |
bAddr, |
|
|
int |
bLen |
|
) |
| |
|
protected |
◆ Resolve()
int XrdNetAddrInfo::Resolve |
( |
| ) |
|
|
protected |
◆ Same()
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).
Note: implemented in terms of const version
Referenced by XrdCmsNode::isNode(), and XrdCmsNode::isNode().
◆ SockAddr()
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.
◆ SockFD()
int XrdNetAddrInfo::SockFD |
( |
| ) |
|
|
inline |
Get the associated file descriptor.
- Returns
- The associated file descriptor. If negative, no association exists.
References sockNum.
◆ SockSize()
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, and SOCKLEN_t.
◆ [union]
◆ addrLoc
◆ addrSize
unsigned short XrdNetAddrInfo::addrSize |
|
protected |
◆ dnsCache
◆ hostName
char* XrdNetAddrInfo::hostName |
|
protected |
◆ IP
◆ isTLS
const char XrdNetAddrInfo::isTLS = 0x01 |
|
staticprotected |
◆ noPort
const int XrdNetAddrInfo::noPort = 0x0000001 |
|
static |
◆ noPortRaw
const int XrdNetAddrInfo::noPortRaw = 0x0000002 |
|
static |
Use raw address format (no port)
◆ old6Map4
const int XrdNetAddrInfo::old6Map4 = 0x0000004 |
|
static |
Use deprecated IPV6 mapped format.
◆ prefipv4
const int XrdNetAddrInfo::prefipv4 = 0x0000008 |
|
static |
Use if mapped IPV4 actual format.
◆ protFlgs
unsigned char XrdNetAddrInfo::protFlgs |
|
protected |
◆ protName
const char* XrdNetAddrInfo::protName |
|
protected |
◆ protType
unsigned char XrdNetAddrInfo::protType |
|
protected |
◆ sockAddr
struct sockaddr* XrdNetAddrInfo::sockAddr |
◆ sockNum
int XrdNetAddrInfo::sockNum |
|
protected |
◆ unixPipe
struct sockaddr_un* XrdNetAddrInfo::unixPipe |
The documentation for this class was generated from the following file: