diff --git a/src/gateAs.cc b/src/gateAs.cc index 962347d..5935616 100644 --- a/src/gateAs.cc +++ b/src/gateAs.cc @@ -253,14 +253,22 @@ gateAsClient::gateAsClient(void) : } gateAsClient::gateAsClient(gateAsEntry *pEntry, const char *user, - const char *host) : + const char *host +#ifdef EPICS_HAS_AS_IPAG + ,epicsUInt32 ip_addr +#endif + ) : asclientpvt(NULL), asentry(pEntry), user_arg(NULL), user_func(NULL) { - if(pEntry&&asAddClient(&asclientpvt,pEntry->asmemberpvt,pEntry->level, - (char*)user,(char*)host) == 0) { + if(pEntry && asAddClient(&asclientpvt,pEntry->asmemberpvt,pEntry->level, + (char*)user ,(char*)host +#ifdef EPICS_HAS_AS_IPAG + ,ip_addr +#endif + ) == 0) { asPutClientPvt(asclientpvt,this); } diff --git a/src/gateAs.h b/src/gateAs.h index 374ecc3..a49bb4b 100644 --- a/src/gateAs.h +++ b/src/gateAs.h @@ -30,6 +30,8 @@ #include #include +#include + extern "C" { #include @@ -152,7 +154,11 @@ class gateAsClient { public: gateAsClient(void); - gateAsClient(gateAsEntry *pase, const char *user, const char *host); + gateAsClient(gateAsEntry *pase, const char *user, const char *host +#ifdef EPICS_HAS_AS_IPAG + ,epicsUInt32 ip_addr +#endif + ); ~gateAsClient(void); aitBool readAccess(void) const @@ -167,8 +173,17 @@ class gateAsClient // Used in virtual function setOwner from casChannel, not called // from Gateway. It is a security hole to support this, and it is // no longer implemented in base. - long changeInfo(const char* user, const char* host) - { return asChangeClient(asclientpvt,asentry->level,(char*)user,(char*)host);} + long changeInfo(const char* user, const char* host +#ifdef EPICS_HAS_AS_IPAG + ,epicsUInt32 ip_addr +#endif + ) + { return asChangeClient(asclientpvt,asentry->level, (char*)user , + (char*)host +#ifdef EPICS_HAS_AS_IPAG + ,ip_addr +#endif + );} #endif const char *user(void) { return (const char*)asclientpvt->user; } diff --git a/src/gateStat.cc b/src/gateStat.cc index eb01f95..1903c11 100644 --- a/src/gateStat.cc +++ b/src/gateStat.cc @@ -30,6 +30,8 @@ #include #endif +#include + #include #include #include "gateResources.h" @@ -59,8 +61,16 @@ static struct timespec *timeSpec(void) //////// gateStatChan (derived from gate chan derived from casChannel) gateStatChan::gateStatChan(const casCtx &ctx, casPV *casPvIn, gateAsEntry *asentry, - const char * const user, const char * const host) : - gateChan(ctx,casPvIn,asentry,user,host) + const char * const user, const char * const host +#ifdef EPICS_HAS_AS_IPAG + ,epicsUInt32 ip_addr +#endif + ) : + gateChan(ctx,casPvIn,asentry,user,host +#ifdef EPICS_HAS_AS_IPAG + ,ip_addr +#endif + ) { gateStat *pStat=(gateStat *)casPv; if(pStat) pStat->addChan(this); @@ -217,9 +227,17 @@ const char *gateStat::getName() const } casChannel* gateStat::createChannel(const casCtx &ctx, - const char * const user, const char * const host) + const char * const user, const char * const host +#ifdef EPICS_HAS_AS_IPAG + ,epicsUInt32 ip_addr +#endif + ) { - gateStatChan *pChan=new gateStatChan(ctx,this,asentry,user,host); + gateStatChan *pChan=new gateStatChan(ctx,this,asentry,user,host +#ifdef EPICS_HAS_AS_IPAG + ,ip_addr +#endif + ); return pChan; } diff --git a/src/gateStat.h b/src/gateStat.h index e057c2d..1e73618 100644 --- a/src/gateStat.h +++ b/src/gateStat.h @@ -18,6 +18,8 @@ #ifndef GATE_STAT_H #define GATE_STAT_H +#include + #include "casdef.h" #include "aitTypes.h" @@ -38,7 +40,11 @@ class gateStatChan : public gateChan, public tsDLNode { public: gateStatChan(const casCtx &ctx, casPV *pvIn, gateAsEntry *asentryIn, - const char * const user, const char * const host); + const char * const user, const char * const host +#ifdef EPICS_HAS_AS_IPAG + ,epicsUInt32 ip_addr +#endif + ); ~gateStatChan(void); virtual caStatus write(const casCtx &ctx, const gdd &value); @@ -61,7 +67,11 @@ class gateStat : public casPV virtual unsigned maxSimultAsyncOps(void) const; virtual const char *getName() const; virtual casChannel *createChannel (const casCtx &ctx, - const char* const pUserName, const char* const pHostName); + const char* const pUserName, const char* const pHostName +#ifdef EPICS_HAS_AS_IPAG + ,epicsUInt32 ip_addr +#endif + ); caStatus write(const casCtx &ctx, const gdd &dd, gateChan &chan); diff --git a/src/gateVc.cc b/src/gateVc.cc index 6775827..06bcbb0 100644 --- a/src/gateVc.cc +++ b/src/gateVc.cc @@ -48,6 +48,8 @@ # include #endif +#include + #include #include #include @@ -113,14 +115,25 @@ void dumpdd(int step, const char *desc, const char * /*name*/, const gdd *dd) // gateAsClient::gateAsClient. We assume this storage is in the // server and just keep pointers to it. gateChan::gateChan(const casCtx &ctx, casPV *casPvIn, gateAsEntry *asentry, - const char * const userIn, const char * const hostIn) : + const char * const userIn, const char * const hostIn +#ifdef EPICS_HAS_AS_IPAG + ,epicsUInt32 ip_addrIn +#endif + ) : casChannel(ctx), casPv(casPvIn), user(userIn), host(hostIn) +#ifdef EPICS_HAS_AS_IPAG + ,ip_addr(ip_addrIn) +#endif { - asclient=new gateAsClient(asentry,user,host); + asclient=new gateAsClient(asentry,user,host +#ifdef EPICS_HAS_AS_IPAG + ,ip_addr +#endif + ); if(asclient) asclient->setUserFunction(post_rights,this); } @@ -133,9 +146,17 @@ gateChan::~gateChan(void) // Virtual function from casChannel, not called from Gateway. It is a // security hole to support this, and it is no longer implemented in // base. -void gateChan::setOwner(const char* const u, const char* const h) +void gateChan::setOwner(const char* const u, const char* const h +#ifdef EPICS_HAS_AS_IPAG + ,epicsUInt32 ip_addr +#endif + ) { - asclient->changeInfo(u,h); + asclient->changeInfo(u,h +#ifdef EPICS_HAS_AS_IPAG + ,ip_addr +#endif + ); } #endif @@ -184,7 +205,11 @@ void gateChan::resetAsClient(gateAsEntry *asentry) // being destroyed or if the asentry is NULL if(!casPv || !asentry) return; - asclient=new gateAsClient(asentry,user,host); + asclient=new gateAsClient(asentry,user,host +#ifdef EPICS_HAS_AS_IPAG + ,ip_addr +#endif + ); if(asclient) { asclient->setUserFunction(post_rights,this); } @@ -211,8 +236,16 @@ void gateChan::deleteAsClient(void) // ------------------------gateVcChan gateVcChan::gateVcChan(const casCtx &ctx, casPV *casPvIn, gateAsEntry *asentry, - const char * const user, const char * const host) : - gateChan(ctx,casPvIn,asentry,user,host) + const char * const user, const char * const host +#ifdef EPICS_HAS_AS_IPAG + ,epicsUInt32 ip_addr +#endif + ) : + gateChan(ctx,casPvIn,asentry,user,host +#ifdef EPICS_HAS_AS_IPAG + ,ip_addr +#endif + ) { gateVcData *vc=(gateVcData *)casPv; if(vc) vc->addChan(this); @@ -492,10 +525,18 @@ void gateVcData::destroy(void) } casChannel* gateVcData::createChannel(const casCtx &ctx, - const char * const user, const char * const host) + const char * const user, const char * const host +#ifdef EPICS_HAS_AS_IPAG + ,epicsUInt32 ip_addr +#endif + ) { gateDebug0(5,"gateVcData::createChannel()\n"); - gateVcChan* chan = new gateVcChan(ctx,this,asentry,user,host); + gateVcChan* chan = new gateVcChan(ctx,this,asentry,user,host +#ifdef EPICS_HAS_AS_IPAG + ,ip_addr +#endif + ); return chan; } diff --git a/src/gateVc.h b/src/gateVc.h index 02f96c1..c8a6bd9 100644 --- a/src/gateVc.h +++ b/src/gateVc.h @@ -34,6 +34,8 @@ # include #endif +#include + #include #include "casdef.h" @@ -74,14 +76,22 @@ class gateChan : public casChannel { public: gateChan(const casCtx &ctx, casPV *pvIn, gateAsEntry *asentryIn, - const char * const user, const char * const host); + const char * const user, const char * const host +#ifdef EPICS_HAS_AS_IPAG + ,epicsUInt32 ip_addr +#endif + ); ~gateChan(void); #ifdef SUPPORT_OWNER_CHANGE // Virtual function from casChannel, not called from Gateway. It // is a security hole to support this, and it is no longer // implemented in base. - virtual void setOwner(const char * const user, const char * const host); + virtual void setOwner(const char * const user, const char * const host +#ifdef EPICS_HAS_AS_IPAG + ,epicsUInt32 ip_addr +#endif + ); #endif void report(FILE *fp); @@ -103,13 +113,20 @@ class gateChan : public casChannel gateAsClient *asclient; // Must be deleted when done using it const char *user; const char *host; +#ifdef EPICS_HAS_AS_IPAG + epicsUInt32 ip_addr; +#endif }; class gateVcChan : public gateChan, public tsDLNode { public: gateVcChan(const casCtx &ctx, casPV *pvIn, gateAsEntry *asentryIn, - const char * const user, const char * const host); + const char * const user, const char * const host +#ifdef EPICS_HAS_AS_IPAG + ,epicsUInt32 ip_addr +#endif + ); ~gateVcChan(void); virtual caStatus write(const casCtx &ctx, const gdd &value); @@ -138,7 +155,11 @@ class gateVcData : public casPV, public tsDLHashNode virtual unsigned maxDimension(void) const; virtual aitIndex maxBound(unsigned dim) const; virtual casChannel *createChannel (const casCtx &ctx, - const char* const pUserName, const char* const pHostName); + const char* const pUserName, const char* const pHostName +#ifdef EPICS_HAS_AS_IPAG + ,epicsUInt32 ip_addr +#endif + ); virtual const char *getName() const; caStatus write(const casCtx &ctx, const gdd &value, gateChan &chan); diff --git a/src/gateway.cc b/src/gateway.cc index 8cc83fb..2533af2 100644 --- a/src/gateway.cc +++ b/src/gateway.cc @@ -591,11 +591,17 @@ static int startEverything(char *prefix) printf("CA Protocol version %s\n", ca_version()); printEnv(stdout,"EPICS_CA_ADDR_LIST"); printEnv(stdout,"EPICS_CA_AUTO_ADDR_LIST"); +#ifdef EPICS_HAS_CA_IGNORE_NET_LIST + printEnv(stdout,"EPICS_CA_IGNORE_NET_LIST"); +#endif printEnv(stdout,"EPICS_CA_SERVER_PORT"); printEnv(stdout,"EPICS_CA_MAX_ARRAY_BYTES"); printEnv(stdout,"EPICS_CAS_INTF_ADDR_LIST"); printEnv(stdout,"EPICS_CAS_SERVER_PORT"); printEnv(stdout,"EPICS_CAS_IGNORE_ADDR_LIST"); +#ifdef EPICS_HAS_CAS_IGNORE_NET_LIST + printEnv(stdout,"EPICS_CAS_IGNORE_NET_LIST"); +#endif printEnv(stdout,"EPICS_CAS_AUTO_BEACON_ADDR_LIST"); printEnv(stdout,"EPICS_CAS_BEACON_ADDR_LIST");