Skip to content

Commit d6d8e98

Browse files
committed
New distribution [0.14.4]
* included vendor scripts to distro * seperate CLI deps in setup.py * added vendor deps in setup.py * linted source files (except protocols/ipsuite) * revised impl of vendor scripts * updated const enums accordingly * some other minor changes
1 parent 1b11d2d commit d6d8e98

File tree

177 files changed

+1658
-2458
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+1658
-2458
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11

2+
pcapkit-*-tempdir/
3+
pcapkit-temp.html
4+
25
out
36
*.js
47
!out.js

.vscode/settings.json

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,92 @@
11
{
22
"python.pythonPath": ".venv/bin/python",
33
"cSpell.words": [
4+
"Chksum",
45
"DEVMODE",
56
"ECDSA",
67
"INET",
8+
"NPROCESSORS",
9+
"PROTO",
10+
"RCVBT",
711
"SIOP",
12+
"Serv",
13+
"aftermathmp",
814
"aktau",
15+
"bctr",
916
"bufid",
17+
"ccecho",
18+
"ccnew",
19+
"chkreq",
1020
"cmmd",
1121
"cmmt",
1222
"distro",
23+
"dlink",
24+
"dport",
1325
"dscp",
26+
"dtgram",
27+
"echore",
28+
"emojize",
29+
"eool",
30+
"exeng",
31+
"exlyr",
32+
"expkg",
33+
"exptl",
34+
"extmp",
35+
"fdpext",
36+
"fext",
1437
"fileng",
38+
"fout",
39+
"foutio",
40+
"fpout",
41+
"fproot",
42+
"frnum",
1543
"gaocegege",
44+
"gbhdr",
45+
"hdrs",
46+
"httpv",
47+
"ifile",
48+
"ifnm",
49+
"ilnp",
50+
"inarp",
1651
"ipsuite",
1752
"lrfc",
53+
"mpbuf",
54+
"mpfdp",
55+
"mpfrm",
56+
"mpkit",
57+
"mpmng",
58+
"mpprc",
59+
"mprsm",
60+
"mpsvc",
61+
"newflg",
62+
"nnsec",
63+
"nnsecd",
64+
"nofile",
65+
"nsec",
66+
"ofile",
67+
"ofnm",
68+
"padn",
1869
"plen",
70+
"pocsp",
1971
"prio",
2072
"protos",
2173
"pval",
74+
"pycapfile",
2275
"pyenv",
76+
"pypcap",
77+
"reasm",
2378
"renm",
79+
"sackpmt",
80+
"sched",
81+
"splt",
2482
"srcport",
83+
"strflg",
2584
"subd",
85+
"subn",
2686
"sufs",
87+
"sysconf",
2788
"tbitem",
28-
"tbody"
89+
"tbody",
90+
"vinfo"
2991
]
3092
}

MANIFEST.in

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,20 @@ global-exclude .DS_Store
33
global-include *.md
44
global-include *.py
55

6+
prune .github
67
prune .venv
8+
prune .vscode
9+
710
prune archive
811
prune devel
12+
prune doc
913
prune release
14+
prune sample
1015
prune src
1116
prune test
1217
prune testbench
1318

1419
include README.md
1520
include LICENSE
1621

17-
prune pcapkit/protocols/*/NotImplemented
18-
# prune pcapkit/vendor
22+
exclude pcapkit/protocols/*/NotImplemented

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ const: update-const
1515
dist: dist-pypi dist-upload
1616
release: release-master
1717
pipenv: update-pipenv
18-
update: update-const update-date
18+
# update: update-const update-date
19+
update: update-const
1920

2021
pypi:
2122
DIR=release $(MAKE) dist-prep dist

Pipfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ emoji = "*"
2121
tbtrim = ">=0.2.1"
2222

2323
[dev-packages]
24-
pypcapkit = {editable = true, path = "."}
24+
pypcapkit = {editable = true,path = "."}
2525
pyshark = "*"
2626
dpkt = "*"
2727
scapy = "*"
28+
pathlib2 = "*"
2829
bs4 = "*"
2930
html5lib = "*"
30-
requests = "*"
31+
requests = {extras = ["socks"],version = "*"}
3132
ipython = "*"
3233
autopep8 = "*"
3334
pylint = "*"

Pipfile.lock

Lines changed: 23 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

setup.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from distutils.core import setup
77

88
# version string
9-
__version__ = '0.14.3'
9+
__version__ = '0.14.4'
1010

1111
# README
1212
with open('README.md', encoding='utf-8') as file:
@@ -32,14 +32,23 @@
3232
'dictdumper>=0.7.0.post1', # for formatted output
3333
'chardet', # for bytes decode
3434
'aenum', # for const types
35-
'emoji', # for CLI display
3635
'tbtrim>=0.2.1', # for refined exceptions
3736
],
3837
extras_require={
39-
'all': ['dpkt', 'scapy', 'pyshark'],
38+
'all': [
39+
'emoji',
40+
'dpkt', 'scapy', 'pyshark',
41+
'requests[socks]', 'bs4', 'html5lib',
42+
],
43+
# for CLI display
44+
'cli': ['emoji'],
45+
# for normal users
4046
'DPKT': ['dpkt'],
4147
'Scapy': ['scapy'],
4248
'PyShark': ['pyshark'],
49+
# for developers
50+
'vendor': ['requests[socks]', 'bs4', 'html5lib'],
51+
# version compatibility
4352
':python_version == "3.4"': ['pathlib2>=2.3.2'],
4453
},
4554
# py_modules = ['pcapkit'],
@@ -63,8 +72,8 @@
6372
'pcapkit.const.ipv6',
6473
'pcapkit.const.ipx',
6574
'pcapkit.const.mh',
66-
'pcapkit.const.misc',
6775
'pcapkit.const.ospf',
76+
'pcapkit.const.reg',
6877
'pcapkit.const.tcp',
6978
'pcapkit.const.vlan',
7079
'pcapkit.corekit',
@@ -95,8 +104,8 @@
95104
'pcapkit.vendor.ipv6',
96105
'pcapkit.vendor.ipx',
97106
'pcapkit.vendor.mh',
98-
'pcapkit.vendor.misc',
99107
'pcapkit.vendor.ospf',
108+
'pcapkit.vendor.reg',
100109
'pcapkit.vendor.tcp',
101110
'pcapkit.vendor.vlan',
102111
],

src/__init__.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
# pylint: disable=wrong-import-position, unused-import, unused-wildcard-import, bad-continuation
23
"""stream pcap file extractor
34
45
`pcapkit` is an independent open source library, using only
@@ -53,17 +54,17 @@
5354
dump utilities for `pcapkit` implementation
5455
5556
"""
56-
# pylint: disable=wrong-import-position, unused-import, unused-wildcard-import
5757
import os
5858
import warnings
5959

6060
import tbtrim
6161

6262
from pcapkit.utilities.exceptions import DEVMODE, BaseError
63+
from pcapkit.utilities.warnings import DevModeWarning
6364

6465
# set up sys.excepthook
6566
if DEVMODE:
66-
warnings.showwarning('development mode enabled', RuntimeWarning,
67+
warnings.showwarning('development mode enabled', DevModeWarning,
6768
filename=__file__, lineno=0,
6869
line=f"PCAPKIT_DEVMODE={os.environ['PCAPKIT_DEVMODE']}")
6970
else:
@@ -72,7 +73,7 @@
7273
exception=BaseError, strict=False)
7374

7475
# All Reference
75-
import pcapkit.__all__ as all # pylint: disable=redefined-builtin
76+
import pcapkit.all
7677

7778
# Interface
7879
from pcapkit.interface import *
@@ -111,13 +112,13 @@
111112
'TREE', 'JSON', 'PLIST', 'PCAP', # Format Macros
112113
'LINK', 'INET', 'TRANS', 'APP', 'RAW', # Layer Macros
113114
'DPKT', 'Scapy', 'PyShark', 'MPServer', 'MPPipeline', 'PCAPKit',
114-
# Engine Macros # pylint: disable=bad-continuation
115+
# Engine Macros
115116
'NoPayload', # No Payload
116117
'Raw', # Raw Packet
117118
'ARP', 'Ethernet', 'L2TP', 'OSPF', 'RARP', 'VLAN', # Link Layer
118119
'AH', 'IP', 'IPsec', 'IPv4', 'IPv6', 'IPX', # Internet Layer
119120
'HIP', 'HOPOPT', 'IPv6_Frag', 'IPv6_Opts', 'IPv6_Route', 'MH',
120-
# IPv6 Extension Header # pylint: disable=bad-continuation
121+
# IPv6 Extension Header
121122
'TCP', 'UDP', # Transport Layer
122123
'FTP', 'HTTP', # Application Layer
123124
]

src/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222
def get_parser():
23-
parser = argparse.ArgumentParser(prog='pcapkit',
23+
parser = argparse.ArgumentParser(prog='pcapkit-cli',
2424
description='PCAP file extractor and formatted dumper')
2525
parser.add_argument('-V', '--version', action='version', version=__version__)
2626
parser.add_argument('fin', metavar='input-file-name',

src/__all__.py renamed to src/all.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
# pylint: disable=unused-import, unused-wildcard-import, bad-continuation
23
"""index for the library
34
45
`pcapkit` has defined various and numerous functions and
@@ -7,6 +8,8 @@
78
contains all things from `pcapkit`.
89
910
"""
11+
import pcapkit.const as const
12+
import pcapkit.vendor as vendor
1013
from pcapkit.corekit import *
1114
from pcapkit.dumpkit import *
1215
from pcapkit.foundation import *
@@ -15,9 +18,15 @@
1518
from pcapkit.protocols import *
1619
from pcapkit.reassembly import *
1720
from pcapkit.toolkit import *
18-
from pcapkit.utilities import *
21+
from pcapkit.utilities import * # pylint: disable=redefined-builtin
1922

2023
__all__ = [
24+
# pcapkit.const
25+
'const',
26+
27+
# pcapkit.vendor
28+
'vendor',
29+
2130
# pcapkit.corekit
2231
'Info', # Info Class
2332
'ProtoChain', # ProtoChain

0 commit comments

Comments
 (0)