--- a/src/DAF/CDAP/CDAPMessage.msg
+++ b/src/DAF/CDAP/CDAPMessage.msg
@@ -25,28 +25,29 @@
//Message operation codes
enum opCode_t {
- M_CONNECT = 0;
- M_CONNECT_R = 1;
- M_RELEASE = 2;
- M_RELEASE_R = 3;
- M_CREATE = 4;
- M_CREATE_R = 5;
- M_DELETE = 6;
- M_DELETE_R = 7;
- M_READ = 8;
- M_READ_R = 9;
- M_CANCELREAD = 10;
- M_CANCELREAD_R = 11;
- M_WRITE = 12;
- M_WRITE_R = 13;
- M_START = 14;
- M_START_R = 15;
- M_STOP = 16;
- M_STOP_R = 17;
- M_INACTIV = 18;
- M_UNABLE_MAINTAIN = 19;
- M_STOP_SENDING = 20;
- M_START_SENDING = 21;
+ UNKNOWN = 0;
+ M_CONNECT = 1;
+ M_CONNECT_R = 2;
+ M_RELEASE = 3;
+ M_RELEASE_R = 4;
+ M_CREATE = 5;
+ M_CREATE_R = 6;
+ M_DELETE = 7;
+ M_DELETE_R = 8;
+ M_READ = 9;
+ M_READ_R = 10;
+ M_CANCELREAD = 11;
+ M_CANCELREAD_R = 12;
+ M_WRITE = 13;
+ M_WRITE_R = 14;
+ M_START = 15;
+ M_START_R = 16;
+ M_STOP = 17;
+ M_STOP_R = 18;
+// M_INACTIV = 19;
+// M_UNABLE_MAINTAIN = 20;
+// M_STOP_SENDING = 21;
+// M_START_SENDING = 22;
}
// Values for the flags field.
@@ -102,18 +103,21 @@
// General structure holding operation return value and potentionaly its verbal
// explanation for debugging purposes
+//Magical length is 8 B
struct result_t {
string resultReason; //Additional explanation of resultValue
- int resultValue; //The result of an operation, indicating its success, partial success in the case of synchronized operations, or reason for failure.
+ int32 resultValue; //The result of an operation, indicating its success, partial success in the case of synchronized operations, or reason for failure.
}
// General structure holding authentication related information
+// Magic length is 17 B
struct auth_t {
unsigned char authType enum(authTypes_t); //Authentication type
authValue_t authValue; //Relevant authentication data
}
// General structures for holding naming information regarding requestor/responder
+// Magic length is 64 B
struct naming_t {
string AEInst; //AE instance-id
string AEName; //AE name
@@ -128,14 +132,26 @@
ObjectPtr objectVal; //Actual object
}
+// Magical Header lengths
+enum headerBitLengths {
+ hdrInt32 = 32;
+ hdrFiltr = 128;
+ hdrResult = 132;
+ hdrAuth = 136;
+ hdrNaming = 512;
+}
+
//////////////////////////////////////////////
//CDAP general messages
//////////////////////////////////////////////
packet CDAPMessage {
string displayString;
- unsigned int size;
+ unsigned int headerBitLength = 160; //in bits
int handle;
- Address dstAddr;
+ Address dstAddr;
+ schedulingPriority = -1;
+ int32 opCode enum(opCode_t);
+ int32 invokeID;
}
//////////////////////////////////////////////
@@ -144,25 +160,30 @@
packet CDAP_M_Connect extends CDAPMessage {
displayString = "b=15,15,oval,#0066CC,#0066CC,0";
- unsigned char opCode enum(opCode_t) = M_CONNECT;
- int invokeID;
- unsigned char flags enum(flagValues_t);
- int version;
- int absSyntax enum(absSyntax_t);
- auth_t auth;
+ opCode enum(opCode_t) = M_CONNECT;
+ headerBitLength = (2+3)*hdrInt32 + hdrAuth + 2*hdrNaming;
+
+ int32 flags enum(flagValues_t);
+ int32 version;
+ int32 absSyntax enum(absSyntax_t);
+
+ auth_t auth;
naming_t src;
naming_t dst;
}
packet CDAP_M_Connect_R extends CDAPMessage {
displayString = "b=15,15,oval,#0099FF,#0099FF,0";
- unsigned char opCode enum(opCode_t) = M_CONNECT_R;
- int invokeID;
- unsigned char flags enum(flagValues_t);
- int version;
- result_t result;
- int absSyntax enum(absSyntax_t);
- auth_t auth;
+ opCode enum(opCode_t) = M_CONNECT_R;
+ headerBitLength = (2+3)*hdrInt32 + hdrAuth + 2*hdrNaming + hdrResult;
+
+ int32 flags enum(flagValues_t);
+ int32 version;
+ int32 absSyntax enum(absSyntax_t);
+
+ result_t result;
+
+ auth_t auth;
naming_t src;
naming_t dst;
}
@@ -173,18 +194,21 @@
packet CDAP_M_Release extends CDAPMessage {
displayString = "b=15,15,oval,#993399,#993399,0";
- unsigned char opCode enum(opCode_t) = M_RELEASE;
- int invokeID;
- unsigned char flags enum(flagValues_t);
- int version;
+ opCode enum(opCode_t) = M_RELEASE;
+ headerBitLength = (2+2)*hdrInt32;
+
+ int32 flags enum(flagValues_t);
+ int32 version;
}
packet CDAP_M_Release_R extends CDAPMessage {
displayString = "b=15,15,oval,#9966CC,#9966CC,0";
- unsigned char opCode enum(opCode_t) = M_RELEASE_R;
- int invokeID;
- unsigned char flags enum(flagValues_t);
- int version;
+ opCode enum(opCode_t) = M_RELEASE_R;
+ headerBitLength = (2+2)*hdrInt32 + hdrResult;
+
+ int32 flags enum(flagValues_t);
+ int32 version;
+
result_t result;
}
@@ -194,24 +218,31 @@
packet CDAP_M_Create extends CDAPMessage {
displayString = "b=15,15,oval,#FFEE00,#FFEE00,0";
- unsigned char opCode enum(opCode_t) = M_CREATE;
- int invokeID;
- unsigned char flags enum(flagValues_t);
- int version;
- object_t object;
- int scope;
- int filter;
+ opCode enum(opCode_t) = M_CREATE;
+ headerBitLength = (2+3)*hdrInt32 + hdrFiltr;
+
+ int32 flags enum(flagValues_t);
+ int32 version;
+
+ object_t object;
+
+ int32 scope;
+ string filter;
}
packet CDAP_M_Create_R extends CDAPMessage {
displayString = "b=15,15,oval,#FFFF66,#FFFF66,0";
- unsigned char opCode enum(opCode_t) = M_CREATE_R;
- int invokeID;
- unsigned char flags enum(flagValues_t);
- int version;
- result_t result;
+ opCode enum(opCode_t) = M_CREATE_R;
+ headerBitLength = (2+2)*hdrInt32 + hdrResult + hdrFiltr;
+
+ int32 flags enum(flagValues_t);
+ int32 version;
+
object_t object;
- int filter;
+
+ string filter;
+
+ result_t result;
}
//////////////////////////////////////////////
@@ -220,24 +251,31 @@
packet CDAP_M_Delete extends CDAPMessage {
displayString = "b=15,15,oval,#CC6633,#CC6633,0";
- unsigned char opCode enum(opCode_t) = M_DELETE;
- int invokeID;
- unsigned char flags enum(flagValues_t);
- int version;
- object_t object;
- int scope;
- int filter;
+ opCode enum(opCode_t) = M_DELETE;
+ headerBitLength = (2+3)*hdrInt32 + hdrFiltr;
+
+ int32 flags enum(flagValues_t);
+ int32 version;
+
+ object_t object;
+
+ int32 scope;
+ string filter;
}
packet CDAP_M_Delete_R extends CDAPMessage {
displayString = "b=15,15,oval,#CC9966,#CC9966,0";
- unsigned char opCode enum(opCode_t) = M_DELETE_R;
- int invokeID;
- unsigned char flags enum(flagValues_t);
- int version;
- result_t result;
- object_t object;
- int filter;
+ opCode enum(opCode_t) = M_DELETE_R;
+ headerBitLength = (2+2)*hdrInt32 + hdrResult + hdrFiltr;
+
+ int32 flags enum(flagValues_t);
+ int32 version;
+
+ object_t object;
+
+ string filter;
+
+ result_t result;
}
//////////////////////////////////////////////
@@ -246,24 +284,31 @@
packet CDAP_M_Read extends CDAPMessage {
displayString = "b=15,15,oval,#33CCCC,#33CCCC,0";
- unsigned char opCode enum(opCode_t) = M_READ;
- int invokeID;
- unsigned char flags enum(flagValues_t);
- int version;
- object_t object;
- int scope;
- int filter;
+ opCode enum(opCode_t) = M_READ;
+ headerBitLength = (2+3)*hdrInt32 + hdrFiltr;
+
+ int32 flags enum(flagValues_t);
+ int32 version;
+
+ object_t object;
+
+ int32 scope;
+ string filter;
}
packet CDAP_M_Read_R extends CDAPMessage {
displayString = "b=15,15,oval,#33FFCC,#33FFCC,0";
- unsigned char opCode enum(opCode_t) = M_READ_R;
- int invokeID;
- unsigned char flags enum(flagValues_t);
- int version;
+ opCode enum(opCode_t) = M_READ_R;
+ headerBitLength = (2+2)*hdrInt32 + hdrResult + hdrFiltr;
+
+ int32 flags enum(flagValues_t);
+ int32 version;
+
+ object_t object;
+
+ string filter;
+
result_t result;
- object_t object;
- int filter;
}
//////////////////////////////////////////////
@@ -272,20 +317,24 @@
packet CDAP_M_CancelRead extends CDAPMessage {
displayString = "b=15,15,oval,#333366,#333366,0";
- unsigned char opCode enum(opCode_t) = M_CANCELREAD;
- int invokeID;
- unsigned char flags enum(flagValues_t);
- int version;
- result_t result;
+ opCode enum(opCode_t) = M_CANCELREAD;
+ headerBitLength = (2+2)*hdrInt32 + hdrResult;
+
+ int32 flags enum(flagValues_t);
+ int32 version;
+
+ result_t result;
}
packet CDAP_M_CancelRead_R extends CDAPMessage {
displayString = "b=15,15,oval,#333399,#333399,0";
- unsigned char opCode enum(opCode_t) = M_CANCELREAD_R;
- int invokeID;
- unsigned char flags enum(flagValues_t);
- int version;
- result_t result;
+ opCode enum(opCode_t) = M_CANCELREAD_R;
+ headerBitLength = (2+2)*hdrInt32 + hdrResult;
+
+ int32 flags enum(flagValues_t);
+ int32 version;
+
+ result_t result;
}
//////////////////////////////////////////////
@@ -294,24 +343,31 @@
packet CDAP_M_Write extends CDAPMessage {
displayString = "b=15,15,oval,#CC9900,#CC9900,0";
- unsigned char opCode enum(opCode_t) = M_WRITE;
- int invokeID;
- unsigned char flags enum(flagValues_t);
- int version;
- object_t object;
- int scope;
- int filter;
+ opCode enum(opCode_t) = M_WRITE;
+ headerBitLength = (2+3)*hdrInt32 + hdrFiltr;
+
+ int32 flags enum(flagValues_t);
+ int32 version;
+
+ object_t object;
+
+ int32 scope;
+ string filter;
}
packet CDAP_M_Write_R extends CDAPMessage {
displayString = "b=15,15,oval,#CC9933,#CC9933,0";
- unsigned char opCode enum(opCode_t) = M_WRITE_R;
- int invokeID;
- unsigned char flags enum(flagValues_t);
- int version;
- result_t result;
- object_t object;
- int filter;
+ opCode enum(opCode_t) = M_WRITE_R;
+ headerBitLength = (2+2)*hdrInt32 + hdrResult + hdrFiltr;
+
+ int32 flags enum(flagValues_t);
+ int32 version;
+
+ object_t object;
+
+ string filter;
+
+ result_t result;
}
//////////////////////////////////////////////
@@ -320,24 +376,31 @@
packet CDAP_M_Start extends CDAPMessage {
displayString = "b=15,15,oval,#99CC00,#99CC00,0";
- unsigned char opCode enum(opCode_t) = M_START;
- int invokeID;
- unsigned char flags enum(flagValues_t);
- int version;
- object_t object;
- int scope;
- int filter;
+ opCode enum(opCode_t) = M_START;
+ headerBitLength = (2+3)*hdrInt32 + hdrFiltr;
+
+ int32 flags enum(flagValues_t);
+ int32 version;
+
+ object_t object;
+
+ int32 scope;
+ string filter;
}
packet CDAP_M_Start_R extends CDAPMessage {
displayString = "b=15,15,oval,#99FF33,#99FF33,0";
- unsigned char opCode enum(opCode_t) = M_START_R;
- int invokeID;
- unsigned char flags enum(flagValues_t);
- int version;
- result_t result;
- object_t object;
- int filter;
+ opCode enum(opCode_t) = M_START_R;
+ headerBitLength = (2+2)*hdrInt32 + hdrResult + hdrFiltr;
+
+ int32 flags enum(flagValues_t);
+ int32 version;
+
+ object_t object;
+
+ string filter;
+
+ result_t result;
}
//////////////////////////////////////////////
@@ -345,41 +408,48 @@
//////////////////////////////////////////////
packet CDAP_M_Stop extends CDAPMessage {
- displayString = "b=15,15,oval,#FF3333,#FF3333,0";
- unsigned char opCode enum(opCode_t) = M_STOP;
- int invokeID;
- unsigned char flags enum(flagValues_t);
- int version;
- object_t object;
- int scope;
- int filter;
-
+ displayString = "b=15,15,oval,#FF3333,#FF3333,0";
+ opCode enum(opCode_t) = M_STOP;
+ headerBitLength = (2+3)*hdrInt32 + hdrFiltr;
+
+ int32 flags enum(flagValues_t);
+ int32 version;
+
+ object_t object;
+
+ int32 scope;
+ string filter;
}
packet CDAP_M_Stop_R extends CDAPMessage {
displayString = "b=15,15,oval,#FF6666,#FF6666,0";
- unsigned char opCode enum(opCode_t) = M_STOP_R;
- int invokeID;
- unsigned char flags enum(flagValues_t);
- int version;
+ opCode enum(opCode_t) = M_STOP_R;
+ headerBitLength = (2+2)*hdrInt32 + hdrResult + hdrFiltr;
+
+ int32 flags enum(flagValues_t);
+ int32 version;
+
+ object_t object;
+
+ string filter;
+
result_t result;
- object_t object;
- int filter;
-}
+}
+
//////////////////////////////////////////////////////
// To inform app (socket) about inactivity //////////
/////////////////////////////////////////////////////
-message CDAP_M_Inactiv extends CDAPMessage {
- displayString = "b=15,15,oval,#FF0000,#FF0000,0";
- unsigned char opCode enum(opCode_t) = M_INACTIV;
+//message CDAP_M_Inactiv extends CDAPMessage {
+// displayString = "b=15,15,oval,#FF0000,#FF0000,0";
+// opCode enum(opCode_t) = M_INACTIV;
// int invokeID;
// unsigned char flags enum(flagValues_t);
// int version;
// result_t result;
// object_t object;
// int filter;
-}
+//}
@@ -387,30 +457,30 @@
// To inform app (socket) about that we were unable //
// to maintain QoS parameters //
//////////////////////////////////////////////////////
-message CDAP_M_Unable_Maintain extends CDAPMessage {
- displayString = "b=15,15,oval,#FF0000,#FF0000,0";
- unsigned char opCode enum(opCode_t) = M_UNABLE_MAINTAIN;
+//message CDAP_M_Unable_Maintain extends CDAPMessage {
+// displayString = "b=15,15,oval,#FF0000,#FF0000,0";
+// opCode enum(opCode_t) = M_UNABLE_MAINTAIN;
// int invokeID;
// unsigned char flags enum(flagValues_t);
// int version;
// result_t result;
// object_t object;
// int filter;
-}
+//}
//////////////////////////////////////////////////////
// To inform app (socket) to STOP sending //
//////////////////////////////////////////////////////
-message CDAP_M_STOP_SENDING extends CDAPMessage {
- displayString = "b=15,15,oval,#FF0000,#FF0000,0";
- unsigned char opCode enum(opCode_t) = M_STOP_SENDING;
-}
+//message CDAP_M_STOP_SENDING extends CDAPMessage {
+// displayString = "b=15,15,oval,#FF0000,#FF0000,0";
+// opCode enum(opCode_t) = M_STOP_SENDING;
+//}
//////////////////////////////////////////////////////
// To inform app (socket) to START sending again //
//////////////////////////////////////////////////////
-message CDAP_M_START_SENDING extends CDAPMessage {
- displayString = "b=15,15,oval,#FF0000,#FF0000,0";
- unsigned char opCode enum(opCode_t) = M_START_SENDING;
-}
+//message CDAP_M_START_SENDING extends CDAPMessage {
+// displayString = "b=15,15,oval,#FF0000,#FF0000,0";
+// opCode enum(opCode_t) = M_START_SENDING;
+//}