Commit 2a611bad authored by grahamj's avatar grahamj Committed by canterburym
Browse files

TS 33.128 CR 669 - Introduction of next generation IP Packet Report format

parent db7b4454
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -5,6 +5,15 @@ DEFINITIONS IMPLICIT TAGS EXTENSIBILITY IMPLIED ::=

BEGIN

IMPORTS

-- from ETSI TS 102 232-3 [6]
    IPIRIPacketReport
        FROM IPAccessPDU
        {itu-t(0) identified-organization(4) etsi(0) securityDomain(2) lawfulIntercept(2) li-ps(5) iPAccess(3) version17(17)};

-- end of IMPORTS

-- =============
-- Relative OIDs
-- =============
@@ -266,7 +275,10 @@ XIRIEvent ::= CHOICE

    -- UDM events, see clause 7.2.2.3, continued from tag 124
    uDMProSeTargetIdentifierDeconcealment               [159] UDMProSeTargetIdentifierDeconcealment,
    uDMProSeTargetAuthentication                        [160] UDMProSeTargetAuthentication
    uDMProSeTargetAuthentication                        [160] UDMProSeTargetAuthentication,

    -- IP Packet Report, see clause 6.2.3.9.5
    iPIRIPacketReport                                   [161] IPAccessPDU.IPIRIPacketReport
}

-- ==============
@@ -527,6 +539,8 @@ IRIEvent ::= CHOICE
    -- UDM events, see clause 7.2.2.3, continued from tag 124
    uDMProSeTargetIdentifierDeconcealment               [159] UDMProSeTargetIdentifierDeconcealment,
    uDMProSeTargetAuthentication                        [160] UDMProSeTargetAuthentication

    -- Tag 161 is reserved because there is no equivalent IP Packet Report in IRIEvent.
}

IRITargetIdentifier ::= SEQUENCE
+5 −1
Original line number Diff line number Diff line
@@ -4,6 +4,10 @@
    ["./33128/r16/TS33128IdentityAssociation.asn"],
    ["./33128/r17/TS33128Payloads.asn"],
    ["./33128/r17/TS33128IdentityAssociation.asn"],
    ["./33128/r18/TS33128Payloads.asn"],
    [
        "./33128/r18/TS33128Payloads.asn",
        "./testing/dependencies/asn/IPAccessPDU.asn",
        "./testing/dependencies/asn/stubs/LI-PS-PDU.asn"
    ],
    ["./33128/r18/TS33128IdentityAssociation.asn"]
]
+2 −1
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@
        "Tag 2 missing in LALSReport",
        "Tag 6 missing in LALSReport",
        "Tag 8 missing in MMEStartOfInterceptionWithEPSAttachedUE",
        "Tag 11 missing in MMEStartOfInterceptionWithEPSAttachedUE"
        "Tag 11 missing in MMEStartOfInterceptionWithEPSAttachedUE",
        "Tag 161 XIRIEvent field 'iPIRIPacketReport' is not present in IRIEvent"
    ]
}
+40 −8
Original line number Diff line number Diff line
@@ -5,11 +5,28 @@ import os
import json
from pathlib import Path
from subprocess import run
from shutil import which

from pycrate_asn1c.asnproc import *

import lint_asn1

def reconstrainInteger (filename):
    Path('temp.asn').write_text(Path(filename).read_text().replace("18446744073709551615", "65536"))
    return 'temp.asn'

filesWithBigInts = [
    'testing/dependencies/asn/stubs/LI-PS-PDU.asn',
    'testing/dependencies/asn/IPAccessPDU.asn'
]

change_path_to_unix = False

def fix_path(path):
    if change_path_to_unix:
        return "./" + path.replace("\\","/")
    else:
        return path

def syntaxCheckASN(fileList):
    """
@@ -24,20 +41,35 @@ def syntaxCheckASN(fileList):
    results = {}
    for file in fileList:
        try:
            p = run(["asn1c", "-E", str(file)], capture_output=True)
            if p.returncode != 0:
            if file.as_posix() in filesWithBigInts:
                newFile = reconstrainInteger(str(file))
                p = run(["asn1c", '-E', fix_path(newFile)], capture_output=True)
                Path(newFile).unlink()
            else:
                p = run(["asn1c", '-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'):
                    results[str(file)] = { 'ok' : True}
                    continue
                results[str(file)] = {
                    "ok": False,
                    "code": p.returncode,
                    "message": p.stderr.decode().splitlines()[0],
                    'ok'   : False,
                    'code' : p.returncode,
                    'message'  : p.stderr.decode().splitlines()[0]
                }
            else:
                results[str(file)] = {"ok": True}
                results[str(file)] = {
                    'ok'   : True
                }            
        except Exception as ex:
            results[str(file)] = {"ok": False, "code": -1, "message": f"{ex.__class__.__qualname__}: {ex}"}
            raise ex
            results[str(file)] = {
                'ok'   : False,
                'code' : -1,
                'message'  : f"{ex!r}"
            }
    return results


def compileAllTargets(compileTargets):
    """
    Attempts to compile a set of compile targets using the pycrate ASN1 tools
+0 −0

Empty file added.

Loading