]> git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MMonSubscribeAck.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / messages / MMonSubscribeAck.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) 2004-2006 Sage Weil <sage@newdream.net>
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_MMONSUBSCRIBEACK_H
16 #define CEPH_MMONSUBSCRIBEACK_H
17
18 #include "msg/Message.h"
19
20 class MMonSubscribeAck final : public Message {
21 public:
22 __u32 interval;
23 uuid_d fsid;
24
25 MMonSubscribeAck() : Message{CEPH_MSG_MON_SUBSCRIBE_ACK},
26 interval(0) {
27 }
28 MMonSubscribeAck(uuid_d& f, int i) : Message{CEPH_MSG_MON_SUBSCRIBE_ACK},
29 interval(i), fsid(f) { }
30 private:
31 ~MMonSubscribeAck() final {}
32
33 public:
34 std::string_view get_type_name() const override { return "mon_subscribe_ack"; }
35 void print(std::ostream& o) const override {
36 o << "mon_subscribe_ack(" << interval << "s)";
37 }
38
39 void decode_payload() override {
40 using ceph::decode;
41 auto p = payload.cbegin();
42 decode(interval, p);
43 decode(fsid, p);
44 }
45 void encode_payload(uint64_t features) override {
46 using ceph::encode;
47 encode(interval, payload);
48 encode(fsid, payload);
49 }
50 private:
51 template<class T, typename... Args>
52 friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args);
53 };
54
55 #endif