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_MMONMAP_H
16 #define CEPH_MMONMAP_H
18 #include "include/ceph_features.h"
19 #include "msg/Message.h"
20 #include "mon/MonMap.h"
22 class MMonMap : public Message {
26 MMonMap() : Message(CEPH_MSG_MON_MAP) { }
27 explicit MMonMap(bufferlist &bl) : Message(CEPH_MSG_MON_MAP) {
31 ~MMonMap() override {}
34 const char *get_type_name() const override { return "mon_map"; }
36 void encode_payload(uint64_t features) override {
37 if (monmapbl.length() &&
38 ((features & CEPH_FEATURE_MONENC) == 0 ||
39 (features & CEPH_FEATURE_MSG_ADDR2) == 0)) {
40 // reencode old-format monmap
44 t.encode(monmapbl, features);
47 ::encode(monmapbl, payload);
49 void decode_payload() override {
50 bufferlist::iterator p = payload.begin();
51 ::decode(monmapbl, p);