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