diff --git a/102657/RDMessage.asn b/102657/RDMessage.asn index 7d312cec22d9ee559f99a04d916344d70c35dab5..3e1f090491e3615c7e53c0aad4feeba932d203ac 100644 --- a/102657/RDMessage.asn +++ b/102657/RDMessage.asn @@ -1,4 +1,4 @@ -RDMessage {itu-t(0) identified-organization(4) etsi(0) securityDomain(2) retainedData(3) rdHeader(0) version29(29)} +RDMessage {itu-t(0) identified-organization(4) etsi(0) securityDomain(2) retainedData(3) rdHeader(0) version30(30)} DEFINITIONS IMPLICIT TAGS ::= @@ -12,7 +12,7 @@ BEGIN retainedDataDomainId OBJECT IDENTIFIER ::= {itu-t(0) identified-organization(4) etsi(0) securityDomain(2) retainedData(3)} -- rdHeader -rdHeaderId OBJECT IDENTIFIER ::= {retainedDataDomainId rdHeader(0) version29(29)} +rdHeaderId OBJECT IDENTIFIER ::= {retainedDataDomainId rdHeader(0) version30(30)} -- ====================================== -- Top level definitions for RDHI wrapper @@ -728,7 +728,8 @@ SubscribedTelephonyServices ::= SEQUENCE -- in cases of MultiSIM card contracts loginInfos [24] SEQUENCE OF LoginInfo OPTIONAL, -- e.g. login information according a VMS/UMS account - paymentTransactions [25] SEQUENCE OF BillingRecords OPTIONAL + paymentTransactions [25] SEQUENCE OF BillingRecords OPTIONAL, + iMEIs [26] SEQUENCE OF IMEI OPTIONAL } @@ -3045,7 +3046,9 @@ PEI ::= CHOICE { iMEI [1] IMEI, iMEISV [2] IMEISV, - ... + ..., + mACAddress [3] MACAddress, + eUI64 [4] EUI64 } @@ -3056,6 +3059,10 @@ IMEI ::= OCTET STRING (SIZE(8)) IMEISV ::= NumericString (SIZE(16)) +MACAddress ::= UTF8String + +EUI64 ::= UTF8String + IMSI ::= OCTET STRING (SIZE(3..8)) -- format as per 3GPP TS 09.02 [8] diff --git a/102657/RDMessage.xsd b/102657/RDMessage.xsd index f3b0e7791090ee2fb6fa3b0c733e40b2e47c646f..ce0a971c8774460f95857dad176c49ae3aa106d2 100644 --- a/102657/RDMessage.xsd +++ b/102657/RDMessage.xsd @@ -1,8 +1,8 @@ - + - XSD translated from ASN.1 derived from outcome of TS 102 657 v2.1.1 + XSD translated from ASN.1 derived from outcome of TS 102 657 v2.3.1 @@ -434,6 +434,16 @@ + + + + + + + + + + @@ -788,6 +798,13 @@ + + + + + + + @@ -3313,7 +3330,9 @@ - + + + diff --git a/103120/dictionaries/ts_103120_ETSIDictionaryDefinitions.xml b/103120/dictionaries/ts_103120_ETSIDictionaryDefinitions.xml index 33fd4f3d746d09034f69b25777bc2b0f53f22ea8..242ca814aded62a7b57ce2a35da92610883b11c1 100644 --- a/103120/dictionaries/ts_103120_ETSIDictionaryDefinitions.xml +++ b/103120/dictionaries/ts_103120_ETSIDictionaryDefinitions.xml @@ -354,6 +354,10 @@ Delivered Traffic that matches the policy is delivered + + Truncate + Deliver only the specified number of the first octets of each datagram + @@ -728,6 +732,10 @@ TS103707 Delivery according to ETSI TS 103 707 + + TS103976 + Delivery according to ETSI TS 103 976, using JSON encoding + diff --git a/103120/schema/json/ts_103120_Core.schema.json b/103120/schema/json/ts_103120_Core.schema.json index b7f61078d24233c7a98df13c9189340c00c6b78e..63e2ad484c3ae7f709be33f17c0a23ec4a2872c8 100644 --- a/103120/schema/json/ts_103120_Core.schema.json +++ b/103120/schema/json/ts_103120_Core.schema.json @@ -603,4 +603,4 @@ } }, "$ref": "#/$defs/HI1Message" -} +} \ No newline at end of file diff --git a/103120/schema/json/ts_103120_TrafficPolicy.schema.json b/103120/schema/json/ts_103120_TrafficPolicy.schema.json index 013e0a7dcb9999947aaee41cb852f115fee7d176..18bb9cfed8e694aa791d12b671ead4e94e4f8fd4 100644 --- a/103120/schema/json/ts_103120_TrafficPolicy.schema.json +++ b/103120/schema/json/ts_103120_TrafficPolicy.schema.json @@ -111,6 +111,9 @@ }, "tp:Action": { "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "tp:Parameters": { + "$ref": "#/$defs/ActionParameters" } }, "required": [ @@ -272,6 +275,36 @@ "required": [ "tp:CommunicationServiceID" ] + }, + "ActionParameters": { + "oneOf": [ + { + "type": "object", + "properties": { + "tp:TruncateActionParameters": { + "$ref": "#/$defs/TruncateActionParameters" + } + }, + "required": [ + "tp:TruncateActionParameters" + ] + } + ] + }, + "TruncateActionParameters": { + "type": "object", + "properties": { + "tp:NumberOfOctets": { + "type": "integer", + "minimum": 0 + }, + "tp:ProvideOriginalLength": { + "type": "boolean" + } + }, + "required": [ + "tp:NumberOfOctets" + ] } } -} +} \ No newline at end of file diff --git a/103120/schema/xsd/ts_103120_TrafficPolicy.xsd b/103120/schema/xsd/ts_103120_TrafficPolicy.xsd index 0ef26315c17c4ea65c8596d17ad3186461ebe123..75e6145e1f7f5910a1b249b9749fd609e7d66976 100644 --- a/103120/schema/xsd/ts_103120_TrafficPolicy.xsd +++ b/103120/schema/xsd/ts_103120_TrafficPolicy.xsd @@ -42,6 +42,7 @@ + @@ -96,4 +97,15 @@ + + + + + + + + + + + diff --git a/103221-1/TS_103_221_01.xsd b/103221-1/TS_103_221_01.xsd index 48288eeb6289593f4ea6e2dc4b86a72b04522b6a..cfcc6908baf0680385875be0f165dd7923e75811 100644 --- a/103221-1/TS_103_221_01.xsd +++ b/103221-1/TS_103_221_01.xsd @@ -1,5 +1,5 @@ - + @@ -200,6 +200,7 @@ + diff --git a/103221-1/validate_examples.py b/103221-1/validate_examples.py deleted file mode 100644 index a22c986f0c122fe00ec025acad8bd8805a03ce3b..0000000000000000000000000000000000000000 --- a/103221-1/validate_examples.py +++ /dev/null @@ -1,95 +0,0 @@ -import glob -import sys -from pathlib import Path - - -XS = 'http://www.w3.org/2001/XMLSchema' - - -def validate_example(example, schema): - - print('Validating example {}'.format(example)) - - xml = open(example) - doc = etree.parse(xml) - schema.assertValid(doc) - - print('Validated example {}'.format(example)) - - -def validate_examples(schema): - - examples = glob.glob('./examples/*.xml') - - if not examples: - sys.exit('ERROR: No examples found in ./examples/ directory') - - for example in examples: - validate_example(example, schema) - - -def load_schema(xsd): - - xsd_file = open(xsd) - - xsd_doc = etree.parse(xsd_file) - - # Set schemaLocation of TS 103 280 XSD - - common_xsd = glob.glob('./TS_103_280_*.xsd') - - if not common_xsd: - sys.exit('ERROR: Please copy a TS 103 280 XSD into this directory') - - if len(common_xsd) > 1: - sys.exit('ERROR: Too many TS 103 280 XSDs in current directory') - - imports = xsd_doc.xpath('//*/xs:import', namespaces={'xs': XS}) - - for xsd_import in imports: - xsd_import.attrib['schemaLocation'] = str(Path(common_xsd[0])) - print (xsd_import.attrib) - - # Load TS 103 221-1 XSD as a schema - - return etree.XMLSchema(xsd_doc) - - -def validate_xsd(xsd): - - print('Validating XSD {}'.format(xsd)) - - schema = load_schema(xsd) - - print('Validated XSD {}'.format(xsd)) - print('') - - validate_examples(schema) - - print('') - print('Validated all examples for XSD {}'.format(xsd)) - print('') - - -def validate_xsds(): - - xsds = glob.glob('./TS_103_221_01_*.xsd') - - if not xsds: - sys.exit('ERROR: No TS 103 221-1 XSDs found in current directory') - - for xsd in xsds: - validate_xsd(xsd) - - -if __name__ == '__main__': - - if sys.version_info <= (3, 5): - sys.exit('ERROR: You need at least Python 3.5 to run this tool') - - try: - from lxml import etree - except ImportError: - sys.exit('ERROR: You need to install the Python lxml library') - - validate_xsds() diff --git a/103280/TS_103_280.asn1 b/103280/TS_103_280.asn1 index d384ec866a9ad37d73552de8dd77f3fbeb2e2ec0..0ba972553bfc385fc42dc82076ac7dfe767731f6 100644 --- a/103280/TS_103_280.asn1 +++ b/103280/TS_103_280.asn1 @@ -1,11 +1,11 @@ Common-Parameters -{itu-t(0) identified-organization(4) etsi(0) common-parameters(3280) version251(251)} +{itu-t(0) identified-organization(4) etsi(0) common-parameters(3280) version261(261)} DEFINITIONS IMPLICIT TAGS EXTENSIBILITY IMPLIED ::= BEGIN -- Object Identifier definitions -commonParameterDomainId OBJECT IDENTIFIER ::= {itu-t(0) identified-organization(4) etsi(0) common-parameters(3280) version251(251)} +commonParameterDomainId OBJECT IDENTIFIER ::= {itu-t(0) identified-organization(4) etsi(0) common-parameters(3280) version261(261)} -- Common Parameters (below are as defined in clause 6) @@ -95,4 +95,6 @@ IPProtocol ::= INTEGER (0..255) VLANID ::= INTEGER (0..4095) +ServiceAccessIdentifier ::= UTF8String + END diff --git a/103280/TS_103_280.schema.json b/103280/TS_103_280.schema.json index 1d1e0c0b4722abe16fac4714551cb4df9be95faf..a6cca0c8e5af008e2ec6a4a572ec45b2f38f4e77 100644 --- a/103280/TS_103_280.schema.json +++ b/103280/TS_103_280.schema.json @@ -196,6 +196,13 @@ "minimum": 0, "maximum": 4095 }, + "VIN": { + "type": "string", + "pattern": "^[A-HJ-NPR-Z0-9]{17}$" + }, + "ServiceAccessIdentifier": { + "type": "string" + }, "IPAddress": { "oneOf": [ { diff --git a/103280/TS_103_280.xsd b/103280/TS_103_280.xsd index 1eb122884223c99806cb466f1d30c1d01e151110..cdbafba15e631772c32221f2826f81dfd185ad17 100644 --- a/103280/TS_103_280.xsd +++ b/103280/TS_103_280.xsd @@ -1,5 +1,5 @@ - + @@ -278,4 +278,12 @@ + + + + + + + + diff --git a/103976/examples/example.json b/103976/examples/example.json new file mode 100644 index 0000000000000000000000000000000000000000..f8090eea8ea07cb0550b7313d2e2fb12b10813b4 --- /dev/null +++ b/103976/examples/example.json @@ -0,0 +1,24 @@ +{ + "VINtoLocationRecords" : [ + { + "Location" : { + "WGS84CoordinateDecimal" : { + "etsi280:latitude" : "N54.123456", + "etsi280:longitude" : "W001.123456" + } + }, + "TimeOfLocation" : { + "PointInTime" : "2022-01-16T15:57:00Z" + }, + "CommunicationsIdentifier" : { + "IMSI" : "0123456" + }, + "AssociationTime" : { + "PeriodInTime" : { + "StartTime" : "2022-01-16T15:57:00Z", + "EndTime" : "2022-01-16T15:57:00Z" + } + } + } + ] +} \ No newline at end of file diff --git a/103976/ts_103976.schema.json b/103976/ts_103976.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..008c0835d7eae7ced4eae246f59577794d01232a --- /dev/null +++ b/103976/ts_103976.schema.json @@ -0,0 +1,146 @@ +{ + "$id": "ts_103976_core", + "$defs": { + "AssociationPeriod" : { + "type" : "object", + "properties" : { + "StartTime" : { "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" }, + "EndTime" : { "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" } + }, + "required" : ["StartTime"] + }, + "AssociationTime" : { + "oneOf" : [ + { + "type" : "object", + "properties" : { + "PointInTime" : { "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" } + }, + "required" : ["PointInTime"] + }, + { + "type" : "object", + "properties" : { + "PeriodInTime" : { "$ref": "#/$defs/AssociationPeriod" } + }, + "required" : ["PeriodInTime"] + } + ] + }, + "CommsID" : { + "oneOf" : [ + { + "type" : "object", + "properties" : { "IMEI" : { "$ref" : "ts_103280_2017_07#/$defs/IMEI"} }, + "required" : ["IMEI"] + }, + { + "type" : "object", + "properties" : { "IMSI" : { "$ref" : "ts_103280_2017_07#/$defs/IMSI"} }, + "required" : ["IMSI"] + }, + { + "type" : "object", + "properties" : { "IMSI" : { "$ref" : "ts_103280_2017_07#/$defs/ICCID"} }, + "required" : ["ICCID"] + }, + { + "type" : "object", + "properties" : { "IMSI" : { "$ref" : "ts_103280_2017_07#/$defs/PEIIMEI"} }, + "required" : ["PEIIMEI"] + }, + { + "type" : "object", + "properties" : { "IMSI" : { "$ref" : "ts_103280_2017_07#/$defs/SUPIIMSI"} }, + "required" : ["SUPIIMSI"] + }, + { + "type" : "object", + "properties" : { "IMSI" : { "$ref" : "ts_103280_2017_07#/$defs/SUPINAI"} }, + "required" : ["SUPINAI"] + }, + { + "type" : "object", + "properties" : { "IMSI" : { "$ref" : "ts_103280_2017_07#/$defs/InternationalE164"} }, + "required" : ["MSISDN"] + }, + { + "type" : "object", + "properties" : { "IMSI" : { "$ref" : "ts_103280_2017_07#/$defs/GPSIMSISDN"} }, + "required" : ["GPSIMSISDN"] + }, + { + "type" : "object", + "properties" : { "IMSI" : { "$ref" : "ts_103280_2017_07#/$defs/GPSINAI"} }, + "required" : ["GPSINAI"] + }, + { + "type" : "object", + "properties" : { "IMSI" : { "$ref" : "ts_103280_2017_07#/$defs/MACAddress"} }, + "required" : ["MACAddress"] + }, + { + "type" : "object", + "properties" : { "IMSI" : { "$ref" : "ts_103280_2017_07#/$defs/EUI64"} }, + "required" : ["EUI164"] + } + ] + }, + "Location" : { + "oneOf" : [ + { + "type" : "object", + "properties" : { + "WGS84CoordinateDecimal" : { "$ref" : "ts_103280_2017_07#/$defs/WGS84CoordinateDecimal"} + } + } + ] + }, + "SourceOfLocation" : { + "enum" : ["GNSS"] + }, + "VINtoCommsIDRecord" : { + "type" : "object", + "properties" : { + "CommsID" : { "$ref" : "#/$defs/CommsID" }, + "AssociationTime" : { "$ref" : "#/$defs/AssociationTime"} + }, + "required" : ["CommsID"] + }, + "CommsIDToVINRecord" : { + "type" : "object", + "properties" : { + "VIN" : { "$ref" : "ts_103280_2017_07#/$defs/VIN" } + }, + "required" : ["VIN"] + }, + "VINtoLocationRecord" : { + "type" : "object", + "properties" : { + "Location" : { "$ref" : "#/$defs/Location" }, + "TimeOfLocation" : { "$ref" : "#/$defs/AssociationTime" }, + "SourceOfLocation" : { "$ref" : "#/$defs/SourceOfLocation" }, + "LocationRecordReason" : { "$ref" : "ts_103280_2017_07#/$defs/LongString" } + }, + "required" : ["Location", "TimeOfLocation"] + }, + "ResultRecords" : { + "type" : "object", + "properties" : { + "VINtoCommsIDRecords" : { + "type" : "array", + "items" : { "$ref" : "#/$defs/VINtoCommsIDRecord"} + }, + "CommsIDToVINRecords" : { + "type" : "array", + "items" : { "$ref" : "#/$defs/CommsIDToVINRecord"} + }, + "VINtoLocationRecords" : { + "type" : "array", + "items" : { "$ref" : "#/$defs/VINtoLocationRecord"} + } + } + } + }, + "$ref": "#/$defs/ResultRecords" +} \ No newline at end of file diff --git a/testing/asn_process.py b/testing/asn_process.py index aa0a0a63777202d29ee51587ffdafb760c360560..8c4394cd6456364706a95c238554f8164137ba7c 100644 --- a/testing/asn_process.py +++ b/testing/asn_process.py @@ -2,7 +2,7 @@ import logging import json from pathlib import Path from subprocess import run -from re import sub +from shutil import which from pycrate_asn1c.asnproc import * @@ -16,6 +16,15 @@ filesWithBigInts = [ '102232-4/L2AccessPDU.asn' ] +asn1c_path = "" +change_path_to_unix = False + +def fix_path(path): + if change_path_to_unix: + return "./" + path.replace("\\","/") + else: + return path + def syntaxCheckASN (fileList): """ Performs ASN syntax checking on a list of filenames (or pathlib Paths) @@ -31,10 +40,10 @@ def syntaxCheckASN (fileList): try: if file.as_posix() in filesWithBigInts: newFile = reconstrainInteger(str(file)) - p = run(['asn1c', '-E', newFile], capture_output=True) + p = run([asn1c_path, '-E', fix_path(newFile)], capture_output=True) Path(newFile).unlink() else: - p = run(['asn1c', '-E', str(file)], capture_output=True) + p = run([asn1c_path, '-E', fix_path(str(file))], capture_output=True) if (p.returncode != 0): errorMessage = p.stderr.decode().splitlines()[0] if errorMessage.startswith(' Value "18446744073709551615" at line'): @@ -50,6 +59,7 @@ def syntaxCheckASN (fileList): 'ok' : True } except Exception as ex: + raise ex results[str(file)] = { 'ok' : False, 'code' : -1, @@ -162,6 +172,16 @@ def processResults (results, stageName): if __name__ == '__main__': + logging.info ('Searching for ASN1C') + asn1c_path = which("asn1c") + if asn1c_path is None: + raise Exception ("No asn1c executable found. Please install asn1c") + logging.info (f"asn1c found at {asn1c_path}") + if asn1c_path.lower().endswith("bat"): + logging.info (f"asn1c is a batch file, so assume path separators need to be changed") + change_path_to_unix = True + + logging.info('Searching for ASN.1 files') fileList = list(Path(".").rglob("*.asn1")) + list(Path(".").rglob("*.asn")) logging.info(f'{len(fileList)} ASN.1 files found') diff --git a/testing/xsd_process.py b/testing/xsd_process.py index a0efd07b5b43db84e9797e965c8e06d4d213e5b9..97dc2a883dd1f344811754a79ebfb328d829aa66 100644 --- a/testing/xsd_process.py +++ b/testing/xsd_process.py @@ -2,7 +2,7 @@ import json import logging from pathlib import Path -from xmlschema.etree import etree_tostring +from xmlschema import etree_tostring from xmlschema import XMLSchema, XMLSchemaParseError diff --git a/utils/json_validator.py b/utils/json_validator.py index fb4619384b416e0156f517c14a0b0c4f0a6817cb..e9ff0c03a2b121ba5f9a429221288158c0bdcd03 100644 --- a/utils/json_validator.py +++ b/utils/json_validator.py @@ -151,6 +151,7 @@ if __name__ == "__main__": logging.info(f"{len(errors)} errors detected") if len(errors) > 0: + logging.info(errors) exit(-1) else: exit(0) diff --git a/utils/translate_spec.py b/utils/translate_spec.py index ce7a05572deaabffdd85573c38b154fe31991b5c..01880ff872f4c25cc447f1be3825254c7fc44cda 100644 --- a/utils/translate_spec.py +++ b/utils/translate_spec.py @@ -112,6 +112,6 @@ if __name__ == "__main__": if "Core" in schema_tuple[1]: json_string = json_string.replace('"$ref": "#/$defs/HI1Object"', '"$ref": "#/$defs/ConcreteHI1Object"') - with open(str(js_path), 'w') as f: + with open(str(js_path), 'w', newline='\n') as f: f.write(json_string) json_schemas[js['$id']] = json.loads(json_string)