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 "messages/PaxosServiceMessage.h"
20 struct MAuth : public PaxosServiceMessage {
22 bufferlist auth_payload;
25 /* if protocol == 0, then auth_payload is a set<__u32> listing protocols the client supports */
27 MAuth() : PaxosServiceMessage(CEPH_MSG_AUTH, 0), protocol(0), monmap_epoch(0) { }
32 const char *get_type_name() const override { return "auth"; }
33 void print(ostream& out) const override {
34 out << "auth(proto " << protocol << " " << auth_payload.length() << " bytes"
35 << " epoch " << monmap_epoch << ")";
38 void decode_payload() override {
39 bufferlist::iterator p = payload.begin();
41 ::decode(protocol, p);
42 ::decode(auth_payload, p);
44 ::decode(monmap_epoch, p);
48 void encode_payload(uint64_t features) override {
50 ::encode(protocol, payload);
51 ::encode(auth_payload, payload);
52 ::encode(monmap_epoch, payload);
54 bufferlist& get_auth_payload() { return auth_payload; }