Commit 6b8bdf7a authored by canterburym's avatar canterburym
Browse files

Fixing ASN.1 and XSD (with additional XSD testing)

parent 72129591
Loading
Loading
Loading
Loading
Loading
+7 −114
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ XIRIEvent ::= CHOICE
    nEFdeviceTriggerCancellation                        [77] NEFDeviceTriggerCancellation,
    nEFdeviceTriggerReportNotify                        [78] NEFDeviceTriggerReportNotify,
    nEFMSISDNLessMOSMS                                  [79] NEFMSISDNLessMOSMS,
    nEFExpectedUEBehaviourUpdate                        [80] NEFExpectedUEBehaviourUpdate
    nEFExpectedUEBehaviourUpdate                        [80] NEFExpectedUEBehaviourUpdate,

    -- SCEF services related events, see clause 7.Y.2
    sCEFPDNConnectionEstablishment                      [81] SCEFPDNConnectionEstablishment,
@@ -144,7 +144,7 @@ XIRIEvent ::= CHOICE
    sCEFdeviceTriggerCancellation                       [88] SCEFDeviceTriggerCancellation,
    sCEFdeviceTriggerReportNotify                       [89] SCEFDeviceTriggerReportNotify,
    sCEFMSISDNLessMOSMS                                 [90] SCEFMSISDNLessMOSMS,
    sCEFCommunicationPatternUpdate                      [91] SCEFCommunicationPatternUpdate
    sCEFCommunicationPatternUpdate                      [91] SCEFCommunicationPatternUpdate,

    --EPS Events, see clause 6.3

@@ -278,7 +278,7 @@ IRIEvent ::= CHOICE
    nEFdeviceTriggerCancellation                        [77] NEFDeviceTriggerCancellation,
    nEFdeviceTriggerReportNotify                        [78] NEFDeviceTriggerReportNotify,
    nEFMSISDNLessMOSMS                                  [79] NEFMSISDNLessMOSMS,
    nEFExpectedUEBehaviourUpdate                        [80] NEFExpectedUEBehaviourUpdate
    nEFExpectedUEBehaviourUpdate                        [80] NEFExpectedUEBehaviourUpdate,
    
    -- SCEF services related events, see clause 7.Y.2
    sCEFPDNConnectionEstablishment                      [81] SCEFPDNConnectionEstablishment,
@@ -291,7 +291,7 @@ IRIEvent ::= CHOICE
    sCEFdeviceTriggerCancellation                       [88] SCEFDeviceTriggerCancellation,
    sCEFdeviceTriggerReportNotify                       [89] SCEFDeviceTriggerReportNotify,
    sCEFMSISDNLessMOSMS                                 [90] SCEFMSISDNLessMOSMS,
    sCEFCommunicationPatternUpdate                      [91] SCEFCommunicationPatternUpdate
    sCEFCommunicationPatternUpdate                      [91] SCEFCommunicationPatternUpdate,
    
    --EPS Events, see clause 6.3

@@ -814,113 +814,6 @@ EPSBearerID ::= INTEGER (0..255)

APN ::= UTF8String

-- ==========================
-- Common SCEF/NEF parameters
-- ==========================

RDSSupport ::= BOOLEAN

RDSPortNumber ::= INTEGER (0..15)

RDSAction ::= ENUMERATED
{
    reservePort(1),
    releasePort(2)
}

SerializationFormat ::= ENUMERATED
{
    xml(1),
    json(2),
    cbor(3)
}

ApplicationID ::= OCTET STRING

NIDDCCPDU ::= OCTET STRING

TriggerID ::= UTF8String

PriorityDT ::= ENUMERATED
{
    noPriority(1),
    priority(2)
}

TriggerPayload ::= OCTET STRING

DeviceTriggerDeliveryResult ::= ENUMERATED
{
    success(1),
    unknown(2),
    failure(3),
    triggered(4),
    expired(5),
    unconfirmed(6),
    replaced(7),
    terminate(8)
}

StationaryIndication ::= ENUMERATED
{
    stationary(1),
    mobile(2)
}

BatteryIndication ::= ENUMERATED
{
    batteryRecharge(1),
    batteryReplace(2),
    batteryNoRecharge(3),
    batteryNoReplace(4),
    noBattery(5)
}

ScheduledCommunicationTime ::= SEQUENCE
{
    days [1] SEQUENCE OF Daytime
}

UMTLocationArea5G ::= SEQUENCE
{
    timeOfDay        [1] Daytime,
    durationSec      [2] INTEGER,
    location         [3] NRLocation
}

Daytime ::= SEQUENCE
{
    daysOfWeek       [1] Day OPTIONAL,
    timeOfDayStart   [2] Timestamp OPTIONAL,
    timeOfDayEnd     [3] Timestamp OPTIONAL
}

Day ::= ENUMERATED
{
    monday(1),
    tuesday(2),
    wednesday(3),
    thursday(4),
    friday(5),
    saturday(6),
    sunday(7)
}

TrafficProfile ::= ENUMERATED
{
    singleTransUL(1),
    singleTransDL(2),
    dualTransULFirst(3),
    dualTransDLFirst(4),
    multiTrans(5)
}

ScheduledCommunicationType ::= ENUMERATED
{
    downlinkOnly(1),
    uplinkOnly(2),
    bidirectional(3)
}

-- ==================
-- 5G AMF definitions
@@ -989,9 +882,9 @@ AMFStartOfInterceptionWithRegisteredUE ::= SEQUENCE
    non3GPPAccessEndpoint       [10] UEEndpointAddress OPTIONAL,
    timeOfRegistration          [11] Timestamp OPTIONAL,
    fiveGSTAIList               [12] TAIList OPTIONAL,
    sMSOverNASIndicator         [12] SMSOverNASIndicator OPTIONAL,
    oldGUTI                     [13] EPS5GGUTI OPTIONAL,
    eMM5GRegStatus              [14] EMM5GMMStatus OPTIONAL
    sMSOverNASIndicator         [13] SMSOverNASIndicator OPTIONAL,
    oldGUTI                     [14] EPS5GGUTI OPTIONAL,
    eMM5GRegStatus              [15] EMM5GMMStatus OPTIONAL
}

-- See clause 6.2.2.2.6 for details of this structure
+2 −4
Original line number Diff line number Diff line
import logging

logging.basicConfig(level=logging.INFO)
import glob
import sys
from pathlib import Path
@@ -60,9 +60,7 @@ def ValidateXSDFiles (fileList):


def ValidateAllXSDFilesInPath (path):
    globPattern = str(Path(path)) + '/*.xsd'
    logging.info("Searching: " + globPattern)
    schemaGlob = glob.glob(globPattern, recursive=True)
    schemaGlob = [str(f) for f in Path(path).rglob("*.xsd")]
    return ValidateXSDFiles(schemaGlob)


+790 −0

File added.

Preview size limit exceeded, changes collapsed.

+239 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://uri.etsi.org/03280/common/2017/07" targetNamespace="http://uri.etsi.org/03280/common/2017/07" version="2.4.1" elementFormDefault="qualified">
    <xs:simpleType name="ShortString">
        <xs:restriction base="xs:string">
            <xs:maxLength value="255"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="LongString">
        <xs:restriction base="xs:string">
            <xs:maxLength value="65535"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="LIID">
        <xs:restriction base="xs:normalizedString">
            <xs:pattern value="([!-~]{1,25})|([0-9a-f]{26,50})"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="UTCDateTime">
        <xs:restriction base="xs:dateTime">
            <xs:pattern value="[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="UTCMicrosecondDateTime">
        <xs:restriction base="xs:dateTime">
            <xs:pattern value="[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{6}Z"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="QualifiedDateTime">
        <xs:restriction base="xs:dateTime">
            <xs:pattern value="[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(Z|[+-][0-9]{2}:[0-9]{2})"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="QualifiedMicrosecondDateTime">
        <xs:restriction base="xs:dateTime">
            <xs:pattern value="[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{6}(Z|[+-][0-9]{2}:[0-9]{2})"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="InternationalE164">
        <xs:restriction base="xs:token">
            <xs:pattern value="[0-9]{1,15}"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="IMSI">
        <xs:restriction base="xs:token">
            <xs:pattern value="[0-9]{6,15}"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="IMEI">
        <xs:restriction base="xs:token">
            <xs:pattern value="[0-9]{14}"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="IMEICheckDigit">
        <xs:restriction base="xs:token">
            <xs:pattern value="[0-9]{15}"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="IMEISV">
        <xs:restriction base="xs:token">
            <xs:pattern value="[0-9]{16}"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="IPv4Address">
        <xs:restriction base="xs:token">
            <xs:pattern value="((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="IPv4CIDR">
        <xs:restriction base="xs:token">
            <xs:pattern value="((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])/([1-2]?[0-9]|3[0-2])"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="IPv6Address">
        <xs:restriction base="xs:token">
            <xs:pattern value="([0-9a-f]{4}:){7}([0-9a-f]{4})"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="IPv6CIDR">
        <xs:restriction base="xs:token">
            <xs:pattern value="([0-9a-f]{4}:){7}([0-9a-f]{4})/(([1-9][0-9]?)|(1[0-1][0-9])|(12[0-8]))"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:complexType name="IPAddress">
        <xs:choice>
            <xs:element name="IPv4Address" type="IPv4Address"/>
            <xs:element name="IPv6Address" type="IPv6Address"/>
        </xs:choice>
    </xs:complexType>
    <xs:complexType name="IPCIDR">
        <xs:choice>
            <xs:element name="IPv4CIDR" type="IPv4CIDR"/>
            <xs:element name="IPv6CIDR" type="IPv6CIDR"/>
        </xs:choice>
    </xs:complexType>
    <xs:simpleType name="TCPPort">
        <xs:restriction base="xs:integer">
            <xs:minExclusive value="1"/>
            <xs:maxInclusive value="65535"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:complexType name="TCPPortRange">
        <xs:sequence>
            <xs:element name="start" type="TCPPort"/>
            <xs:element name="end" type="TCPPort"/>
        </xs:sequence>
    </xs:complexType>
    <xs:simpleType name="UDPPort">
        <xs:restriction base="xs:integer">
            <xs:minInclusive value="0"/>
            <xs:maxInclusive value="65535"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:complexType name="UDPPortRange">
        <xs:sequence>
            <xs:element name="start" type="UDPPort"/>
            <xs:element name="end" type="UDPPort"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Port">
        <xs:choice>
            <xs:element name="TCPPort" type="TCPPort"/>
            <xs:element name="UDPPort" type="UDPPort"/>
        </xs:choice>
    </xs:complexType>
    <xs:complexType name="PortRange">
        <xs:choice>
            <xs:element name="TCPPortRange" type="TCPPortRange"/>
            <xs:element name="UDPPortRange" type="UDPPortRange"/>
        </xs:choice>
    </xs:complexType>
    <xs:complexType name="IPAddressPort">
        <xs:sequence>
            <xs:element name="address" type="IPAddress"/>
            <xs:element name="port" type="Port"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="IPAddressPortRange">
        <xs:sequence>
            <xs:element name="address" type="IPAddress"/>
            <xs:element name="portRange" type="PortRange"/>
        </xs:sequence>
    </xs:complexType>
    <xs:simpleType name="MACAddress">
        <xs:restriction base="xs:token">
            <xs:pattern value="([a-f0-9]{2}:){5}[a-f0-9]{2}"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="EmailAddress">
        <xs:restriction base="ShortString">
            <xs:pattern value="[a-zA-Z0-9\.!#$%&amp;'\*\+\\/=\?\^_`\{\|\}~\-]+@[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="UUID">
        <xs:restriction base="xs:token">
            <xs:pattern value="[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="ISOCountryCode">
        <xs:restriction base="xs:token">
            <xs:pattern value="[A-Z]{2}"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="SIPURI">
        <xs:restriction base="xs:anyURI">
            <xs:pattern value="sips?:[a-zA-Z0-9!#$&amp;-;=?-\[\]_~%]+"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TELURI">
        <xs:restriction base="xs:anyURI">
            <xs:pattern value="tel:[a-zA-Z0-9!#$&amp;-;=?-\[\]_~%]+"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:complexType name="WGS84CoordinateDecimal">
        <xs:sequence>
            <xs:element name="latitude" type="WGS84LatitudeDecimal"/>
            <xs:element name="longitude" type="WGS84LongitudeDecimal"/>
        </xs:sequence>
    </xs:complexType>
    <xs:simpleType name="WGS84LatitudeDecimal">
        <xs:restriction base="xs:string">
            <xs:pattern value="[NS][0-9]{2}\.[0-9]{6}"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="WGS84LongitudeDecimal">
        <xs:restriction base="xs:string">
            <xs:pattern value="[EW][0-9]{3}\.[0-9]{6}"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:complexType name="WGS84CoordinateAngular">
        <xs:sequence>
            <xs:element name="latitude" type="WGS84LatitudeAngular"/>
            <xs:element name="longitude" type="WGS84LongitudeAngular"/>
        </xs:sequence>
    </xs:complexType>
    <xs:simpleType name="WGS84LatitudeAngular">
        <xs:restriction base="xs:string">
            <xs:pattern value="[NS][0-9]{6}\.[0-9]{2}"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="WGS84LongitudeAngular">
        <xs:restriction base="xs:string">
            <xs:pattern value="[EW][0-9]{7}\.[0-9]{2}"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="SUPIIMSI">
        <xs:restriction base="IMSI"/>
    </xs:simpleType>
    <xs:simpleType name="SUPINAI">
        <xs:restriction base="NAI"/>
    </xs:simpleType>
    <xs:simpleType name="SUCI">
        <xs:restriction base="xs:hexBinary"/>
    </xs:simpleType>
    <xs:simpleType name="PEIIMEI">
        <xs:restriction base="IMEI"/>
    </xs:simpleType>
    <xs:simpleType name="PEIIMEICheckDigit">
        <xs:restriction base="IMEICheckDigit"/>
    </xs:simpleType>
    <xs:simpleType name="PEIIMEISV">
        <xs:restriction base="IMEISV"/>
    </xs:simpleType>
     <xs:simpleType name="GPSIMSISDN">
        <xs:restriction base="xs:token">
            <xs:pattern value="[0-9]{1,15}"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="GPSINAI">
        <xs:restriction base="NAI"/>
    </xs:simpleType>
    <xs:simpleType name="NAI">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>
    <xs:simpleType name="LDID">
        <xs:restriction base="xs:string">
            <xs:pattern value="([A-Z]{2}-.+-.+)"/>
        </xs:restriction>
    </xs:simpleType>
</xs:schema>