Commit 5e43e6fa authored by Jason Graham's avatar Jason Graham
Browse files

Merge branch 'draft/jason/additionalLocations2' into 'cr/102232-1/114'

Additional Locations

See merge request !254
parents e762b619 382fdfb2
Loading
Loading
Loading
Loading
Loading
+95 −2
Original line number Diff line number Diff line
@@ -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,
+3 −6
Original line number Diff line number Diff line
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"