In this phase the peers identify each other and (if desired) reconnect to
an established session.
-* TAG_IDENT: identify ourselves::
+* TAG_CLIENT_IDENT (client->server): identify ourselves::
- entity_addrvec_t addr(s)
- __u8 my type (CEPH_ENTITY_TYPE_*)
+ __le32 num_addrs
+ entity_addrvec_t*num_addrs entity addrs
__le64 gid (numeric part of osd.0, client.123456, ...)
+ __le64 global_seq
__le64 features supported (CEPH_FEATURE_* bitmask)
__le64 features required (CEPH_FEATURE_* bitmask)
__le64 flags (CEPH_MSG_CONNECT_* bitmask)
- __le64 cookie (a client identifier, assigned by the sender. unique on the sender.)
- client will send first, server will reply with same. if this is a
new session, the client and server can proceed to the message exchange.
- - type.gid (entity_name_t) is set here. this means we don't need it
+ - type.gid (entity_name_t) is set here, by combinging the type shared in the hello
+ frame with the gid here. this means we don't need it
in the header of every message. it also means that we can't send
messages "from" other entity_name_t's. the current
implementations set this at the top of _send_message etc so this
likely want to mask this against what the authenticated credential
allows.
- we've dropped the 'protocol_version' field from msgr1
- - for lossy sessions, cookie is meaningless. for lossless sessions,
- we assign a local value that identifies the local Connection
- state. when we receive this from a peer, we make a note of their
- cookie, so that on reconnect we can reattach (see below).
-* TAG_IDENT_MISSING_FEATURES (server only): complain about a TAG_IDENT
+* TAG_IDENT_MISSING_FEATURES (server->client): complain about a TAG_IDENT
with too few features::
__le64 features we require that the peer didn't advertise
-* TAG_RECONNECT (client only): reconnect to an established session::
+* TAG_SERVER_IDENT (server->client): accept client ident and identify server::
+
+ __le32 num_addrs
+ entity_addrvec_t*num_addrs entity addrs
+ __le64 gid (numeric part of osd.0, client.123456, ...)
+ __le64 global_seq
+ __le64 features supported (CEPH_FEATURE_* bitmask)
+ __le64 features required (CEPH_FEATURE_* bitmask)
+ __le64 flags (CEPH_MSG_CONNECT_* bitmask)
+ __le64 cookie
+
+ - The cookie can be used by the client if it is later disconnected and wants to
+ reconnect and resume the session.
+
__le64 cookie
__le64 global_seq
struct ClientIdentFrame
: public SignedEncryptedFrame<ClientIdentFrame, entity_addrvec_t, int64_t,
uint64_t, uint64_t, uint64_t, uint64_t> {
- const ProtocolV2::Tag tag = ProtocolV2::Tag::IDENT;
+ const ProtocolV2::Tag tag = ProtocolV2::Tag::CLIENT_IDENT;
using SignedEncryptedFrame::SignedEncryptedFrame;
inline entity_addrvec_t &addrs() { return get_val<0>(); }
: public SignedEncryptedFrame<ServerIdentFrame, entity_addrvec_t,
int64_t, uint64_t, uint64_t,
uint64_t, uint64_t, uint64_t> {
- const ProtocolV2::Tag tag = ProtocolV2::Tag::IDENT;
+ const ProtocolV2::Tag tag = ProtocolV2::Tag::SERVER_IDENT;
using SignedEncryptedFrame::SignedEncryptedFrame;
inline entity_addrvec_t &addrs() { return get_val<0>(); }
case Tag::AUTH_REPLY_MORE:
case Tag::AUTH_REQUEST_MORE:
case Tag::AUTH_DONE:
- case Tag::IDENT:
+ case Tag::CLIENT_IDENT:
+ case Tag::SERVER_IDENT:
case Tag::IDENT_MISSING_FEATURES:
case Tag::SESSION_RECONNECT:
case Tag::SESSION_RETRY:
return handle_auth_request_more(buffer, next_payload_len);
case Tag::AUTH_DONE:
return handle_auth_done(buffer, next_payload_len);
- case Tag::IDENT:
- return handle_ident(buffer, next_payload_len);
+ case Tag::CLIENT_IDENT:
+ return handle_client_ident(buffer, next_payload_len);
+ case Tag::SERVER_IDENT:
+ return handle_server_ident(buffer, next_payload_len);
case Tag::IDENT_MISSING_FEATURES:
return handle_ident_missing_features(buffer, next_payload_len);
case Tag::SESSION_RECONNECT:
return nullptr;
}
-CtPtr ProtocolV2::handle_ident(char *payload, uint32_t length) {
- if (state == CONNECTING) {
- return handle_server_ident(payload, length);
- }
- if (state == ACCEPTING) {
- return handle_client_ident(payload, length);
- }
- ceph_abort("wrong state at handle_ident");
-}
-
CtPtr ProtocolV2::ready() {
ldout(cct, 25) << __func__ << dendl;
AUTH_REPLY_MORE,
AUTH_REQUEST_MORE,
AUTH_DONE,
- IDENT,
+ CLIENT_IDENT,
+ SERVER_IDENT,
IDENT_MISSING_FEATURES,
SESSION_RECONNECT,
SESSION_RESET,
Ct<ProtocolV2> *read_frame();
Ct<ProtocolV2> *handle_read_frame_length_and_tag(char *buffer, int r);
Ct<ProtocolV2> *handle_frame_payload(char *buffer, int r);
- Ct<ProtocolV2> *handle_ident(char *payload, uint32_t length);
Ct<ProtocolV2> *ready();