1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2011 New Dream Network
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
15 #ifndef CEPH_MMONGETVERSIONREPLY_H
16 #define CEPH_MMONGETVERSIONREPLY_H
18 #include "msg/Message.h"
20 #include "include/types.h"
23 * This message is sent from the monitors to clients in response to a
24 * MMonGetVersion. The latest version of the requested thing is sent
27 class MMonGetVersionReply final
: public Message
{
29 static constexpr int HEAD_VERSION
= 2;
32 MMonGetVersionReply() : Message
{CEPH_MSG_MON_GET_VERSION_REPLY
, HEAD_VERSION
} { }
34 std::string_view
get_type_name() const override
{
35 return "mon_get_version_reply";
38 void print(std::ostream
& o
) const override
{
39 o
<< "mon_get_version_reply(handle=" << handle
<< " version=" << version
<< ")";
42 void encode_payload(uint64_t features
) override
{
44 encode(handle
, payload
);
45 encode(version
, payload
);
46 encode(oldest_version
, payload
);
49 void decode_payload() override
{
51 auto p
= payload
.cbegin();
54 if (header
.version
>= 2)
55 decode(oldest_version
, p
);
58 ceph_tid_t handle
= 0;
59 version_t version
= 0;
60 version_t oldest_version
= 0;
63 ~MMonGetVersionReply() final
{}