File Common/BaseOverlayMessage.msg
Contains:
cplusplus {{
#include <OverlayKey.h>
#include <NodeHandle.h>
#define KEY_L OverlayKey::getLength()
static const int TYPE_L = 8;
static const int IPADDR_L = 32;
static const int UDPPORT_L = 16;
static const int HOPCOUNT_L = 16;
static const int NONCE_L = 32;
static const int NEIGHBORSFLAG_L = 8;
#define NODEHANDLE_L (IPADDR_L + UDPPORT_L + KEY_L)
#define BASEOVERLAY_L(msg) TYPE_L
#define BASEROUTE_L(msg) (BASEOVERLAY_L(msg) + NODEHANDLE_L + KEY_L + \
HOPCOUNT_L)
#define BASEAPPDATA_L(msg) BASEOVERLAY_L(msg)
#define BASERPC_L(msg) (BASEOVERLAY_L(msg) + NONCE_L + NODEHANDLE_L)
#define BASECALL_L(msg) BASERPC_L(msg)
#define BASERESPONSE_L(msg) BASERPC_L(msg)
#define FINDNODECALL_L(msg) (BASECALL_L(msg) + KEY_L)
#define FINDNODERESPONSE_L(msg) (BASERESPONSE_L(msg) + NEIGHBORSFLAG_L + \
(msg->getClosestNodesArraySize() * NODEHANDLE_L))
#define FAILEDNODECALL_L(msg) (BASECALL_L(msg) + IPADDR_L + UDPPORT_L)
#define FAILEDNODERESPONSE_L(msg) (BASERESPONSE_L(msg) + 8 * sizeof(bool))
#define PINGCALL_L(msg) BASECALL_L(msg)
#define PINGRESPONSE_L(msg) BASERESPONSE_L(msg)
}};
class noncobject OverlayKey;
class noncobject TransportAddress;
class noncobject NodeHandle;
enum BaseOverlayMessageType
{
OVERLAYSIGNALING = 0;
RPC = 1;
APPDATA = 2;
OVERLAYROUTE = 3;
};
message BaseOverlayMessage {
fields:
int type enum(BaseOverlayMessageType) = OVERLAYSIGNALING;
bool signaling = true;
};
message BaseRouteMessage extends BaseOverlayMessage {
fields:
OverlayKey destKey;
NodeHandle srcNode;
int hopCount = 0;
};
message BaseAppDataMessage extends BaseOverlayMessage {
};
message BaseRpcMessage extends BaseOverlayMessage {
fields:
unsigned int nonce;
NodeHandle srcNode;
};
message BaseCallMessage extends BaseRpcMessage {
};
message BaseResponseMessage extends BaseRpcMessage {
};
message RpcTimeoutMessage extends BaseRpcMessage {
};
message FindNodeCall extends BaseCallMessage {
fields:
OverlayKey lookupKey;
int numRedundantNodes;
int numSiblings;
};
message FindNodeResponse extends BaseResponseMessage {
fields:
bool siblings;
NodeHandle closestNodes[];
};
message FailedNodeCall extends BaseCallMessage {
fields:
TransportAddress failedNode;
};
message FailedNodeResponse extends BaseResponseMessage {
fields:
bool tryAgain;
};
message PingCall extends BaseCallMessage {
};
message PingResponse extends BaseResponseMessage {
};