From e1b12214c404c0be7608771422a0531d4fa6a456 Mon Sep 17 00:00:00 2001 From: Jarry Shaw Date: Tue, 26 Feb 2019 10:10:47 +0800 Subject: [PATCH] New distribution [0.13.3] - fixed minor bugs in const for number literal incompatibility with Python 3.5 --- release | 2 +- src/const/http/error_code.py | 30 +++++++++++++++--------------- src/const/misc/linktype.py | 2 ++ testbench/rc:protocols | 2 +- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/release b/release index 7df647ee8..f4c69b905 160000 --- a/release +++ b/release @@ -1 +1 @@ -Subproject commit 7df647ee825196361f96ac996fa6d4fc29dba596 +Subproject commit f4c69b905aef88ca4dc79375e54887bab694919e diff --git a/src/const/http/error_code.py b/src/const/http/error_code.py index 1c3d1d3fc..7aa28341e 100644 --- a/src/const/http/error_code.py +++ b/src/const/http/error_code.py @@ -9,20 +9,20 @@ class ErrorCode(IntEnum): ErrorCode = vars() # HTTP/2 Error Code - ErrorCode['NO_ERROR'] = 0x0000_0000 # [RFC 7540, Section 7] Graceful shutdown - ErrorCode['PROTOCOL_ERROR'] = 0x0000_0001 # [RFC 7540, Section 7] Protocol error detected - ErrorCode['INTERNAL_ERROR'] = 0x0000_0002 # [RFC 7540, Section 7] Implementation fault - ErrorCode['FLOW_CONTROL_ERROR'] = 0x0000_0003 # [RFC 7540, Section 7] Flow-control limits exceeded - ErrorCode['SETTINGS_TIMEOUT'] = 0x0000_0004 # [RFC 7540, Section 7] Settings not acknowledged - ErrorCode['STREAM_CLOSED'] = 0x0000_0005 # [RFC 7540, Section 7] Frame received for closed stream - ErrorCode['FRAME_SIZE_ERROR'] = 0x0000_0006 # [RFC 7540, Section 7] Frame size incorrect - ErrorCode['REFUSED_STREAM'] = 0x0000_0007 # [RFC 7540, Section 7] Stream not processed - ErrorCode['CANCEL'] = 0x0000_0008 # [RFC 7540, Section 7] Stream cancelled - ErrorCode['COMPRESSION_ERROR'] = 0x0000_0009 # [RFC 7540, Section 7] Compression state not updated - ErrorCode['CONNECT_ERROR'] = 0x0000_000A # [RFC 7540, Section 7] TCP connection error for CONNECT method - ErrorCode['ENHANCE_YOUR_CALM'] = 0x0000_000B # [RFC 7540, Section 7] Processing capacity exceeded - ErrorCode['INADEQUATE_SECURITY'] = 0x0000_000C # [RFC 7540, Section 7] Negotiated TLS parameters not acceptable - ErrorCode['HTTP_1_1_REQUIRED'] = 0x0000_000D # [RFC 7540, Section 7] Use HTTP/1.1 for the request + ErrorCode['NO_ERROR'] = 0x00000000 # [RFC 7540, Section 7] Graceful shutdown + ErrorCode['PROTOCOL_ERROR'] = 0x00000001 # [RFC 7540, Section 7] Protocol error detected + ErrorCode['INTERNAL_ERROR'] = 0x00000002 # [RFC 7540, Section 7] Implementation fault + ErrorCode['FLOW_CONTROL_ERROR'] = 0x00000003 # [RFC 7540, Section 7] Flow-control limits exceeded + ErrorCode['SETTINGS_TIMEOUT'] = 0x00000004 # [RFC 7540, Section 7] Settings not acknowledged + ErrorCode['STREAM_CLOSED'] = 0x00000005 # [RFC 7540, Section 7] Frame received for closed stream + ErrorCode['FRAME_SIZE_ERROR'] = 0x00000006 # [RFC 7540, Section 7] Frame size incorrect + ErrorCode['REFUSED_STREAM'] = 0x00000007 # [RFC 7540, Section 7] Stream not processed + ErrorCode['CANCEL'] = 0x00000008 # [RFC 7540, Section 7] Stream cancelled + ErrorCode['COMPRESSION_ERROR'] = 0x00000009 # [RFC 7540, Section 7] Compression state not updated + ErrorCode['CONNECT_ERROR'] = 0x0000000A # [RFC 7540, Section 7] TCP connection error for CONNECT method + ErrorCode['ENHANCE_YOUR_CALM'] = 0x0000000B # [RFC 7540, Section 7] Processing capacity exceeded + ErrorCode['INADEQUATE_SECURITY'] = 0x0000000C # [RFC 7540, Section 7] Negotiated TLS parameters not acceptable + ErrorCode['HTTP_1_1_REQUIRED'] = 0x0000000D # [RFC 7540, Section 7] Use HTTP/1.1 for the request @staticmethod def get(key, default=-1): @@ -38,7 +38,7 @@ def _missing_(cls, value): """Lookup function used when value is not found.""" if not (isinstance(value, int) and 0x0000_0000 <= value <= 0xFFFF_FFFF): raise ValueError('%r is not a valid %s' % (value, cls.__name__)) - if 0x0000_000E <= value <= 0xFFFF_FFFF: + if 0x0000000E <= value <= 0xFFFFFFFF: temp = hex(value)[2:].upper().zfill(8) extend_enum(cls, 'Unassigned [0x%s]' % (temp[:4]+'_'+temp[4:]), value) return cls(value) diff --git a/src/const/misc/linktype.py b/src/const/misc/linktype.py index 736ffae86..78d7ed849 100644 --- a/src/const/misc/linktype.py +++ b/src/const/misc/linktype.py @@ -128,6 +128,8 @@ class LinkType(IntEnum): LinkType['OPENVIZSLA'] = 278 # DLT_OPENVIZSLA LinkType['EBHSCR'] = 279 # DLT_EBHSCR LinkType['VPP_DISPATCH'] = 280 # DLT_VPP_DISPATCH + LinkType['DSA_TAG_BRCM'] = 281 # DLT_DSA_TAG_BRCM + LinkType['DSA_TAG_BRCM_PREPEND'] = 282 # DLT_DSA_TAG_BRCM_PREPEND @staticmethod def get(key, default=-1): diff --git a/testbench/rc:protocols b/testbench/rc:protocols index 3a7590c4a..449fa2844 160000 --- a/testbench/rc:protocols +++ b/testbench/rc:protocols @@ -1 +1 @@ -Subproject commit 3a7590c4aefcf16a7613f19d30b2000bdfc8c8a5 +Subproject commit 449fa28449115a41b1ad0624c1830bcc0916f654