]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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 | */ | |
f67539c2 | 28 | class MMonGetVersion final : public Message { |
7c673cae | 29 | public: |
9f95a23c | 30 | MMonGetVersion() : Message{CEPH_MSG_MON_GET_VERSION} {} |
11fdf7f2 TL |
31 | |
32 | std::string_view get_type_name() const override { | |
7c673cae FG |
33 | return "mon_get_version"; |
34 | } | |
35 | ||
9f95a23c | 36 | void print(std::ostream& o) const override { |
7c673cae FG |
37 | o << "mon_get_version(what=" << what << " handle=" << handle << ")"; |
38 | } | |
39 | ||
40 | void encode_payload(uint64_t features) override { | |
11fdf7f2 TL |
41 | using ceph::encode; |
42 | encode(handle, payload); | |
43 | encode(what, payload); | |
7c673cae FG |
44 | } |
45 | ||
46 | void decode_payload() override { | |
11fdf7f2 | 47 | auto p = payload.cbegin(); |
9f95a23c | 48 | using ceph::decode; |
11fdf7f2 TL |
49 | decode(handle, p); |
50 | decode(what, p); | |
7c673cae FG |
51 | } |
52 | ||
d2e6a577 | 53 | ceph_tid_t handle = 0; |
9f95a23c | 54 | std::string what; |
7c673cae FG |
55 | |
56 | private: | |
f67539c2 | 57 | ~MMonGetVersion() final {} |
7c673cae FG |
58 | }; |
59 | ||
60 | #endif |