pycrate/pycrate_mobile/TS24501_IE.py

88 lines
2.7 KiB
Python
Raw Normal View History

2019-11-08 15:11:02 +00:00
# -*- coding: UTF-8 -*-
#/**
# * Software Name : pycrate
# * Version : 0.4
# *
# * Copyright 2019. Benoit Michau. P1Sec.
# *
# * This library is free software; you can redistribute it and/or
# * modify it under the terms of the GNU Lesser General Public
# * License as published by the Free Software Foundation; either
# * version 2.1 of the License, or (at your option) any later version.
# *
# * This library is distributed in the hope that it will be useful,
# * but WITHOUT ANY WARRANTY; without even the implied warranty of
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# * Lesser General Public License for more details.
# *
# * You should have received a copy of the GNU Lesser General Public
# * License along with this library; if not, write to the Free Software
# * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# * MA 02110-1301 USA
# *
# *--------------------------------------------------------
# * File Name : pycrate_mobile/TS24501_IE.py
# * Created : 2019-11-08
# * Authors : Benoit Michau
# *--------------------------------------------------------
#*/
#------------------------------------------------------------------------------#
# 3GPP TS 24.501: NAS protocol for 5G
# release 16 (g20)
#------------------------------------------------------------------------------#
from pycrate_core.utils import *
from pycrate_core.elt import (
Envelope, Sequence, Array,
REPR_RAW, REPR_HEX, REPR_BIN, REPR_HD, REPR_HUM
)
from pycrate_core.base import *
from pycrate_core.repr import *
from pycrate_core.charpy import Charpy
from pycrate_mobile.TS24008_IE import (
BufBCD
)
#------------------------------------------------------------------------------#
# UE status
# TS 24.501, 9.11.3.56
#------------------------------------------------------------------------------#
class UEStatus(Envelope):
_GEN = (
Uint('spare', bl=6),
Uint('N1ModeReg', bl=1),
Uint('S1ModeReg', bl=1)
)
#------------------------------------------------------------------------------#
# UE radio capability ID
# TS 24.501, 9.11.3.68
#------------------------------------------------------------------------------#
class UERadioCapID(BufBCD):
pass
#------------------------------------------------------------------------------#
# UE radio capability ID deletion indication
# TS 24.501, 9.11.3.69
#------------------------------------------------------------------------------#
_DelRequest_dict = {
0 : 'UE radio capability ID deletion not requested',
1 : 'Network-assigned UE radio capability IDs deletion requested'
}
class UERadioCapIDDelInd(Envelope):
_GEN = (
Uint('spare', bl=1),
Uint('DelRequest', bl=3, dic=_DelRequest_dict)
)