diff options
author | lloyd <[email protected]> | 2012-01-26 21:00:01 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-01-26 21:00:01 +0000 |
commit | 4b8786ad157e38b4143b0968c1ea1c83c2ee7388 (patch) | |
tree | 2a0272f0b6f5e14d738c5bfdb126f5e3ef45fb3b /src/tls/tls_channel.h | |
parent | 4b285bd51a48f78f41a14beb9626a8db59e65960 (diff) |
Make Alert a first class object ala Version. Move the alert codes into
the Alert class for namespacing.
Diffstat (limited to 'src/tls/tls_channel.h')
-rw-r--r-- | src/tls/tls_channel.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tls/tls_channel.h b/src/tls/tls_channel.h index 6021b65b2..75d2b5918 100644 --- a/src/tls/tls_channel.h +++ b/src/tls/tls_channel.h @@ -11,6 +11,7 @@ #include <botan/tls_policy.h> #include <botan/tls_record.h> #include <botan/tls_session.h> +#include <botan/tls_alert.h> #include <botan/x509cert.h> #include <vector> @@ -39,7 +40,7 @@ class BOTAN_DLL Channel /** * Send a close notification alert */ - void close() { alert(WARNING, CLOSE_NOTIFY); } + void close() { send_alert(Alert(Alert::WARNING, Alert::CLOSE_NOTIFY)); } /** * @return true iff the connection is active for sending application data @@ -74,7 +75,7 @@ class BOTAN_DLL Channel * @param level is warning or fatal * @param type is the type of alert */ - void alert(Alert_Level level, Alert_Type type); + void send_alert(const Alert& alert); virtual void read_handshake(byte rec_type, const MemoryRegion<byte>& rec_buf); @@ -82,7 +83,7 @@ class BOTAN_DLL Channel virtual void process_handshake_msg(Handshake_Type type, const MemoryRegion<byte>& contents) = 0; - virtual void alert_notify(bool fatal_alert, Alert_Type type) = 0; + virtual void alert_notify(const Alert& alert) = 0; std::tr1::function<void (const byte[], size_t, u16bit)> proc_fn; std::tr1::function<bool (const Session&)> handshake_fn; |