# -*- coding: utf-8 -*-# pylint: disable=line-too-long,consider-using-f-string"""Status Codes (DNS Update Mobility Option)===============================================.. module:: pcapkit.const.mh.dns_status_codeThis module contains the constant enumeration for **Status Codes (DNS Update Mobility Option)**,which is automatically generated from :class:`pcapkit.vendor.mh.dns_status_code.DNSStatusCode`."""fromaenumimportIntEnum,extend_enum__all__=['DNSStatusCode']
[docs]classDNSStatusCode(IntEnum):"""[DNSStatusCode] Status Codes (DNS Update Mobility Option)"""#: DNS update performed [:rfc:`5026`]DNS_update_performed=0#: Reason unspecified [:rfc:`5026`]Reason_unspecified=128#: Administratively prohibited [:rfc:`5026`]Administratively_prohibited=129#: DNS Update Failed [:rfc:`5026`]DNS_Update_Failed=130@staticmethoddefget(key:'int | str',default:'int'=-1)->'DNSStatusCode':"""Backport support for original codes. Args: key: Key to get enum item. default: Default value if not found. :meta private: """ifisinstance(key,int):returnDNSStatusCode(key)ifkeynotinDNSStatusCode._member_map_:# pylint: disable=no-memberreturnextend_enum(DNSStatusCode,key,default)returnDNSStatusCode[key]# type: ignore[misc]
[docs]@classmethoddef_missing_(cls,value:'int')->'DNSStatusCode':"""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__))if1<=value<=127:#: Unassignedreturnextend_enum(cls,'Unassigned_%d'%value,value)if131<=value<=255:#: Unassignedreturnextend_enum(cls,'Unassigned_%d'%value,value)returnsuper()._missing_(value)