# -*- coding: utf-8 -*-# pylint: disable=line-too-long,consider-using-f-string"""Traffic Selector Format=============================.. module:: pcapkit.const.mh.traffic_selectorThis module contains the constant enumeration for **Traffic Selector Format**,which is automatically generated from :class:`pcapkit.vendor.mh.traffic_selector.TrafficSelector`."""fromaenumimportIntEnum,extend_enum__all__=['TrafficSelector']
[docs]classTrafficSelector(IntEnum):"""[TrafficSelector] Traffic Selector Format"""#: Reserved [:rfc:`6089`]Reserved_0=0#: IPv4 Binary Traffic Selector [:rfc:`6088`]IPv4_Binary_Traffic_Selector=1#: IPv6 Binary Traffic Selector [:rfc:`6088`]IPv6_Binary_Traffic_Selector=2@staticmethoddefget(key:'int | str',default:'int'=-1)->'TrafficSelector':"""Backport support for original codes. Args: key: Key to get enum item. default: Default value if not found. :meta private: """ifisinstance(key,int):returnTrafficSelector(key)ifkeynotinTrafficSelector._member_map_:# pylint: disable=no-memberreturnextend_enum(TrafficSelector,key,default)returnTrafficSelector[key]# type: ignore[misc]
[docs]@classmethoddef_missing_(cls,value:'int')->'TrafficSelector':"""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__))if3<=value<=250:#: Unassignedreturnextend_enum(cls,'Unassigned_%d'%value,value)if251<=value<=255:#: Reserved for Experimental Use [:rfc:`6089`]returnextend_enum(cls,'Reserved_for_Experimental_Use_%d'%value,value)returnsuper()._missing_(value)