#include <log4cpp/Category.hh>
#include <xercesc/framework/URLInputSource.hpp>
+using namespace std;
+using namespace log4cpp;
+using namespace saml;
+using namespace shibboleth;
+using namespace shibtarget;
+
namespace shibtarget {
class XMLApplicationMapperImpl : public ReloadableXMLFileImpl
#include "ccache-utils.h"
-#include <log4cpp/Category.hh>
-
-using namespace std;
-using namespace log4cpp;
-using namespace saml;
-using namespace shibboleth;
-using namespace shibtarget;
-
namespace shibtarget {
// An implementation of the URL->application mapping API using an XML file
- class XMLApplicationMapper : public IApplicationMapper, public ReloadableXMLFile
+ class XMLApplicationMapper : public IApplicationMapper, public shibboleth::ReloadableXMLFile
{
public:
- XMLApplicationMapper(const char* pathname) : ReloadableXMLFile(pathname) {}
+ XMLApplicationMapper(const char* pathname) : shibboleth::ReloadableXMLFile(pathname) {}
~XMLApplicationMapper() {}
const char* getApplicationFromURL(const char* url) const;
) const;
protected:
- virtual ReloadableXMLFileImpl* newImplementation(const char* pathname) const;
+ virtual shibboleth::ReloadableXMLFileImpl* newImplementation(const char* pathname) const;
};
class STConfig : public ShibTargetConfig
void shutdown();
ShibINI& getINI() const { return *ini; }
IApplicationMapper* getApplicationMapper() const { return m_applicationMapper; }
- saml::Iterator<IMetadata*> getMetadataProviders() const { return metadatas; }
- saml::Iterator<ITrust*> getTrustProviders() const { return trusts; }
- saml::Iterator<ICredentials*> getCredentialProviders() const { return creds; }
- saml::Iterator<IAAP*> getAAPProviders() const { return aaps; }
+ saml::Iterator<shibboleth::IMetadata*> getMetadataProviders() const { return metadatas; }
+ saml::Iterator<shibboleth::ITrust*> getTrustProviders() const { return trusts; }
+ saml::Iterator<shibboleth::ICredentials*> getCredentialProviders() const { return creds; }
+ saml::Iterator<shibboleth::IAAP*> getAAPProviders() const { return aaps; }
saml::Iterator<const XMLCh*> getPolicies() const { return saml::Iterator<const XMLCh*>(policies); }
private:
std::vector<std::string> m_SocketACL;
#endif
IApplicationMapper* m_applicationMapper;
- std::vector<IMetadata*> metadatas;
- std::vector<ITrust*> trusts;
- std::vector<ICredentials*> creds;
- std::vector<IAAP*> aaps;
+ std::vector<shibboleth::IMetadata*> metadatas;
+ std::vector<shibboleth::ITrust*> trusts;
+ std::vector<shibboleth::ICredentials*> creds;
+ std::vector<shibboleth::IAAP*> aaps;
- friend ShibSockName ::shib_target_sockname();
- friend ShibSockName ::shib_target_sockacl(unsigned int);
+ friend const char* ::shib_target_sockname();
+ friend const char* ::shib_target_sockacl(unsigned int);
};
class XML
#include <dmalloc.h>
#endif
+using namespace std;
+using namespace log4cpp;
+using namespace saml;
+using namespace shibboleth;
+using namespace shibtarget;
+
class InternalCCache;
class InternalCCacheEntry : public CCacheEntry
{
#define SHIBTARGET_INIFILE "/opt/shibboleth/etc/shibboleth/shibboleth.ini"
#endif
+using namespace std;
+using namespace log4cpp;
+using namespace saml;
+using namespace shibboleth;
+using namespace shibtarget;
+
namespace {
STConfig * g_Config = NULL;
Mutex * g_lock = NULL;
}
}
-extern "C" ShibSockName shib_target_sockname(void)
+extern "C" const char* shib_target_sockname(void)
{
- return (g_Config ? g_Config->m_SocketName.c_str() : (ShibSockName)0);
+ return g_Config ? g_Config->m_SocketName.c_str() : NULL;
}
-extern "C" ShibSockName shib_target_sockacl(unsigned int index)
+extern "C" const char* shib_target_sockacl(unsigned int index)
{
#ifdef WANT_TCP_SHAR
if (g_Config && index<g_Config->m_SocketACL.size())
return g_Config->m_SocketACL[index].c_str();
#endif
- return (ShibSockName)0;
+ return NULL;
}
ApplicationMapper::ApplicationMapper() : m_mapper(ShibTargetConfig::getConfig().getApplicationMapper())
#include "internal.h"
#include <shib/shib-threads.h>
+#include <log4cpp/Category.hh>
#include <sstream>
#include <iostream>
#include <sys/types.h>
#include <sys/stat.h>
+using namespace std;
+using namespace saml;
+using namespace shibboleth;
+using namespace shibtarget;
+
class HeaderIterator : public shibtarget::ShibINI::Iterator {
public:
HeaderIterator (ShibINIPriv* ini);
#include <sstream>
#include <ctype.h>
#include <xercesc/util/XercesDefs.hpp>
+#include <log4cpp/Category.hh>
+
+using namespace std;
+using namespace log4cpp;
+using namespace saml;
+using namespace shibboleth;
+using namespace shibtarget;
class shibtarget::ShibMLPPriv {
public:
#include <dmalloc.h>
#endif
+#include <log4cpp/Category.hh>
+
+using namespace std;
+using namespace log4cpp;
+using namespace saml;
+using namespace shibboleth;
+using namespace shibtarget;
+
class shibtarget::ResourceEntryPriv
{
public:
#include <sstream>
#include <stdexcept>
+using namespace std;
+using namespace log4cpp;
+using namespace saml;
+using namespace shibboleth;
+using namespace shibtarget;
+
class shibtarget::RMPriv
{
public:
#include <stdexcept>
#include <sstream>
#include <typeinfo>
+#include <log4cpp/Category.hh>
+
+using namespace std;
+using namespace log4cpp;
+using namespace saml;
+using namespace shibboleth;
+using namespace shibtarget;
namespace {
int initializing = 0;
#include <shib/shib-threads.h>
#include <stdexcept>
+#include <log4cpp/Category.hh>
+
+using namespace std;
+using namespace log4cpp;
+using namespace saml;
+using namespace shibboleth;
+using namespace shibtarget;
class shibtarget::RPCHandleInternal
{
CLIENT * m_clnt;
ShibSocket m_sock;
- ShibSockName m_shar;
+ const char* m_shar;
u_long m_program;
u_long m_version;
//*************************************************************************
// RPCHandle Implementation
-RPCHandle::RPCHandle(ShibSockName shar, u_long program, u_long version)
+RPCHandle::RPCHandle(const char* shar, u_long program, u_long version)
{
m_priv = new RPCHandleInternal();
}
RPCHandle* RPCHandle::get_handle(ThreadKey* key,
- ShibSockName shar, u_long program,
+ const char* shar, u_long program,
u_long version)
{
RPCHandle* retval = (RPCHandle*)key->getData();
#endif
#include <stdexcept>
+#include <log4cpp/Category.hh>
+
+using namespace std;
+using namespace log4cpp;
+using namespace saml;
+using namespace shibboleth;
+using namespace shibtarget;
class shibtarget::SHIREPriv
{
#include <errno.h>
#if defined(WANT_TCP_SHAR)
-static void setup_tcp_sockaddr(struct sockaddr_in *addr, ShibSockName name)
+static void setup_tcp_sockaddr(struct sockaddr_in *addr, const char* name)
{
// Split on host:port boundary. Default to port only.
char* dup=strdup(name);
return 0;
}
-int shib_sock_bind(ShibSocket s, ShibSockName name)
+int shib_sock_bind(ShibSocket s, const char* name)
{
struct sockaddr_in addr;
int res;
return map_winsock_result(listen(s,3));
}
-int shib_sock_connect(ShibSocket s, ShibSockName name)
+int shib_sock_connect(ShibSocket s, const char* name)
{
struct sockaddr_in addr;
setup_tcp_sockaddr(&addr,name);
return map_winsock_result(connect(s,(struct sockaddr *)&addr,sizeof(addr)));
}
-void shib_sock_close(ShibSocket s, ShibSockName name)
+void shib_sock_close(ShibSocket s, const char* name)
{
int rc=map_winsock_result(closesocket(s));
}
int shib_sock_accept(ShibSocket listener, ShibSocket* s)
{
unsigned int index=0;
- ShibSockName acl,client;
+ const char *acl,*client;
struct sockaddr_in addr;
size_t size=sizeof(addr);
if(*s==INVALID_SOCKET)
return get_winsock_errno();
client=inet_ntoa(addr.sin_addr);
- while ((acl=shib_target_sockacl(index++))!=(ShibSockName)0)
+ while (acl=shib_target_sockacl(index++))
{
if (!strcmp(acl,client))
return 0;
}
- shib_sock_close(*s,(ShibSockName)0);
+ shib_sock_close(*s,NULL);
*s=-1;
fprintf(stderr,"shib_sock_accept(): rejected client at %s\n",client);
return EACCES;
*
* NOTE: This will close the socket on failure
*/
-int shib_sock_bind(ShibSocket s, ShibSockName name)
+int shib_sock_bind(ShibSocket s, const char* name)
{
#ifdef WANT_TCP_SHAR
struct sockaddr_in addr;
}
/* Connect the socket to the local host and "port name" */
-int shib_sock_connect(ShibSocket s, ShibSockName name)
+int shib_sock_connect(ShibSocket s, const char* name)
{
#ifdef WANT_TCP_SHAR
struct sockaddr_in addr;
}
/* close the socket (and remove the file) */
-void shib_sock_close(ShibSocket s, ShibSockName name)
+void shib_sock_close(ShibSocket s, const char* name)
{
#ifndef WANT_TCP_SHAR
if (name) {
{
#ifdef WANT_TCP_SHAR
unsigned int index=0;
- ShibSockName acl,client;
+ const char *acl,*client;
struct sockaddr_in addr;
size_t size=sizeof(addr);
if (*s < 0)
return errno;
client=inet_ntoa(addr.sin_addr);
- while ((acl=shib_target_sockacl(index++))!=(ShibSockName)0)
+ while (acl=shib_target_sockacl(index++))
{
if (!strcmp(acl,client))
return 0;
}
- shib_sock_close(*s,(ShibSockName)0);
+ shib_sock_close(*s,NULL);
*s=-1;
fprintf(stderr,"shib_sock_accept(): rejected client at %s\n",client);
return EACCES;
#include "internal.h"
+#include <log4cpp/Category.hh>
+
+using namespace std;
+using namespace shibtarget;
+
/* shib-target.cpp */
namespace {
#include <winsock.h>
typedef SOCKET ShibSocket;
-typedef const char* ShibSockName;
#define SHIB_SHAR_SOCKET "127.0.0.1:12345" /* TCP host:port */
#else /* UNIX */
typedef int ShibSocket;
-typedef const char* ShibSockName;
#define SHIB_SHAR_SOCKET "/tmp/shar-socket" /* Unix domain socket */
#endif
*
* SIDE EFFECT: On error, the socket is closed!
*/
-SHIBTARGET_EXPORTS int shib_sock_bind (ShibSocket s, ShibSockName name);
+SHIBTARGET_EXPORTS int shib_sock_bind (ShibSocket s, const char* name);
/*
* connect the socket s to the "port" name on the local host.
*
* Returns 0 on success; non-zero on error.
*/
-SHIBTARGET_EXPORTS int shib_sock_connect (ShibSocket s, ShibSockName name);
+SHIBTARGET_EXPORTS int shib_sock_connect (ShibSocket s, const char* name);
/*
* accept a connection. Returns 0 on success, non-zero on failure.
/*
* close the socket
*/
-SHIBTARGET_EXPORTS void shib_sock_close (ShibSocket s, ShibSockName name);
+SHIBTARGET_EXPORTS void shib_sock_close (ShibSocket s, const char* name);
/* shib-target.cpp */
SHIBTARGET_EXPORTS void shib_target_finalize (void);
/* access socket specifics from C code */
-SHIBTARGET_EXPORTS ShibSockName shib_target_sockname(void);
-SHIBTARGET_EXPORTS ShibSockName shib_target_sockacl(unsigned int index);
+SHIBTARGET_EXPORTS const char* shib_target_sockname(void);
+SHIBTARGET_EXPORTS const char* shib_target_sockacl(unsigned int index);
#ifdef __cplusplus
}
class SHIBTARGET_EXPORTS RPCHandle
{
public:
- RPCHandle(ShibSockName shar, u_long program, u_long version);
+ RPCHandle(const char* shar, u_long program, u_long version);
~RPCHandle();
CLIENT * connect(void); /* locks the HANDLE and returns the CLIENT */
// A simple function to get a handle
// Note that it does not check that an existing handle matches the request.
static RPCHandle* get_handle(shibboleth::ThreadKey* key,
- ShibSockName shar, u_long program,
+ const char* shar, u_long program,
u_long version);
private:
#include <dmalloc.h>
#endif
+#include <log4cpp/Category.hh>
+
+using namespace std;
+using namespace log4cpp;
+using namespace saml;
+using namespace shibboleth;
+using namespace shibtarget;
+
static string get_threadid (const char* proc)
{
static u_long counter = 0;