3 #ifndef __ZMQ_ZMTP_ENGINE_HPP_INCLUDED__
4 #define __ZMQ_ZMTP_ENGINE_HPP_INCLUDED__
36 class zmtp_engine_t
ZMQ_FINAL :
public stream_engine_base_t
39 zmtp_engine_t (
fd_t fd_,
41 const endpoint_uri_pair_t &endpoint_uri_pair_);
48 void plug_internal ();
50 int process_command_message (msg_t *msg_);
51 int produce_ping_message (msg_t *msg_);
52 int process_heartbeat_message (msg_t *msg_);
53 int produce_pong_message (msg_t *msg_);
57 int receive_greeting ();
58 void receive_greeting_versioned ();
60 typedef bool (zmtp_engine_t::*handshake_fun_t) ();
61 static handshake_fun_t select_handshake_fun (
bool unversioned,
62 unsigned char revision,
65 bool handshake_v1_0_unversioned ();
66 bool handshake_v1_0 ();
67 bool handshake_v2_0 ();
68 bool handshake_v3_x (
bool downgrade_sub);
69 bool handshake_v3_0 ();
70 bool handshake_v3_1 ();
72 int routing_id_msg (
msg_t *msg_);
73 int process_routing_id_msg (
msg_t *msg_);
80 static const size_t signature_size = 10;
83 static const size_t v2_greeting_size = 12;
86 static const size_t v3_greeting_size = 64;
92 unsigned char _greeting_recv[v3_greeting_size];
93 unsigned char _greeting_send[v3_greeting_size];