]>
git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MAuth.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.
18 #include <string_view>
20 #include "include/encoding.h"
22 #include "msg/Message.h"
23 #include "msg/MessageRef.h"
24 #include "messages/PaxosServiceMessage.h"
26 class MAuth final
: public PaxosServiceMessage
{
29 ceph::buffer::list auth_payload
;
32 /* if protocol == 0, then auth_payload is a set<__u32> listing protocols the client supports */
34 MAuth() : PaxosServiceMessage
{CEPH_MSG_AUTH
, 0}, protocol(0), monmap_epoch(0) { }
39 std::string_view
get_type_name() const override
{ return "auth"; }
40 void print(std::ostream
& out
) const override
{
41 out
<< "auth(proto " << protocol
<< " " << auth_payload
.length() << " bytes"
42 << " epoch " << monmap_epoch
<< ")";
45 void decode_payload() override
{
47 auto p
= payload
.cbegin();
50 decode(auth_payload
, p
);
52 decode(monmap_epoch
, p
);
56 void encode_payload(uint64_t features
) override
{
59 encode(protocol
, payload
);
60 encode(auth_payload
, payload
);
61 encode(monmap_epoch
, payload
);
63 ceph::buffer::list
& get_auth_payload() { return auth_payload
; }