traffic-taffy 0.5.5__py3-none-any.whl → 0.5.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
traffic_taffy/__init__.py CHANGED
@@ -1 +1 @@
1
- __VERSION__ = "0.5.5"
1
+ __VERSION__ = "0.5.6"
@@ -283,6 +283,26 @@ class Dissection:
283
283
 
284
284
  # save it
285
285
  info(f"caching PCAP data to '{where}'")
286
+
287
+ # convert int keys that are too large
288
+ for timestamp in versioned_cache["dissection"]:
289
+ for key in versioned_cache["dissection"][timestamp]:
290
+ versioned_cache["dissection"][timestamp][key] = dict(
291
+ versioned_cache["dissection"][timestamp][key]
292
+ )
293
+ # sigh -- msgpack can't handle large int based dictionary keys
294
+ fix_list = []
295
+ for subkey in versioned_cache["dissection"][timestamp][key]:
296
+ if isinstance(subkey, int) and subkey > 2**32 - 1:
297
+ info(f"converting {key} {subkey}")
298
+ fix_list.append(subkey)
299
+
300
+ for subkey in fix_list:
301
+ versioned_cache["dissection"][timestamp][key][
302
+ str(subkey)
303
+ ] = versioned_cache["dissection"][timestamp][key][subkey]
304
+ del versioned_cache["dissection"][timestamp][key][subkey]
305
+
286
306
  with open(where, "wb") as saveto:
287
307
  msgpack.dump(versioned_cache, saveto)
288
308
 
@@ -83,7 +83,16 @@ class PCAPDissectMany:
83
83
 
84
84
  return dissection
85
85
 
86
- def load_all(self, return_as_list: bool = False):
86
+ def load_all(self, return_as_list: bool = False, dont_fork: bool = False):
87
+ if dont_fork:
88
+ # handle each one individually -- typically for inserting debugging stops
89
+ dissections = []
90
+ for pcap_file in self.pcap_files:
91
+ dissection = self.load_pcap(pcap_file)
92
+ dissections.append(dissection)
93
+ return dissections
94
+
95
+ # use all available resources
87
96
  with ProcessPoolExecutor() as executor:
88
97
  dissections = executor.map(self.load_pcap, self.pcap_files)
89
98
  if return_as_list: # convert from generator
@@ -33,6 +33,12 @@ def main():
33
33
  help="Print results in an FSDB formatted output",
34
34
  )
35
35
 
36
+ parser.add_argument(
37
+ "--dont-fork",
38
+ action="store_true",
39
+ help="Do not fork into multiple processes per file (still fork per file)",
40
+ )
41
+
36
42
  dissector_add_parseargs(parser)
37
43
  limitor_add_parseargs(parser)
38
44
 
@@ -61,7 +67,7 @@ def main():
61
67
  force_overwrite=args.force_overwrite,
62
68
  force_load=args.force_load,
63
69
  )
64
- dissections = pdm.load_all(True)
70
+ dissections = pdm.load_all(True, dont_fork=args.dont_fork)
65
71
 
66
72
  # merge them into a single dissection
67
73
  dissection = dissections.pop(0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: traffic-taffy
3
- Version: 0.5.5
3
+ Version: 0.5.6
4
4
  Summary: A tool for doing differential analysis of pcap files
5
5
  Project-URL: Homepage, https://github.com/hardaker/traffic-taffy
6
6
  Author-email: Wes Hardaker <opensource@hardakers.net>
@@ -1,8 +1,8 @@
1
- traffic_taffy/__init__.py,sha256=V-xYqF0o3J2i1kBnMgotAxdH0cteTXuZ3Z9Wujg9uBo,22
1
+ traffic_taffy/__init__.py,sha256=bzOhFUIQlCdC61joh43BrAkK-ns_1TJAXxkswf9jr6Q,22
2
2
  traffic_taffy/compare.py,sha256=wgClLO5qHQirv4fKQ20gI9H2PD7noMIGS98LUdqRx8Q,10643
3
3
  traffic_taffy/comparison.py,sha256=goGJbJsr8mzMqRvrJOXxW9QJaLZUg4W85Ji7Bjl-UKA,583
4
- traffic_taffy/dissection.py,sha256=mdwDtOrcyz389KALQXDeyDND0EYCKgkVPAxkY5h0-_w,15588
5
- traffic_taffy/dissectmany.py,sha256=UGKCrrH7VOzIR8TL_JMdW8NrbiHF-b-rDMI9jiGK5fI,3023
4
+ traffic_taffy/dissection.py,sha256=FHVi4AXAqXrSzXz-d9SKkbPBD03EDDvKYWE2Opi9r6U,16575
5
+ traffic_taffy/dissectmany.py,sha256=hbCX-AEMTquTaqTpb05D8ek5dS5z9nr28BC5e27mzo8,3403
6
6
  traffic_taffy/dissector.py,sha256=4jgwK45fDju86wzU5uzbo4r4Rr5IopqjIyb92il8A3A,9617
7
7
  traffic_taffy/dissectorresults.py,sha256=LKoyX04Qjc6B7RnqtJgIWsyVnselJ9CygLkMAp3lhw0,647
8
8
  traffic_taffy/graph.py,sha256=UxRQRnv8WuwjFt_hesk4B31-I2fUnAJlLzM5pHvrNus,3996
@@ -24,11 +24,11 @@ traffic_taffy/tests/test_value_printing.py,sha256=3k-d1bpa6tD8qcrgNVoZhhG7kwylI2
24
24
  traffic_taffy/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  traffic_taffy/tools/cache_info.py,sha256=QC-BiaJ_uHwH-B05a29qdW7oTHfKmO1PT31d_FvIJlU,1965
26
26
  traffic_taffy/tools/compare.py,sha256=tJW5PZHpbiFN5YlIu3IIz6vkFowYuxhgmWVO9JAJ4Co,3438
27
- traffic_taffy/tools/dissect.py,sha256=ifADbYhoe3Rh3l_6ufmdcHt1ut5EJ45XeIR0isNnYK0,3063
27
+ traffic_taffy/tools/dissect.py,sha256=QST4NlH1HbzepJLAHFlghm47MDBd0CHBjquRnqqs_SY,3276
28
28
  traffic_taffy/tools/explore.py,sha256=HWyRWc0GpK0jpoVyGqkeFyqSwVE9NLxGh4r4iW7HLYM,24968
29
29
  traffic_taffy/tools/export.py,sha256=jk5ck-K9m9_Rno72fDWgfS67WKUumDL1KQpMG_j0-G8,2682
30
30
  traffic_taffy/tools/graph.py,sha256=gcyI0C8E21Uuon3j_n58tV-kKSn8wXjov-JSCKjPukI,2466
31
- traffic_taffy-0.5.5.dist-info/METADATA,sha256=A9pRSFdxqN4J607jl_O2mzqqKnXJMuWZVP3e4FjK0ug,1526
32
- traffic_taffy-0.5.5.dist-info/WHEEL,sha256=TJPnKdtrSue7xZ_AVGkp9YXcvDrobsjBds1du3Nx6dc,87
33
- traffic_taffy-0.5.5.dist-info/entry_points.txt,sha256=ySz30b1Cu03CtCGMRqqg0NZJpzrVI91T5HjbEaTNnpQ,314
34
- traffic_taffy-0.5.5.dist-info/RECORD,,
31
+ traffic_taffy-0.5.6.dist-info/METADATA,sha256=wFX9sA44cLQKAqqJkDOHZ8b6pVibn7iEkM1Yy54-9_U,1526
32
+ traffic_taffy-0.5.6.dist-info/WHEEL,sha256=TJPnKdtrSue7xZ_AVGkp9YXcvDrobsjBds1du3Nx6dc,87
33
+ traffic_taffy-0.5.6.dist-info/entry_points.txt,sha256=ySz30b1Cu03CtCGMRqqg0NZJpzrVI91T5HjbEaTNnpQ,314
34
+ traffic_taffy-0.5.6.dist-info/RECORD,,