]>
git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MGetConfig.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
6 #include "msg/Message.h"
8 class MGetConfig
: public Message
{
10 static constexpr int HEAD_VERSION
= 1;
11 static constexpr int COMPAT_VERSION
= 1;
13 EntityName name
; ///< e.g., mon.a, client.foo
14 std::string host
; ///< our hostname
15 std::string device_class
;
17 MGetConfig() : Message
{MSG_GET_CONFIG
, HEAD_VERSION
, COMPAT_VERSION
} { }
18 MGetConfig(const EntityName
& n
, const std::string
& h
)
19 : Message
{MSG_GET_CONFIG
, HEAD_VERSION
, COMPAT_VERSION
},
23 std::string_view
get_type_name() const override
{
26 void print(std::ostream
& o
) const override
{
27 o
<< "get_config(" << name
<< "@" << host
;
28 if (device_class
.size()) {
29 o
<< " device_class " << device_class
;
34 void decode_payload() override
{
36 auto p
= payload
.cbegin();
39 decode(device_class
, p
);
42 void encode_payload(uint64_t) override
{
44 encode(name
, payload
);
45 encode(host
, payload
);
46 encode(device_class
, payload
);