Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / 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 struct MMonSubscribeAck : public Message {
21   __u32 interval;
22   uuid_d fsid;
23   
24   MMonSubscribeAck() : Message(CEPH_MSG_MON_SUBSCRIBE_ACK),
25                        interval(0) {
26     memset(&fsid, 0, sizeof(fsid));
27   }
28   MMonSubscribeAck(uuid_d& f, int i) : Message(CEPH_MSG_MON_SUBSCRIBE_ACK),
29                                        interval(i), fsid(f) { }
30 private:
31   ~MMonSubscribeAck() override {}
32
33 public:
34   const char *get_type_name() const override { return "mon_subscribe_ack"; }
35   void print(ostream& o) const override {
36     o << "mon_subscribe_ack(" << interval << "s)";
37   }
38
39   void decode_payload() override {
40     bufferlist::iterator p = payload.begin();
41     ::decode(interval, p);
42     ::decode(fsid, p);
43   }
44   void encode_payload(uint64_t features) override {
45     ::encode(interval, payload);
46     ::encode(fsid, payload);
47   }
48 };
49
50 #endif