Loading ccsrc/EncDec/LibItsCam_Encdec.cc +19 −19 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ namespace LibItsCam__EncdecDeclarations { p_camInd.msgIn() = cam; // Decode lower layer data TTCN_Buffer decoding_buffer(OCTETSTRING(s, static_cast<const unsigned char *>(is) + is.lengthof() - s)); loggers::get_instance().log_to_hexa("fx__dec__CAM: ", decoding_buffer); loggers::get_instance().log_to_hexa("fx__dec__CamInd: ", decoding_buffer); // gnNextHeader if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCam__TypesAndValues::CamInd_gnNextHeader_raw_.fieldlength / 8)) { p_camInd.gnNextHeader().set_to_omit(); Loading @@ -87,8 +87,8 @@ namespace LibItsCam__EncdecDeclarations { os.decode(LibItsCam__TypesAndValues::CamInd_gnNextHeader_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_camInd.gnNextHeader() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__CAM: gnNextHeader=", p_camInd.gnNextHeader()); loggers::get_instance().log_to_hexa("fx__dec__CAM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__CamInd: gnNextHeader=", p_camInd.gnNextHeader()); loggers::get_instance().log_to_hexa("fx__dec__CamInd: ", decoding_buffer); // gnHeaderType if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCam__TypesAndValues::CamInd_gnHeaderType_raw_.fieldlength / 8)) { p_camInd.gnHeaderType().set_to_omit(); Loading @@ -97,8 +97,8 @@ namespace LibItsCam__EncdecDeclarations { os.decode(LibItsCam__TypesAndValues::CamInd_gnHeaderType_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_camInd.gnHeaderType() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__CAM: gnHeaderType=", p_camInd.gnHeaderType()); loggers::get_instance().log_to_hexa("fx__dec__CAM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__CamInd: gnHeaderType=", p_camInd.gnHeaderType()); loggers::get_instance().log_to_hexa("fx__dec__CamInd: ", decoding_buffer); // gnHeaderSubtype if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCam__TypesAndValues::CamInd_gnHeaderSubtype_raw_.fieldlength / 8)) { p_camInd.gnHeaderSubtype().set_to_omit(); Loading @@ -107,8 +107,8 @@ namespace LibItsCam__EncdecDeclarations { os.decode(LibItsCam__TypesAndValues::CamInd_gnHeaderSubtype_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_camInd.gnHeaderSubtype() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__CAM: gnHeaderSubtype=", p_camInd.gnHeaderSubtype()); loggers::get_instance().log_to_hexa("fx__dec__CAM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__CamInd: gnHeaderSubtype=", p_camInd.gnHeaderSubtype()); loggers::get_instance().log_to_hexa("fx__dec__CamInd: ", decoding_buffer); // gnLifetime if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCam__TypesAndValues::CamInd_gnLifetime_raw_.fieldlength / 8)) { p_camInd.gnLifetime().set_to_omit(); Loading @@ -117,8 +117,8 @@ namespace LibItsCam__EncdecDeclarations { i.decode(LibItsCam__TypesAndValues::CamInd_gnLifetime_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_camInd.gnLifetime() = i; } loggers::get_instance().log_msg("fx__dec__CAM: gnLifetime=", p_camInd.gnLifetime()); loggers::get_instance().log_to_hexa("fx__dec__CAM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__CamInd: gnLifetime=", p_camInd.gnLifetime()); loggers::get_instance().log_to_hexa("fx__dec__CamInd: ", decoding_buffer); // gnTrafficClass if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCam__TypesAndValues::CamInd_gnTrafficClass_raw_.fieldlength / 8)) { p_camInd.gnTrafficClass().set_to_omit(); Loading @@ -127,8 +127,8 @@ namespace LibItsCam__EncdecDeclarations { os.decode(LibItsCam__TypesAndValues::CamInd_gnTrafficClass_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_camInd.gnTrafficClass() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__CAM: gnTrafficClass=", p_camInd.gnTrafficClass()); loggers::get_instance().log_to_hexa("fx__dec__CAM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__CamInd: gnTrafficClass=", p_camInd.gnTrafficClass()); loggers::get_instance().log_to_hexa("fx__dec__CamInd: ", decoding_buffer); // btpDestinationPort if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCam__TypesAndValues::CamInd_btpDestinationPort_raw_.fieldlength / 8)) { p_camInd.btpDestinationPort().set_to_omit(); Loading @@ -137,8 +137,8 @@ namespace LibItsCam__EncdecDeclarations { i.decode(LibItsCam__TypesAndValues::CamInd_btpDestinationPort_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_camInd.btpDestinationPort() = i; } loggers::get_instance().log_msg("fx__dec__CAM: btpDestinationPort=", p_camInd.btpDestinationPort()); loggers::get_instance().log_to_hexa("fx__dec__CAM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__CamInd: btpDestinationPort=", p_camInd.btpDestinationPort()); loggers::get_instance().log_to_hexa("fx__dec__CamInd: ", decoding_buffer); // btpInfo if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCam__TypesAndValues::CamInd_btpInfo_raw_.fieldlength / 8)) { p_camInd.btpInfo().set_to_omit(); Loading @@ -147,8 +147,8 @@ namespace LibItsCam__EncdecDeclarations { i.decode(LibItsCam__TypesAndValues::CamInd_btpInfo_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_camInd.btpInfo() = i; } loggers::get_instance().log_msg("fx__dec__CAM: btpInfo=", p_camInd.btpInfo()); loggers::get_instance().log_to_hexa("fx__dec__CAM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__CamInd: btpInfo=", p_camInd.btpInfo()); loggers::get_instance().log_to_hexa("fx__dec__CamInd: ", decoding_buffer); // ssp if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCam__TypesAndValues::CamInd_ssp_raw_.fieldlength / 8)) { p_camInd.ssp().set_to_omit(); Loading @@ -157,8 +157,8 @@ namespace LibItsCam__EncdecDeclarations { bs.decode(LibItsCam__TypesAndValues::CamInd_ssp_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_camInd.ssp() = bs; } loggers::get_instance().log_msg("fx__dec__CAM: ssp=", p_camInd.ssp()); loggers::get_instance().log_to_hexa("fx__dec__CAM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__CamInd: ssp=", p_camInd.ssp()); loggers::get_instance().log_to_hexa("fx__dec__CamInd: ", decoding_buffer); // its__aid if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCam__TypesAndValues::CamInd_its__aid_raw_.fieldlength / 8)) { p_camInd.its__aid().set_to_omit(); Loading @@ -167,8 +167,8 @@ namespace LibItsCam__EncdecDeclarations { i.decode(LibItsCam__TypesAndValues::CamInd_its__aid_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_camInd.its__aid() = i; } loggers::get_instance().log_msg("fx__dec__CAM: its_aid=", p_camInd.its__aid()); loggers::get_instance().log_to_hexa("fx__dec__CAM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__CamInd: its_aid=", p_camInd.its__aid()); loggers::get_instance().log_to_hexa("fx__dec__CamInd: ", decoding_buffer); return 0; } Loading ccsrc/EncDec/LibItsCps_Encdec.cc +226 −0 Original line number Diff line number Diff line #include <memory> #include "LibItsCps_EncdecDeclarations.hh" #include "cps_codec.hh" #include "loggers.hh" #include "uppertester_cps_codec.hh" namespace LibItsCps__EncdecDeclarations { /**************************************************** * @desc External function to encode a CpsReq type * @param value to encode * @return encoded value ****************************************************/ BITSTRING fx__enc__CpsReq(const LibItsCps__TypesAndValues::CpsReq &p_cpsReq) { loggers::get_instance().log_msg(">>> fx__enc__CpsReq: ", p_cpsReq); cps_codec codec; OCTETSTRING os; if (codec.encode(p_cpsReq.msgOut(), os) == -1) { loggers::get_instance().warning("fx__enc__CpsReq: -1 result code was returned"); return int2bit(0, 1); } return oct2bit(os); } /**************************************************** * @desc External function to decode a CpsReq type * @param value to encode * @return encoded value ****************************************************/ INTEGER fx__dec__CpsReq(BITSTRING &b, LibItsCps__TypesAndValues::CpsReq &p) { loggers::get_instance().log(">>> fx__dec__CpsReq"); // Sanity check if (b.lengthof() == 0) { return -1; } cps_codec codec; CPM__PDU__Descriptions::CollectivePerceptionMessage cps; OCTETSTRING is = bit2oct(b); if (codec.decode(is, cps) == -1) { loggers::get_instance().warning("fx__dec__CpsReq: -1 result code was returned"); return -1; } p.msgOut() = cps; return 0; } INTEGER fx__dec__CpsInd(BITSTRING &b, LibItsCps__TypesAndValues::CpsInd &p_cpsInd) { loggers::get_instance().log(">>> fx__dec__CpsInd"); // Sanity check if (b.lengthof() == 0) { return -1; } cps_codec codec; CPM__PDU__Descriptions::CollectivePerceptionMessage cps; OCTETSTRING is = bit2oct(b); // Calculate the size of the lower layers information int s = (LibItsCps__TypesAndValues::CpsInd_gnNextHeader_raw_.fieldlength + LibItsCps__TypesAndValues::CpsInd_gnHeaderType_raw_.fieldlength + LibItsCps__TypesAndValues::CpsInd_gnHeaderSubtype_raw_.fieldlength + LibItsCps__TypesAndValues::CpsInd_gnLifetime_raw_.fieldlength + LibItsCps__TypesAndValues::CpsInd_gnTrafficClass_raw_.fieldlength + LibItsCps__TypesAndValues::CpsInd_btpDestinationPort_raw_.fieldlength + LibItsCps__TypesAndValues::CpsInd_btpInfo_raw_.fieldlength + LibItsCps__TypesAndValues::CpsInd_ssp_raw_.fieldlength + LibItsCps__TypesAndValues::CpsInd_its__aid_raw_.fieldlength) / 8; // Decode CA message if (codec.decode(OCTETSTRING(is.lengthof() - s, static_cast<const unsigned char *>(is)), cps) == -1) { loggers::get_instance().warning("fx__dec__CpsInd: -1 result code was returned"); return -1; } p_cpsInd.msgIn() = cps; // Decode lower layer data TTCN_Buffer decoding_buffer(OCTETSTRING(s, static_cast<const unsigned char *>(is) + is.lengthof() - s)); loggers::get_instance().log_to_hexa("fx__dec__CpsInd: ", decoding_buffer); // gnNextHeader if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCps__TypesAndValues::CpsInd_gnNextHeader_raw_.fieldlength / 8)) { p_cpsInd.gnNextHeader().set_to_omit(); } else { OCTETSTRING os; os.decode(LibItsCps__TypesAndValues::CpsInd_gnNextHeader_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_cpsInd.gnNextHeader() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__CpsInd: gnNextHeader=", p_cpsInd.gnNextHeader()); loggers::get_instance().log_to_hexa("fx__dec__CpsInd: ", decoding_buffer); // gnHeaderType if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCps__TypesAndValues::CpsInd_gnHeaderType_raw_.fieldlength / 8)) { p_cpsInd.gnHeaderType().set_to_omit(); } else { OCTETSTRING os; os.decode(LibItsCps__TypesAndValues::CpsInd_gnHeaderType_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_cpsInd.gnHeaderType() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__CpsInd: gnHeaderType=", p_cpsInd.gnHeaderType()); loggers::get_instance().log_to_hexa("fx__dec__CpsInd: ", decoding_buffer); // gnHeaderSubtype if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCps__TypesAndValues::CpsInd_gnHeaderSubtype_raw_.fieldlength / 8)) { p_cpsInd.gnHeaderSubtype().set_to_omit(); } else { OCTETSTRING os; os.decode(LibItsCps__TypesAndValues::CpsInd_gnHeaderSubtype_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_cpsInd.gnHeaderSubtype() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__CpsInd: gnHeaderSubtype=", p_cpsInd.gnHeaderSubtype()); loggers::get_instance().log_to_hexa("fx__dec__CpsInd: ", decoding_buffer); // gnLifetime if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCps__TypesAndValues::CpsInd_gnLifetime_raw_.fieldlength / 8)) { p_cpsInd.gnLifetime().set_to_omit(); } else { INTEGER i; i.decode(LibItsCps__TypesAndValues::CpsInd_gnLifetime_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_cpsInd.gnLifetime() = i; } loggers::get_instance().log_msg("fx__dec__CpsInd: gnLifetime=", p_cpsInd.gnLifetime()); loggers::get_instance().log_to_hexa("fx__dec__CpsInd: ", decoding_buffer); // gnTrafficClass if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCps__TypesAndValues::CpsInd_gnTrafficClass_raw_.fieldlength / 8)) { p_cpsInd.gnTrafficClass().set_to_omit(); } else { OCTETSTRING os; os.decode(LibItsCps__TypesAndValues::CpsInd_gnTrafficClass_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_cpsInd.gnTrafficClass() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__CpsInd: gnTrafficClass=", p_cpsInd.gnTrafficClass()); loggers::get_instance().log_to_hexa("fx__dec__CpsInd: ", decoding_buffer); // btpDestinationPort if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCps__TypesAndValues::CpsInd_btpDestinationPort_raw_.fieldlength / 8)) { p_cpsInd.btpDestinationPort().set_to_omit(); } else { INTEGER i; i.decode(LibItsCps__TypesAndValues::CpsInd_btpDestinationPort_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_cpsInd.btpDestinationPort() = i; } loggers::get_instance().log_msg("fx__dec__CpsInd: btpDestinationPort=", p_cpsInd.btpDestinationPort()); loggers::get_instance().log_to_hexa("fx__dec__CpsInd: ", decoding_buffer); // btpInfo if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCps__TypesAndValues::CpsInd_btpInfo_raw_.fieldlength / 8)) { p_cpsInd.btpInfo().set_to_omit(); } else { INTEGER i; i.decode(LibItsCps__TypesAndValues::CpsInd_btpInfo_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_cpsInd.btpInfo() = i; } loggers::get_instance().log_msg("fx__dec__CpsInd: btpInfo=", p_cpsInd.btpInfo()); loggers::get_instance().log_to_hexa("fx__dec__CpsInd: ", decoding_buffer); // ssp if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCps__TypesAndValues::CpsInd_ssp_raw_.fieldlength / 8)) { p_cpsInd.ssp().set_to_omit(); } else { BITSTRING bs; bs.decode(LibItsCps__TypesAndValues::CpsInd_ssp_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_cpsInd.ssp() = bs; } loggers::get_instance().log_msg("fx__dec__CpsInd: ssp=", p_cpsInd.ssp()); loggers::get_instance().log_to_hexa("fx__dec__CpsInd: ", decoding_buffer); // its__aid if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCps__TypesAndValues::CpsInd_its__aid_raw_.fieldlength / 8)) { p_cpsInd.its__aid().set_to_omit(); } else { INTEGER i; i.decode(LibItsCps__TypesAndValues::CpsInd_its__aid_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_cpsInd.its__aid() = i; } loggers::get_instance().log_msg("fx__dec__CpsInd: its_aid=", p_cpsInd.its__aid()); loggers::get_instance().log_to_hexa("fx__dec__CpsInd: ", decoding_buffer); return 0; } BITSTRING fx__enc__CPM(const CPM__PDU__Descriptions::CollectivePerceptionMessage &p_cps) { loggers::get_instance().log_msg(">>> fx__enc__CPM: ", p_cps); cps_codec codec; OCTETSTRING os; codec.encode(p_cps, os); return oct2bit(os); } INTEGER fx__dec__CPM(BITSTRING &b, CPM__PDU__Descriptions::CollectivePerceptionMessage &p) { loggers::get_instance().log(">>> fx__dec__CPM"); cps_codec codec; OCTETSTRING is = bit2oct(b); if (codec.decode(OCTETSTRING(is.lengthof(), static_cast<const unsigned char *>(is)), p) == -1) { loggers::get_instance().warning("fx__dec__CPM: -1 result code was returned"); return -1; } return 0; } BITSTRING fx__enc__UtCpsInitialize(const LibItsCps__TypesAndValues::UtCpsInitialize &p_utCpsInitialize) { loggers::get_instance().log_msg(">>> fx__enc__UtCpsInitialize: ", p_utCpsInitialize); uppertester_cps_codec codec; OCTETSTRING os; codec.encode(p_utCpsInitialize, os); return oct2bit(os); } /**************************************************** * @desc External function to decode a UtCpsEventInd type * @param value to encode * @return encoded value ****************************************************/ INTEGER fx__dec__UtCpsEventInd(BITSTRING &b, LibItsCps__TypesAndValues::UtCpsEventInd &p) { loggers::get_instance().log(">>> fx__dec__UtCpsEventInd"); uppertester_cps_codec codec; OCTETSTRING is = bit2oct(b); std::unique_ptr<Base_Type> ptr = codec.decode(is); if (ptr == nullptr) { loggers::get_instance().warning("fx__dec__UtCpsEventInd: -1 result code was returned"); return -1; } p = static_cast<LibItsCps__TypesAndValues::UtCpsEventInd &>(*ptr); return 0; } } // namespace LibItsCps__EncdecDeclarations ccsrc/EncDec/LibItsDenm_Encdec.cc +19 −19 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ namespace LibItsDenm__EncdecDeclarations { p_denmInd.msgIn() = denm; // Decode lower layer data TTCN_Buffer decoding_buffer(OCTETSTRING(s, static_cast<const unsigned char *>(is) + is.lengthof() - s)); loggers::get_instance().log_to_hexa("fx__dec__DENM: ", decoding_buffer); loggers::get_instance().log_to_hexa("fx__dec__DenmInd: ", decoding_buffer); // gnNextHeader if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsDenm__TypesAndValues::DenmInd_gnNextHeader_raw_.fieldlength / 8)) { p_denmInd.gnNextHeader().set_to_omit(); Loading @@ -86,8 +86,8 @@ namespace LibItsDenm__EncdecDeclarations { os.decode(LibItsDenm__TypesAndValues::DenmInd_gnNextHeader_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_denmInd.gnNextHeader() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__DENM: gnNextHeader=", p_denmInd.gnNextHeader()); loggers::get_instance().log_to_hexa("fx__dec__DENM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__DenmInd: gnNextHeader=", p_denmInd.gnNextHeader()); loggers::get_instance().log_to_hexa("fx__dec__DenmInd: ", decoding_buffer); // gnHeaderType if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsDenm__TypesAndValues::DenmInd_gnHeaderType_raw_.fieldlength / 8)) { p_denmInd.gnHeaderType().set_to_omit(); Loading @@ -96,8 +96,8 @@ namespace LibItsDenm__EncdecDeclarations { os.decode(LibItsDenm__TypesAndValues::DenmInd_gnHeaderType_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_denmInd.gnHeaderType() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__DENM: gnHeaderType=", p_denmInd.gnHeaderType()); loggers::get_instance().log_to_hexa("fx__dec__DENM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__DenmInd: gnHeaderType=", p_denmInd.gnHeaderType()); loggers::get_instance().log_to_hexa("fx__dec__DenmInd: ", decoding_buffer); // gnHeaderSubtype if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsDenm__TypesAndValues::DenmInd_gnHeaderSubtype_raw_.fieldlength / 8)) { p_denmInd.gnHeaderSubtype().set_to_omit(); Loading @@ -106,8 +106,8 @@ namespace LibItsDenm__EncdecDeclarations { os.decode(LibItsDenm__TypesAndValues::DenmInd_gnHeaderSubtype_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_denmInd.gnHeaderSubtype() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__DENM: gnHeaderSubType=", p_denmInd.gnHeaderSubtype()); loggers::get_instance().log_to_hexa("fx__dec__DENM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__DenmInd: gnHeaderSubType=", p_denmInd.gnHeaderSubtype()); loggers::get_instance().log_to_hexa("fx__dec__DenmInd: ", decoding_buffer); // gnLifetime if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsDenm__TypesAndValues::DenmInd_gnLifetime_raw_.fieldlength / 8)) { p_denmInd.gnLifetime().set_to_omit(); Loading @@ -116,8 +116,8 @@ namespace LibItsDenm__EncdecDeclarations { os.decode(LibItsDenm__TypesAndValues::DenmInd_gnLifetime_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_denmInd.gnLifetime() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__DENM: gnLifetime=", p_denmInd.gnLifetime()); loggers::get_instance().log_to_hexa("fx__dec__DENM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__DenmInd: gnLifetime=", p_denmInd.gnLifetime()); loggers::get_instance().log_to_hexa("fx__dfx__dec__DenmIndec__DENM: ", decoding_buffer); // gnTrafficClass if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsDenm__TypesAndValues::DenmInd_gnTrafficClass_raw_.fieldlength / 8)) { p_denmInd.gnTrafficClass().set_to_omit(); Loading @@ -126,8 +126,8 @@ namespace LibItsDenm__EncdecDeclarations { os.decode(LibItsDenm__TypesAndValues::DenmInd_gnTrafficClass_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_denmInd.gnTrafficClass() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__DENM: gnTrafficClass=", p_denmInd.gnTrafficClass()); loggers::get_instance().log_to_hexa("fx__dec__DENM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__DenmInd: gnTrafficClass=", p_denmInd.gnTrafficClass()); loggers::get_instance().log_to_hexa("fx__dec__DenmInd: ", decoding_buffer); // btpDestinationPort if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsDenm__TypesAndValues::DenmInd_btpDestinationPort_raw_.fieldlength / 8)) { p_denmInd.btpDestinationPort().set_to_omit(); Loading @@ -136,8 +136,8 @@ namespace LibItsDenm__EncdecDeclarations { os.decode(LibItsDenm__TypesAndValues::DenmInd_btpDestinationPort_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_denmInd.btpDestinationPort() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__DENM: btpDestinationPort=", p_denmInd.btpDestinationPort()); loggers::get_instance().log_to_hexa("fx__dec__DENM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__DenmInd: btpDestinationPort=", p_denmInd.btpDestinationPort()); loggers::get_instance().log_to_hexa("fx__dec__DenmInd: ", decoding_buffer); // btpInfo if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsDenm__TypesAndValues::DenmInd_btpInfo_raw_.fieldlength / 8)) { p_denmInd.btpInfo().set_to_omit(); Loading @@ -146,8 +146,8 @@ namespace LibItsDenm__EncdecDeclarations { os.decode(LibItsDenm__TypesAndValues::DenmInd_btpInfo_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_denmInd.btpInfo() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__DENM: btpInfo=", p_denmInd.btpInfo()); loggers::get_instance().log_to_hexa("fx__dec__DENM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__DenmInd: btpInfo=", p_denmInd.btpInfo()); loggers::get_instance().log_to_hexa("fx__dec__DenmInd: ", decoding_buffer); // ssp if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsDenm__TypesAndValues::DenmInd_ssp_raw_.fieldlength / 8)) { p_denmInd.ssp().set_to_omit(); Loading @@ -156,8 +156,8 @@ namespace LibItsDenm__EncdecDeclarations { bs.decode(LibItsDenm__TypesAndValues::DenmInd_ssp_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_denmInd.ssp() = bs; } loggers::get_instance().log_msg("fx__dec__DENM: ssp=", p_denmInd.ssp()); loggers::get_instance().log_to_hexa("fx__dec__DENM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__DenmInd: ssp=", p_denmInd.ssp()); loggers::get_instance().log_to_hexa("fx__dec__DenmInd: ", decoding_buffer); // its__aid if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsDenm__TypesAndValues::DenmInd_its__aid_raw_.fieldlength / 8)) { p_denmInd.its__aid().set_to_omit(); Loading @@ -166,8 +166,8 @@ namespace LibItsDenm__EncdecDeclarations { os.decode(LibItsDenm__TypesAndValues::DenmInd_its__aid_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_denmInd.its__aid() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__DENM: its_aid=", p_denmInd.its__aid()); loggers::get_instance().log_to_hexa("fx__dec__DENM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__DenmInd: its_aid=", p_denmInd.its__aid()); loggers::get_instance().log_to_hexa("fx__dec__DenmInd: ", decoding_buffer); return 0; } Loading ccsrc/EncDec/LibItsGeoNetworking_Encdec.cc +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ namespace LibItsGeoNetworking__EncdecDeclarations { } p.msgOut() = pdu; TTCN_Buffer decoding_buffer(OCTETSTRING(s, static_cast<const unsigned char *>(is) + is.lengthof() - s)); loggers::get_instance().log_to_hexa("fx__dec__GeoNetworkingInd: Lower layer: ", decoding_buffer); loggers::get_instance().log_to_hexa("fx__dec__GeoNetworkingReq: Lower layer: ", decoding_buffer); for (int i = 1; i < p.get_count(); i++) { loggers::get_instance().log("fx__dec__GeoNetworkingReq: processing %s/%s/%s", p.fld_name(i), p.fld_descr(i)->name, p.get_at(i)->get_descriptor()->name); p.get_at(i)->decode(*p.fld_descr(i), decoding_buffer, TTCN_EncDec::CT_RAW); Loading ccsrc/EncDec/LibItsIvim_Encdec.cc +19 −19 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
ccsrc/EncDec/LibItsCam_Encdec.cc +19 −19 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ namespace LibItsCam__EncdecDeclarations { p_camInd.msgIn() = cam; // Decode lower layer data TTCN_Buffer decoding_buffer(OCTETSTRING(s, static_cast<const unsigned char *>(is) + is.lengthof() - s)); loggers::get_instance().log_to_hexa("fx__dec__CAM: ", decoding_buffer); loggers::get_instance().log_to_hexa("fx__dec__CamInd: ", decoding_buffer); // gnNextHeader if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCam__TypesAndValues::CamInd_gnNextHeader_raw_.fieldlength / 8)) { p_camInd.gnNextHeader().set_to_omit(); Loading @@ -87,8 +87,8 @@ namespace LibItsCam__EncdecDeclarations { os.decode(LibItsCam__TypesAndValues::CamInd_gnNextHeader_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_camInd.gnNextHeader() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__CAM: gnNextHeader=", p_camInd.gnNextHeader()); loggers::get_instance().log_to_hexa("fx__dec__CAM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__CamInd: gnNextHeader=", p_camInd.gnNextHeader()); loggers::get_instance().log_to_hexa("fx__dec__CamInd: ", decoding_buffer); // gnHeaderType if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCam__TypesAndValues::CamInd_gnHeaderType_raw_.fieldlength / 8)) { p_camInd.gnHeaderType().set_to_omit(); Loading @@ -97,8 +97,8 @@ namespace LibItsCam__EncdecDeclarations { os.decode(LibItsCam__TypesAndValues::CamInd_gnHeaderType_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_camInd.gnHeaderType() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__CAM: gnHeaderType=", p_camInd.gnHeaderType()); loggers::get_instance().log_to_hexa("fx__dec__CAM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__CamInd: gnHeaderType=", p_camInd.gnHeaderType()); loggers::get_instance().log_to_hexa("fx__dec__CamInd: ", decoding_buffer); // gnHeaderSubtype if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCam__TypesAndValues::CamInd_gnHeaderSubtype_raw_.fieldlength / 8)) { p_camInd.gnHeaderSubtype().set_to_omit(); Loading @@ -107,8 +107,8 @@ namespace LibItsCam__EncdecDeclarations { os.decode(LibItsCam__TypesAndValues::CamInd_gnHeaderSubtype_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_camInd.gnHeaderSubtype() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__CAM: gnHeaderSubtype=", p_camInd.gnHeaderSubtype()); loggers::get_instance().log_to_hexa("fx__dec__CAM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__CamInd: gnHeaderSubtype=", p_camInd.gnHeaderSubtype()); loggers::get_instance().log_to_hexa("fx__dec__CamInd: ", decoding_buffer); // gnLifetime if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCam__TypesAndValues::CamInd_gnLifetime_raw_.fieldlength / 8)) { p_camInd.gnLifetime().set_to_omit(); Loading @@ -117,8 +117,8 @@ namespace LibItsCam__EncdecDeclarations { i.decode(LibItsCam__TypesAndValues::CamInd_gnLifetime_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_camInd.gnLifetime() = i; } loggers::get_instance().log_msg("fx__dec__CAM: gnLifetime=", p_camInd.gnLifetime()); loggers::get_instance().log_to_hexa("fx__dec__CAM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__CamInd: gnLifetime=", p_camInd.gnLifetime()); loggers::get_instance().log_to_hexa("fx__dec__CamInd: ", decoding_buffer); // gnTrafficClass if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCam__TypesAndValues::CamInd_gnTrafficClass_raw_.fieldlength / 8)) { p_camInd.gnTrafficClass().set_to_omit(); Loading @@ -127,8 +127,8 @@ namespace LibItsCam__EncdecDeclarations { os.decode(LibItsCam__TypesAndValues::CamInd_gnTrafficClass_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_camInd.gnTrafficClass() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__CAM: gnTrafficClass=", p_camInd.gnTrafficClass()); loggers::get_instance().log_to_hexa("fx__dec__CAM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__CamInd: gnTrafficClass=", p_camInd.gnTrafficClass()); loggers::get_instance().log_to_hexa("fx__dec__CamInd: ", decoding_buffer); // btpDestinationPort if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCam__TypesAndValues::CamInd_btpDestinationPort_raw_.fieldlength / 8)) { p_camInd.btpDestinationPort().set_to_omit(); Loading @@ -137,8 +137,8 @@ namespace LibItsCam__EncdecDeclarations { i.decode(LibItsCam__TypesAndValues::CamInd_btpDestinationPort_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_camInd.btpDestinationPort() = i; } loggers::get_instance().log_msg("fx__dec__CAM: btpDestinationPort=", p_camInd.btpDestinationPort()); loggers::get_instance().log_to_hexa("fx__dec__CAM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__CamInd: btpDestinationPort=", p_camInd.btpDestinationPort()); loggers::get_instance().log_to_hexa("fx__dec__CamInd: ", decoding_buffer); // btpInfo if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCam__TypesAndValues::CamInd_btpInfo_raw_.fieldlength / 8)) { p_camInd.btpInfo().set_to_omit(); Loading @@ -147,8 +147,8 @@ namespace LibItsCam__EncdecDeclarations { i.decode(LibItsCam__TypesAndValues::CamInd_btpInfo_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_camInd.btpInfo() = i; } loggers::get_instance().log_msg("fx__dec__CAM: btpInfo=", p_camInd.btpInfo()); loggers::get_instance().log_to_hexa("fx__dec__CAM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__CamInd: btpInfo=", p_camInd.btpInfo()); loggers::get_instance().log_to_hexa("fx__dec__CamInd: ", decoding_buffer); // ssp if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCam__TypesAndValues::CamInd_ssp_raw_.fieldlength / 8)) { p_camInd.ssp().set_to_omit(); Loading @@ -157,8 +157,8 @@ namespace LibItsCam__EncdecDeclarations { bs.decode(LibItsCam__TypesAndValues::CamInd_ssp_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_camInd.ssp() = bs; } loggers::get_instance().log_msg("fx__dec__CAM: ssp=", p_camInd.ssp()); loggers::get_instance().log_to_hexa("fx__dec__CAM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__CamInd: ssp=", p_camInd.ssp()); loggers::get_instance().log_to_hexa("fx__dec__CamInd: ", decoding_buffer); // its__aid if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCam__TypesAndValues::CamInd_its__aid_raw_.fieldlength / 8)) { p_camInd.its__aid().set_to_omit(); Loading @@ -167,8 +167,8 @@ namespace LibItsCam__EncdecDeclarations { i.decode(LibItsCam__TypesAndValues::CamInd_its__aid_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_camInd.its__aid() = i; } loggers::get_instance().log_msg("fx__dec__CAM: its_aid=", p_camInd.its__aid()); loggers::get_instance().log_to_hexa("fx__dec__CAM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__CamInd: its_aid=", p_camInd.its__aid()); loggers::get_instance().log_to_hexa("fx__dec__CamInd: ", decoding_buffer); return 0; } Loading
ccsrc/EncDec/LibItsCps_Encdec.cc +226 −0 Original line number Diff line number Diff line #include <memory> #include "LibItsCps_EncdecDeclarations.hh" #include "cps_codec.hh" #include "loggers.hh" #include "uppertester_cps_codec.hh" namespace LibItsCps__EncdecDeclarations { /**************************************************** * @desc External function to encode a CpsReq type * @param value to encode * @return encoded value ****************************************************/ BITSTRING fx__enc__CpsReq(const LibItsCps__TypesAndValues::CpsReq &p_cpsReq) { loggers::get_instance().log_msg(">>> fx__enc__CpsReq: ", p_cpsReq); cps_codec codec; OCTETSTRING os; if (codec.encode(p_cpsReq.msgOut(), os) == -1) { loggers::get_instance().warning("fx__enc__CpsReq: -1 result code was returned"); return int2bit(0, 1); } return oct2bit(os); } /**************************************************** * @desc External function to decode a CpsReq type * @param value to encode * @return encoded value ****************************************************/ INTEGER fx__dec__CpsReq(BITSTRING &b, LibItsCps__TypesAndValues::CpsReq &p) { loggers::get_instance().log(">>> fx__dec__CpsReq"); // Sanity check if (b.lengthof() == 0) { return -1; } cps_codec codec; CPM__PDU__Descriptions::CollectivePerceptionMessage cps; OCTETSTRING is = bit2oct(b); if (codec.decode(is, cps) == -1) { loggers::get_instance().warning("fx__dec__CpsReq: -1 result code was returned"); return -1; } p.msgOut() = cps; return 0; } INTEGER fx__dec__CpsInd(BITSTRING &b, LibItsCps__TypesAndValues::CpsInd &p_cpsInd) { loggers::get_instance().log(">>> fx__dec__CpsInd"); // Sanity check if (b.lengthof() == 0) { return -1; } cps_codec codec; CPM__PDU__Descriptions::CollectivePerceptionMessage cps; OCTETSTRING is = bit2oct(b); // Calculate the size of the lower layers information int s = (LibItsCps__TypesAndValues::CpsInd_gnNextHeader_raw_.fieldlength + LibItsCps__TypesAndValues::CpsInd_gnHeaderType_raw_.fieldlength + LibItsCps__TypesAndValues::CpsInd_gnHeaderSubtype_raw_.fieldlength + LibItsCps__TypesAndValues::CpsInd_gnLifetime_raw_.fieldlength + LibItsCps__TypesAndValues::CpsInd_gnTrafficClass_raw_.fieldlength + LibItsCps__TypesAndValues::CpsInd_btpDestinationPort_raw_.fieldlength + LibItsCps__TypesAndValues::CpsInd_btpInfo_raw_.fieldlength + LibItsCps__TypesAndValues::CpsInd_ssp_raw_.fieldlength + LibItsCps__TypesAndValues::CpsInd_its__aid_raw_.fieldlength) / 8; // Decode CA message if (codec.decode(OCTETSTRING(is.lengthof() - s, static_cast<const unsigned char *>(is)), cps) == -1) { loggers::get_instance().warning("fx__dec__CpsInd: -1 result code was returned"); return -1; } p_cpsInd.msgIn() = cps; // Decode lower layer data TTCN_Buffer decoding_buffer(OCTETSTRING(s, static_cast<const unsigned char *>(is) + is.lengthof() - s)); loggers::get_instance().log_to_hexa("fx__dec__CpsInd: ", decoding_buffer); // gnNextHeader if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCps__TypesAndValues::CpsInd_gnNextHeader_raw_.fieldlength / 8)) { p_cpsInd.gnNextHeader().set_to_omit(); } else { OCTETSTRING os; os.decode(LibItsCps__TypesAndValues::CpsInd_gnNextHeader_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_cpsInd.gnNextHeader() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__CpsInd: gnNextHeader=", p_cpsInd.gnNextHeader()); loggers::get_instance().log_to_hexa("fx__dec__CpsInd: ", decoding_buffer); // gnHeaderType if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCps__TypesAndValues::CpsInd_gnHeaderType_raw_.fieldlength / 8)) { p_cpsInd.gnHeaderType().set_to_omit(); } else { OCTETSTRING os; os.decode(LibItsCps__TypesAndValues::CpsInd_gnHeaderType_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_cpsInd.gnHeaderType() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__CpsInd: gnHeaderType=", p_cpsInd.gnHeaderType()); loggers::get_instance().log_to_hexa("fx__dec__CpsInd: ", decoding_buffer); // gnHeaderSubtype if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCps__TypesAndValues::CpsInd_gnHeaderSubtype_raw_.fieldlength / 8)) { p_cpsInd.gnHeaderSubtype().set_to_omit(); } else { OCTETSTRING os; os.decode(LibItsCps__TypesAndValues::CpsInd_gnHeaderSubtype_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_cpsInd.gnHeaderSubtype() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__CpsInd: gnHeaderSubtype=", p_cpsInd.gnHeaderSubtype()); loggers::get_instance().log_to_hexa("fx__dec__CpsInd: ", decoding_buffer); // gnLifetime if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCps__TypesAndValues::CpsInd_gnLifetime_raw_.fieldlength / 8)) { p_cpsInd.gnLifetime().set_to_omit(); } else { INTEGER i; i.decode(LibItsCps__TypesAndValues::CpsInd_gnLifetime_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_cpsInd.gnLifetime() = i; } loggers::get_instance().log_msg("fx__dec__CpsInd: gnLifetime=", p_cpsInd.gnLifetime()); loggers::get_instance().log_to_hexa("fx__dec__CpsInd: ", decoding_buffer); // gnTrafficClass if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCps__TypesAndValues::CpsInd_gnTrafficClass_raw_.fieldlength / 8)) { p_cpsInd.gnTrafficClass().set_to_omit(); } else { OCTETSTRING os; os.decode(LibItsCps__TypesAndValues::CpsInd_gnTrafficClass_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_cpsInd.gnTrafficClass() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__CpsInd: gnTrafficClass=", p_cpsInd.gnTrafficClass()); loggers::get_instance().log_to_hexa("fx__dec__CpsInd: ", decoding_buffer); // btpDestinationPort if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCps__TypesAndValues::CpsInd_btpDestinationPort_raw_.fieldlength / 8)) { p_cpsInd.btpDestinationPort().set_to_omit(); } else { INTEGER i; i.decode(LibItsCps__TypesAndValues::CpsInd_btpDestinationPort_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_cpsInd.btpDestinationPort() = i; } loggers::get_instance().log_msg("fx__dec__CpsInd: btpDestinationPort=", p_cpsInd.btpDestinationPort()); loggers::get_instance().log_to_hexa("fx__dec__CpsInd: ", decoding_buffer); // btpInfo if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCps__TypesAndValues::CpsInd_btpInfo_raw_.fieldlength / 8)) { p_cpsInd.btpInfo().set_to_omit(); } else { INTEGER i; i.decode(LibItsCps__TypesAndValues::CpsInd_btpInfo_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_cpsInd.btpInfo() = i; } loggers::get_instance().log_msg("fx__dec__CpsInd: btpInfo=", p_cpsInd.btpInfo()); loggers::get_instance().log_to_hexa("fx__dec__CpsInd: ", decoding_buffer); // ssp if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCps__TypesAndValues::CpsInd_ssp_raw_.fieldlength / 8)) { p_cpsInd.ssp().set_to_omit(); } else { BITSTRING bs; bs.decode(LibItsCps__TypesAndValues::CpsInd_ssp_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_cpsInd.ssp() = bs; } loggers::get_instance().log_msg("fx__dec__CpsInd: ssp=", p_cpsInd.ssp()); loggers::get_instance().log_to_hexa("fx__dec__CpsInd: ", decoding_buffer); // its__aid if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsCps__TypesAndValues::CpsInd_its__aid_raw_.fieldlength / 8)) { p_cpsInd.its__aid().set_to_omit(); } else { INTEGER i; i.decode(LibItsCps__TypesAndValues::CpsInd_its__aid_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_cpsInd.its__aid() = i; } loggers::get_instance().log_msg("fx__dec__CpsInd: its_aid=", p_cpsInd.its__aid()); loggers::get_instance().log_to_hexa("fx__dec__CpsInd: ", decoding_buffer); return 0; } BITSTRING fx__enc__CPM(const CPM__PDU__Descriptions::CollectivePerceptionMessage &p_cps) { loggers::get_instance().log_msg(">>> fx__enc__CPM: ", p_cps); cps_codec codec; OCTETSTRING os; codec.encode(p_cps, os); return oct2bit(os); } INTEGER fx__dec__CPM(BITSTRING &b, CPM__PDU__Descriptions::CollectivePerceptionMessage &p) { loggers::get_instance().log(">>> fx__dec__CPM"); cps_codec codec; OCTETSTRING is = bit2oct(b); if (codec.decode(OCTETSTRING(is.lengthof(), static_cast<const unsigned char *>(is)), p) == -1) { loggers::get_instance().warning("fx__dec__CPM: -1 result code was returned"); return -1; } return 0; } BITSTRING fx__enc__UtCpsInitialize(const LibItsCps__TypesAndValues::UtCpsInitialize &p_utCpsInitialize) { loggers::get_instance().log_msg(">>> fx__enc__UtCpsInitialize: ", p_utCpsInitialize); uppertester_cps_codec codec; OCTETSTRING os; codec.encode(p_utCpsInitialize, os); return oct2bit(os); } /**************************************************** * @desc External function to decode a UtCpsEventInd type * @param value to encode * @return encoded value ****************************************************/ INTEGER fx__dec__UtCpsEventInd(BITSTRING &b, LibItsCps__TypesAndValues::UtCpsEventInd &p) { loggers::get_instance().log(">>> fx__dec__UtCpsEventInd"); uppertester_cps_codec codec; OCTETSTRING is = bit2oct(b); std::unique_ptr<Base_Type> ptr = codec.decode(is); if (ptr == nullptr) { loggers::get_instance().warning("fx__dec__UtCpsEventInd: -1 result code was returned"); return -1; } p = static_cast<LibItsCps__TypesAndValues::UtCpsEventInd &>(*ptr); return 0; } } // namespace LibItsCps__EncdecDeclarations
ccsrc/EncDec/LibItsDenm_Encdec.cc +19 −19 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ namespace LibItsDenm__EncdecDeclarations { p_denmInd.msgIn() = denm; // Decode lower layer data TTCN_Buffer decoding_buffer(OCTETSTRING(s, static_cast<const unsigned char *>(is) + is.lengthof() - s)); loggers::get_instance().log_to_hexa("fx__dec__DENM: ", decoding_buffer); loggers::get_instance().log_to_hexa("fx__dec__DenmInd: ", decoding_buffer); // gnNextHeader if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsDenm__TypesAndValues::DenmInd_gnNextHeader_raw_.fieldlength / 8)) { p_denmInd.gnNextHeader().set_to_omit(); Loading @@ -86,8 +86,8 @@ namespace LibItsDenm__EncdecDeclarations { os.decode(LibItsDenm__TypesAndValues::DenmInd_gnNextHeader_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_denmInd.gnNextHeader() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__DENM: gnNextHeader=", p_denmInd.gnNextHeader()); loggers::get_instance().log_to_hexa("fx__dec__DENM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__DenmInd: gnNextHeader=", p_denmInd.gnNextHeader()); loggers::get_instance().log_to_hexa("fx__dec__DenmInd: ", decoding_buffer); // gnHeaderType if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsDenm__TypesAndValues::DenmInd_gnHeaderType_raw_.fieldlength / 8)) { p_denmInd.gnHeaderType().set_to_omit(); Loading @@ -96,8 +96,8 @@ namespace LibItsDenm__EncdecDeclarations { os.decode(LibItsDenm__TypesAndValues::DenmInd_gnHeaderType_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_denmInd.gnHeaderType() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__DENM: gnHeaderType=", p_denmInd.gnHeaderType()); loggers::get_instance().log_to_hexa("fx__dec__DENM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__DenmInd: gnHeaderType=", p_denmInd.gnHeaderType()); loggers::get_instance().log_to_hexa("fx__dec__DenmInd: ", decoding_buffer); // gnHeaderSubtype if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsDenm__TypesAndValues::DenmInd_gnHeaderSubtype_raw_.fieldlength / 8)) { p_denmInd.gnHeaderSubtype().set_to_omit(); Loading @@ -106,8 +106,8 @@ namespace LibItsDenm__EncdecDeclarations { os.decode(LibItsDenm__TypesAndValues::DenmInd_gnHeaderSubtype_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_denmInd.gnHeaderSubtype() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__DENM: gnHeaderSubType=", p_denmInd.gnHeaderSubtype()); loggers::get_instance().log_to_hexa("fx__dec__DENM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__DenmInd: gnHeaderSubType=", p_denmInd.gnHeaderSubtype()); loggers::get_instance().log_to_hexa("fx__dec__DenmInd: ", decoding_buffer); // gnLifetime if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsDenm__TypesAndValues::DenmInd_gnLifetime_raw_.fieldlength / 8)) { p_denmInd.gnLifetime().set_to_omit(); Loading @@ -116,8 +116,8 @@ namespace LibItsDenm__EncdecDeclarations { os.decode(LibItsDenm__TypesAndValues::DenmInd_gnLifetime_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_denmInd.gnLifetime() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__DENM: gnLifetime=", p_denmInd.gnLifetime()); loggers::get_instance().log_to_hexa("fx__dec__DENM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__DenmInd: gnLifetime=", p_denmInd.gnLifetime()); loggers::get_instance().log_to_hexa("fx__dfx__dec__DenmIndec__DENM: ", decoding_buffer); // gnTrafficClass if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsDenm__TypesAndValues::DenmInd_gnTrafficClass_raw_.fieldlength / 8)) { p_denmInd.gnTrafficClass().set_to_omit(); Loading @@ -126,8 +126,8 @@ namespace LibItsDenm__EncdecDeclarations { os.decode(LibItsDenm__TypesAndValues::DenmInd_gnTrafficClass_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_denmInd.gnTrafficClass() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__DENM: gnTrafficClass=", p_denmInd.gnTrafficClass()); loggers::get_instance().log_to_hexa("fx__dec__DENM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__DenmInd: gnTrafficClass=", p_denmInd.gnTrafficClass()); loggers::get_instance().log_to_hexa("fx__dec__DenmInd: ", decoding_buffer); // btpDestinationPort if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsDenm__TypesAndValues::DenmInd_btpDestinationPort_raw_.fieldlength / 8)) { p_denmInd.btpDestinationPort().set_to_omit(); Loading @@ -136,8 +136,8 @@ namespace LibItsDenm__EncdecDeclarations { os.decode(LibItsDenm__TypesAndValues::DenmInd_btpDestinationPort_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_denmInd.btpDestinationPort() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__DENM: btpDestinationPort=", p_denmInd.btpDestinationPort()); loggers::get_instance().log_to_hexa("fx__dec__DENM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__DenmInd: btpDestinationPort=", p_denmInd.btpDestinationPort()); loggers::get_instance().log_to_hexa("fx__dec__DenmInd: ", decoding_buffer); // btpInfo if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsDenm__TypesAndValues::DenmInd_btpInfo_raw_.fieldlength / 8)) { p_denmInd.btpInfo().set_to_omit(); Loading @@ -146,8 +146,8 @@ namespace LibItsDenm__EncdecDeclarations { os.decode(LibItsDenm__TypesAndValues::DenmInd_btpInfo_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_denmInd.btpInfo() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__DENM: btpInfo=", p_denmInd.btpInfo()); loggers::get_instance().log_to_hexa("fx__dec__DENM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__DenmInd: btpInfo=", p_denmInd.btpInfo()); loggers::get_instance().log_to_hexa("fx__dec__DenmInd: ", decoding_buffer); // ssp if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsDenm__TypesAndValues::DenmInd_ssp_raw_.fieldlength / 8)) { p_denmInd.ssp().set_to_omit(); Loading @@ -156,8 +156,8 @@ namespace LibItsDenm__EncdecDeclarations { bs.decode(LibItsDenm__TypesAndValues::DenmInd_ssp_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_denmInd.ssp() = bs; } loggers::get_instance().log_msg("fx__dec__DENM: ssp=", p_denmInd.ssp()); loggers::get_instance().log_to_hexa("fx__dec__DENM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__DenmInd: ssp=", p_denmInd.ssp()); loggers::get_instance().log_to_hexa("fx__dec__DenmInd: ", decoding_buffer); // its__aid if (decoding_buffer.get_read_len() < static_cast<size_t>(LibItsDenm__TypesAndValues::DenmInd_its__aid_raw_.fieldlength / 8)) { p_denmInd.its__aid().set_to_omit(); Loading @@ -166,8 +166,8 @@ namespace LibItsDenm__EncdecDeclarations { os.decode(LibItsDenm__TypesAndValues::DenmInd_its__aid_descr_, decoding_buffer, TTCN_EncDec::CT_RAW); p_denmInd.its__aid() = oct2int(os); } loggers::get_instance().log_msg("fx__dec__DENM: its_aid=", p_denmInd.its__aid()); loggers::get_instance().log_to_hexa("fx__dec__DENM: ", decoding_buffer); loggers::get_instance().log_msg("fx__dec__DenmInd: its_aid=", p_denmInd.its__aid()); loggers::get_instance().log_to_hexa("fx__dec__DenmInd: ", decoding_buffer); return 0; } Loading
ccsrc/EncDec/LibItsGeoNetworking_Encdec.cc +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ namespace LibItsGeoNetworking__EncdecDeclarations { } p.msgOut() = pdu; TTCN_Buffer decoding_buffer(OCTETSTRING(s, static_cast<const unsigned char *>(is) + is.lengthof() - s)); loggers::get_instance().log_to_hexa("fx__dec__GeoNetworkingInd: Lower layer: ", decoding_buffer); loggers::get_instance().log_to_hexa("fx__dec__GeoNetworkingReq: Lower layer: ", decoding_buffer); for (int i = 1; i < p.get_count(); i++) { loggers::get_instance().log("fx__dec__GeoNetworkingReq: processing %s/%s/%s", p.fld_name(i), p.fld_descr(i)->name, p.get_at(i)->get_descriptor()->name); p.get_at(i)->decode(*p.fld_descr(i), decoding_buffer, TTCN_EncDec::CT_RAW); Loading
ccsrc/EncDec/LibItsIvim_Encdec.cc +19 −19 File changed.Preview size limit exceeded, changes collapsed. Show changes