File Applications/DHT/DHTMessage.msg

Contains:

//
// Copyright (C) 2007 Institut fuer Telematik, Universitaet Karlsruhe (TH)
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//

//
// @author Ingmar Baumgart
//

cplusplus {{
#include <OverlayKey.h>
#include <IPvXAddress.h>
#include <BinaryValue.h>
#include <NodeHandle.h>
#include <CommonMessages_m.h>

#define DHTCALL_L(msg) (BASECALL_L(msg) + KEY_L)
#define PUTCALL_L(msg) (DHTCALL_L(msg) + msg->getValue().size() * sizeof(char) + sizeof(int) + sizeof(bool) * 2 + NODEHANDLE_L)
#define GETCALL_L(msg) (DHTCALL_L(msg) + sizeof(bool))
#define DHTRESPONSE_L(msg) (BASERESPONSE_L(msg) + KEY_L + msg->getValue().size() * sizeof(char))
#define PUTRESPONSE_L(msg) (DHTRESPONSE_L(msg))
#define GETRESPONSE_L(msg) (DHTRESPONSE_L(msg) + sizeof(bool))
}};

class BaseRpcMessage;
class BaseCallMessage;
class BaseResponseMessage;
class noncobject OverlayKey;
class noncobject IPvXAddress;
class noncobject BinaryValue;
class noncobject NodeHandle;

message DHTMessageCall extends BaseCallMessage
{
    fields:
	OverlayKey key;

};

message DHTPutCall extends DHTMessageCall {
    fields:
        BinaryValue value;
        int ttl;
        bool isModifiable;
        bool maintenance;
        NodeHandle ownerNode;
};

message DHTGetCall extends DHTMessageCall {
    fields:
        bool isHash;
};

message DHTMessageResponse extends BaseResponseMessage
{
    fields:
	OverlayKey key;
	BinaryValue value;
};

message DHTPutResponse extends DHTMessageResponse {
};

message DHTGetResponse extends DHTMessageResponse {
    fields:
        bool isHash;
};

message DHTTtlTimer
{
	fields:
		OverlayKey key;
};