Source code for pcapkit.const.hip.registration_failure
# -*- coding: utf-8 -*-# pylint: disable=line-too-long,consider-using-f-string"""Registration Failure Types================================.. module:: pcapkit.const.hip.registration_failureThis module contains the constant enumeration for **Registration Failure Types**,which is automatically generated from :class:`pcapkit.vendor.hip.registration_failure.RegistrationFailure`."""fromaenumimportIntEnum,extend_enum__all__=['RegistrationFailure']
[docs]classRegistrationFailure(IntEnum):"""[RegistrationFailure] Registration Failure Types"""#: Registration requires additional credentials [:rfc:`8003`]Registration_requires_additional_credentials=0#: Registration type unavailable [:rfc:`8003`]Registration_type_unavailable=1#: Insufficient resources [:rfc:`8003`]Insufficient_resources=2#: Invalid certificate [:rfc:`8003`]Invalid_certificate=3#: Bad certificate [:rfc:`8003`]Bad_certificate=4#: Unsupported certificate [:rfc:`8003`]Unsupported_certificate=5#: Certificate expired [:rfc:`8003`]Certificate_expired=6#: Certificate other [:rfc:`8003`]Certificate_other=7#: Unknown CA [:rfc:`8003`]Unknown_CA=8#: Simultaneous Rendezvous and Control Relay Service usage prohibited#: [:rfc:`9028`]Simultaneous_Rendezvous_and_Control_Relay_Service_usage_prohibited=9@staticmethoddefget(key:'int | str',default:'int'=-1)->'RegistrationFailure':"""Backport support for original codes. Args: key: Key to get enum item. default: Default value if not found. :meta private: """ifisinstance(key,int):returnRegistrationFailure(key)ifkeynotinRegistrationFailure._member_map_:# pylint: disable=no-memberreturnextend_enum(RegistrationFailure,key,default)returnRegistrationFailure[key]# type: ignore[misc]
[docs]@classmethoddef_missing_(cls,value:'int')->'RegistrationFailure':"""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__))if10<=value<=200:#: Unassignedreturnextend_enum(cls,'Unassigned_%d'%value,value)if201<=value<=255:#: Reserved for Private Use [:rfc:`8003`]returnextend_enum(cls,'Reserved_for_Private_Use_%d'%value,value)returnsuper()._missing_(value)