Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/cron-vendor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,15 @@ jobs:

python -m pip install -U pip setuptools wheel packaging
python -m pip install -U isort
python -m pip install -e .[all]

# `all` does not carry `pycrate` -- see its own comment in
# pyproject.toml -- so `vendor` is installed alongside it
# specifically for that: `pcapkit-vendor` below regenerates every
# crawler with no target given, including pcapkit.vendor.ngap's two
# (#880), and both need `pycrate_asn1dir.NGAP` importable. See the
# `vendor` extra's own comment in pyproject.toml for the full
# reasoning (size, licence) behind installing it here at all.
python -m pip install -e .[all,vendor]

- name: Update Vendor
run: |
Expand Down
1 change: 1 addition & 0 deletions docs/source/pcapkit/const/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,4 @@ Application Layer

ftp
http
ngap
55 changes: 55 additions & 0 deletions docs/source/pcapkit/const/ngap.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
========================================================================
:class:`~pcapkit.protocols.application.ngap.NGAP` Constant Enumerations
========================================================================

.. module:: pcapkit.const.ngap

This module contains all constant enumerations of
:class:`~pcapkit.protocols.application.ngap.NGAP` implementations. Available
enumerations include:

.. list-table::

* - :class:`NGAP_ProcedureCode <pcapkit.const.ngap.procedure_code.ProcedureCode>`
- NGAP Elementary Procedure Codes [*]_
* - :class:`NGAP_ProtocolIE <pcapkit.const.ngap.protocol_ie.ProtocolIE>`
- NGAP Protocol IE Identifiers [*]_

Both are automatically generated from |pycrate|_'s compiled NGAP
specification rather than an IANA-style registry -- see
:mod:`pcapkit.vendor.ngap.procedure_code`'s module docstring for why, and
GitHub issue #880 for the ruling.

NGAP Elementary Procedure Codes
===============================

.. module:: pcapkit.const.ngap.procedure_code

This module contains the constant enumeration for **NGAP Elementary Procedure Codes**,
which is automatically generated from :class:`pcapkit.vendor.ngap.procedure_code.ProcedureCode`.

.. autoclass:: pcapkit.const.ngap.procedure_code.ProcedureCode
:members:
:undoc-members:
:show-inheritance:

NGAP Protocol IE Identifiers
=============================

.. module:: pcapkit.const.ngap.protocol_ie

This module contains the constant enumeration for **NGAP Protocol IE Identifiers**,
which is automatically generated from :class:`pcapkit.vendor.ngap.protocol_ie.ProtocolIE`.

.. autoclass:: pcapkit.const.ngap.protocol_ie.ProtocolIE
:members:
:undoc-members:
:show-inheritance:

.. rubric:: Footnotes

.. [*] 3GPP TS 38.413
.. [*] 3GPP TS 38.413

.. |pycrate| replace:: ``pycrate``
.. _pycrate: https://github.com/pycrate-org/pycrate
1 change: 1 addition & 0 deletions docs/source/pcapkit/vendor/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Application Layer

ftp
http
ngap

Command Line Tool
=================
Expand Down
52 changes: 52 additions & 0 deletions docs/source/pcapkit/vendor/ngap.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
====================================================================
:class:`~pcapkit.protocols.application.ngap.NGAP` Vendor Crawlers
====================================================================

.. module:: pcapkit.vendor.ngap

This module contains all vendor crawlers of
:class:`~pcapkit.protocols.application.ngap.NGAP` implementations. Available
vendor crawlers include:

.. list-table::

* - :class:`NGAP_ProcedureCode <pcapkit.vendor.ngap.procedure_code.ProcedureCode>`
- NGAP Elementary Procedure Codes [*]_
* - :class:`NGAP_ProtocolIE <pcapkit.vendor.ngap.protocol_ie.ProtocolIE>`
- NGAP Protocol IE Identifiers [*]_

Both source the assignment from |pycrate|_'s already-installed, compiled NGAP
specification rather than fetching a network registry -- see the module
docstring below for why, and GitHub issue #880 for the ruling.

NGAP Elementary Procedure Codes
===============================

.. module:: pcapkit.vendor.ngap.procedure_code

This module contains the vendor crawler for **NGAP Elementary Procedure Codes**,
which is automatically generating :class:`pcapkit.const.ngap.procedure_code.ProcedureCode`.

.. autoclass:: pcapkit.vendor.ngap.procedure_code.ProcedureCode
:members: FLAG, LINK
:show-inheritance:

NGAP Protocol IE Identifiers
=============================

.. module:: pcapkit.vendor.ngap.protocol_ie

This module contains the vendor crawler for **NGAP Protocol IE Identifiers**,
which is automatically generating :class:`pcapkit.const.ngap.protocol_ie.ProtocolIE`.

.. autoclass:: pcapkit.vendor.ngap.protocol_ie.ProtocolIE
:members: FLAG, LINK
:show-inheritance:

.. rubric:: Footnotes

.. [*] 3GPP TS 38.413
.. [*] 3GPP TS 38.413

.. |pycrate| replace:: ``pycrate``
.. _pycrate: https://github.com/pycrate-org/pycrate
3 changes: 3 additions & 0 deletions pcapkit/const/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from pcapkit.const.ipx import *
from pcapkit.const.l2tp import *
from pcapkit.const.mh import *
from pcapkit.const.ngap import *
from pcapkit.const.ospf import *
from pcapkit.const.sctp import *
from pcapkit.const.tcp import *
Expand Down Expand Up @@ -72,6 +73,8 @@
'MH_FlowBindingACKStatus', 'MH_FlowBindingAction', 'MH_QoSAttribute',
'MH_LMAControlledMAGSuboption', 'MH_LLACode', 'MH_CGAType',
'MH_CGAExtension', 'MH_CGASec', 'MH_BindingError',
# NGAP
'NGAP_ProcedureCode', 'NGAP_ProtocolIE',
# OSPF
'OSPF_Authentication', 'OSPF_Packet',
# SCTP
Expand Down
36 changes: 36 additions & 0 deletions pcapkit/const/ngap/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
# pylint: disable=unused-import
""":class:`~pcapkit.protocols.application.ngap.NGAP` Constant Enumerations
==============================================================================

.. module:: pcapkit.const.ngap

This module contains all constant enumerations of
:class:`~pcapkit.protocols.application.ngap.NGAP` implementations. Available
enumerations include:

.. list-table::

* - :class:`NGAP_ProcedureCode <pcapkit.const.ngap.procedure_code.ProcedureCode>`
- NGAP Elementary Procedure Codes [*]_
* - :class:`NGAP_ProtocolIE <pcapkit.const.ngap.protocol_ie.ProtocolIE>`
- NGAP Protocol IE Identifiers [*]_

Both are automatically generated from
:mod:`pcapkit.vendor.ngap.procedure_code` and
:mod:`pcapkit.vendor.ngap.protocol_ie`, which source the assignment from
|pycrate|_'s compiled NGAP specification rather than a network registry --
see that module's docstring for why, and GitHub issue #880 for the ruling.

.. [*] 3GPP TS 38.413
.. [*] 3GPP TS 38.413

.. |pycrate| replace:: ``pycrate``
.. _pycrate: https://github.com/pycrate-org/pycrate

"""

from pcapkit.const.ngap.procedure_code import ProcedureCode as NGAP_ProcedureCode
from pcapkit.const.ngap.protocol_ie import ProtocolIE as NGAP_ProtocolIE

__all__ = ['NGAP_ProcedureCode', 'NGAP_ProtocolIE']
195 changes: 195 additions & 0 deletions pcapkit/const/ngap/procedure_code.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long
"""NGAP elementary procedure codes, 3GPP TS 38.413.
======================================================

.. module:: pcapkit.const.ngap.procedure_code

This module contains the constant enumeration for **NGAP elementary procedure codes, 3GPP TS 38.413.**,
which is automatically generated from :class:`pcapkit.vendor.ngap.procedure_code.ProcedureCode`.

"""

from aenum import IntEnum

from pcapkit.corekit.enum import EnumRegistry

__all__ = ['ProcedureCode']


class ProcedureCode(EnumRegistry, IntEnum):
"""[ProcedureCode] NGAP elementary procedure codes, 3GPP TS 38.413."""

AMFConfigurationUpdate = 0

AMFStatusIndication = 1

CellTrafficTrace = 2

DeactivateTrace = 3

DownlinkNASTransport = 4

DownlinkNonUEAssociatedNRPPaTransport = 5

DownlinkRANConfigurationTransfer = 6

DownlinkRANStatusTransfer = 7

DownlinkUEAssociatedNRPPaTransport = 8

ErrorIndication = 9

HandoverCancel = 10

HandoverNotification = 11

HandoverPreparation = 12

HandoverResourceAllocation = 13

InitialContextSetup = 14

InitialUEMessage = 15

LocationReportingControl = 16

LocationReportingFailureIndication = 17

LocationReport = 18

NASNonDeliveryIndication = 19

NGReset = 20

NGSetup = 21

OverloadStart = 22

OverloadStop = 23

Paging = 24

PathSwitchRequest = 25

PDUSessionResourceModify = 26

PDUSessionResourceModifyIndication = 27

PDUSessionResourceRelease = 28

PDUSessionResourceSetup = 29

PDUSessionResourceNotify = 30

PrivateMessage = 31

PWSCancel = 32

PWSFailureIndication = 33

PWSRestartIndication = 34

RANConfigurationUpdate = 35

RerouteNASRequest = 36

RRCInactiveTransitionReport = 37

TraceFailureIndication = 38

TraceStart = 39

UEContextModification = 40

UEContextRelease = 41

UEContextReleaseRequest = 42

UERadioCapabilityCheck = 43

UERadioCapabilityInfoIndication = 44

UETNLABindingRelease = 45

UplinkNASTransport = 46

UplinkNonUEAssociatedNRPPaTransport = 47

UplinkRANConfigurationTransfer = 48

UplinkRANStatusTransfer = 49

UplinkUEAssociatedNRPPaTransport = 50

WriteReplaceWarning = 51

SecondaryRATDataUsageReport = 52

UplinkRIMInformationTransfer = 53

DownlinkRIMInformationTransfer = 54

RetrieveUEInformation = 55

UEInformationTransfer = 56

RANCPRelocationIndication = 57

UEContextResume = 58

UEContextSuspend = 59

UERadioCapabilityIDMapping = 60

HandoverSuccess = 61

UplinkRANEarlyStatusTransfer = 62

DownlinkRANEarlyStatusTransfer = 63

AMFCPRelocationIndication = 64

ConnectionEstablishmentIndication = 65

BroadcastSessionModification = 66

BroadcastSessionRelease = 67

BroadcastSessionSetup = 68

DistributionSetup = 69

DistributionRelease = 70

MulticastSessionActivation = 71

MulticastSessionDeactivation = 72

MulticastSessionUpdate = 73

MulticastGroupPaging = 74

BroadcastSessionReleaseRequired = 75

TimingSynchronisationStatus = 76

TimingSynchronisationStatusReport = 77

MTCommunicationHandling = 78

RANPagingRequest = 79

BroadcastSessionTransport = 80

@classmethod
def _missing_(cls, value: 'int') -> 'ProcedureCode':
"""Lookup function used when value is not found.

Args:
value: Value to get enum item.

"""
if not (isinstance(value, int) and 0 <= value <= 255):
raise ValueError('%r is not a valid %s' % (value, cls.__name__))
return cls._unregistered_member(value, 'Unassigned')
Loading
Loading