Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / messages / MNop.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  * Portions Copyright (C) 2014 CohortFS, LLC
8  *
9  * This is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License version 2.1, as published by the Free Software
12  * Foundation.  See file COPYING.
13  *
14  */
15
16 #ifndef CEPH_MSG_NOP_H
17 #define CEPH_MSG_NOP_H
18
19 #include "msg/Message.h"
20 #include "msg/msg_types.h"
21
22 /*
23  * A message with no (remote) effect.
24  */
25 class MNop : public Message {
26 public:
27   static const int HEAD_VERSION = 1;
28   static const int COMPAT_VERSION = 1;
29
30   __u32 tag; // ignored tag value
31
32   MNop()
33     : Message(MSG_NOP, HEAD_VERSION, COMPAT_VERSION)
34     {}
35
36   ~MNop() {}
37
38   void encode_payload(uint64_t _features) {
39     ::encode(tag, payload);
40   }
41
42   void decode_payload() {
43     bufferlist::iterator p = payload.begin();
44     ::decode(tag, p);
45   }
46
47   const char *get_type_name() const { return "MNop"; }
48
49   void print(ostream& out) const {
50     out << get_type_name() << " ";
51   }
52 }; /* MNop */
53
54 #endif /* CEPH_MSG_NOP_H */