1 #ifndef __XRDNETUTILS_HH__
2 #define __XRDNETUTILS_HH__
156 const char *
GetAddrs(
const std::string &hSpec, std::vector<XrdNetAddr> &aVec,
180 const char *
GetAddrs(std::vector<std::string> &hSVec,
181 std::vector<XrdNetAddr> &aVec,
183 unsigned int rotNum=0,
bool force=
false);
207 int GetSokInfo(
int fd,
char *theAddr,
int theALen,
char &theType);
232 XrdOucTList *
Hosts(
const char *hSpec,
int hPort=-1,
int hWant=8,
int *sPort=0,
233 const char **eText=0);
258 static int IPFormat(
const struct sockaddr *sAddr,
char *bP,
int bL,
int opts=0);
282 static int IPFormat(
int fd,
char *bP,
int bL,
int opts=0);
302 static bool Match(
const char *hName,
const char *pattern);
319 static char *
MyHostName(
const char *eName=
"*unknown*",
const char **eText=0);
365 static bool Parse(
const char *hSpec,
const char **hName,
const char **hNend,
366 const char **hPort,
const char **hPend);
378 static int Port(
int fd,
const char **eText=0);
388 static int ProtoID(
const char *pName);
401 static int ServPort(
const char *sName,
bool isUDP=
false,
const char **eText=0);
428 static bool Singleton(
const char *hSpec,
const char **eText=0);
430 static bool ConnectWithTimeout(
int sockfd,
const struct sockaddr* clientAddr,
size_t clientAddrLen,uint32_t timeout_sec, std::stringstream & errMsg);
446 int *ordn=0,
unsigned int rotNum=0);
453 const char *getMyFQN(
const char *&myDom);
454 static int setET(
const char **errtxt,
int rc);
455 static bool SetSockBlocking(
int sockfd,
bool blocking, std::stringstream & errMsg);
456 static int autoFamily;
457 static int autoHints;
#define XRDOUC_ENUM_OPERATORS(T)
static const int NoPortRaw
static bool Match(const char *hName, const char *pattern)
@ 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)