]> git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MMonGetVersion.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / messages / MMonGetVersion.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 /*
4 * Ceph - scalable distributed file system
5 *
6 * Copyright (C) 2011 New Dream Network
7 *
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.
12 *
13 */
14
15 #ifndef CEPH_MMONGETVERSION_H
16 #define CEPH_MMONGETVERSION_H
17
18 #include "msg/Message.h"
19
20 #include "include/types.h"
21
22 /*
23 * This message is sent to the monitors to verify that the client's
24 * version of the map(s) is the latest available. For example, this
25 * can be used to determine whether a pool actually does not exist, or
26 * if it may have been created but the map was not received yet.
27 */
28 class MMonGetVersion final : public Message {
29 public:
30 MMonGetVersion() : Message{CEPH_MSG_MON_GET_VERSION} {}
31
32 std::string_view get_type_name() const override {
33 return "mon_get_version";
34 }
35
36 void print(std::ostream& o) const override {
37 o << "mon_get_version(what=" << what << " handle=" << handle << ")";
38 }
39
40 void encode_payload(uint64_t features) override {
41 using ceph::encode;
42 encode(handle, payload);
43 encode(what, payload);
44 }
45
46 void decode_payload() override {
47 auto p = payload.cbegin();
48 using ceph::decode;
49 decode(handle, p);
50 decode(what, p);
51 }
52
53 ceph_tid_t handle = 0;
54 std::string what;
55
56 private:
57 ~MMonGetVersion() final {}
58 };
59
60 #endif