diff options
author | lloyd <[email protected]> | 2015-01-27 14:10:37 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2015-01-27 14:10:37 +0000 |
commit | b8fa304ec981d273c45d7ef31705d65ccfb00cc1 (patch) | |
tree | 86a0c03ddcf3f6b331a73170167bbf1e429e3d79 /src/lib/tls/tls_handshake_io.h | |
parent | 5ca89c642f19b747b965a22db87e7af2d13d0f35 (diff) |
Add typedefs for function signatures/types used in TLS for easier reading
Diffstat (limited to 'src/lib/tls/tls_handshake_io.h')
-rw-r--r-- | src/lib/tls/tls_handshake_io.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/lib/tls/tls_handshake_io.h b/src/lib/tls/tls_handshake_io.h index 34873c3a6..00074a744 100644 --- a/src/lib/tls/tls_handshake_io.h +++ b/src/lib/tls/tls_handshake_io.h @@ -65,8 +65,9 @@ class Handshake_IO class Stream_Handshake_IO : public Handshake_IO { public: - Stream_Handshake_IO(std::function<void (byte, const std::vector<byte>&)> writer) : - m_send_hs(writer) {} + typedef std::function<void (byte, const std::vector<byte>&)> writer_fn; + + Stream_Handshake_IO(writer_fn writer) : m_send_hs(writer) {} Protocol_Version initial_record_version() const override; @@ -86,7 +87,7 @@ class Stream_Handshake_IO : public Handshake_IO get_next_record(bool expecting_ccs) override; private: std::deque<byte> m_queue; - std::function<void (byte, const std::vector<byte>&)> m_send_hs; + writer_fn m_send_hs; }; /** @@ -95,8 +96,10 @@ class Stream_Handshake_IO : public Handshake_IO class Datagram_Handshake_IO : public Handshake_IO { public: - Datagram_Handshake_IO(class Connection_Sequence_Numbers& seq, - std::function<void (u16bit, byte, const std::vector<byte>&)> writer, + typedef std::function<void (u16bit, byte, const std::vector<byte>&)> writer_fn; + + Datagram_Handshake_IO(writer_fn writer, + class Connection_Sequence_Numbers& seq, u16bit mtu) : m_seqs(seq), m_flights(1), m_send_hs(writer), m_mtu(mtu) {} @@ -186,7 +189,7 @@ class Datagram_Handshake_IO : public Handshake_IO u16bit m_in_message_seq = 0; u16bit m_out_message_seq = 0; - std::function<void (u16bit, byte, const std::vector<byte>&)> m_send_hs; + writer_fn m_send_hs; u16bit m_mtu; }; |