1 #ifndef __XRDNETUTILS_HH__
2 #define __XRDNETUTILS_HH__
174 const char *
GetAddrs(
const std::string &hSpec, std::vector<XrdNetAddr> &aVec,
198 const char *
GetAddrs(std::vector<std::string> &hSVec,
199 std::vector<XrdNetAddr> &aVec,
201 unsigned int rotNum=0,
bool force=
false);
225 int GetSokInfo(
int fd,
char *theAddr,
int theALen,
char &theType);
250 XrdOucTList *
Hosts(
const char *hSpec,
int hPort=-1,
int hWant=8,
int *sPort=0,
251 const char **eText=0);
276 static int IPFormat(
const struct sockaddr *sAddr,
char *bP,
int bL,
int opts=0);
300 static int IPFormat(
int fd,
char *bP,
int bL,
int opts=0);
320 static bool Match(
const char *hName,
const char *pattern);
337 static char *
MyHostName(
const char *eName=
"*unknown*",
const char **eText=0);
383 static bool Parse(
const char *hSpec,
const char **hName,
const char **hNend,
384 const char **hPort,
const char **hPend);
396 static int Port(
int fd,
const char **eText=0);
406 static int ProtoID(
const char *pName);
419 static int ServPort(
const char *sName,
bool isUDP=
false,
const char **eText=0);
446 static bool Singleton(
const char *hSpec,
const char **eText=0);
448 static bool ConnectWithTimeout(
int sockfd,
const struct sockaddr* clientAddr,
size_t clientAddrLen,uint32_t timeout_sec, std::stringstream & errMsg);
464 int *ordn=0,
unsigned int rotNum=0);
471 const char *getMyFQN(
const char *&myDom);
472 static int setET(
const char **errtxt,
int rc);
473 static bool SetSockBlocking(
int sockfd,
bool blocking, std::stringstream & errMsg);
474 static int autoFamily;
475 static int autoHints;
#define XRDOUC_ENUM_OPERATORS(T)
static const int NoPortRaw
static bool Match(const char *hName, const char *pattern)
static IPComp Compare(XrdNetSockAddr &ip1, XrdNetSockAddr &ip2, bool *psame=0)
@ qryINET
Only consider internet protocols via DNS.
@ qryINIF
Only consider internet protocols via ifconfig.
static char * MyHostName(const char *eName="*unknown*", const char **eText=0)
static int GetSokInfo(int fd, char *theAddr, int theALen, char &theType)
static int Encode(const XrdNetSockAddr *sadr, char *buff, int blen, int port=-1)
@ hasNone
Unable to determine available protocols.
static int IPFormat(const struct sockaddr *sAddr, char *bP, int bL, int opts=0)
static bool Singleton(const char *hSpec, const char **eText=0)
static const char * GetAddrs(const char *hSpec, XrdNetAddr *aListP[], int &aListN, AddrOpts opts=allIPMap, int pNum=PortInSpec)
static int Decode(XrdNetSockAddr *sadr, const char *buff, int blen)
static NetProt NetConfig(NetType netquery=qryINET, const char **eText=0)
static const int PortInSpec
static bool ConnectWithTimeout(int sockfd, const struct sockaddr *clientAddr, size_t clientAddrLen, uint32_t timeout_sec, std::stringstream &errMsg)
static int Port(int fd, const char **eText=0)
~XrdNetUtils()
Destructor.
static int ProtoID(const char *pName)
static int ServPort(const char *sName, bool isUDP=false, const char **eText=0)
static XrdOucTList * Hosts(const char *hSpec, int hPort=-1, int hWant=8, int *sPort=0, const char **eText=0)
XrdNetUtils()
Constructor.
static bool Parse(const char *hSpec, const char **hName, const char **hNend, const char **hPort, const char **hPend)
static int SetAuto(AddrOpts aOpts=allIPMap)