File Overlay/Chord/ChordMessage.msg

Contains:

//
// Copyright (C) 2006 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, Markus Mauch
//

cplusplus {{
#include <IPvXAddress.h>
#include <NodeHandle.h>
#include <BaseOverlayMessage_m.h>

static const int CHORDCOMMAND_L = 8;
static const int SUCNUM_L = 8;
static const int FINGER_L = 8;
static const int STEP_L = 8;
static const int DBNODESET_L = 1;
static const int OTHERLOOKUP_L = 1;

#define NEWSUCCESSORHINT_L(msg) (BASEOVERLAY_L(msg) + CHORDCOMMAND_L + \
                                 2*NODEHANDLE_L)
#define NOTIFYCALL_L(msg) (BASECALL_L(msg) + DBNODESET_L)
#define NOTIFYRESPONSE_L(msg) (BASERESPONSE_L(msg) + SUCNUM_L + NODEHANDLE_L +\
			      DBNODESET_L + (msg->getSucNodeArraySize() * NODEHANDLE_L))
#define JOINCALL_L(msg) BASECALL_L(msg)
#define JOINRESPONSE_L(msg) (BASERESPONSE_L(msg) + SUCNUM_L + NODEHANDLE_L +\
                             (msg->getSucNodeArraySize() * NODEHANDLE_L))
#define STABILIZECALL_L(msg) BASECALL_L(msg)
#define STABILIZERESPONSE_L(msg) (BASERESPONSE_L(msg) + NODEHANDLE_L)
#define FIXFINGERSCALL_L(msg) (BASECALL_L(msg) + FINGER_L)
#define FIXFINGERSRESPONSE_L(msg) (BASERESPONSE_L(msg) + FINGER_L + \
                                   NODEHANDLE_L)
#define DEBRUIJNCALL_L(msg) (BASECALL_L(msg) + KEY_L)
#define DEBRUIJNRESPONSE_L(msg) (BASERESPONSE_L(msg) + SUCNUM_L + NODEHANDLE_L + \
				 (msg->getSucNodeArraySize() * NODEHANDLE_L)) 

#define KOORDEFINDNODEEXTMESSAGE_L (KEY_L + STEP_L + OTHERLOOKUP_L)

}};
//todo add more Koorde message lengths


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

enum ChordCommand
{
	NEWSUCCESSORHINT = 0;
};

message ChordMessage extends BaseOverlayMessage
{
    fields:
        int command enum(ChordCommand); // message type (NEWSUCCESSORHINT, ...)
};

message NewSuccessorHintMessage extends ChordMessage
{
    fields:
        NodeHandle srcNode;     // nodehandle of the message originator
    	NodeHandle preNode;	// the predecessor of the message originator
};


message NotifyCall extends BaseCallMessage
{
    fields:
	bool preDBNodeSet;

};

message NotifyResponse extends BaseResponseMessage
{
    fields:
	int sucNum;		// number of entries in the successor list
	bool sucDBNodeSet;
	NodeHandle sucNode[];	// successor list of the message originator
	NodeHandle preNode;	// in aggressiveJoinMode: predecessor hint
};


message JoinCall extends BaseCallMessage
{
};

message JoinResponse extends BaseResponseMessage
{
    fields:
	int sucNum;		// number of entries in the successor list
	NodeHandle sucNode[];	// successor list of the message originator
	NodeHandle preNode;	// in aggressiveJoinMode: predecessor hint
};

message StabilizeCall extends BaseCallMessage
{
};

message StabilizeResponse extends BaseResponseMessage
{
    fields:
    	NodeHandle preNode;	// the predecessor of the message originator
};

message FixfingersCall extends BaseCallMessage
{
    fields:
        int finger;		// the number of the finger to update
};

message FixfingersResponse extends BaseResponseMessage
{
    fields:
        int finger;		// the number of the finger to update
        NodeHandle sucNode[];     // the successor of the message originator
};

message ChordFindNodeExtMessage
{
    fields:
        int chordCount;
};

// ----------- Koorde -------------------

message KoordeFindNodeExtMessage
{
    fields:
	OverlayKey routeKey;
	int step;
	int length;
	bool otherLookup;
	NodeHandle srcNode;
};

message DeBruijnCall extends BaseCallMessage
{
    fields:
	OverlayKey destKey;
};

message DeBruijnResponse extends BaseResponseMessage
{
    fields:
        NodeHandle dBNode;
        int sucNum;             // number of entries in the successor list
        NodeHandle sucNode[];   // successor list of the message originator
};