#include <XrdNetAddr.hh>
|
int | Port (int pNum=-1) |
|
bool | Register (const char *hName) |
|
const char * | Set (const char *hSpec, int pNum=PortInSpec) |
|
const char * | Set (const char *hSpec, int &numIP, int maxIP, int pNum=PortInSpec, bool forUDP=false) |
|
const char * | Set (const struct sockaddr *sockP, int sockFD=-1) |
|
const char * | Set (int sockFD, bool peer=true) |
|
const char * | Set (struct addrinfo *rP, int port, bool mapit=false) |
|
void | SetDialect (const char *dP) |
|
void | SetLocation (XrdNetAddrInfo::LocInfo &loc) |
|
void | SetTLS (bool val) |
|
| XrdNetAddr () |
| Assignment operator and copy constructor are inherited, no need to define.
|
|
| XrdNetAddr (const XrdNetAddr *addr) |
|
| XrdNetAddr (const sockaddr *addr) |
|
| XrdNetAddr (const sockaddr_in *addr) |
|
| XrdNetAddr (const sockaddr_in6 *addr) |
|
| XrdNetAddr (int port) |
|
| ~XrdNetAddr () |
| Destructor.
|
|
const char * | Dialect () |
|
int | Family () const |
|
int | Format (char *bAddr, int bLen, fmtUse fmtType=fmtAuto, int fmtOpts=0) |
|
bool | isLoopback () |
|
bool | isIPType (IPType ipType) const |
|
bool | isMapped () const |
|
bool | isPrivate () |
|
bool | isRegistered () |
|
bool | isUsingTLS () |
|
const struct LocInfo * | Location () |
|
const char * | Name (const char *eName=0, const char **eText=0) |
|
const XrdNetSockAddr * | NetAddr () |
|
int | Port () |
|
int | Protocol () |
|
int | Same (const XrdNetAddrInfo *ipAddr, bool plusPort=false) |
|
const sockaddr * | SockAddr () |
|
SOCKLEN_t | SockSize () |
|
int | SockFD () |
|
XrdNetAddrInfo & | operator= (XrdNetAddrInfo const &rhs) |
| Assignment operator.
|
|
| XrdNetAddrInfo (XrdNetAddrInfo const &oP) |
| Copy constructor.
|
|
| XrdNetAddrInfo () |
| Constructor.
|
|
| XrdNetAddrInfo (const XrdNetAddrInfo *addr) |
|
| ~XrdNetAddrInfo () |
| Destructor.
|
|
|
static const int | PortInSpec = (int)0x80000000 |
|
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.
|
|
|
static struct addrinfo * | Hints (int htype, int stype) |
|
◆ XrdNetAddr() [1/6]
XrdNetAddr::XrdNetAddr |
( |
| ) |
|
|
inline |
Assignment operator and copy constructor are inherited, no need to define.
Constructor
- Parameters
-
addr | A pointer to an initialized and valid sockaddr or sockaddr compatible structure used to initialize the address. |
port | Uses the address of the current host and the speoified port number to initilize the address. |
◆ XrdNetAddr() [2/6]
◆ XrdNetAddr() [3/6]
XrdNetAddr::XrdNetAddr |
( |
const sockaddr * |
addr | ) |
|
|
inline |
◆ XrdNetAddr() [4/6]
XrdNetAddr::XrdNetAddr |
( |
const sockaddr_in * |
addr | ) |
|
|
inline |
◆ XrdNetAddr() [5/6]
XrdNetAddr::XrdNetAddr |
( |
const sockaddr_in6 * |
addr | ) |
|
|
inline |
◆ XrdNetAddr() [6/6]
XrdNetAddr::XrdNetAddr |
( |
int |
port | ) |
|
◆ ~XrdNetAddr()
XrdNetAddr::~XrdNetAddr |
( |
| ) |
|
|
inline |
◆ DynDNS()
static bool XrdNetAddr::DynDNS |
( |
| ) |
|
|
inlinestatic |
Determine if dynamic DNS has been set.
- Returns
- True Dynamic DNS has been set. False Dynamic DNS has not been set.
References dynDNS.
◆ Hints()
static struct addrinfo * XrdNetAddr::Hints |
( |
int |
htype, |
|
|
int |
stype |
|
) |
| |
|
staticprivate |
◆ IPV4Set()
static bool XrdNetAddr::IPV4Set |
( |
| ) |
|
|
inlinestatic |
Determine if IPV4 mode has been set.
- Returns
- True IPV4 mode has been set. False IPV4 mode has not been set.
References useIPV4.
◆ Map64()
bool XrdNetAddr::Map64 |
( |
| ) |
|
|
private |
◆ Port()
int XrdNetAddr::Port |
( |
int |
pNum = -1 | ) |
|
Optionally set and also returns the port number for our address.
- Parameters
-
pNum | when negative it only returns the current port. Otherwise, it is taken as the value to be set. |
- Returns
- Success: The port number, which may be 0 if not set. Failure: -1 address is not an internet address or port is invalid.
◆ Register()
bool XrdNetAddr::Register |
( |
const char * |
hName | ) |
|
Register a host name with this IP address. This is not MT-safe!
- Parameters
-
hName | -> to a true host name which should be fully qualified. One of the IP addresses registered to this name must match the IP address associated with this object. |
- Returns
- True: Specified name is now associated with this address. False: Nothing changed, registration could not be verified.
◆ Set() [1/5]
const char * XrdNetAddr::Set |
( |
const char * |
hSpec, |
|
|
int & |
numIP, |
|
|
int |
maxIP, |
|
|
int |
pNum = PortInSpec , |
|
|
bool |
forUDP = false |
|
) |
| |
Return multiple addresses. This form can only be used on the first element of this object that has been allocated as an array. This method is useful for getting all of the aliases assigned to a dns entry. The file descriptor association is set to a negative value.
- Parameters
-
hSpec | 0 -> address is set to in6addr_any for binding via bind() !0 -> convert specification to an address. Valid formats: IP.v4: nnn.nnn.nnn.nnn[:<port>] IP.v6: [ipv6_addr][:<port>] IP.xx: name[:port] xx is determined by getaddrinfo() |
maxIP | number of elements in the array. |
numIP | the number of IP addresses actually set (returned value). |
pNum | >= 0 uses the value as the port number regardless of what is in hSpec, should it be supplied. However, if is present, it must be a valid port number or name. < 0 uses the positive value as the port number if the port number has not been specified in hSpec. **** When set to PortInSpec(the default, see below) the port number/name must be specified in hSpec. If it is not, an error is returned. |
forUDP | when true addresses are usable for UDP connections. Otherwise, they are for TCP connections. |
- Returns
- Success: 0 with numIP set to the number of elements set. Failure: the error message text describing the error and numIP is set to zero. The message is in persistent storage and cannot be modified.
◆ Set() [2/5]
const char * XrdNetAddr::Set |
( |
const char * |
hSpec, |
|
|
int |
pNum = PortInSpec |
|
) |
| |
◆ Set() [3/5]
const char * XrdNetAddr::Set |
( |
const struct sockaddr * |
sockP, |
|
|
int |
sockFD = -1 |
|
) |
| |
Set our address via a sockaddr structure.
- Parameters
-
sockP | a pointer to an initialized and valid sockaddr structure. |
sockFD | the associated file descriptor and can be used to record the file descriptor returned by accept(). |
- Returns
- Success: Returns 0. Failure: Returns the error message text describing the error. The message is in persistent storage and cannot be modified.
◆ Set() [4/5]
const char * XrdNetAddr::Set |
( |
int |
sockFD, |
|
|
bool |
peer = true |
|
) |
| |
Set our address from the supplied socket file descriptor.
- Parameters
-
sockFD | a connected socket file descriptor. The value is also recorded as the associated file descriptor. |
peer | When true the address is set from getpeername() When false the address is set from getsockname() |
- Returns
- Success: Returns 0. Failure: Returns the error message text describing the error. The message is in persistent storage and cannot be modified.
◆ Set() [5/5]
const char * XrdNetAddr::Set |
( |
struct addrinfo * |
rP, |
|
|
int |
port, |
|
|
bool |
mapit = false |
|
) |
| |
Set our address via and addrinfo structure and initialize the port.
- Parameters
-
rP | pointer to an addrinfo structure. |
port | the port number to set. |
mapit | when true maps IPv4 addresses to IPv6. Otherwise, does not. |
- Returns
- Success: Returns 0. Failure: Returns the error message text describing the error. The message is in persistent storage and cannot be modified.
◆ SetCache()
static void XrdNetAddr::SetCache |
( |
int |
keeptime | ) |
|
|
static |
Set the cache time for address to name resolutions. This method should only be called during initialization time. The default is to not use the cache.
◆ SetDialect()
void XrdNetAddr::SetDialect |
( |
const char * |
dP | ) |
|
|
inline |
Set the dialect being spoken on this network link.
- Parameters
-
dP | Pointer to the dialect name. It must be permanently stable. |
References XrdNetAddrInfo::protName.
◆ SetDynDNS()
static void XrdNetAddr::SetDynDNS |
( |
bool |
onoff | ) |
|
|
static |
Indicate whether or not dynamic DNS is being used. This method should only be called during initialization time. The default is fixed DNS.
- Parameters
-
onoff | True if dynamic DNS is being used, false otherwise. |
◆ SetIPV4()
static void XrdNetAddr::SetIPV4 |
( |
| ) |
|
|
static |
Force this object to work in IPV4 mode only. This method permanently sets IPV4 mode which cannot be undone without a restart. It is meant to bypass broken IPV6 stacks on those unfortunate hosts that have one. It should be called before any other calls to this object (e.g. initialization time).
◆ SetIPV6()
static void XrdNetAddr::SetIPV6 |
( |
| ) |
|
|
static |
Force this object to work in IPV6 mode using IPV6 or mapped IPV4 addresses. This method permanently sets IPV6 mode which cannot be undone without a restart. It is meant to disable the default mode which determines which address to use based on which address types are configured on the host (i.e. getaddrinfo() with hints AI_ADDRCONFIG|AI_V4MAPPED).
◆ SetLocation()
Set the location for this address
- Parameters
-
loc | pointer to the structure that describes the location. See XrdnetAddrInfo for the definition of the stucture. |
Referenced by XrdLinkXeq::setLocation().
◆ SetTLS()
void XrdNetAddr::SetTLS |
( |
bool |
val | ) |
|
Set the location's TLS state.
- Parameters
-
val | True if TLS is being used, false otherwise. |
◆ dynDNS
◆ hostHints
struct addrinfo* XrdNetAddr::hostHints |
|
staticprivate |
◆ huntHintsTCP
struct addrinfo* XrdNetAddr::huntHintsTCP |
|
staticprivate |
◆ huntHintsUDP
struct addrinfo* XrdNetAddr::huntHintsUDP |
|
staticprivate |
◆ PortInSpec
const int XrdNetAddr::PortInSpec = (int)0x80000000 |
|
static |
Set the IP address and possibly the port number.
- Parameters
-
hSpec | 0 -> address is set to in6addr_any for binding via bind() (INADDR_ANY in IPV4 mode). !0 -> convert specification to an address. Valid formats: IPv4: nnn.nnn.nnn.nnn[:<port>] IPv6: [ipv6_addr][:<port>] addr brackets required IPvx: name[:port] x is determined by getaddrinfo() Unix: /<path> |
pNum | >= 0 uses the value as the port number regardless of what is in hSpec, should it be supplied. However, if is present, it must be a valid port number or name. < 0 uses the positive value as the port number if the port number has not been specified in hSpec. **** When set to PortInSpec(the default, see below) the port number/name must be specified in hSpec. If it is not, an error is returned. |
- Returns
- Success: 0. Failure: Error message text describing the error. The message is in persistent storage and cannot be modified.
◆ useIPV4
The documentation for this class was generated from the following file: