]>
git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MAuthReply.h
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 class MAuthReply final
: public Message
{
25 uint64_t global_id
; // if zero, meaningless
26 std::string result_msg
;
27 ceph::buffer::list result_bl
;
29 MAuthReply() : Message(CEPH_MSG_AUTH_REPLY
), protocol(0), result(0), global_id(0) {}
30 MAuthReply(__u32 p
, ceph::buffer::list
*bl
= NULL
, int r
= 0, uint64_t gid
=0, const char *msg
= "") :
31 Message(CEPH_MSG_AUTH_REPLY
),
32 protocol(p
), result(r
), global_id(gid
),
38 ~MAuthReply() final
{}
41 std::string_view
get_type_name() const override
{ return "auth_reply"; }
42 void print(std::ostream
& o
) const override
{
43 o
<< "auth_reply(proto " << protocol
<< " " << result
<< " " << cpp_strerror(result
);
44 if (result_msg
.length())
45 o
<< ": " << result_msg
;
49 void decode_payload() override
{
51 auto p
= payload
.cbegin();
56 decode(result_msg
, p
);
58 void encode_payload(uint64_t features
) override
{
60 encode(protocol
, payload
);
61 encode(result
, payload
);
62 encode(global_id
, payload
);
63 encode(result_bl
, payload
);
64 encode(result_msg
, payload
);