Skip to content

Commit

Permalink
Complete handling of IPv6/IPv4 and public/private network routing.
Browse files Browse the repository at this point in the history
  • Loading branch information
abh3 committed Jun 27, 2014
1 parent cf8a49f commit ab908b8
Show file tree
Hide file tree
Showing 22 changed files with 920 additions and 514 deletions.
26 changes: 18 additions & 8 deletions src/XProtocol/YProtocol.hh
Expand Up @@ -215,12 +215,17 @@ struct CmsLocateRequest
// kXR_string Ident;
// kXR_unt32 Opts;

enum {kYR_refresh = 0x01,
kYR_retipv4 = 0x02,
kYR_retipv6 = 0x04,
kYR_retname = 0x08,
kYR_asap = 0x80,
kYR_prvtnet = 0x20
enum {kYR_refresh = 0x0001,
kYR_retname = 0x0002,
kYR_asap = 0x0080,
kYR_retipv4 = 0x0000, // Client is only IPv4
kYR_retipv46= 0x1000, // Client is IPv4 IPv6
kYR_retipv6 = 0x2000, // Client is only IPv6
kYR_retipv64= 0x3000, // Client is IPv6 IPv4
kYR_retipmsk= 0x3000, // Mask to isolate retipcxx bits
kYR_retipsft= 12, // Shift to convert retipcxx bits
kYR_listall = 0x4000, // List everything regardless of other settings
kYR_prvtnet = 0x8000, // Client is using a orivate address
};
// kXR_string Path;

Expand Down Expand Up @@ -457,8 +462,13 @@ enum {kYR_refresh = 0x0001,
kYR_stat = 0x0040, // Exclsuive
kYR_metaop = 0x0080,
kYR_replica = 0x0100, // Only in combination with create
kYR_prvtnet = 0x0200, // Client is using a private net address
kYR_ipv4net = 0x0400 // Client is using an ipv4 net address
kYR_retipv4 = 0x0000, // Client is only IPv4
kYR_retipv46= 0x1000, // Client is IPv4 IPv6
kYR_retipv6 = 0x2000, // Client is only IPv6
kYR_retipv64= 0x3000, // Client is IPv6 IPv4
kYR_retipmsk= 0x3000, // Mask to isolate retipcxx bits
kYR_retipsft= 12, // Shift to convert retipcxx bits
kYR_prvtnet = 0x8000, // Client is using a orivate address
};
// kXR_string Path;
// kXR_string Opaque; // Optional
Expand Down
9 changes: 8 additions & 1 deletion src/Xrd/XrdConfig.cc
Expand Up @@ -206,7 +206,7 @@ int XrdConfig::Configure(int argc, char **argv)
static const int myMaxc = 80;
char *myArgv[myMaxc], argBuff[myMaxc*3+8];
char *argbP = argBuff, *argbE = argbP+sizeof(argBuff)-4;
char *ifList;
char *ifList = 0;
int myArgc = 1, bindArg = 1;
bool ipV4 = false, ipV6 = false, pureLFN = false;

Expand Down Expand Up @@ -446,6 +446,13 @@ int XrdConfig::Configure(int argc, char **argv)
if (ppNet && XrdNetIF::GetIF(ifList, 0, true))
XrdOucEnv::Export("XRDIFADDRS",ifList);

// Configure network routing
//
if (!XrdInet::netIF.SetIF(myIPAddr, ifList))
{Log.Emsg("Config", "Unable to determine interface addresses!");
NoGo = 1;
}

// Now initialize the default protocl
//
if (!NoGo) NoGo = Setup(dfltProt);
Expand Down
2 changes: 2 additions & 0 deletions src/Xrd/XrdInet.cc
Expand Up @@ -52,6 +52,8 @@

const char *XrdInet::TraceID = "Inet";

XrdNetIF XrdInet::netIF;

/******************************************************************************/
/* A c c e p t */
/******************************************************************************/
Expand Down
4 changes: 4 additions & 0 deletions src/Xrd/XrdInet.hh
Expand Up @@ -32,6 +32,7 @@
#include <unistd.h>

#include "XrdNet/XrdNet.hh"
#include "XrdNet/XrdNetIF.hh"

// The XrdInet class defines a generic network where we can define common
// initial tcp/ip and udp operations. It is based on the generalized network
Expand All @@ -57,6 +58,9 @@ void Secure(XrdNetSecurity *secp);
XrdInet(XrdSysError *erp, XrdOucTrace *tP, XrdNetSecurity *secp=0)
: XrdNet(erp,0), Patrol(secp), XrdTrace(tP) {}
~XrdInet() {}
static
XrdNetIF netIF;

private:

XrdNetSecurity *Patrol;
Expand Down
2 changes: 1 addition & 1 deletion src/XrdCms/XrdCmsCache.cc
Expand Up @@ -442,7 +442,7 @@ void XrdCmsCache::Add2Q(XrdCmsRRQInfo *Info, XrdCmsKeyItem *iP, int selOpts)
//
Info->Key = iP;
Info->isRW= isrw;
Info->prvt= (selOpts & XrdCmsSelect::Private) != 0;
Info->ifOP= (selOpts & XrdCmsSelect::ifWant);
if (!(Slot = RRQ.Add(Slot, Info))) Info->Key = 0;
else if (isrw) iP->Loc.rwPend = Slot;
else iP->Loc.roPend = Slot;
Expand Down

0 comments on commit ab908b8

Please sign in to comment.