![]() |
libzmq
master
ZeroMQ C++ Core Engine (LIBZMQ)
|
#include <mechanism.hpp>
Public Types | |
enum | status_t { handshaking, ready, error } |
Public Member Functions | |
mechanism_t (const options_t &options_) | |
virtual | ~mechanism_t () |
virtual int | decode (msg_t *) |
virtual int | encode (msg_t *) |
blob_t | get_user_id () const |
const metadata_t::dict_t & | get_zap_properties () |
const metadata_t::dict_t & | get_zmtp_properties () |
virtual int | next_handshake_command (msg_t *msg_)=0 |
void | peer_identity (msg_t *msg_) |
virtual int | process_handshake_command (msg_t *msg_)=0 |
void | set_peer_identity (const void *id_ptr, size_t id_size) |
void | set_user_id (const void *user_id, size_t size) |
virtual status_t | status () const =0 |
virtual int | zap_msg_available () |
Protected Member Functions | |
size_t | add_property (unsigned char *ptr, const char *name, const void *value, size_t value_len) const |
int | parse_metadata (const unsigned char *ptr_, size_t length, bool zap_flag=false) |
virtual int | property (const std::string &name_, const void *value_, size_t length_) |
const char * | socket_type_string (int socket_type) const |
Protected Attributes | |
options_t | options |
metadata_t::dict_t | zap_properties |
metadata_t::dict_t | zmtp_properties |
Private Member Functions | |
bool | check_socket_type (const std::string &type_) const |
Private Attributes | |
blob_t | identity |
blob_t | user_id |
Definition at line 46 of file mechanism.hpp.
Enumerator | |
---|---|
handshaking | |
ready | |
error |
Definition at line 50 of file mechanism.hpp.
zmq::mechanism_t::mechanism_t | ( | const options_t & | options_ | ) |
Definition at line 39 of file mechanism.cpp.
|
virtual |
Definition at line 44 of file mechanism.cpp.
|
protected |
Definition at line 86 of file mechanism.cpp.
References zmq::put_uint32(), and zmq_assert.
Referenced by get_zap_properties(), zmq::null_mechanism_t::next_handshake_command(), zmq::plain_client_t::produce_initiate(), and zmq::plain_server_t::produce_ready().
|
private |
Definition at line 169 of file mechanism.cpp.
References options, zmq::options_t::type, ZMQ_CLIENT, ZMQ_DEALER, ZMQ_DISH, ZMQ_GATHER, ZMQ_PAIR, ZMQ_PUB, ZMQ_PULL, ZMQ_PUSH, ZMQ_RADIO, ZMQ_REP, ZMQ_REQ, ZMQ_ROUTER, ZMQ_SCATTER, ZMQ_SERVER, ZMQ_SUB, ZMQ_XPUB, and ZMQ_XSUB.
Referenced by parse_metadata().
Definition at line 68 of file mechanism.hpp.
Referenced by zmq::stream_engine_t::decode_and_push().
Definition at line 66 of file mechanism.hpp.
Referenced by zmq::stream_engine_t::produce_ping_message(), zmq::stream_engine_t::produce_pong_message(), and zmq::stream_engine_t::pull_and_encode().
zmq::blob_t zmq::mechanism_t::get_user_id | ( | ) | const |
Definition at line 69 of file mechanism.cpp.
References user_id.
Referenced by zmq::stream_engine_t::write_credential(), and zap_msg_available().
|
inline |
Definition at line 88 of file mechanism.hpp.
References add_property(), parse_metadata(), property(), socket_type_string(), and zap_properties.
Referenced by zmq::stream_engine_t::mechanism_ready().
|
inline |
Definition at line 84 of file mechanism.hpp.
References zmtp_properties.
Referenced by zmq::stream_engine_t::mechanism_ready().
Implemented in zmq::null_mechanism_t, zmq::plain_server_t, and zmq::plain_client_t.
Referenced by zmq::stream_engine_t::next_handshake_command().
|
protected |
Definition at line 102 of file mechanism.cpp.
References check_socket_type(), EPROTO, zmq::get_uint32(), options, property(), zmq::options_t::recv_identity, set_peer_identity(), zap_properties, and zmtp_properties.
Referenced by get_zap_properties(), zmq::plain_server_t::process_initiate(), zmq::plain_client_t::process_ready(), zmq::null_mechanism_t::process_ready_command(), zmq::null_mechanism_t::receive_and_process_zap_reply(), and zmq::plain_server_t::receive_and_process_zap_reply().
void zmq::mechanism_t::peer_identity | ( | msg_t * | msg_ | ) |
Definition at line 53 of file mechanism.cpp.
References zmq::msg_t::data, errno_assert, zmq::msg_t::identity, identity, zmq::msg_t::init_size(), and zmq::msg_t::set_flags().
Referenced by zmq::stream_engine_t::mechanism_ready(), and zap_msg_available().
Implemented in zmq::null_mechanism_t, zmq::plain_server_t, and zmq::plain_client_t.
Referenced by zmq::stream_engine_t::process_handshake_command().
|
protectedvirtual |
Definition at line 161 of file mechanism.cpp.
Referenced by get_zap_properties(), and parse_metadata().
void zmq::mechanism_t::set_peer_identity | ( | const void * | id_ptr, |
size_t | id_size | ||
) |
Definition at line 48 of file mechanism.cpp.
References identity.
Referenced by parse_metadata(), and zap_msg_available().
void zmq::mechanism_t::set_user_id | ( | const void * | user_id, |
size_t | size | ||
) |
Definition at line 61 of file mechanism.cpp.
References user_id, and zap_properties.
Referenced by zmq::null_mechanism_t::receive_and_process_zap_reply(), zmq::plain_server_t::receive_and_process_zap_reply(), and zap_msg_available().
|
protected |
Definition at line 74 of file mechanism.cpp.
References zmq_assert.
Referenced by get_zap_properties(), zmq::null_mechanism_t::next_handshake_command(), zmq::plain_client_t::produce_initiate(), and zmq::plain_server_t::produce_ready().
|
pure virtual |
Implemented in zmq::null_mechanism_t, zmq::plain_server_t, and zmq::plain_client_t.
Referenced by zmq::stream_engine_t::next_handshake_command(), zmq::stream_engine_t::process_handshake_command(), and zap_msg_available().
|
inlinevirtual |
Reimplemented in zmq::null_mechanism_t, and zmq::plain_server_t.
Definition at line 71 of file mechanism.hpp.
References get_user_id(), peer_identity(), set_peer_identity(), set_user_id(), size, status(), and user_id.
Referenced by zmq::stream_engine_t::zap_msg_available().
|
private |
Definition at line 128 of file mechanism.hpp.
Referenced by peer_identity(), and set_peer_identity().
|
protected |
Definition at line 124 of file mechanism.hpp.
Referenced by check_socket_type(), zmq::null_mechanism_t::next_handshake_command(), zmq::null_mechanism_t::null_mechanism_t(), parse_metadata(), zmq::plain_client_t::produce_hello(), zmq::plain_client_t::produce_initiate(), zmq::plain_server_t::produce_ready(), zmq::null_mechanism_t::send_zap_request(), and zmq::plain_server_t::send_zap_request().
|
private |
Definition at line 130 of file mechanism.hpp.
Referenced by get_user_id(), set_user_id(), and zap_msg_available().
|
protected |
Definition at line 122 of file mechanism.hpp.
Referenced by get_zap_properties(), parse_metadata(), and set_user_id().
|
protected |
Definition at line 119 of file mechanism.hpp.
Referenced by get_zmtp_properties(), and parse_metadata().