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 : public Message {
29 static const int HEAD_VERSION = 2;
32 MMonGetVersionReply() : Message(CEPH_MSG_MON_GET_VERSION_REPLY, HEAD_VERSION) { }
34 const char *get_type_name() const override {
35 return "mon_get_version_reply";
38 void print(ostream& o) const override {
39 o << "mon_get_version_reply(handle=" << handle << " version=" << version << ")";
42 void encode_payload(uint64_t features) override {
43 ::encode(handle, payload);
44 ::encode(version, payload);
45 ::encode(oldest_version, payload);
48 void decode_payload() override {
49 bufferlist::iterator p = payload.begin();
52 if (header.version >= 2)
53 ::decode(oldest_version, p);
56 ceph_tid_t handle = 0;
57 version_t version = 0;
58 version_t oldest_version = 0;
61 ~MMonGetVersionReply() override {}