diff --git a/102232-1/LI-PS-PDU.asn b/102232-1/LI-PS-PDU.asn index d084ae6ad2b826d68315c97015706df0d9d9d489..9f8f6c211597c56efb710271cfe313346b64d4a2 100644 --- a/102232-1/LI-PS-PDU.asn +++ b/102232-1/LI-PS-PDU.asn @@ -386,10 +386,11 @@ IRIPayload ::= SEQUENCE -- If the sessionDirection field is to be used for a given service then -- the exact meaning and use of the field will be described in the -- relevant service-specific details - payloadDirection [6] PayloadDirection OPTIONAL + payloadDirection [6] PayloadDirection OPTIONAL, -- If the payloadDirection field is to be used for a given service then -- the exact meaning and use of the field will be described in the -- relevant service-specific details + iRILocationInformation [7] Locations OPTIONAL } IRIType ::= ENUMERATED @@ -685,9 +686,101 @@ Location ::= SEQUENCE wlanLocationAttributes [2] WlanLocationAttributes OPTIONAL, eTSI671HI2Location [3] HI2Operations.Location OPTIONAL, threeGPP33128UserLocation [4] TS33128Payloads.UserLocation OPTIONAL, - cPEProvidedLocationAttributes [5] CPEProvidedLocationAttributes OPTIONAL + cPEProvidedLocationAttributes [5] CPEProvidedLocationAttributes OPTIONAL, + wGS84CoordinateDecimal [6] Common-Parameters.WGS84CoordinateDecimal OPTIONAL, + pIDF-LO [7] XMLType OPTIONAL } +--================================================================================================================= +-- These is just here for the example, this could be defined in another 102 232 module, 103 280 or somewhere else +Locations ::= SEQUENCE (SIZE (1..MAX)) OF LocationInformation + +LocationInformation ::= SEQUENCE +{ + location [1] Location, + -- I use Location here, although, it may be cleaner to make a new type that is a choice vs the sequence to enforce the 1-1 of provenance to location + locationProvenance [2] LocationProvenance +} + +LocationProvenance ::= SEQUENCE +{ + locationLIProvenance [1] LocationLIProvenance, + locationNetworkProvenance [2] LocationNetworkProvenance +} + +LocationLIProvenance ::= SEQUENCE +{ + locationProvenance [1] LIProvenance, + timeStamp [2] TimeOfLocation, + sourceNF [3] SourceNF, + additionalInformation [4] AdditionalProvenanceInformation +} + +LocationNetworkProvenance ::= SEQUENCE +{ + locationTime [1] TimeOfLocation, + locationSource [2] LocationSource, + additionalInformation [3] AdditionalProvenanceInformation +} + +LocationSource ::= ENUMERATED +{ + other(1), + unknown(2), + cPEOrClient(3), + network(4) +} + +LIProvenance ::= ENUMERATED +{ + other(1), + observed(2), + nFContext(3), + nFLookup(4) +} + +TimeOfLocation ::= SEQUENCE +{ + timeOfLocation [1] TimeFormat, + locationTimeStampQualifier [2] LocationTimeStampQualifier OPTIONAL +} + +LocationTimeStampQualifier ::= ENUMERATED +{ + unknown(1), + timeOfInterception(2), + timeOfMediation(3), + timeOfCalculation(4), + timeLastObserved(5) +} + +SourceNF ::= ENUMERATED +{ + aDMF(1), + triggeringFunction(2), + pOI(3), + mDF(4) +} + +XMLType ::= SEQUENCE +{ + xMLNamespace [1] XMLNamespace, + xMLValue [2] XMLValue +} + +XMLNamespace ::= UTF8String + +XMLValue ::= UTF8String + +TimeFormat ::= CHOICE +{ + generalizedTime [1] GeneralizedTime, + microSecondTime [2] MicroSecondTimeStamp +} + +AdditionalProvenanceInformation ::= UTF8String +--================================================================================================================= + WlanLocationAttributes ::= SEQUENCE { wlanAPMACAddress [0] OCTET STRING (SIZE(6)) OPTIONAL, diff --git a/testing/asn/asn_process.py b/testing/asn/asn_process.py index 508569153837abddc43900cd34773396890e0b56..878eb632cbf5d068a7584f719b7acef7d57f826d 100644 --- a/testing/asn/asn_process.py +++ b/testing/asn/asn_process.py @@ -1,5 +1,6 @@ import logging import json +import re from pathlib import Path from subprocess import run from shutil import which @@ -77,12 +78,8 @@ duplicateObjects = { def fixDuplicateObjects(filename): stringContent = filename.read_text() for object in duplicateObjects[filename.as_posix()]: - stringContent = stringContent.replace(f"{object} ::=", f"Native{object} ::=", 1) - stringContent = stringContent.replace( - f"SEQUENCE OF {object}", f"SEQUENCE OF Native{object}" - ) - # stringContent = sub(f"]\\w{object}", f"] Native{object}", stringContent) - + stringContent = re.sub(f"^({object} ::=)", 'Native\\1', stringContent, flags=re.MULTILINE) + stringContent = re.sub(f"^SEQUENCE (\(SIZE\(\d+\.\.(\d+|MAX)\)\) )*OF ({object})", 'SEQUENCE \\1OF Native\\2', stringContent, flags=re.MULTILINE) Path("temp.asn").write_text(stringContent) return "temp.asn"