aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/tls_exceptn.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2011-12-23 16:17:29 +0000
committerlloyd <[email protected]>2011-12-23 16:17:29 +0000
commit67c1645ae151f5dd0f2bafce926ff8690fd97f19 (patch)
tree9af9c1c22ab58093328cdfd00dbe42292d8b5ed6 /src/tls/tls_exceptn.h
parentd363602f95f1514b4b595d9912fba2e503edcb21 (diff)
Rename ssl module to tls
Diffstat (limited to 'src/tls/tls_exceptn.h')
-rw-r--r--src/tls/tls_exceptn.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/tls/tls_exceptn.h b/src/tls/tls_exceptn.h
new file mode 100644
index 000000000..37b9c0d27
--- /dev/null
+++ b/src/tls/tls_exceptn.h
@@ -0,0 +1,43 @@
+/*
+* Exceptions
+* (C) 2004-2006 Jack Lloyd
+*
+* Released under the terms of the Botan license
+*/
+
+#ifndef BOTAN_TLS_EXCEPTION_H__
+#define BOTAN_TLS_EXCEPTION_H__
+
+#include <botan/exceptn.h>
+#include <botan/tls_magic.h>
+
+namespace Botan {
+
+/**
+* Exception Base Class
+*/
+class BOTAN_DLL TLS_Exception : public Exception
+ {
+ public:
+ Alert_Type type() const throw() { return alert_type; }
+
+ TLS_Exception(Alert_Type type,
+ const std::string& err_msg = "Unknown error") :
+ Exception(err_msg), alert_type(type) {}
+
+ private:
+ Alert_Type alert_type;
+ };
+
+/**
+* Unexpected_Message Exception
+*/
+struct BOTAN_DLL Unexpected_Message : public TLS_Exception
+ {
+ Unexpected_Message(const std::string& err) :
+ TLS_Exception(UNEXPECTED_MESSAGE, err) {}
+ };
+
+}
+
+#endif