Source code for pcapkit.const.mh.dsmip6_tls_packet
# -*- coding: utf-8 -*-# pylint: disable=line-too-long,consider-using-f-string"""DSMIP6-TLS Packet Types Registry======================================.. module:: pcapkit.const.mh.dsmip6_tls_packetThis module contains the constant enumeration for **DSMIP6-TLS Packet Types Registry**,which is automatically generated from :class:`pcapkit.vendor.mh.dsmip6_tls_packet.DSMIP6TLSPacket`."""fromaenumimportIntEnum,extend_enum__all__=['DSMIP6TLSPacket']
[docs]classDSMIP6TLSPacket(IntEnum):"""[DSMIP6TLSPacket] DSMIP6-TLS Packet Types Registry"""#: non-encrypted IP packet [:rfc:`6618`]non_encrypted_IP_packet=0#: encrypted IP packet [:rfc:`6618`]encrypted_IP_packet=1#: mobility header [:rfc:`6618`]mobility_header=8@staticmethoddefget(key:'int | str',default:'int'=-1)->'DSMIP6TLSPacket':"""Backport support for original codes. Args: key: Key to get enum item. default: Default value if not found. :meta private: """ifisinstance(key,int):returnDSMIP6TLSPacket(key)ifkeynotinDSMIP6TLSPacket._member_map_:# pylint: disable=no-memberreturnextend_enum(DSMIP6TLSPacket,key,default)returnDSMIP6TLSPacket[key]# type: ignore[misc]
[docs]@classmethoddef_missing_(cls,value:'int')->'DSMIP6TLSPacket':"""Lookup function used when value is not found. Args: value: Value to get enum item. """ifnot(isinstance(value,int)and0<=value<=15):raiseValueError('%r is not a valid %s'%(value,cls.__name__))if2<=value<=7:#: Unassignedreturnextend_enum(cls,'Unassigned_%d'%value,value)if9<=value<=15:#: Unassignedreturnextend_enum(cls,'Unassigned_%d'%value,value)returnsuper()._missing_(value)