Source code for pcapkit.const.mh.enumerating_algorithm
# -*- coding: utf-8 -*-# pylint: disable=line-too-long,consider-using-f-string"""Enumerating Algorithms============================.. module:: pcapkit.const.mh.enumerating_algorithmThis module contains the constant enumeration for **Enumerating Algorithms**,which is automatically generated from :class:`pcapkit.vendor.mh.enumerating_algorithm.EnumeratingAlgorithm`."""fromaenumimportIntEnum,extend_enum__all__=['EnumeratingAlgorithm']
[docs]classEnumeratingAlgorithm(IntEnum):"""[EnumeratingAlgorithm] Enumerating Algorithms"""#: Reserved (not available for assignment) [:rfc:`4285`]Reserved_0=0#: HMAC_SHA1_SPI [:rfc:`4285`]HMAC_SHA1_SPI=3#: Reserved for use by 3GPP2 [:rfc:`4285`]Reserved_for_use_by_3GPP2=5@staticmethoddefget(key:'int | str',default:'int'=-1)->'EnumeratingAlgorithm':"""Backport support for original codes. Args: key: Key to get enum item. default: Default value if not found. :meta private: """ifisinstance(key,int):returnEnumeratingAlgorithm(key)ifkeynotinEnumeratingAlgorithm._member_map_:# pylint: disable=no-memberreturnextend_enum(EnumeratingAlgorithm,key,default)returnEnumeratingAlgorithm[key]# type: ignore[misc]
[docs]@classmethoddef_missing_(cls,value:'int')->'EnumeratingAlgorithm':"""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)