File Common/CommonAPIMessages.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.
//

cplusplus {{
#include <OverlayKey.h>
#include <IPvXAddress.h>
#include <NodeHandle.h>
}};

class CommonAPIMessage;
class noncobject NodeHandle;
class noncobject OverlayKey;
class noncobject IPvXAddress;


enum CommonAPIMessageType
{
	KBR_ROUTE = 0;
	KBR_DELIVER = 1;
	KBR_FORWARD = 2;
	KBR_FORWARD_RESPONSE = 3;
	KBR_UPDATE = 4;
	DHT_PUT = 5;	
	DHT_PUT_RESPONSE = 6;	
	DHT_GET = 7;
	DHT_GET_RESPONSE = 8;	
	DHT_REMOVE = 9;
	DHT_REMOVE_RESPONSE = 10;
	COMMON_API_UNDEFINED = 99;
};

//
// @author Bernhard Heep
//
// Base class for all common API message types
//
message CommonAPIMessage
{
    fields:	
	int type enum(CommonAPIMessageType) = COMMON_API_UNDEFINED;  // message type	
};

//
// @author Bernhard Heep
//
// Message type for KBR route calls 
//
message KBRroute extends CommonAPIMessage
{
    fields:
	OverlayKey destKey; // the destination key
	NodeHandle hint;    // first hop, usually unspecified
};

//
// @author Bernhard Heep
//
// Message type for KBR forward calls
//
message KBRforward extends CommonAPIMessage
{
    fields:
	OverlayKey destKey;     // the destination key
	NodeHandle nextHopNode; // the proposed/changed next hop node
};

//
// @author Bernhard Heep
//
// ...
//
message KBRdeliver extends CommonAPIMessage
{
    fields:
	OverlayKey destKey;
};

//
// @author Bernhard Heep
//
// ...
//
message KBRupdate extends CommonAPIMessage
{
    fields:
	NodeHandle node;
	bool joined;
};

//
// @author Ingmar Baumgart
//
// ...
//
message DHTput extends CommonAPIMessage
{
	fields:
		OverlayKey key;
		string value;
};

//
// @author Ingmar Baumgart
//
// ...
//
message DHTget extends CommonAPIMessage
{
	fields:
		OverlayKey key;
};

//
// @author Ingmar Baumgart
//
// ...
//
message DHTputResponse extends CommonAPIMessage
{
	fields:
		OverlayKey key;
		string value;
};

//
// @author Ingmar Baumgart
//
// ...
//
message DHTgetResponse extends CommonAPIMessage
{
	fields:
		OverlayKey key;
		string value;
};

//
// @author Bernhard Heep
//
// Control info for sending/receiving data via overlay Network. Travels between
// application and overlay.
//
class OverlayCtrlInfo
{
    fields:
	IPvXAddress lastHopAddr; // IP address of last hop node
	int lastHopPort;         // UDP port of last hop node

	//NodeHandle thisNode;     // local IP/port/nodeID (DEPRECATED!!!)
	NodeHandle srcNode;      // the message's source node IP/port/nodeID

	int hopCount = 0;        // hop count
};