summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2001-11-13 19:27:43 +0000
committerMarc Laukien <marc@zeroc.com>2001-11-13 19:27:43 +0000
commit18d5598670ec6550f209913bd0ead621f62921af (patch)
tree43621c565ee94ca0a54ad98d7445f7185fdc3605 /cpp/src
parentFixed some problems regarding Security.h, and bugs found by Marc. (diff)
downloadice-18d5598670ec6550f209913bd0ead621f62921af.tar.bz2
ice-18d5598670ec6550f209913bd0ead621f62921af.tar.xz
ice-18d5598670ec6550f209913bd0ead621f62921af.zip
added missing file
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/Security.h92
1 files changed, 92 insertions, 0 deletions
diff --git a/cpp/src/Ice/Security.h b/cpp/src/Ice/Security.h
new file mode 100644
index 00000000000..3d30bc4d69e
--- /dev/null
+++ b/cpp/src/Ice/Security.h
@@ -0,0 +1,92 @@
+// **********************************************************************
+//
+// Copyright (c) 2001
+// MutableRealms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+#ifndef ICE_SECURITY_H
+#define ICE_SECURITY_H
+
+// NOTE: Define USE_SOCKETS in order to turn on use of sockets in OpenSSL
+#ifndef USE_SOCKETS
+#define USE_SOCKETS
+#endif
+
+#include <openssl/ssl.h>
+
+namespace IceSecurity
+{
+
+typedef enum
+{
+ NO_SECURITY_TRACE = 0,
+ SECURITY_WARNINGS,
+ SECURITY_PARSE_WARNINGS,
+ SECURITY_METHODS,
+ SECURITY_EXCEPTIONS,
+ SECURITY_PROTOCOL,
+ SECURITY_PROTOCOL_DEBUG
+} SecurityTraceLevel;
+
+}
+
+#define SECURITY_LEVEL_METHODS (_traceLevels->security >= IceSecurity::SECURITY_METHODS)
+#define SECURITY_LEVEL_PARSEWARNINGS (_traceLevels->security >= IceSecurity::SECURITY_PARSE_WARNINGS)
+#define SECURITY_LEVEL_WARNINGS (_traceLevels->security >= IceSecurity::SECURITY_WARNINGS)
+#define SECURITY_LEVEL_EXCEPTIONS (_traceLevels->security >= IceSecurity::SECURITY_EXCEPTIONS)
+#define SECURITY_LEVEL_PROTOCOL (_traceLevels->security >= IceSecurity::SECURITY_PROTOCOL)
+#define SECURITY_LEVEL_PROTOCOL_DEBUG (_traceLevels->security >= IceSecurity::SECURITY_PROTOCOL_DEBUG)
+
+#define SECURITY_LOGGER(s) _logger->trace(_traceLevels->securityCat, s);
+
+#define METHOD_INV(s) \
+ if (_traceLevels->security >= IceSecurity::SECURITY_METHODS) \
+ { \
+ _logger->trace(_traceLevels->securityCat, "INV " + string(s)); \
+ }
+
+#define METHOD_INS(s) \
+ if (_traceLevels->security >= IceSecurity::SECURITY_METHODS) \
+ { \
+ _logger->trace(_traceLevels->securityCat, "INS " + string(s)); \
+ }
+
+#define METHOD_RET(s) \
+ if (_traceLevels->security >= IceSecurity::SECURITY_METHODS) \
+ { \
+ _logger->trace(_traceLevels->securityCat, "RET " + string(s)); \
+ }
+
+#define PARSE_WARNING(s) \
+ if (_traceLevels->security >= IceSecurity::SECURITY_PARSE_WARNINGS) \
+ { \
+ _logger->trace(_traceLevels->securityCat, "PWN " + string(s)); \
+ }
+
+#define WARNING(s) \
+ if (_traceLevels->security >= IceSecurity::SECURITY_WARNINGS) \
+ { \
+ _logger->trace(_traceLevels->securityCat, "WRN " + string(s)); \
+ }
+
+#define EXCEPTION(s) \
+ if (_traceLevels->security >= IceSecurity::SECURITY_EXCEPTIONS) \
+ { \
+ _logger->trace(_traceLevels->securityCat, "EXC " + string(s)); \
+ }
+
+#define PROTOCOL(s) \
+ if (_traceLevels->security >= IceSecurity::SECURITY_PROTOCOL) \
+ { \
+ _logger->trace(_traceLevels->securityCat, "PTL " + string(s)); \
+ }
+
+#define PROTOCOL_DEBUG(s) \
+ if (_traceLevels->security >= IceSecurity::SECURITY_PROTOCOL_DEBUG) \
+ { \
+ _logger->trace(_traceLevels->securityCat, "DBG " + string(s)); \
+ }
+#endif