Change namespace
authorZofia Abramowska <z.abramowska@samsung.com>
Mon, 26 May 2014 14:04:56 +0000 (16:04 +0200)
committerBartlomiej Grzelewski <b.grzelewski@samsung.com>
Tue, 27 May 2014 13:53:03 +0000 (22:53 +0900)
Changing namespace CentralKeyManager to shorter version.

Change-Id: If0ce82ee574a0bb77c4c3e014cec60a2a37240ad

43 files changed:
src/manager/client/client-common.cpp
src/manager/client/client-common.h
src/manager/client/client-echo.cpp
src/manager/common/connection-info.h
src/manager/common/message-buffer.cpp
src/manager/common/message-buffer.h
src/manager/common/protocols.cpp
src/manager/common/protocols.h
src/manager/common/smack-check.cpp
src/manager/common/smack-check.h
src/manager/dpl/core/include/dpl/assert.h
src/manager/dpl/core/include/dpl/binary_queue.h
src/manager/dpl/core/include/dpl/colors.h
src/manager/dpl/core/include/dpl/exception.h
src/manager/dpl/core/include/dpl/noncopyable.h
src/manager/dpl/core/include/dpl/serialization.h
src/manager/dpl/core/include/dpl/singleton.h
src/manager/dpl/core/include/dpl/singleton_impl.h
src/manager/dpl/core/include/dpl/singleton_safe_impl.h
src/manager/dpl/core/src/assert.cpp
src/manager/dpl/core/src/binary_queue.cpp
src/manager/dpl/core/src/colors.cpp
src/manager/dpl/core/src/exception.cpp
src/manager/dpl/core/src/noncopyable.cpp
src/manager/dpl/log/include/dpl/log/abstract_log_provider.h
src/manager/dpl/log/include/dpl/log/dlog_log_provider.h
src/manager/dpl/log/include/dpl/log/log.h
src/manager/dpl/log/include/dpl/log/old_style_log_provider.h
src/manager/dpl/log/src/abstract_log_provider.cpp
src/manager/dpl/log/src/dlog_log_provider.cpp
src/manager/dpl/log/src/log.cpp
src/manager/dpl/log/src/old_style_log_provider.cpp
src/manager/main/generic-event.h
src/manager/main/generic-socket-manager.cpp
src/manager/main/generic-socket-manager.h
src/manager/main/key-manager-main.cpp
src/manager/main/key-manager-util.cpp
src/manager/main/key-manager-util.h
src/manager/main/service-thread.h
src/manager/main/socket-manager.cpp
src/manager/main/socket-manager.h
src/manager/service/echo.cpp
src/manager/service/echo.h

index 957a233..67e7609 100644 (file)
 //#include <key-manager.h>
 #include <ckm/errors.h>
 
-IMPLEMENT_SAFE_SINGLETON(CentralKeyManager::Log::LogSystem);
+IMPLEMENT_SAFE_SINGLETON(CKM::Log::LogSystem);
 
 namespace {
 
 const int POLL_TIMEOUT = 2000;
 
 void centKeyClientEnableLogSystem(void) {
-    CentralKeyManager::Singleton<CentralKeyManager::Log::LogSystem>::Instance().SetTag("CENT_KEY_CLIENT");
+    CKM::Singleton<CKM::Log::LogSystem>::Instance().SetTag("CENT_KEY_CLIENT");
 }
 
 int waitForSocket(int sock, int event, int timeout) {
@@ -166,7 +166,7 @@ private:
 
 } // namespace anonymous
 
-namespace CentralKeyManager {
+namespace CKM {
 
 
 int sendToServer(char const * const interface, const RawBuffer &send, MessageBuffer &recv) {
@@ -222,7 +222,7 @@ int try_catch(const std::function<int()>& func)
     try {
         return func();
     } catch (MessageBuffer::Exception::Base &e) {
-        LogError("CentralKeyManager::MessageBuffer::Exception " << e.DumpToString());
+        LogError("CKM::MessageBuffer::Exception " << e.DumpToString());
     } catch (std::exception &e) {
         LogError("STD exception " << e.what());
     } catch (...) {
@@ -231,7 +231,7 @@ int try_catch(const std::function<int()>& func)
     return KEY_MANAGER_API_ERROR_UNKNOWN;
 }
 
-} // namespace CentralKeyManager
+} // namespace CKM
 
 static void init_lib(void) __attribute__ ((constructor));
 static void init_lib(void)
index 9022fa8..af04e8d 100644 (file)
@@ -37,7 +37,7 @@ extern "C" {
     struct msghdr;
 }
 
-namespace CentralKeyManager {
+namespace CKM {
 
 typedef std::vector<unsigned char> RawBuffer;
 
@@ -49,6 +49,6 @@ int sendToServer(char const * const interface, const RawBuffer &send, MessageBuf
  */
 int try_catch(const std::function<int()>& func);
 
-} // namespace CentralKeyManager
+} // namespace CKM
 
 #endif // _KEY_MANAGER_CLIENT_
index bed8462..5b8a232 100644 (file)
@@ -33,7 +33,7 @@
 
 KEY_MANAGER_API
 int key_manager_echo(const char *echo, char** oche) {
-    using namespace CentralKeyManager;
+    using namespace CKM;
 
     if(echo == NULL){
         LogDebug("Echo message is null");
index 6b50a52..b824a35 100644 (file)
@@ -30,7 +30,7 @@
 #include <generic-socket-manager.h>
 #include <message-buffer.h>
 
-namespace CentralKeyManager
+namespace CKM
 {
     struct ConnectionInfo {
         InterfaceID interfaceID;
@@ -38,6 +38,6 @@ namespace CentralKeyManager
     };
 
     typedef std::map<int, ConnectionInfo> ConnectionInfoMap;
-} //namespace CentralKeyManager
+} //namespace CKM
 
 #endif //_CONNECTION_INFO_H_
index 7425a25..bfecf37 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <dpl/log/log.h>
 
-namespace CentralKeyManager {
+namespace CKM {
 
 void MessageBuffer::Push(const RawBuffer &data) {
     m_buffer.AppendCopy(&data[0], data.size());
@@ -66,5 +66,5 @@ void MessageBuffer::Write(size_t num, const void *bytes) {
     m_buffer.AppendCopy(bytes, num);
 }
 
-} // namespace CentralKeyManager
+} // namespace CKM
 
index 89cd824..e19a07b 100644 (file)
 #include <dpl/exception.h>
 #include <dpl/serialization.h>
 
-namespace CentralKeyManager {
+namespace CKM {
 
 typedef std::vector<unsigned char> RawBuffer;
 
-class MessageBuffer : public CentralKeyManager::IStream {
+class MessageBuffer : public CKM::IStream {
 public:
     class Exception
     {
     public:
-        DECLARE_EXCEPTION_TYPE(CentralKeyManager::Exception, Base)
+        DECLARE_EXCEPTION_TYPE(CKM::Exception, Base)
         DECLARE_EXCEPTION_TYPE(Base, OutOfData)
     };
 
@@ -72,9 +72,9 @@ protected:
     }
 
     size_t m_bytesLeft;
-    CentralKeyManager::BinaryQueue m_buffer;
+    CKM::BinaryQueue m_buffer;
 };
 
-} // namespace CentralKeyManager
+} // namespace CKM
 
 #endif // _CENT_KEY_MNG_SOCKET_BUFFER_
index 5891808..a8ec364 100644 (file)
@@ -25,9 +25,9 @@
 
 #include <protocols.h>
 
-namespace CentralKeyManager {
+namespace CKM {
 
     char const * const SERVICE_SOCKET_ECHO =
         "/tmp/.key-manager-api-echo.sock";
-} // namespace CentralKeyManager
+} // namespace CKM
 
index 6bbde5d..08734dc 100644 (file)
 #ifndef _CENT_KEY_MNG_PROTOCOLS_
 #define _CENT_KEY_MNG_PROTOCOLS_
 
-namespace CentralKeyManager {
+namespace CKM {
 
     extern char const * const SERVICE_SOCKET_ECHO;
 
-} // namespace CentralKeyManager
+} // namespace CKM
 
 #endif // _CENT_KEY_MNG_PROTOCOLS_
 
index f6f6f30..ce7899a 100644 (file)
@@ -5,7 +5,7 @@
 
 #include <dpl/log/log.h>
 
-namespace CentralKeyManager {
+namespace CKM {
 
 int smack_runtime_check(void)
 {
@@ -31,4 +31,4 @@ int smack_check(void)
 #endif
 }
 
-} // namespace CentralKeyManager
+} // namespace CKM
index e1d81b1..7c9220c 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef _SMACK_CHECK_H_
 #define _SMACK_CHECK_H_
 
-namespace CentralKeyManager {
+namespace CKM {
 
 /*
  * A very simple runtime check for SMACK on the platform
@@ -37,6 +37,6 @@ int smack_runtime_check(void);
  */
 int smack_check(void);
 
-} // namespace CentralKeyManager
+} // namespace CKM
 
 #endif // _SMACK_CHECK_H_
index 7e1062e..5c88b59 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <dpl/noreturn.h>
 
-namespace CentralKeyManager {
+namespace CKM {
 // Assertion handler procedure
 // Do not call directly
 // Always use Assert macro
@@ -32,9 +32,9 @@ CENT_KEY_NORETURN void AssertProc(const char *condition,
                              const char *file,
                              int line,
                              const char *function);
-} // namespace CentralKeyManager
+} // namespace CKM
 
-#define Assert(Condition) do { if (!(Condition)) { CentralKeyManager::AssertProc(#Condition, \
+#define Assert(Condition) do { if (!(Condition)) { CKM::AssertProc(#Condition, \
                                                                    __FILE__, \
                                                                    __LINE__, \
                                                                    __FUNCTION__); \
index 2b3dd7a..c1ad21f 100644 (file)
@@ -28,7 +28,7 @@
 #include <memory>
 #include <list>
 
-namespace CentralKeyManager {
+namespace CKM {
 /**
  * Binary queue auto pointer
  */
@@ -47,7 +47,7 @@ class BinaryQueue
     class Exception
     {
       public:
-        DECLARE_EXCEPTION_TYPE(CentralKeyManager::Exception, Base)
+        DECLARE_EXCEPTION_TYPE(CKM::Exception, Base)
         DECLARE_EXCEPTION_TYPE(Base, OutOfData)
     };
 
@@ -293,6 +293,6 @@ class BinaryQueue
     virtual size_t Write(const BinaryQueue &buffer, size_t bufferSize);
 };
 
-} // namespace CentralKeyManager
+} // namespace CKM
 
 #endif // CENT_KEY_BINARY_QUEUE_H
index 641904b..19e8258 100644 (file)
@@ -24,7 +24,7 @@
 #ifndef CENT_KEY_COLORS_H
 #define CENT_KEY_COLORS_H
 
-namespace CentralKeyManager {
+namespace CKM {
 namespace Colors {
 namespace Text {
 extern const char* BOLD_GREEN_BEGIN;
@@ -68,6 +68,6 @@ extern const char* BOLD_WHITE_BEGIN;
 extern const char* BOLD_WHITE_END;
 } //namespace Html
 } //namespace Colors
-} //namespace CentralKeyManager
+} //namespace CKM
 
 #endif /* CENT_KEY_COLORS_H */
index 1e06cc7..c2a0ff3 100644 (file)
@@ -29,7 +29,7 @@
 #include <cstdlib>
 #include <sstream>
 
-namespace CentralKeyManager {
+namespace CKM {
 void LogUnhandledException(const std::string &str);
 void LogUnhandledException(const std::string &str,
                            const char *filename,
@@ -37,7 +37,7 @@ void LogUnhandledException(const std::string &str,
                            const char *function);
 }
 
-namespace CentralKeyManager {
+namespace CKM {
 class Exception
 {
   private:
@@ -94,7 +94,7 @@ class Exception
     {
         std::ostringstream message;
         message <<
-        "\033[1;5;31m\n=== Unhandled CentralKeyManager exception occurred ===\033[m\n\n";
+        "\033[1;5;31m\n=== Unhandled CKM exception occurred ===\033[m\n\n";
         message << "\033[1;33mException trace:\033[m\n\n";
         message << e.DumpToString();
         message << "\033[1;31m\n=== Will now abort ===\033[m\n";
@@ -106,7 +106,7 @@ class Exception
     {
         std::ostringstream message;
         message <<
-        "\033[1;5;31m\n=== Unhandled non-CentralKeyManager exception occurred ===\033[m\n\n";
+        "\033[1;5;31m\n=== Unhandled non-CKM exception occurred ===\033[m\n\n";
         message << "\033[1;31m\n=== Will now abort ===\033[m\n";
 
         return message.str();
@@ -287,7 +287,7 @@ class Exception
         return m_className;
     }
 };
-} // namespace CentralKeyManager
+} // namespace CKM
 
 #define Try try
 
@@ -332,7 +332,7 @@ class Exception
         Class(const char *path, \
               const char *function, \
               int line, \
-              const CentralKeyManager::Exception & reason, \
+              const CKM::Exception & reason, \
               const std::string & message = std::string()) :                                                                                                                             \
             BaseClass(path, function, line, reason, message)                                                                            \
         {                                                                                                                                 \
@@ -343,11 +343,11 @@ class Exception
 #define UNHANDLED_EXCEPTION_HANDLER_BEGIN try
 
 #define UNHANDLED_EXCEPTION_HANDLER_END                                                                   \
-    catch (const CentralKeyManager::Exception &exception)                                                               \
+    catch (const CKM::Exception &exception)                                                               \
     {                                                                                                     \
         std::ostringstream msg;                                                                           \
-        msg << CentralKeyManager::Exception::KnownExceptionToString(exception);                                         \
-        CentralKeyManager::LogUnhandledException(msg.str(), __FILE__, __LINE__, __FUNCTION__);                          \
+        msg << CKM::Exception::KnownExceptionToString(exception);                                         \
+        CKM::LogUnhandledException(msg.str(), __FILE__, __LINE__, __FUNCTION__);                          \
         abort();                                                                                          \
     }                                                                                                     \
     catch (std::exception& e)                                                                             \
@@ -355,19 +355,19 @@ class Exception
         std::ostringstream msg;                                                                           \
         msg << e.what();                                                                                  \
         msg << "\n";                                                                                      \
-        msg << CentralKeyManager::Exception::UnknownExceptionToString();                                                \
-        CentralKeyManager::LogUnhandledException(msg.str(), __FILE__, __LINE__, __FUNCTION__);                          \
+        msg << CKM::Exception::UnknownExceptionToString();                                                \
+        CKM::LogUnhandledException(msg.str(), __FILE__, __LINE__, __FUNCTION__);                          \
         abort();                                                                                          \
     }                                                                                                     \
     catch (...)                                                                                           \
     {                                                                                                     \
         std::ostringstream msg;                                                                           \
-        msg << CentralKeyManager::Exception::UnknownExceptionToString();                                                \
-        CentralKeyManager::LogUnhandledException(msg.str(), __FILE__, __LINE__, __FUNCTION__);                          \
+        msg << CKM::Exception::UnknownExceptionToString();                                                \
+        CKM::LogUnhandledException(msg.str(), __FILE__, __LINE__, __FUNCTION__);                          \
         abort();                                                                                          \
     }
 
-namespace CentralKeyManager {
+namespace CKM {
 namespace CommonException {
 /**
  * Internal exception definitions
index 5d006a3..abc77a3 100644 (file)
@@ -22,7 +22,7 @@
 #ifndef CENT_KEY_NONCOPYABLE_H
 #define CENT_KEY_NONCOPYABLE_H
 
-namespace CentralKeyManager {
+namespace CKM {
 class Noncopyable
 {
   private:
@@ -33,6 +33,6 @@ class Noncopyable
     Noncopyable();
     virtual ~Noncopyable();
 };
-} // namespace CentralKeyManager
+} // namespace CKM
 
 #endif // CENT_KEY_NONCOPYABLE_H
index 7bd0bd2..2e1a8fe 100644 (file)
@@ -28,7 +28,7 @@
 #include <map>
 #include <memory>
 
-namespace CentralKeyManager {
+namespace CKM {
 // Abstract data stream buffer
 class IStream
 {
@@ -393,6 +393,6 @@ struct Deserialization {
         Deserialize(stream, *map);
     }
 }; // struct Deserialization
-} // namespace CentralKeyManager
+} // namespace CKM
 
 #endif // CENT_KEY_SERIALIZATION_H
index ad6ff71..ff713a4 100644 (file)
@@ -22,7 +22,7 @@
 #ifndef CENT_KEY_SINGLETON_H
 #define CENT_KEY_SINGLETON_H
 
-namespace CentralKeyManager {
+namespace CKM {
 template<typename Class>
 class Singleton :
     private Class
@@ -46,6 +46,6 @@ class Singleton :
 
     static Class &Instance();
 };
-} // namespace CentralKeyManager
+} // namespace CKM
 
 #endif // CENT_KEY_SINGLETON_H
index da70325..cce8959 100644 (file)
@@ -30,7 +30,7 @@
  * singleton_safe_impl.h if possible.
  */
 
-namespace CentralKeyManager {
+namespace CKM {
 template<typename Class>
 Singleton<Class>& Singleton<Class>::InternalInstance()
 {
@@ -44,10 +44,10 @@ Class &Singleton<Class>::Instance()
     Singleton<Class>& instance = Singleton<Class>::InternalInstance();
     return instance;
 }
-} // namespace CentralKeyManager
+} // namespace CKM
 
 #define IMPLEMENT_SINGLETON(Type)                                           \
-    template CentralKeyManager::Singleton<Type>&CentralKeyManager::Singleton<Type>::InternalInstance();    \
-    template Type & CentralKeyManager::Singleton<Type>::Instance();                            \
+    template CKM::Singleton<Type>&CKM::Singleton<Type>::InternalInstance();    \
+    template Type & CKM::Singleton<Type>::Instance();                            \
 
 #endif // CENT_KEY_SINGLETON_IMPL_H
index 6a502cb..9b66c0d 100644 (file)
@@ -23,7 +23,7 @@
 #define CENT_KEY_SINGLETON_SAFE_IMPL_H
 
 #define IMPLEMENT_SAFE_SINGLETON(Class)                                        \
-    namespace CentralKeyManager {                                                                \
+    namespace CKM {                                                                \
     template<>                                                                     \
     Singleton<Class>&Singleton<Class>::InternalInstance()                         \
     {                                                                              \
@@ -40,6 +40,6 @@
                                                                                \
     template Singleton<Class>&Singleton<Class>::InternalInstance();               \
     template Class & Singleton<Class>::Instance();                                  \
-    } // namespace CentralKeyManager
+    } // namespace CKM
 
 #endif // CENT_KEY_SINGLETON_SAFE_IMPL_H
index 6ec7db3..6a19fa9 100644 (file)
@@ -26,7 +26,7 @@
 #include <dpl/exception.h>
 #include <cstdlib>
 
-namespace CentralKeyManager {
+namespace CKM {
 void AssertProc(const char *condition,
                 const char *file,
                 int line,
@@ -37,7 +37,7 @@ void AssertProc(const char *condition,
     {                                                                  \
         std::ostringstream platformLog;                                \
         platformLog << message;                                        \
-        CentralKeyManager::Log::LogSystemSingleton::Instance().Pedantic(             \
+        CKM::Log::LogSystemSingleton::Instance().Pedantic(             \
             platformLog.str().c_str(),                                 \
             __FILE__, __LINE__, __FUNCTION__);                         \
     } \
@@ -49,7 +49,7 @@ void AssertProc(const char *condition,
         INTERNAL_LOG(
             "################################################################################");
         INTERNAL_LOG(
-            "###                          CentralKeyManager assertion failed!                           ###");
+            "###                          CKM assertion failed!                           ###");
         INTERNAL_LOG(
             "################################################################################");
         INTERNAL_LOG("### Condition: " << condition);
@@ -65,4 +65,4 @@ void AssertProc(const char *condition,
     // Fail with c-library abort
     abort();
 }
-} // namespace CentralKeyManager
+} // namespace CKM
index ba0cf80..5a3c42e 100644 (file)
@@ -27,7 +27,7 @@
 #include <cstring>
 #include <new>
 
-namespace CentralKeyManager {
+namespace CKM {
 BinaryQueue::BinaryQueue() :
     m_size(0)
 {}
@@ -314,4 +314,4 @@ size_t BinaryQueue::Write(const BinaryQueue &buffer, size_t bufferSize)
     AppendCopyFrom(buffer);
     return bufferSize;
 }
-} // namespace CentralKeyManager
+} // namespace CKM
index c099a96..5758512 100644 (file)
@@ -23,7 +23,7 @@
 #include <stddef.h>
 #include <dpl/colors.h>
 
-namespace CentralKeyManager {
+namespace CKM {
 namespace Colors {
 namespace Text {
 const char* BOLD_GREEN_BEGIN = "\033[1;32m";
@@ -67,4 +67,4 @@ const char* BOLD_WHITE_BEGIN = "<font color=\"white\"><b>";
 const char* BOLD_WHITE_END = "</b></font>";
 } //namespace Html
 } //namespace Colors
-} //namespace CentralKeyManager
+} //namespace CKM
index db45e8a..0def9bf 100644 (file)
@@ -24,7 +24,7 @@
 #include <dpl/log/log.h>
 #include <cstdio>
 
-namespace CentralKeyManager {
+namespace CKM {
 Exception* Exception::m_lastException = NULL;
 unsigned int Exception::m_exceptionCount = 0;
 void (*Exception::m_terminateHandler)() = NULL;
@@ -51,7 +51,7 @@ void LogUnhandledException(const std::string &str,
     printf("%s\n", msg.str().c_str());
 
     // Logging to dlog
-    CentralKeyManager::Log::LogSystemSingleton::Instance().Error(
+    CKM::Log::LogSystemSingleton::Instance().Error(
         str.c_str(), filename, line, function);
 }
-} // namespace CentralKeyManager
+} // namespace CKM
index 9e9c723..8ec5335 100644 (file)
 #include <stddef.h>
 #include <dpl/noncopyable.h>
 
-namespace CentralKeyManager {
+namespace CKM {
 Noncopyable::Noncopyable()
 {}
 
 Noncopyable::~Noncopyable()
 {}
-} // namespace CentralKeyManager
+} // namespace CKM
index bcc7e5c..65fd956 100644 (file)
@@ -22,7 +22,7 @@
 #ifndef CENT_KEY_ABSTRACT_LOG_PROVIDER_H
 #define CENT_KEY_ABSTRACT_LOG_PROVIDER_H
 
-namespace CentralKeyManager {
+namespace CKM {
 namespace Log {
 class AbstractLogProvider
 {
@@ -71,6 +71,6 @@ class AbstractLogProvider
     static const char *LocateSourceFileName(const char *filename);
 };
 }
-} // namespace CentralKeyManager
+} // namespace CKM
 
 #endif // CENT_KEY_ABSTRACT_LOG_PROVIDER_H
index da11b6e..bf443d9 100644 (file)
@@ -26,7 +26,7 @@
 #include <memory>
 #include <string>
 
-namespace CentralKeyManager {
+namespace CKM {
 namespace Log {
 class DLOGLogProvider :
     public AbstractLogProvider
@@ -84,6 +84,6 @@ class DLOGLogProvider :
 };
 
 } // namespace Log
-} // namespace CentralKeyManager
+} // namespace CKM
 
 #endif // CENT_KEY_DLOG_LOG_PROVIDER_H
index 3a3ed07..30c30bf 100644 (file)
 #include <sstream>
 #include <list>
 
-namespace CentralKeyManager {
+namespace CKM {
 namespace Log {
 /**
- * CentralKeyManager log system
+ * CKM log system
  *
  * To switch logs into old style, export
  * DPL_USE_OLD_STYLE_LOGS before application start
@@ -160,7 +160,7 @@ class NullStream
  */
 typedef Singleton<LogSystem> LogSystemSingleton;
 }
-} // namespace CentralKeyManager
+} // namespace CKM
 
 //
 // Log support
@@ -170,18 +170,18 @@ typedef Singleton<LogSystem> LogSystemSingleton;
 /* avoid warnings about unused variables */
 #define DPL_MACRO_DUMMY_LOGGING(message, function)                         \
     do {                                                                   \
-        CentralKeyManager::Log::NullStream ns;                                \
+        CKM::Log::NullStream ns;                                \
         ns << message;                                                     \
     } while (0)
 
 #define DPL_MACRO_FOR_LOGGING(message, function)                           \
 do                                                                         \
 {                                                                          \
-    if (CentralKeyManager::Log::LogSystemSingleton::Instance().IsLoggingEnabled())   \
+    if (CKM::Log::LogSystemSingleton::Instance().IsLoggingEnabled())   \
     {                                                                      \
         std::ostringstream platformLog;                                    \
         platformLog << message;                                            \
-        CentralKeyManager::Log::LogSystemSingleton::Instance().function(      \
+        CKM::Log::LogSystemSingleton::Instance().function(      \
             platformLog.str().c_str(),                                     \
             __FILE__, __LINE__, __FUNCTION__);                             \
     }                                                                      \
index 59472ef..f890e29 100644 (file)
@@ -25,7 +25,7 @@
 #include <dpl/log/abstract_log_provider.h>
 #include <string>
 
-namespace CentralKeyManager {
+namespace CKM {
 namespace Log {
 class OldStyleLogProvider :
     public AbstractLogProvider
@@ -95,6 +95,6 @@ class OldStyleLogProvider :
                        const char *function);
 };
 }
-} // namespace CentralKeyManager
+} // namespace CKM
 
 #endif // CENT_KEY_OLD_STYLE_LOG_PROVIDER_H
index a08eaa7..af05449 100644 (file)
@@ -25,7 +25,7 @@
 
 #define UNUSED __attribute__((unused))
 
-namespace CentralKeyManager {
+namespace CKM {
 namespace Log {
 
 void AbstractLogProvider::SetTag(const char *tag UNUSED) {}
index 9ce3d56..4b4fba0 100644 (file)
@@ -27,7 +27,7 @@
 
 #define UNUSED __attribute__((unused))
 
-namespace CentralKeyManager {
+namespace CKM {
 namespace Log {
 std::string DLOGLogProvider::FormatMessage(const char *message,
                                            const char *filename,
@@ -99,7 +99,7 @@ void DLOGLogProvider::Pedantic(const char *message,
                                int line,
                                const char *function)
 {
-    SLOG(LOG_DEBUG, "CentralKeyManager", "%s", FormatMessage(message,
+    SLOG(LOG_DEBUG, "CKM", "%s", FormatMessage(message,
                                               filename,
                                               line,
                                               function).c_str());
@@ -142,4 +142,4 @@ void DLOGLogProvider::SecureError(const char *message UNUSED,
 }
 
 } // nemespace Log
-} // namespace CentralKeyManager
+} // namespace CKM
index 16c73b3..9b7d2e2 100644 (file)
@@ -27,9 +27,9 @@
 #include <dpl/log/dlog_log_provider.h>
 #include <dpl/log/old_style_log_provider.h>
 
-IMPLEMENT_SINGLETON(CentralKeyManager::Log::LogSystem)
+IMPLEMENT_SINGLETON(CKM::Log::LogSystem)
 
-namespace CentralKeyManager {
+namespace CKM {
 namespace Log {
 namespace // anonymous
 {
@@ -277,4 +277,4 @@ void LogSystem::SecureWarning(const char *message,
 }
 
 }
-} // namespace CentralKeyManager
+} // namespace CKM
index 399d288..20d6d2c 100644 (file)
 #include <unistd.h>
 #include <dlog.h>
 
-namespace CentralKeyManager {
+namespace CKM {
 namespace Log {
 namespace // anonymous
 {
-using namespace CentralKeyManager::Colors::Text;
+using namespace CKM::Colors::Text;
 const char *DEBUG_BEGIN = GREEN_BEGIN;
 const char *DEBUG_END = GREEN_END;
 const char *INFO_BEGIN = CYAN_BEGIN;
@@ -299,4 +299,4 @@ void OldStyleLogProvider::SecureError(const char *message,
 }
 
 }
-} // namespace CentralKeyManager
+} // namespace CKM
index ebb88ac..9cf60f8 100644 (file)
 #ifndef _CENT_KEY_MNG_GENERIC_EVENT_
 #define _CENT_KEY_MNG_GENERIC_EVENT_
 
-namespace CentralKeyManager {
+namespace CKM {
 
 struct GenericEvent {
     virtual ~GenericEvent(){}
 };
 
-} // namespace CentralKeyManager
+} // namespace CKM
 
 #endif // _CENT_KEY_MNG_GENERIC_EVENT_
index abd23d9..68e501e 100644 (file)
@@ -28,8 +28,8 @@
 
 #include <generic-socket-manager.h>
 
-namespace CentralKeyManager {
+namespace CKM {
 
 
-} // namespace CentralKeyManager
+} // namespace CKM
 
index bf0dc6a..a603731 100644 (file)
@@ -37,7 +37,7 @@ extern "C" {
 struct msghdr;
 } // extern "C"
 
-namespace CentralKeyManager {
+namespace CKM {
 
 typedef int InterfaceID;
 
@@ -119,6 +119,6 @@ struct GenericSocketManager {
     virtual ~GenericSocketManager(){}
 };
 
-} // namespace CentralKeyManager
+} // namespace CKM
 
 #endif // _CENT_KEY_MNG_GENERIC_SERVICE_MANAGER_
index fde96bd..59bd37a 100644 (file)
 
 #include <echo.h>
 
-IMPLEMENT_SAFE_SINGLETON(CentralKeyManager::Log::LogSystem);
+IMPLEMENT_SAFE_SINGLETON(CKM::Log::LogSystem);
 
 #define REGISTER_SOCKET_SERVICE(manager, service) \
     registerSocketService<service>(manager, #service)
 
 template<typename T>
-void registerSocketService(CentralKeyManager::SocketManager &manager, const std::string& serviceName)
+void registerSocketService(CKM::SocketManager &manager, const std::string& serviceName)
 {
     T *service = NULL;
     try {
@@ -46,7 +46,7 @@ void registerSocketService(CentralKeyManager::SocketManager &manager, const std:
         service->Create();
         manager.RegisterSocketService(service);
         service = NULL;
-    } catch (const CentralKeyManager::Exception &exception) {
+    } catch (const CKM::Exception &exception) {
         LogError("Error in creating service " << serviceName <<
                  ", details:\n" << exception.DumpToString());
     } catch (const std::exception& e) {
@@ -64,7 +64,7 @@ int main(void) {
 
     UNHANDLED_EXCEPTION_HANDLER_BEGIN
     {
-        CentralKeyManager::Singleton<CentralKeyManager::Log::LogSystem>::Instance().SetTag("CENT_KEY_MNG");
+        CKM::Singleton<CKM::Log::LogSystem>::Instance().SetTag("CENT_KEY_MNG");
 
         sigset_t mask;
         sigemptyset(&mask);
@@ -76,9 +76,9 @@ int main(void) {
         }
 
         LogInfo("Start!");
-        CentralKeyManager::SocketManager manager;
+        CKM::SocketManager manager;
 
-        auto echoService = new CentralKeyManager::EchoService;
+        auto echoService = new CKM::EchoService;
         echoService->Create();
         manager.RegisterSocketService(echoService);
 
index 8574b0b..e91dfbe 100644 (file)
@@ -33,7 +33,7 @@ namespace {
 const size_t SIZE_T_MAX = std::numeric_limits<size_t>::max();
 } // namespace anonymous
 
-namespace CentralKeyManager {
+namespace CKM {
 
 int util_smack_label_is_valid(const char *smack_label)
 {
@@ -112,5 +112,5 @@ char *read_exe_path_from_proc(pid_t pid)
     return exe;
 }
 
-} // namespace CentralKeyManager
+} // namespace CKM
 
index d32d932..4c25bd3 100644 (file)
 
 #include <sys/types.h>
 
-namespace CentralKeyManager {
+namespace CKM {
 
 int util_smack_label_is_valid(const char *smack_label);
 char *read_exe_path_from_proc(pid_t pid);
 
-} // namespace CentralKeyManager
+} // namespace CKM
 
 #endif /*CENT_KEY_MNG_UTIL_H*/
index 0918c3d..3e538b5 100644 (file)
@@ -41,7 +41,7 @@
 
 #define DEFINE_THREAD_EVENT(eventType)                                \
     void Event(const eventType &event) {                              \
-        CentralKeyManager::ServiceThread<ParentClassName>::              \
+        CKM::ServiceThread<ParentClassName>::              \
             Event(event,                                              \
                   this,                                               \
                   &ParentClassName::EventInternal##eventType);        \
 
 #define DECLARE_THREAD_EVENT(eventType, methodName)                   \
     void Event(const eventType &event) {                              \
-        CentralKeyManager::ServiceThread<ParentClassName>::              \
+        CKM::ServiceThread<ParentClassName>::              \
             Event(event,                                              \
                   this,                                               \
                   &ParentClassName::methodName);                      \
     }
 
-namespace CentralKeyManager {
+namespace CKM {
 
 template <class Service>
 class ServiceThread {
@@ -173,6 +173,6 @@ protected:
     bool m_quit;
 };
 
-} // namespace CentralKeyManager
+} // namespace CKM
 
 #endif // _CENT_KEY_SERVICE_THREAD_
index 9b938f2..cc2f5dc 100644 (file)
@@ -52,7 +52,7 @@ const time_t SOCKET_TIMEOUT = 20;
 
 } // namespace anonymous
 
-namespace CentralKeyManager {
+namespace CKM {
 
 struct DummyService : public GenericSocketService {
     ServiceDescriptionVector GetServiceDescription() {
@@ -637,4 +637,4 @@ void SocketManager::CloseSocket(int sock) {
     FD_CLR(sock, &m_writeSet);
 }
 
-} // namespace CentralKeyManager
+} // namespace CKM
index 8fae0a8..978dbee 100644 (file)
 
 #include <generic-socket-manager.h>
 
-namespace CentralKeyManager {
+namespace CKM {
 
 class SocketManager : public GenericSocketManager {
 public:
     class Exception {
     public:
-        DECLARE_EXCEPTION_TYPE(CentralKeyManager::Exception, Base)
+        DECLARE_EXCEPTION_TYPE(CKM::Exception, Base)
         DECLARE_EXCEPTION_TYPE(Base, InitFailed)
     };
     SocketManager();
@@ -121,6 +121,6 @@ protected:
     std::priority_queue<Timeout> m_timeoutQueue;
 };
 
-} // namespace CentralKeyManager
+} // namespace CKM
 
 #endif // _CENT_KEY_MNG_SOCKET_MANAGER_
index 27f7f4c..2712afd 100644 (file)
@@ -27,7 +27,7 @@
 #include <protocols.h>
 #include <echo.h>
 
-namespace CentralKeyManager {
+namespace CKM {
 
 GenericSocketService::ServiceDescriptionVector EchoService::GetServiceDescription() {
     return ServiceDescriptionVector {{SERVICE_SOCKET_ECHO, "*"}};
@@ -56,5 +56,5 @@ void EchoService::close(const CloseEvent &event) {
     LogDebug("CloseEvent. ConnectionID: " << event.connectionID.sock);
 }
 
-} // namespace CentralKeyManager
+} // namespace CKM
 
index cf3065e..99342c8 100644 (file)
 
 #include <message-buffer.h>
 
-namespace CentralKeyManager {
+namespace CKM {
 
 class EchoService
-  : public CentralKeyManager::GenericSocketService
-  , public CentralKeyManager::ServiceThread<EchoService>
+  : public CKM::GenericSocketService
+  , public CKM::ServiceThread<EchoService>
 {
 public:
     ServiceDescriptionVector GetServiceDescription();
@@ -52,6 +52,6 @@ public:
     void close(const CloseEvent &event);
 };
 
-} // namespace CentralKeyManager
+} // namespace CKM
 
 #endif // _SECURITY_SERVER_ECHO_