Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / messages / MMonJoin.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_MMONJOIN_H
16 #define CEPH_MMONJOIN_H
17
18 #include "messages/PaxosServiceMessage.h"
19
20 #include <vector>
21 using std::vector;
22
23 class MMonJoin : public PaxosServiceMessage {
24  public:
25   uuid_d fsid;
26   string name;
27   entity_addr_t addr;
28
29   MMonJoin() : PaxosServiceMessage(MSG_MON_JOIN, 0) {}
30   MMonJoin(uuid_d &f, string n, const entity_addr_t& a)
31     : PaxosServiceMessage(MSG_MON_JOIN, 0),
32       fsid(f), name(n), addr(a)
33   { }
34   
35 private:
36   ~MMonJoin() override {}
37
38 public:  
39   const char *get_type_name() const override { return "mon_join"; }
40   void print(ostream& o) const override {
41     o << "mon_join(" << name << " " << addr << ")";
42   }
43   
44   void encode_payload(uint64_t features) override {
45     paxos_encode();
46     ::encode(fsid, payload);
47     ::encode(name, payload);
48     ::encode(addr, payload, features);
49   }
50   void decode_payload() override {
51     bufferlist::iterator p = payload.begin();
52     paxos_decode(p);
53     ::decode(fsid, p);
54     ::decode(name, p);
55     ::decode(addr, p);
56   }
57 };
58
59 #endif