1 #ifndef __XRDNETIF_HH__
2 #define __XRDNETIF_HH__
59 void Display(
const char *pfx=
"=====> ");
116 {
if (ifT >=
ifAny) ifT =
static_cast<ifType>(ifAvail);
117 name = ifName[ifT]->iVal;
118 return ifName[ifT]->iLen;
134 {
if (ifT >=
ifAny) ifT =
static_cast<ifType>(ifAvail);
135 strcpy(nbuff, ifName[ifT]->iVal); nport = ifPort;
136 return ifName[ifT]->iLen;
152 strcpy(nbuff, m_PublicName.c_str());
154 return m_PublicName.size();
167 if (name.size() > 255)
return false;
223 static int GetIF(
char *buff,
int blen,
const char **eText=0,
bool show=
false);
238 static int GetIF(
char *&ifline,
const char **eText=0,
bool show=
false);
268 {
return ifT >=
ifAny || ifDest[ifT]->iLen != 0;}
299 {
if (ifT >=
ifAny)
return 0x0f;
300 return ifMaskVec[ifT];
322 inline int Port() {
return ifPort;}
447 bool GenAddrs(ifAddrs &ifTab,
const char *hName,
bool wantV6);
448 bool GenIF(
XrdNetAddrInfo **src,
int srcnum,
const char *xName=0);
452 bool IsOkName(
const char *ifn,
short &ifIdx);
454 bool SetIF64(
bool retVal);
456 bool V4LinkLocal(
struct sockaddr *saP);
463 ifData() : iLen(0) {*iVal = 0;}
467 ifData *ifName[
ifMax];
468 ifData *ifDest[
ifMax];
472 struct pInfo {
char len;
474 pInfo() : len(0) {*val = 0;}
483 std::string m_PublicName;
488 const char *myDomain;
489 static char *ifCfg[2];
491 const char *ifTName[
ifMax];
493 const char *ifMaskVec;
497 static ifData ifNull;
static const int haveNoGI
ifList == 0 && getifaddrs() is not supported
bool SetIF(XrdNetAddrInfo *src, const char *ifList, int port=0, netType nettype=netDefault, const char *xName=0)
bool SetPublicName(const std::string &name)
static const int haveIPv4
ifList == 0 && non-local ipv4 i/f found (or'd)
static void SetRPIPA(bool rval)
int GetName(char *nbuff, int &nport, ifType ifT=PublicV6)
static bool InDomain(XrdNetAddrInfo *epaddr)
XrdNetIF()
Constructor and Destructor.
void Display(const char *pfx="=====> ")
int GetPublicName(char *nbuff, int &nport)
static int GetIF(XrdOucTList **ifList, const char **eText=0)
static void Routing(netType nettype)
static char Mask(ifType ifT)
static void SetMsgs(XrdSysError *erp)
bool HasDest(ifType ifT=PublicV6)
static void PortDefault(int pnum=1094)
static const int havePub6
ifList == 0 && public ipv6 i/f found (or'd)
static ifType GetIFType(bool conIPv4, bool hasIP64, bool pvtIP)
static bool SetIFNames(char *ifnames)
static const char * Name(ifType ifT)
int GetPublicDest(char *dest, size_t dlen)
int GetName(const char *&name, ifType ifT=PublicV6)
static const int havePub4
ifList == 0 && public ipv4 i/f found (or'd)
int GetDest(char *dest, int dlen, ifType ifT=PublicV6, bool prefn=false)
static const int haveIPv6
ifList == 0 && non-local ipv6 i/f found (or'd)
ifType
The enum that is used to index into ifData to get appropriate interface.
static const int havePrv6
ifList == 0 && private ipv6 i/f found (or'd)
static void Privatize(ifType &x)
static const int havePrv4
ifList == 0 && private ipv4 i/f found (or'd)