diff --git a/ccsrc/Framework/include/codec_gen.hh b/ccsrc/Framework/include/codec_gen.hh index 82cfc8b047ad47c2900397ff39a4e7e8a410883b..b36664cc417cbe805cf591e622a6a2bdefc79925 100644 --- a/ccsrc/Framework/include/codec_gen.hh +++ b/ccsrc/Framework/include/codec_gen.hh @@ -50,7 +50,7 @@ public: //! \publicsection */ virtual int encode(const TPDUEnc &p_message, OCTETSTRING &p_data) = 0; /*! - * \fn int decode(const OCTETSTRING& p_, TPDUDec& p_message, params_its* p_params = NULL); + * \fn int decode(const OCTETSTRING& p_, TPDUDec& p_message, params* p_params = NULL); * \brief Encode typed message into an octet string format * \param[in] p_data The message in its octet string * \param[out] p_message The decoded typed message diff --git a/ccsrc/Framework/include/layer.hh b/ccsrc/Framework/include/layer.hh index 8268401767cc76fecf09231ab30a718bc89588ea..b42e68d8c1706e79a0aff8e55deb079caa4f9cd5 100644 --- a/ccsrc/Framework/include/layer.hh +++ b/ccsrc/Framework/include/layer.hh @@ -102,7 +102,7 @@ public: //! \publicsection /*! * \virtual - * \fn void receive_data(OCTETSTRING& data, params_its& params); + * \fn void receive_data(OCTETSTRING& data, params& params); * \brief Receive bytes formated data from the lower layers * \param[in] p_data The bytes formated data received * \param[in] p_params Some lower layers parameters values when data was received diff --git a/ccsrc/Framework/include/layer_factory.hh b/ccsrc/Framework/include/layer_factory.hh index 7b8ac35a611565cef89956c2a142bfe3b0576604..68e99c587b624a475139cc7dc2e3c9f94fbcd120 100644 --- a/ccsrc/Framework/include/layer_factory.hh +++ b/ccsrc/Framework/include/layer_factory.hh @@ -36,52 +36,10 @@ public: //! \publicsection * \param[in] p_params Optional parameters * \return 0 on success, -1 otherwise * \remark The description below introduces layers stack in case of ITS project: - * CAM layer - * next_header : btpA|btpB (overwrite BTP.type) - * header_type : tsb|gbc - * header_sub_type : sh (single hop) - * DENM layer - * next_header : btpA|btpB (overwrite BTP.type) - * header_type : tsb|gbc - * BTP layer - * type : btpA|btpB - * destination port: dst_port - * source port : src_port - * device_mode : Set to 1 if the layer shall encapsulate upper layer PDU - * GN layer - * its_aid : ITS AID as defined by ETSI TS 102 965 V1.2.1. Default: 141 - * ll_address : GeoNetworking address of the Test System - * latitude : latitude of the Test System - * longitude : longitude of the Test System - * beaconing : Set to 1 if GnLayer shall start beaconing - * Beaconing timer expiry : expiry (ms) - * device_mode : Set to 1 if the layer shall encapsulate upper layer PDU - * secured_mode : Set to 1 if message exchanges shall be signed - * encrypted_mode : Set to 1 if message exchanges shall be encrypted - * NOTE: For signed & encrypted message exchanges, both secured_mode and encrypted_mode shall be set to 1 - * certificate : Certificate identifier the Test Adapter shall use - * secure_db_path : Path to the certificates and keys storage location - * hash : Hash algorithm to be used when secured mode is set - * Authorized values are SHA-256 or SHA-384 - * Default: SHA-256 - * signature : Signature algorithm to be used when secured mode is set - * Authorized values are NISTP-256, BP-256 and BP-384 - * Default: NISTP-256 - * cypher : Cyphering algorithm to be used when secured mode is set * Ethernet layer * mac_src :Source MAC address * mac_bc :Broadcast address * eth_type : Ethernet type - * Commsignia layer - * mac_src : Device MAC address, used to discard packets - * To indicate no filering, use the value 000000000000 - * mac_bc : Broadcast address - * eth_type : Ethernet type, used to discard packets - * target_host : Device address - * target_port : Device port - * source_port : Test System port - * interface_id: Interface id, used to discard packets - * tx_power : TX power (dB) * UDP layer (IP/UDP based on Pcap) * dst_ip : destination IPv4 address (aa.bb.cc.dd) * dst_port: destination port @@ -99,22 +57,6 @@ public: //! \publicsection * frame_offset: Frame offset, used to skip packets with frame number < frame_offset * time_offset : Time offset, used to skip packets with time offset < time_offset * save_mode : 1 to save sent packet, 0 otherwise - * Here are some examples: - * GeoNetworking multiple component case: - * NodeB.geoNetworkingPort.params := -"GN(ll_address=04e548000001,latitude=43551050,longitude=10298730,beaconing=0,expiry=1000,its_aid=141)/COMMSIGNIA(mac_src=04e548000001,mac_bc=FFFFFFFFFFFF,eth_type=8947,target_host=10.200.1.101,target_port=7942,source_port=7943,its_aid=141,interface_id=2,tx_power=-32)/UDP(dst_ip=192.168.56.1,dst_port=12346,src_ip=192.168.156.4,src_port=12345)/ETH(mac_src=04e548000001,mac_dst=0A0027000011,eth_type=0800)/PCAP(mac_src=04e548000001,file=/home/vagrant/TriesAndDelete/etsi_its/testdata/TC_AUTO_IOT_DENM_RWW_BV_01_short.pcap,filter=and -(udp port 30000 or udp port 7943))" NodeC.geoNetworkingPort.params := -"GN(ll_address=70b3d5791b48,latitude=43551050,longitude=10298730,beaconing=0,expiry=1000,its_aid=141)/COMMSIGNIA(mac_src=70b3d5791b48,mac_bc=FFFFFFFFFFFF,eth_type=8947,target_host=10.200.1.101,target_port=7942,source_port=7943,its_aid=141,interface_id=2,tx_power=-32)/UDP(dst_ip=192.168.56.1,dst_port=12346,src_ip=192.168.156.4,src_port=12345)/ETH(mac_src=70b3d5791b48,mac_dst=0A0027000011,eth_type=0800)/PCAP(mac_src=70b3d5791b48,file=/home/vagrant/TriesAndDelete/etsi_its/testdata/TC_AUTO_IOT_DENM_RWW_BV_01_short.pcap,filter=and -(udp port 30000 or udp port 7943))" - * NodeB.geoNetworkingPort.params := -"GN(ll_address=04e548000001,latitude=43551050,longitude=10298730,beaconing=0,expiry=1000,its_aid=141)/ETH(mac_src=04e548000001,mac_dst=0A0027000011,eth_type=0800)/PCAP(mac_src=04e548000001,file=/home/vagrant/TriesAndDelete/etsi_its/testdata/TC_AUTO_IOT_DENM_RWW_BV_01.pcap,filter=and -ether src 04e548000001)" #NodeC.geoNetworkingPort.params := -"GN(ll_address=70b3d5791b48,latitude=43551050,longitude=10298730,beaconing=0,expiry=1000,its_aid=141)/ETH(mac_src=70b3d5791b48,mac_dst=0A0027000011,eth_type=0800)/PCAP(mac_src=70b3d5791b48,file=/home/vagrant/TriesAndDelete/etsi_its/testdata/TC_AUTO_IOT_DENM_RWW_BV_01.pcap,filter=and -ether src 70b3d5791b48)" - * UpperTester port based on UDP - * system.utPort.params := -"UT_GN/UDP(dst_ip=192.168.1.1,dst_port=12346,src_ip=192.168.156.4,src_port=12345)/ETH(mac_src=026f8338c1e5,mac_dst=0A0027000011,eth_type=0800)/PCAP(mac_src=0800275c4959,nic=enp0s8,filter=and -udp port 12346)" * \pure */ virtual layer *create_layer(const std::string &p_type, const std::string &p_params) = 0; diff --git a/ttcn/LibHttp/module.mk b/ttcn/LibHttp/module.mk new file mode 120000 index 0000000000000000000000000000000000000000..26de7167e45a3aaa12461cbfed0a4b4bcc83b1b6 --- /dev/null +++ b/ttcn/LibHttp/module.mk @@ -0,0 +1 @@ +module_cise.mk \ No newline at end of file diff --git a/ttcn/LibHttp/module_cise.mk b/ttcn/LibHttp/module_cise.mk new file mode 100644 index 0000000000000000000000000000000000000000..516c376707c922b31d6dec9f4f1c9ae45d521f4c --- /dev/null +++ b/ttcn/LibHttp/module_cise.mk @@ -0,0 +1,19 @@ +sources := \ + ttcn/LibHttp_BinaryMessageBodyTypes.ttcn \ + ttcn/LibHttp_EncdecDeclarations.ttcn \ + ttcn/LibHttp_Functions.ttcn \ + ttcn/LibHttp_JsonMessageBodyTypes.ttcn \ + ttcn/LibHttp_JsonTemplates.ttcn \ + ttcn/LibHttp_JSONTypes.ttcn \ + ttcn/LibHttp_MessageBodyTypes.ttcn \ + ttcn/LibHttp_Pics.ttcn \ + ttcn/LibHttp_Pixits.ttcn \ + ttcn/LibHttp_Templates.ttcn \ + ttcn/LibHttp_TestSystem.ttcn \ + ttcn/LibHttp_TypesAndValues.ttcn \ + ttcn/LibHttp_XMLTypes.ttcn \ + + +# Please, move and comment the module you need to overwrite tofit your project +# ttcn/LibHttp_XmlMessageBodyTypes.ttcn \ +# ttcn/LibHttp_XmlTemplates.ttcn diff --git a/ttcn/LibJson/module.mk b/ttcn/LibJson/module.mk index a5d3e3b067498ebf1cbebe5212ff82699b9d1b84..2d0875696f9c74b553fa7d4a30a67248b396228f 100644 --- a/ttcn/LibJson/module.mk +++ b/ttcn/LibJson/module.mk @@ -1,4 +1,2 @@ sources := \ ttcn/Json.ttcn - -# Please, move and comment the module you need to overwrite tofit your project diff --git a/ttcn/LibXsd/module.mk b/ttcn/LibXsd/module.mk new file mode 100644 index 0000000000000000000000000000000000000000..edc3ade99d0735ed53c8e126458a6ae0f24042e1 --- /dev/null +++ b/ttcn/LibXsd/module.mk @@ -0,0 +1,3 @@ +sources := \ + ttcn/UsefulTtcn3Types.ttcn \ + ttcn/XSD.ttcn diff --git a/ttcn/LibXsd/ttcn/UsefulTtcn3Types.ttcn b/ttcn/LibXsd/ttcn/UsefulTtcn3Types.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ae682d65b0c40db0e6ad22d38cba1089e8d8fd0c --- /dev/null +++ b/ttcn/LibXsd/ttcn/UsefulTtcn3Types.ttcn @@ -0,0 +1,95 @@ +/******************************************************************************* +* Copyright (c) 2000-2022 Ericsson Telecom AB +* +* XSD to TTCN-3 Translator version: CRL 113 200/6 R6B +* +* All rights reserved. This program and the accompanying materials +* are made available under the terms of the Eclipse Public License v2.0 +* which accompanies this distribution, and is available at +* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html +*******************************************************************************/ +// +// File: UsefulTtcn3Types.ttcn +// Description: +// References: +// Rev: +// Prodnr: +// Updated: +// Contact: http://ttcn.ericsson.se +// +//////////////////////////////////////////////////////////////////////////////// +module UsefulTtcn3Types { + + + type integer byte (-128 .. 127) /*with { variant "8 bit" }*/; + + type integer unsignedbyte (0 .. 255) /*with { variant "unsigned 8 bit" }*/; + + type integer short (-32768 .. 32767) /*with { variant "16 bit" }*/; + + type integer unsignedshort (0 .. 65535) /*with { variant "unsigned 16 bit" }*/; + + type integer long (-2147483648 .. 2147483647) /*with { variant "32 bit" }*/; + + type integer unsignedlong (0 .. 4294967295) /*with { variant "unsigned 32 bit" }*/; + + type integer longlong ( -9223372036854775808 .. 9223372036854775807 ) /*with { variant "64 bit" }*/; + + type integer unsignedlonglong ( 0 .. 18446744073709551615 ) /*with { variant "unsigned 64 bit" }*/; + + type float IEEE754float /*with { variant "IEEE754 float" }*/; + + type float IEEE754double /*with { variant "IEEE754 double" }*/; + + type float IEEE754extfloat /*with { variant "IEEE754 extended float" }*/; + + type float IEEE754extdouble /*with { variant "IEEE754 extended double" }*/; + + type universal charstring utf8string /*with { variant "UTF-8" }*/; + + type universal charstring bmpstring ( char ( 0,0,0,0 ) .. char ( 0,0,255,255) ) /*with { variant "UCS-2" }*/; + + type universal charstring utf16string ( char ( 0,0,0,0 ) .. char ( 0,16,255,255) ) /*with { variant "UTF-16" }*/; + + type universal charstring iso8859string ( char ( 0,0,0,0 ) .. char ( 0,0,0,255) ) /*with { variant "8 bit" }*/; + + type record IDLfixed + { + unsignedshort digits, + short scale, + charstring value_ + } + /*with { + variant "IDL:fixed FORMAL/01-12-01 v.2.6"; + }*/; + + /* + type charstring char length (1); + + NOTE 1: The name of this useful type is the same as the TTCN-3 keyword used to denote universal + charstring values in the quadraple form. In general it is disallowed to use TTCN-3 keywords as + identifiers. The "char" useful type is a solitary exception and allowed only for backward compatibility + with previous versions of the TTCN-3 standard. (except Titan doesn't) + + NOTE 2: The special string "8 bit" defined in clause 28.2.3 may be used with this type to specify a given encoding + for its values. Also, other properties of the base type can be changed by using attribute mechanisms. + */ + + type universal charstring uchar length (1); + + /* + NOTE: Special strings defined in clause 28.2.3 except "8 bit" may be used with this type to specify a given + encoding for its values. Also, other properties of the base type can be changed by using attribute + mechanisms. + */ + + type bitstring bit length (1); + + type hexstring hex length (1); + + type octetstring octet length (1); + +} +with { +encode "XML"; +} diff --git a/ttcn/LibXsd/ttcn/XSD.ttcn b/ttcn/LibXsd/ttcn/XSD.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b519f6be8994038928d1a87a460d8d47a09c6a6c --- /dev/null +++ b/ttcn/LibXsd/ttcn/XSD.ttcn @@ -0,0 +1,338 @@ +/******************************************************************************* +* Copyright (c) 2000-2022 Ericsson Telecom AB +* +* XSD to TTCN-3 Translator version: CRL 113 200/6 R6B +* +* All rights reserved. This program and the accompanying materials +* are made available under the terms of the Eclipse Public License v2.0 +* which accompanies this distribution, and is available at +* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html +*******************************************************************************/ +// +// File: XSD.ttcn +// Description: +// References: +// Rev: +// Prodnr: +// Updated: +// Contact: http://ttcn.ericsson.se +// +//////////////////////////////////////////////////////////////////////////////// +module XSD { + +import from UsefulTtcn3Types all; + +//These constants are used in the XSD date/time type definitions +const charstring + dash := "-", + cln := ":", + year := "[0-9]#4", + yearExpansion := "(-([1-9][0-9]#(0,))#(,1))#(,1)", + month := "(0[1-9]|1[0-2])", + dayOfMonth := "(0[1-9]|[12][0-9]|3[01])", + hour := "([01][0-9]|2[0-3])", + minute := "([0-5][0-9])", + second := "([0-5][0-9])", + sFraction := "(.[0-9]#(1,))#(,1)", + endOfDayExt := "24:00:00(.0#(1,))#(,1)", + nums := "[0-9]#(1,)", + ZorTimeZoneExt := "(Z|[+-]((0[0-9]|1[0-3]):[0-5][0-9]|14:00))#(,1)", + durTime := "(T[0-9]#(1,)"& + "(H([0-9]#(1,)(M([0-9]#(1,)(S|.[0-9]#(1,)S))#(,1)|.[0-9]#(1,)S|S))#(,1)|"& + "M([0-9]#(1,)(S|.[0-9]#(1,)S)|.[0-9]#(1,)M)#(,1)|"& + "S|"& + ".[0-9]#(1,)S))" + +//anySimpleType + +type XMLCompatibleString AnySimpleType +with { +variant "XSD:anySimpleType"; +}; + +//anyType; + +type record AnyType +{ + record of String embed_values optional, + record of String attr optional, + record of String elem_list +} +with { +variant "XSD:anyType"; +variant "embedValues"; +variant (attr) "anyAttributes"; +variant (elem_list) "anyElement"; +}; +// String types + +type XMLCompatibleString String +with { +variant "XSD:string"; +}; + +type XMLStringWithNoCRLFHT NormalizedString +with { +variant "XSD:normalizedString"; +}; + +type NormalizedString Token +with { +variant "XSD:token"; +}; + +type XMLStringWithNoWhitespace Name +with { +variant "XSD:Name"; +}; + +type XMLStringWithNoWhitespace NMTOKEN +with { +variant "XSD:NMTOKEN"; +}; + +type Name NCName +with { +variant "XSD:NCName"; +}; + +type NCName ID +with { +variant "XSD:ID"; +}; + +type NCName IDREF +with { +variant "XSD:IDREF"; +}; + +type NCName ENTITY +with { +variant "XSD:ENTITY"; +}; + +type octetstring HexBinary +with { +variant "XSD:hexBinary"; +}; + +type octetstring Base64Binary +with { +variant "XSD:base64Binary"; +}; + +type XMLStringWithNoCRLFHT AnyURI +with { +variant "XSD:anyURI"; +}; + +type charstring Language (pattern "[a-zA-Z]#(1,8)(-\w#(1,8))#(0,)") +with { +variant "XSD:language"; +}; +// Integer types + +type integer Integer +with { +variant "XSD:integer"; +}; + +type integer PositiveInteger (1 .. infinity) +with { +variant "XSD:positiveInteger"; +}; + +type integer NonPositiveInteger (-infinity .. 0) +with { +variant "XSD:nonPositiveInteger"; +}; + +type integer NegativeInteger (-infinity .. -1) +with { +variant "XSD:negativeInteger"; +}; + +type integer NonNegativeInteger (0 .. infinity) +with { +variant "XSD:nonNegativeInteger"; +}; + +type longlong Long +with { +variant "XSD:long"; +}; + +type unsignedlonglong UnsignedLong +with { +variant "XSD:unsignedLong"; +}; + +type long Int +with { +variant "XSD:int"; +}; + +type unsignedlong UnsignedInt +with { +variant "XSD:unsignedInt"; +}; + +type short Short +with { +variant "XSD:short"; +}; + +type unsignedshort UnsignedShort +with { +variant "XSD:unsignedShort"; +}; + +type octetstring byte length(1) with {encode "length(1)"}; +type byte Byte +with { +variant "XSD:byte"; +}; + +type unsignedbyte UnsignedByte +with { +variant "XSD:unsignedByte"; +}; + +// Float types + +type float Decimal +with { +variant "XSD:decimal"; +}; + +type IEEE754float Float +with { +variant "XSD:float"; +}; + +type IEEE754double Double +with { +variant "XSD:double"; +}; + +// Time types + +type charstring Duration (pattern + "{dash}#(,1)P({nums}(Y({nums}(M({nums}D{durTime}#(,1)|{durTime}#(,1))|D{durTime}#(,1))|" & + "{durTime}#(,1))|M({nums}D{durTime}#(,1)|{durTime}#(,1))|D{durTime}#(,1))|{durTime})") +with { +variant "XSD:duration"; +}; + +type charstring DateTime (pattern + "{yearExpansion}{year}{dash}{month}{dash}{dayOfMonth}T({hour}{cln}{minute}{cln}{second}" & + "{sFraction}|{endOfDayExt}){ZorTimeZoneExt}" ) +with { +variant "XSD:dateTime"; +}; + +type charstring Time (pattern + "({hour}{cln}{minute}{cln}{second}{sFraction}|{endOfDayExt}){ZorTimeZoneExt}" ) +with { +variant "XSD:time"; +}; + +type charstring Date (pattern + "{yearExpansion}{year}{dash}{month}{dash}{dayOfMonth}{ZorTimeZoneExt}" ) +with { +variant "XSD:date"; +}; + +type charstring GYearMonth (pattern + "{yearExpansion}{year}{dash}{month}{ZorTimeZoneExt}" ) +with { +variant "XSD:gYearMonth"; +}; + +type charstring GYear (pattern + "{yearExpansion}{year}{ZorTimeZoneExt}" ) +with { +variant "XSD:gYear"; +}; + +type charstring GMonthDay (pattern + "{dash}{dash}{month}{dash}{dayOfMonth}{ZorTimeZoneExt}" ) +with { +variant "XSD:gMonthDay"; +}; + +type charstring GDay (pattern + "{dash}{dash}{dash}{dayOfMonth}{ZorTimeZoneExt}" ) +with { +variant "XSD:gDay"; +}; + +type charstring GMonth (pattern + "{dash}{dash}{month}{ZorTimeZoneExt}" ) +with { +variant "XSD:gMonth"; +}; + +// Sequence types + +type record of NMTOKEN NMTOKENS +with { +variant "XSD:NMTOKENS"; +}; + +type record of IDREF IDREFS +with { +variant "XSD:IDREFS"; +}; + +type record of ENTITY ENTITIES +with { +variant "XSD:ENTITIES"; +}; + +type record QName +{ + AnyURI uri optional, + NCName name +} +with { +variant "XSD:QName"; +}; + +// Boolean type + +type boolean Boolean +with { +variant "XSD:boolean"; +}; + +//TTCN-3 type definitions supporting the mapping of W3C XML Schema built-in datatypes + +type utf8string XMLCompatibleString +( + char(0,0,0,9)..char(0,0,0,9), + char(0,0,0,10)..char(0,0,0,10), + char(0,0,0,13)..char(0,0,0,13), + char(0,0,0,32)..char(0,0,215,255), + char(0,0,224,0)..char(0,0,255,253), + char(0,1,0,0)..char(0,16,255,253) +) + +type utf8string XMLStringWithNoWhitespace +( + char(0,0,0,33)..char(0,0,215,255), + char(0,0,224,0)..char(0,0,255,253), + char(0,1,0,0)..char(0,16,255,253) +) + +type utf8string XMLStringWithNoCRLFHT +( + char(0,0,0,32)..char(0,0,215,255), + char(0,0,224,0)..char(0,0,255,253), + char(0,1,0,0)..char(0,16,255,253) +) + +} +with{ +encode "XML" +}