# -*- coding: utf-8 -*-# pylint: disable=line-too-long,consider-using-f-string"""HTTP/2 Frame Type=======================.. module:: pcapkit.const.http.frameThis module contains the constant enumeration for **HTTP/2 Frame Type**,which is automatically generated from :class:`pcapkit.vendor.http.frame.Frame`."""fromaenumimportIntEnum,extend_enum__all__=['Frame']
[docs]classFrame(IntEnum):"""[Frame] HTTP/2 Frame Type"""#: ``DATA`` [:rfc:`9113#section-6.1`]DATA=0x00#: ``HEADERS`` [:rfc:`9113#section-6.2`]HEADERS=0x01#: ``PRIORITY`` [:rfc:`9113#section-6.3`]PRIORITY=0x02#: ``RST_STREAM`` [:rfc:`9113#section-6.4`]RST_STREAM=0x03#: ``SETTINGS`` [:rfc:`9113#section-6.5`]SETTINGS=0x04#: ``PUSH_PROMISE`` [:rfc:`9113#section-6.6`]PUSH_PROMISE=0x05#: ``PING`` [:rfc:`9113#section-6.7`]PING=0x06#: ``GOAWAY`` [:rfc:`9113#section-6.8`]GOAWAY=0x07#: ``WINDOW_UPDATE`` [:rfc:`9113#section-6.9`]WINDOW_UPDATE=0x08#: ``CONTINUATION`` [:rfc:`9113#section-6.10`]CONTINUATION=0x09#: ``ALTSVC`` [:rfc:`7838#section-4`]ALTSVC=0x0A#: ``Unassigned``Unassigned_0x0B=0x0B#: ``ORIGIN`` [:rfc:`8336`]ORIGIN=0x0C#: ``PRIORITY_UPDATE`` [:rfc:`9218`]PRIORITY_UPDATE=0x10@staticmethoddefget(key:'int | str',default:'int'=-1)->'Frame':"""Backport support for original codes. Args: key: Key to get enum item. default: Default value if not found. :meta private: """ifisinstance(key,int):returnFrame(key)ifkeynotinFrame._member_map_:# pylint: disable=no-memberreturnextend_enum(Frame,key,default)returnFrame[key]# type: ignore[misc]
[docs]@classmethoddef_missing_(cls,value:'int')->'Frame':"""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__))if0x0D<=value<=0x0F:#: ``Unassigned``returnextend_enum(cls,'Unassigned_0x%s'%hex(value)[2:].upper().zfill(2),value)if0x11<=value<=0xFF:#: ``Unassigned``returnextend_enum(cls,'Unassigned_0x%s'%hex(value)[2:].upper().zfill(2),value)returnsuper()._missing_(value)