Skip to content

Commit

Permalink
Regular update
Browse files Browse the repository at this point in the history
 * revised vendor (using class impl)
 * updated const correspondingly
 * updated setup.py, MANIFEST.in to add vendor to distro
 * updated Pipfile
  • Loading branch information
JarryShaw committed Aug 25, 2019
1 parent 9e07350 commit 1b11d2d
Show file tree
Hide file tree
Showing 79 changed files with 1,530 additions and 3,519 deletions.
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
{
"python.pythonPath": ".venv/bin/python",
"cSpell.words": [
"DEVMODE",
"ECDSA",
"INET",
"SIOP",
"aktau",
"bufid",
"cmmd",
"cmmt",
"distro",
"dscp",
"fileng",
"gaocegege",
"ipsuite",
"lrfc",
"plen",
"prio",
"protos",
"pval",
"pyenv",
"renm",
"srcport",
"subd",
"sufs",
"tbitem",
"tbody"
Expand Down
10 changes: 9 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@ global-exclude .DS_Store
global-include *.md
global-include *.py

prune .venv
prune archive
prune devel
prune release
prune src
prune test
prune testbench

include README.md
include LICENSE

prune pcapkit/protocols/*/NotImplemented
prune pcapkit/vendor
# prune pcapkit/vendor
12 changes: 11 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
[[source]]
url = "https://pypi.org/simple"
name = "tuna"
url = "https://pypi.tuna.tsinghua.edu.cn/simple"
verify_ssl = true

[[source]]
name = "sjtu"
url = "https://mirrors.sjtug.sjtu.edu.cn/pypi/web/simple"
verify_ssl = true

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[packages]
chardet = "*"
Expand Down
214 changes: 96 additions & 118 deletions Pipfile.lock

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@
'pcapkit.reassembly',
'pcapkit.toolkit',
'pcapkit.utilities',
'pcapkit.vendor',
'pcapkit.vendor.arp',
'pcapkit.vendor.ftp',
'pcapkit.vendor.hip',
'pcapkit.vendor.http',
'pcapkit.vendor.ipv4',
'pcapkit.vendor.ipv6',
'pcapkit.vendor.ipx',
'pcapkit.vendor.mh',
'pcapkit.vendor.misc',
'pcapkit.vendor.ospf',
'pcapkit.vendor.tcp',
'pcapkit.vendor.vlan',
],
package_data={
'': [
Expand Down
5 changes: 3 additions & 2 deletions src/const/arp/hardware.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long

from aenum import IntEnum, extend_enum

Expand Down Expand Up @@ -56,7 +57,7 @@ def get(key, default=-1):
"""Backport support for original codes."""
if isinstance(key, int):
return Hardware(key)
if key not in Hardware._member_map_:
if key not in Hardware._member_map_: # pylint: disable=no-member
extend_enum(Hardware, key, default)
return Hardware[key]

Expand All @@ -71,4 +72,4 @@ def _missing_(cls, value):
if 258 <= value <= 65534:
extend_enum(cls, 'Unassigned [%d]' % value, value)
return cls(value)
super()._missing_(value)
return super()._missing_(value)
5 changes: 3 additions & 2 deletions src/const/arp/operation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long

from aenum import IntEnum, extend_enum

Expand Down Expand Up @@ -42,7 +43,7 @@ def get(key, default=-1):
"""Backport support for original codes."""
if isinstance(key, int):
return Operation(key)
if key not in Operation._member_map_:
if key not in Operation._member_map_: # pylint: disable=no-member
extend_enum(Operation, key, default)
return Operation[key]

Expand All @@ -54,4 +55,4 @@ def _missing_(cls, value):
if 26 <= value <= 65534:
extend_enum(cls, 'Unassigned [%d]' % value, value)
return cls(value)
super()._missing_(value)
return super()._missing_(value)
1 change: 1 addition & 0 deletions src/const/ftp/command.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long

from pcapkit.corekit.infoclass import Info

Expand Down
3 changes: 2 additions & 1 deletion src/const/ftp/return_code.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long

from aenum import IntEnum, extend_enum

Expand Down Expand Up @@ -81,7 +82,7 @@ def get(key, default=-1):
"""Backport support for original codes."""
if isinstance(key, int):
return ReturnCode(key)
if key not in ReturnCode._member_map_:
if key not in ReturnCode._member_map_: # pylint: disable=no-member
extend_enum(ReturnCode, key, default)
return ReturnCode[key]

Expand Down
5 changes: 3 additions & 2 deletions src/const/hip/certificate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long

from aenum import IntEnum, extend_enum

Expand All @@ -24,7 +25,7 @@ def get(key, default=-1):
"""Backport support for original codes."""
if isinstance(key, int):
return Certificate(key)
if key not in Certificate._member_map_:
if key not in Certificate._member_map_: # pylint: disable=no-member
extend_enum(Certificate, key, default)
return Certificate[key]

Expand All @@ -36,4 +37,4 @@ def _missing_(cls, value):
if 9 <= value <= 255:
extend_enum(cls, 'Unassigned [%d]' % value, value)
return cls(value)
super()._missing_(value)
return super()._missing_(value)
5 changes: 3 additions & 2 deletions src/const/hip/cipher.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long

from aenum import IntEnum, extend_enum

Expand All @@ -20,7 +21,7 @@ def get(key, default=-1):
"""Backport support for original codes."""
if isinstance(key, int):
return Cipher(key)
if key not in Cipher._member_map_:
if key not in Cipher._member_map_: # pylint: disable=no-member
extend_enum(Cipher, key, default)
return Cipher[key]

Expand All @@ -32,4 +33,4 @@ def _missing_(cls, value):
if 5 <= value <= 65535:
extend_enum(cls, 'Unassigned [%d]' % value, value)
return cls(value)
super()._missing_(value)
return super()._missing_(value)
5 changes: 3 additions & 2 deletions src/const/hip/di.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long

from aenum import IntEnum, extend_enum

Expand All @@ -18,7 +19,7 @@ def get(key, default=-1):
"""Backport support for original codes."""
if isinstance(key, int):
return DI(key)
if key not in DI._member_map_:
if key not in DI._member_map_: # pylint: disable=no-member
extend_enum(DI, key, default)
return DI[key]

Expand All @@ -30,4 +31,4 @@ def _missing_(cls, value):
if 3 <= value <= 15:
extend_enum(cls, 'Unassigned [%d]' % value, value)
return cls(value)
super()._missing_(value)
return super()._missing_(value)
5 changes: 3 additions & 2 deletions src/const/hip/ecdsa_curve.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long

from aenum import IntEnum, extend_enum

Expand All @@ -18,7 +19,7 @@ def get(key, default=-1):
"""Backport support for original codes."""
if isinstance(key, int):
return ECDSA_Curve(key)
if key not in ECDSA_Curve._member_map_:
if key not in ECDSA_Curve._member_map_: # pylint: disable=no-member
extend_enum(ECDSA_Curve, key, default)
return ECDSA_Curve[key]

Expand All @@ -30,4 +31,4 @@ def _missing_(cls, value):
if 3 <= value <= 65535:
extend_enum(cls, 'Unassigned [%d]' % value, value)
return cls(value)
super()._missing_(value)
return super()._missing_(value)
5 changes: 3 additions & 2 deletions src/const/hip/ecdsa_low_curve.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long

from aenum import IntEnum, extend_enum

Expand All @@ -17,7 +18,7 @@ def get(key, default=-1):
"""Backport support for original codes."""
if isinstance(key, int):
return ECDSA_LOW_Curve(key)
if key not in ECDSA_LOW_Curve._member_map_:
if key not in ECDSA_LOW_Curve._member_map_: # pylint: disable=no-member
extend_enum(ECDSA_LOW_Curve, key, default)
return ECDSA_LOW_Curve[key]

Expand All @@ -29,4 +30,4 @@ def _missing_(cls, value):
if 2 <= value <= 65535:
extend_enum(cls, 'Unassigned [%d]' % value, value)
return cls(value)
super()._missing_(value)
return super()._missing_(value)
5 changes: 3 additions & 2 deletions src/const/hip/esp_transform_suite.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long

from aenum import IntEnum, extend_enum

Expand Down Expand Up @@ -31,7 +32,7 @@ def get(key, default=-1):
"""Backport support for original codes."""
if isinstance(key, int):
return ESP_TransformSuite(key)
if key not in ESP_TransformSuite._member_map_:
if key not in ESP_TransformSuite._member_map_: # pylint: disable=no-member
extend_enum(ESP_TransformSuite, key, default)
return ESP_TransformSuite[key]

Expand All @@ -43,4 +44,4 @@ def _missing_(cls, value):
if 16 <= value <= 65535:
extend_enum(cls, 'Unassigned [%d]' % value, value)
return cls(value)
super()._missing_(value)
return super()._missing_(value)
5 changes: 3 additions & 2 deletions src/const/hip/group.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long

from aenum import IntEnum, extend_enum

Expand Down Expand Up @@ -27,7 +28,7 @@ def get(key, default=-1):
"""Backport support for original codes."""
if isinstance(key, int):
return Group(key)
if key not in Group._member_map_:
if key not in Group._member_map_: # pylint: disable=no-member
extend_enum(Group, key, default)
return Group[key]

Expand All @@ -39,4 +40,4 @@ def _missing_(cls, value):
if 12 <= value <= 255:
extend_enum(cls, 'Unassigned [%d]' % value, value)
return cls(value)
super()._missing_(value)
return super()._missing_(value)
5 changes: 3 additions & 2 deletions src/const/hip/hi_algorithm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long

from aenum import IntEnum, extend_enum

Expand All @@ -25,7 +26,7 @@ def get(key, default=-1):
"""Backport support for original codes."""
if isinstance(key, int):
return HI_Algorithm(key)
if key not in HI_Algorithm._member_map_:
if key not in HI_Algorithm._member_map_: # pylint: disable=no-member
extend_enum(HI_Algorithm, key, default)
return HI_Algorithm[key]

Expand All @@ -37,4 +38,4 @@ def _missing_(cls, value):
if 10 <= value <= 65535:
extend_enum(cls, 'Unassigned [%d]' % value, value)
return cls(value)
super()._missing_(value)
return super()._missing_(value)
5 changes: 3 additions & 2 deletions src/const/hip/hit_suite.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long

from aenum import IntEnum, extend_enum

Expand All @@ -19,7 +20,7 @@ def get(key, default=-1):
"""Backport support for original codes."""
if isinstance(key, int):
return HIT_Suite(key)
if key not in HIT_Suite._member_map_:
if key not in HIT_Suite._member_map_: # pylint: disable=no-member
extend_enum(HIT_Suite, key, default)
return HIT_Suite[key]

Expand All @@ -31,4 +32,4 @@ def _missing_(cls, value):
if 4 <= value <= 15:
extend_enum(cls, 'Unassigned [%d]' % value, value)
return cls(value)
super()._missing_(value)
return super()._missing_(value)
5 changes: 3 additions & 2 deletions src/const/hip/nat_traversal.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long

from aenum import IntEnum, extend_enum

Expand All @@ -18,7 +19,7 @@ def get(key, default=-1):
"""Backport support for original codes."""
if isinstance(key, int):
return NAT_Traversal(key)
if key not in NAT_Traversal._member_map_:
if key not in NAT_Traversal._member_map_: # pylint: disable=no-member
extend_enum(NAT_Traversal, key, default)
return NAT_Traversal[key]

Expand All @@ -30,4 +31,4 @@ def _missing_(cls, value):
if 3 <= value <= 65535:
extend_enum(cls, 'Unassigned [%d]' % value, value)
return cls(value)
super()._missing_(value)
return super()._missing_(value)
5 changes: 3 additions & 2 deletions src/const/hip/notify_message.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long

from aenum import IntEnum, extend_enum

Expand Down Expand Up @@ -50,7 +51,7 @@ def get(key, default=-1):
"""Backport support for original codes."""
if isinstance(key, int):
return NotifyMessage(key)
if key not in NotifyMessage._member_map_:
if key not in NotifyMessage._member_map_: # pylint: disable=no-member
extend_enum(NotifyMessage, key, default)
return NotifyMessage[key]

Expand Down Expand Up @@ -100,4 +101,4 @@ def _missing_(cls, value):
# [RFC 7401]
extend_enum(cls, 'Reserved for Private Use [%d]' % value, value)
return cls(value)
super()._missing_(value)
return super()._missing_(value)
Loading

0 comments on commit 1b11d2d

Please sign in to comment.