ceph/branches/riccardo/monitor2/messages/MNSConnect.h
riccardo80 07ac5d3e74 creating branch for distributed monitor
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1068 29311d96-e01e-0410-9327-a35deaab8ce9
2007-02-01 05:43:23 +00:00

46 lines
937 B
C++

// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software
* Foundation. See file COPYING.
*
*/
#ifndef __MNSCONNECT_H
#define __MNSCONNECT_H
#include "msg/Message.h"
#include "msg/tcp.h"
class MNSConnect : public Message {
tcpaddr_t tcpaddr;
public:
MNSConnect() {}
MNSConnect(tcpaddr_t t) :
Message(MSG_NS_CONNECT) {
tcpaddr = t;
}
char *get_type_name() { return "NSCon"; }
tcpaddr_t& get_addr() { return tcpaddr; }
void encode_payload() {
payload.append((char*)&tcpaddr, sizeof(tcpaddr));
}
void decode_payload() {
payload.copy(0, sizeof(tcpaddr), (char*)&tcpaddr);
}
};
#endif