# -*- coding: utf-8 -*-# pylint: disable=line-too-long,consider-using-f-string"""Verdict Types===================.. module:: pcapkit.const.pcapng.verdict_typeThis module contains the constant enumeration for **Verdict Types**,which is automatically generated from :class:`pcapkit.vendor.pcapng.verdict_type.VerdictType`."""fromaenumimportIntEnum,extend_enum__all__=['VerdictType']
[docs]classVerdictType(IntEnum):"""[VerdictType] Verdict Types"""Hardware=0Linux_eBPF_TC=1Linux_eBPF_XDP=2@staticmethoddefget(key:'int | str',default:'int'=-1)->'VerdictType':"""Backport support for original codes. Args: key: Key to get enum item. default: Default value if not found. :meta private: """ifisinstance(key,int):returnVerdictType(key)ifkeynotinVerdictType._member_map_:# pylint: disable=no-memberreturnextend_enum(VerdictType,key,default)returnVerdictType[key]# type: ignore[misc]
[docs]@classmethoddef_missing_(cls,value:'int')->'VerdictType':"""Lookup function used when value is not found. Args: value: Value to get enum item. """ifnot(isinstance(value,int)and0x00<=value<=0xFF):raiseValueError('%r is not a valid %s'%(value,cls.__name__))returnextend_enum(cls,'Unassigned_%d'%value,value)