Commit 9d1566a8 authored by garciay's avatar garciay
Browse files

Simplify Payload for GeoNetworking & BTP

==> Check TODO in Security ATS
parent 51bab01d
......@@ -121,7 +121,7 @@ module ItsAutoInterop_Templates {
m_shbHeaderType,
p_hopLimit
),
payload := {
payload := ?/*TODO Check DENM in TC{
decodedPayload := {
btpPacket := mw_btpB(
PICS_DENM_BTP_DESTINATION_PORT,
......@@ -135,7 +135,7 @@ module ItsAutoInterop_Templates {
)
},
rawPayload := ?
}
}*/
} // End of template mw_geoNwTsbPacketWithNextHeader_denm
/**
......@@ -151,7 +151,7 @@ module ItsAutoInterop_Templates {
template (present) NextHeader p_nextHeader := ?,
template (present) CAM p_cam := ?
) modifies mw_geoNwShbPacket := {
payload := {
payload := ?/*TODO Check CAM in TC{
decodedPayload := {
btpPacket := mw_btpB(
PICS_CAM_BTP_DESTINATION_PORT,
......@@ -165,7 +165,7 @@ module ItsAutoInterop_Templates {
)
},
rawPayload := ?
}
}*/
} // End of template mw_geoNwShbPacketWithNextHeader_cam
} // End of group geoNetworkingTemplates
......
......@@ -237,7 +237,7 @@ module ItsGeoNetworking_TpFunctions {
[] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwShbPacket))) -> value v_geoNwInd {
tc_ac.stop;
if(ispresent(v_geoNwInd.msgIn.gnPacket.packet.payload)) {
if(v_geoNwInd.msgIn.gnPacket.packet.commonHeader.plLength == lengthof(v_geoNwInd.msgIn.gnPacket.packet.payload.rawPayload)) {
if(v_geoNwInd.msgIn.gnPacket.packet.commonHeader.plLength == lengthof(v_geoNwInd.msgIn.gnPacket.packet.payload)) {
log("*** " & testcasename() & ": PASS: PL field correctly indicates payload size ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
......@@ -245,7 +245,7 @@ module ItsGeoNetworking_TpFunctions {
log("*** " & testcasename() & ": FAIL: PL does correctly not indicate payload size ("
& int2str(v_geoNwInd.msgIn.gnPacket.packet.commonHeader.plLength)
& " != "
& int2str(lengthof(v_geoNwInd.msgIn.gnPacket.packet.payload.rawPayload))
& int2str(lengthof(v_geoNwInd.msgIn.gnPacket.packet.payload))
& ")***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
......@@ -2318,7 +2318,7 @@ module ItsGeoNetworking_TpFunctions {
)
)
),
f_adaptPayload_mw(v_payload1)
v_payload1
)
) {
v_msg1Received := true;
......@@ -2341,7 +2341,7 @@ module ItsGeoNetworking_TpFunctions {
)
)
),
f_adaptPayload_mw(v_payload2)
v_payload2
)
) {
v_msg2Received := true;
......@@ -3197,7 +3197,7 @@ module ItsGeoNetworking_TpFunctions {
)
)
),
f_adaptPayload_mw(v_payload1)
v_payload1
)
) {
v_msg1Received := true;
......@@ -3213,7 +3213,7 @@ module ItsGeoNetworking_TpFunctions {
)
)
),
f_adaptPayload_mw(v_payload2)
v_payload2
)
) {
tc_ac.stop;
......@@ -6696,7 +6696,7 @@ module ItsGeoNetworking_TpFunctions {
f_sleep(PX_TAC);
v_sentRawPayload := f_adaptPayloadForUtInd_m(v_gnPacket.gnPacket.packet.payload);
v_sentRawPayload := valueof(v_gnPacket.gnPacket.packet.payload);
for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i:=i+1) {
// empty on purpose
}
......@@ -7733,7 +7733,7 @@ module ItsGeoNetworking_TpFunctions {
// Preamble
f_prNeighbour();
f_sleep(PX_TAC);
v_sentRawPayload := f_adaptPayloadForUtInd_m(valueof(v_gnPacket.gnPacket.packet.payload));
v_sentRawPayload := valueof(v_gnPacket.gnPacket.packet.payload);
for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i:=i+1) {
// empty on purpose
}
......@@ -8950,7 +8950,7 @@ module ItsGeoNetworking_TpFunctions {
f_sleep(PX_TAC);
v_sentRawPayload := f_adaptPayloadForUtInd_m(v_gnPacket.gnPacket.packet.payload);
v_sentRawPayload := valueof(v_gnPacket.gnPacket.packet.payload);
for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i:=i+1) {
// empty on purpose
}
......@@ -9052,7 +9052,7 @@ module ItsGeoNetworking_TpFunctions {
f_sleep(PX_TAC);
v_sentRawPayload := f_adaptPayloadForUtInd_m(valueof(v_gnPacket.gnPacket.packet.payload));
v_sentRawPayload := valueof(v_gnPacket.gnPacket.packet.payload);
for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i:=i+1) {
// empty on purpose
}
......@@ -10520,7 +10520,7 @@ module ItsGeoNetworking_TpFunctions {
f_sleep(PX_TAC);
v_sentRawPayload := f_adaptPayloadForUtInd_m(v_gnPacket.gnPacket.packet.payload);
v_sentRawPayload := valueof(v_gnPacket.gnPacket.packet.payload);
for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i:=i+1) {
// empty on purpose
}
......@@ -10617,7 +10617,7 @@ module ItsGeoNetworking_TpFunctions {
f_sleep(PX_TAC);
v_sentRawPayload := f_adaptPayloadForUtInd_m(v_gnPacket.gnPacket.packet.payload);
v_sentRawPayload := valueof(v_gnPacket.gnPacket.packet.payload);
for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i:=i+1) {
// empty on purpose
}
......@@ -10640,7 +10640,7 @@ module ItsGeoNetworking_TpFunctions {
// Test Body
f_sleep(PX_TAC);
v_sentRawPayload := f_adaptPayloadForUtInd_m(v_gnPacket.gnPacket.packet.payload);
v_sentRawPayload := valueof(v_gnPacket.gnPacket.packet.payload);
for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i:=i+1) {
// empty on purpose
}
......@@ -10866,7 +10866,7 @@ module ItsGeoNetworking_TpFunctions {
f_sleep(PX_TAC);
v_sentRawPayload := f_adaptPayloadForUtInd_m(v_gnPacket.gnPacket.packet.payload);
v_sentRawPayload := valueof(v_gnPacket.gnPacket.packet.payload);
for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i:=i+1) {
// empty on purpose
}
......@@ -11846,7 +11846,7 @@ module ItsGeoNetworking_TpFunctions {
f_sleep(PX_TAC);
v_sentRawPayload := f_adaptPayloadForUtInd_m(v_gnPacket.gnPacket.packet.payload);
v_sentRawPayload := valueof(v_gnPacket.gnPacket.packet.payload);
for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i:=i+1) {
// empty on purpose
}
......@@ -11930,7 +11930,7 @@ module ItsGeoNetworking_TpFunctions {
-,
c_defaultHopLimit
);
v_sentRawPayload := f_adaptPayloadForUtInd_m(v_gnPacket.gnPacket.packet.payload);
v_sentRawPayload := valueof(v_gnPacket.gnPacket.packet.payload);
for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i:=i+1) {
// empty on purpose
}
......@@ -15458,7 +15458,7 @@ module ItsGeoNetworking_TpFunctions {
)
)
),
f_adaptPayload_mw(char2oct("PAYLOAD_" & oct2str(int2oct(v_index, 2))))
char2oct("PAYLOAD_" & oct2str(int2oct(v_index, 2)))
)
) {
if (v_index < v_nbrOfPackets) {
......@@ -15524,7 +15524,7 @@ module ItsGeoNetworking_TpFunctions {
f_longPosVector2ShortPosVector(valueof(m_dummyLongPosVector)),
0)
);
v_geoNetworkingMsg.gnPacket.packet.payload := f_adaptPayload_m(v_payload);
v_geoNetworkingMsg.gnPacket.packet.payload := valueof(v_payload);
v_packetSize := lengthof(bit2oct(encvalue(v_geoNetworkingMsg)));
// Fill the UC forwarding buffer + c_nbrOfDiscardedMessages more message to remove older messages
......@@ -15696,7 +15696,7 @@ module ItsGeoNetworking_TpFunctions {
v_payload := v_payload & c_defaultPayload;
}
v_geoNetworkingMsg.gnPacket.packet.payload := f_adaptPayload_m(v_payload);
v_geoNetworkingMsg.gnPacket.packet.payload := valueof(v_payload);
v_packetSize := lengthof(bit2oct(encvalue(v_geoNetworkingMsg)));
......@@ -15792,7 +15792,7 @@ module ItsGeoNetworking_TpFunctions {
// Local variables
var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC);
var integer i := 0;
var Payload v_payload := valueof(p_geoNetworkingMsg.gnPacket.packet.payload); //save the given payload
var GnRawPayload v_payload := valueof(p_geoNetworkingMsg.gnPacket.packet.payload); //save the given payload
// Preamble
f_prNeighbour();
......
......@@ -74,7 +74,7 @@ module ItsSecurity_Functions {
// Add CAM payload
v_gnNonSecuredPacket.payload := valueof(
f_adaptPayload_m(
valueof(
bit2oct(
encvalue(
m_camReq(
......@@ -140,7 +140,7 @@ module ItsSecurity_Functions {
// Add CAM payload
v_gnNonSecuredPacket.payload := valueof(
f_adaptPayload_m(
valueof(
bit2oct(
encvalue(
m_camReq(
......@@ -262,7 +262,7 @@ module ItsSecurity_Functions {
// Add the DENM payload
v_gnNonSecuredPacket.payload := valueof(
f_adaptPayload_m(
valueof(
bit2oct(
encvalue(
m_denmReq(
......@@ -338,7 +338,7 @@ module ItsSecurity_Functions {
// Add the DENM payload
v_gnNonSecuredPacket.payload := valueof(
f_adaptPayload_m(
valueof(
bit2oct(
encvalue(
m_denmReq(
......
......@@ -24,43 +24,43 @@ module ItsSecurity_Templates {
import from LibItsGeoNetworking_TypesAndValues all;
// import from LibItsGeoNetworking_Templates all;
template (present) BtpPayload mw_btpCamPayload := {
decodedPayload := {
camPacket := ?
},
rawPayload := ?
} // End of template mw_btpCamPayload
template (present) BtpPayload mw_btpDenmPayload := {
decodedPayload := {
denmPacket := ?
},
rawPayload := ?
} // End of template mw_btpDenmPayload
template (present) Payload mw_secCamPayload := {
decodedPayload := {
btpPacket := mw_btpB(
PX_DESTINATION_PORT,
?,
mw_btpCamPayload
)
},
rawPayload := ?
} // End of template mw_secCamPayload
template (present) Payload mw_secDenmPayload := {
decodedPayload := {
btpPacket := mw_btpB(
PX_DESTINATION_PORT,
?,
mw_btpDenmPayload
)
},
rawPayload := ?
} // End of template mw_secCamPayload
// template (present) BtpPayload mw_btpCamPayload := {
// decodedPayload := {
// camPacket := ?
// },
// rawPayload := ?
// } // End of template mw_btpCamPayload
//
//
// template (present) BtpPayload mw_btpDenmPayload := {
// decodedPayload := {
// denmPacket := ?
// },
// rawPayload := ?
// } // End of template mw_btpDenmPayload
//
// template (present) Payload mw_secCamPayload := {
// decodedPayload := {
// btpPacket := mw_btpB(
// PX_DESTINATION_PORT,
// ?,
// mw_btpCamPayload
// )
// },
// rawPayload := ?
//
// } // End of template mw_secCamPayload
//
// template (present) Payload mw_secDenmPayload := {
// decodedPayload := {
// btpPacket := mw_btpB(
// PX_DESTINATION_PORT,
// ?,
// mw_btpDenmPayload
// )
// },
// rawPayload := ?
//
// } // End of template mw_secCamPayload
} // End of module ItsSecurity_Templates
\ No newline at end of file
This diff is collapsed.
......@@ -616,13 +616,33 @@ module TestCodec_GeoNetworking {
?,
?
)))) -> value v_msg {
log(
valueof(
v_msg.msgIn.gnPacket.packet.extendedHeader.lsRequestHeader.srcPosVector
));
log("Receive LsRequest: ", v_msg.msgIn);
// Send LsReply
f_sendGeoNetMessage(
m_geoNwReq_linkLayerBroadcast(
m_geoNwPdu(
m_geoNwLsReplyPacket(
m_dummyLongPosVectorNodeA,
f_longPosVector2ShortPosVector(
valueof(v_msg.msgIn.gnPacket.packet.extendedHeader.lsRequestHeader.srcPosVector)
),
vc_localSeqNumber
))));
repeat;
}
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwPdu(
mw_geoNwBeaconPacket(?)
)
)) -> value v_msg {
log("Receive beacon: ", v_msg.msgIn);
repeat;
}
[] geoNetworkingPort.receive(mw_geoNwInd(?)) {
[] geoNetworkingPort.receive(
mw_geoNwInd(
?
)) -> value v_msg {
setverdict(fail);
}
[] tc_ac.timeout {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment