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) 2004-2006 Sage Weil <sage@newdream.net>
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_MAUTHREPLY_H
16 #define CEPH_MAUTHREPLY_H
18 #include "msg/Message.h"
19 #include "common/errno.h"
21 struct MAuthReply : public Message {
24 uint64_t global_id; // if zero, meaningless
28 MAuthReply() : Message(CEPH_MSG_AUTH_REPLY), protocol(0), result(0), global_id(0) {}
29 MAuthReply(__u32 p, bufferlist *bl = NULL, int r = 0, uint64_t gid=0, const char *msg = "") :
30 Message(CEPH_MSG_AUTH_REPLY),
31 protocol(p), result(r), global_id(gid),
37 ~MAuthReply() override {}
40 const char *get_type_name() const override { return "auth_reply"; }
41 void print(ostream& o) const override {
42 o << "auth_reply(proto " << protocol << " " << result << " " << cpp_strerror(result);
43 if (result_msg.length())
44 o << ": " << result_msg;
48 void decode_payload() override {
49 bufferlist::iterator p = payload.begin();
50 ::decode(protocol, p);
52 ::decode(global_id, p);
53 ::decode(result_bl, p);
54 ::decode(result_msg, p);
56 void encode_payload(uint64_t features) override {
57 ::encode(protocol, payload);
58 ::encode(result, payload);
59 ::encode(global_id, payload);
60 ::encode(result_bl, payload);
61 ::encode(result_msg, payload);