# -*- coding: utf-8 -*-# pylint: disable=line-too-long,consider-using-f-string"""CGA Extension Type Values===============================.. module:: pcapkit.const.mh.cga_extensionThis module contains the constant enumeration for **CGA Extension Type Values**,which is automatically generated from :class:`pcapkit.vendor.mh.cga_extension.CGAExtension`."""fromaenumimportIntEnum,extend_enum__all__=['CGAExtension']
[docs]classCGAExtension(IntEnum):"""[CGAExtension] CGA Extension Type Values"""#: Multi-Prefix [:rfc:`5535`]Multi_Prefix=0x0012#: Exp_FFFD (experimental) [:rfc:`4581`]Exp_FFFD=0xFFFD#: Exp_FFFE (experimental) [:rfc:`4581`]Exp_FFFE=0xFFFE#: Exp_FFFF (experimental) [:rfc:`4581`]Exp_FFFF=0xFFFF@staticmethoddefget(key:'int | str',default:'int'=-1)->'CGAExtension':"""Backport support for original codes. Args: key: Key to get enum item. default: Default value if not found. :meta private: """ifisinstance(key,int):returnCGAExtension(key)ifkeynotinCGAExtension._member_map_:# pylint: disable=no-memberreturnextend_enum(CGAExtension,key,default)returnCGAExtension[key]# type: ignore[misc]
[docs]@classmethoddef_missing_(cls,value:'int')->'CGAExtension':"""Lookup function used when value is not found. Args: value: Value to get enum item. """ifnot(isinstance(value,int)and0<=value<=0xFFFF):raiseValueError('%r is not a valid %s'%(value,cls.__name__))if0x0000<=value<=0x0011:#: Unassignedreturnextend_enum(cls,'Unassigned_%04x'%value,value)if0x0013<=value<=0xFFFC:#: Unassignedreturnextend_enum(cls,'Unassigned_%04x'%value,value)#: Unspecified in the IANA registryreturnextend_enum(cls,'Unassigned_%04x'%value,value)