# -*- coding: utf-8 -*-# pylint: disable=line-too-long,consider-using-f-string"""IPX Packet Types======================.. module:: pcapkit.const.ipx.packetThis module contains the constant enumeration for **IPX Packet Types**,which is automatically generated from :class:`pcapkit.vendor.ipx.packet.Packet`."""fromaenumimportIntEnum,extend_enum__all__=['Packet']
[docs]classPacket(IntEnum):"""[Packet] IPX Packet Types"""#: UnknownUnknown=0#: ``RIP``, Routing Information Protocol ([:rfc:`1582`], [:rfc:`2091`])RIP=1#: Echo PacketEcho_Packet=2#: Error PacketError_Packet=3#: ``PEP``, Packet Exchange Protocol, used for SAP (Service Advertising#: Protocol)PEP=4#: ``SPX``, Sequenced Packet ExchangeSPX=5#: ``NCP``, NetWare Core ProtocolNCP=17#: Broadcast[4]Broadcast_4=20@staticmethoddefget(key:'int | str',default:'int'=-1)->'Packet':"""Backport support for original codes. Args: key: Key to get enum item. default: Default value if not found. :meta private: """ifisinstance(key,int):returnPacket(key)ifkeynotinPacket._member_map_:# pylint: disable=no-memberreturnextend_enum(Packet,key,default)returnPacket[key]# type: ignore[misc]
[docs]@classmethoddef_missing_(cls,value:'int')->'Packet':"""Lookup function used when value is not found. Args: value: Value to get enum item. """ifnot(isinstance(value,int)and0<=value<=255):raiseValueError('%r is not a valid %s'%(value,cls.__name__))returnextend_enum(cls,'Unassigned_%d'%value,value)