00001 // ---------------------------------------------------------------------------- 00002 // CERTI - HLA RunTime Infrastructure 00003 // Copyright (C) 2002-2005 ONERA 00004 // 00005 // This file is part of CERTI-libCERTI 00006 // 00007 // CERTI-libCERTI is free software ; you can redistribute it and/or 00008 // modify it under the terms of the GNU Lesser General Public License 00009 // as published by the Free Software Foundation ; either version 2 of 00010 // the License, or (at your option) any later version. 00011 // 00012 // CERTI-libCERTI is distributed in the hope that it will be useful, but 00013 // WITHOUT ANY WARRANTY ; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 // Lesser General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU Lesser General Public 00018 // License along with this program ; if not, write to the Free Software 00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00020 // USA 00021 // 00022 // $Id: SecurityServer.hh,v 3.11 2007/06/22 08:51:39 erk Exp $ 00023 // ---------------------------------------------------------------------------- 00024 00025 #ifndef _CERTI_SECURITY_SERVER_HH 00026 #define _CERTI_SECURITY_SERVER_HH 00027 00028 00029 #include "SocketServer.hh" 00030 #include "AuditFile.hh" 00031 #include "FederateLevelList.hh" 00032 #include "SecureTCPSocket.hh" 00033 00034 #include <list> 00035 00036 namespace certi { 00037 00048 class CERTI_EXPORT SecurityServer : private std::list<SecurityLevel *> 00049 { 00050 public: 00051 SecurityServer(SocketServer &, AuditFile &, Handle); 00052 ~SecurityServer(); 00053 00055 AuditFile &audit ; 00056 00057 Handle federation() const { return myFederation ; }; 00058 00059 Socket *getSocketLink(FederateHandle theFederate, 00060 TransportType theType = RELIABLE) const ; 00061 00062 // Security related methods 00063 bool dominates(SecurityLevelID A, SecurityLevelID B) const ; 00064 00065 bool canFederateAccessData(FederateHandle theFederate, 00066 SecurityLevelID theDataLevelID); 00067 00068 SecurityLevelID getLevelIDWithName(const char *theName); 00069 00070 void registerFederate(const char *the_federate, 00071 SecurityLevelID the_level_id); 00072 00073 private: 00074 Handle myFederation ; 00075 SocketServer &RTIG_SocketServer ; 00076 00077 SecurityLevelID LastLevelID ; 00078 FederateLevelList FedLevelList ; 00079 SecurityLevelID getLevel(const char *theFederate) const ; 00080 00081 void insertPublicLevel(); 00082 }; 00083 00084 } 00085 00086 #endif // _CERTI_SECURITY_SERVER_HH 00087 00088 // $Id: SecurityServer.hh,v 3.11 2007/06/22 08:51:39 erk Exp $