]> git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MMonGetVersion.h
update sources to ceph Nautilus 14.2.1
[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 : public MessageInstance<MMonGetVersion> {
29 public:
30 friend factory;
31
32 MMonGetVersion() : MessageInstance(CEPH_MSG_MON_GET_VERSION) {}
33
34 std::string_view get_type_name() const override {
35 return "mon_get_version";
36 }
37
38 void print(ostream& o) const override {
39 o << "mon_get_version(what=" << what << " handle=" << handle << ")";
40 }
41
42 void encode_payload(uint64_t features) override {
43 using ceph::encode;
44 encode(handle, payload);
45 encode(what, payload);
46 }
47
48 void decode_payload() override {
49 auto p = payload.cbegin();
50 decode(handle, p);
51 decode(what, p);
52 }
53
54 ceph_tid_t handle = 0;
55 string what;
56
57 private:
58 ~MMonGetVersion() override {}
59 };
60
61 #endif