# -*- coding: utf-8 -*-# pylint: disable=line-too-long,consider-using-f-string"""Authentication Types==========================.. module:: pcapkit.const.ospf.authenticationThis module contains the constant enumeration for **Authentication Types**,which is automatically generated from :class:`pcapkit.vendor.ospf.authentication.Authentication`."""fromaenumimportIntEnum,extend_enum__all__=['Authentication']
[docs]classAuthentication(IntEnum):"""[Authentication] Authentication Types"""#: No Authentication [:rfc:`1583`]No_Authentication=0#: Simple Password Authentication [:rfc:`1583`]Simple_Password_Authentication=1#: Cryptographic authentication [:rfc:`2328`][:rfc:`5709`]Cryptographic_authentication=2#: Cryptographic Authentication with Extended Sequence Numbers [:rfc:`7474`]Cryptographic_Authentication_with_Extended_Sequence_Numbers=3@staticmethoddefget(key:'int | str',default:'int'=-1)->'Authentication':"""Backport support for original codes. Args: key: Key to get enum item. default: Default value if not found. :meta private: """ifisinstance(key,int):returnAuthentication(key)ifkeynotinAuthentication._member_map_:# pylint: disable=no-memberreturnextend_enum(Authentication,key,default)returnAuthentication[key]# type: ignore[misc]
[docs]@classmethoddef_missing_(cls,value:'int')->'Authentication':"""Lookup function used when value is not found. Args: value: Value to get enum item. """ifnot(isinstance(value,int)and0<=value<=65535):raiseValueError('%r is not a valid %s'%(value,cls.__name__))if4<=value<=255:#: Unassignedreturnextend_enum(cls,'Unassigned_%d'%value,value)if256<=value<=65535:#: Deprecated [:rfc:`6549`]returnextend_enum(cls,'Deprecated_%d'%value,value)returnsuper()._missing_(value)