~clint-fewbar/+junk/ceph-packaging

« back to all changes in this revision

Viewing changes to src/messages/MMonSubscribeAck.h

  • Committer: Clint Byrum
  • Date: 2010-07-21 04:26:29 UTC
  • Revision ID: clint@ubuntu.com-20100721042629-srvi3wzjib97px3o
importingĀ upstreamĀ v0.20.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
 
2
// vim: ts=8 sw=2 smarttab
 
3
/*
 
4
 * Ceph - scalable distributed file system
 
5
 *
 
6
 * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
 
7
 *
 
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.
 
12
 * 
 
13
 */
 
14
 
 
15
#ifndef __MMONSUBSCRIBEACK_H
 
16
#define __MMONSUBSCRIBEACK_H
 
17
 
 
18
#include "msg/Message.h"
 
19
 
 
20
struct MMonSubscribeAck : public Message {
 
21
  __u32 interval;
 
22
  ceph_fsid fsid;
 
23
  
 
24
  MMonSubscribeAck() : Message(CEPH_MSG_MON_SUBSCRIBE_ACK),
 
25
                       interval(0) {
 
26
    memset(&fsid, 0, sizeof(fsid));
 
27
  }
 
28
  MMonSubscribeAck(ceph_fsid& f, int i) : Message(CEPH_MSG_MON_SUBSCRIBE_ACK),
 
29
                                          interval(i), fsid(f) { }
 
30
 
 
31
  
 
32
  const char *get_type_name() { return "mon_subscribe_ack"; }
 
33
  void print(ostream& o) {
 
34
    o << "mon_subscribe_ack(" << interval << "s)";
 
35
  }
 
36
 
 
37
  void decode_payload() {
 
38
    bufferlist::iterator p = payload.begin();
 
39
    ::decode(interval, p);
 
40
    ::decode(fsid, p);
 
41
  }
 
42
  void encode_payload() {
 
43
    ::encode(interval, payload);
 
44
    ::encode(fsid, payload);
 
45
  }
 
46
};
 
47
 
 
48
#endif