pypcapkit 1.0.3.post2__cp39-none-any.whl → 1.1.0.post1__cp39-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.
Files changed (41) hide show
  1. pcapkit/__init__.py +1 -1
  2. pcapkit/const/pcapng/option_type.py +25 -1
  3. pcapkit/const/reg/apptype.py +8118 -8094
  4. pcapkit/corekit/fields/collections.py +4 -5
  5. pcapkit/corekit/fields/field.py +33 -8
  6. pcapkit/corekit/fields/ipaddress.py +0 -1
  7. pcapkit/corekit/fields/misc.py +14 -19
  8. pcapkit/corekit/fields/numbers.py +2 -3
  9. pcapkit/corekit/fields/strings.py +2 -3
  10. pcapkit/corekit/infoclass.py +59 -6
  11. pcapkit/corekit/protochain.py +8 -1
  12. pcapkit/foundation/registry/protocols.py +30 -51
  13. pcapkit/protocols/data/__init__.py +4 -4
  14. pcapkit/protocols/data/internet/__init__.py +4 -4
  15. pcapkit/protocols/data/internet/mh.py +4 -4
  16. pcapkit/protocols/data/transport/__init__.py +4 -4
  17. pcapkit/protocols/data/transport/tcp.py +4 -4
  18. pcapkit/protocols/internet/mh.py +20 -20
  19. pcapkit/protocols/protocol.py +3 -2
  20. pcapkit/protocols/schema/__init__.py +4 -4
  21. pcapkit/protocols/schema/application/httpv2.py +16 -29
  22. pcapkit/protocols/schema/internet/__init__.py +4 -4
  23. pcapkit/protocols/schema/internet/hip.py +62 -111
  24. pcapkit/protocols/schema/internet/hopopt.py +46 -48
  25. pcapkit/protocols/schema/internet/ipv4.py +36 -41
  26. pcapkit/protocols/schema/internet/ipv6_opts.py +48 -52
  27. pcapkit/protocols/schema/internet/ipv6_route.py +9 -20
  28. pcapkit/protocols/schema/internet/mh.py +49 -84
  29. pcapkit/protocols/schema/misc/pcapng.py +178 -195
  30. pcapkit/protocols/schema/schema.py +252 -53
  31. pcapkit/protocols/schema/transport/__init__.py +4 -4
  32. pcapkit/protocols/schema/transport/tcp.py +52 -83
  33. pcapkit/protocols/transport/tcp.py +14 -14
  34. pcapkit/vendor/pcapng/option_type.py +25 -1
  35. pcapkit/vendor/reg/apptype.py +26 -2
  36. {pypcapkit-1.0.3.post2.dist-info → pypcapkit-1.1.0.post1.dist-info}/METADATA +1 -1
  37. {pypcapkit-1.0.3.post2.dist-info → pypcapkit-1.1.0.post1.dist-info}/RECORD +41 -41
  38. {pypcapkit-1.0.3.post2.dist-info → pypcapkit-1.1.0.post1.dist-info}/LICENSE +0 -0
  39. {pypcapkit-1.0.3.post2.dist-info → pypcapkit-1.1.0.post1.dist-info}/WHEEL +0 -0
  40. {pypcapkit-1.0.3.post2.dist-info → pypcapkit-1.1.0.post1.dist-info}/entry_points.txt +0 -0
  41. {pypcapkit-1.0.3.post2.dist-info → pypcapkit-1.1.0.post1.dist-info}/top_level.txt +0 -0
pcapkit/__init__.py CHANGED
@@ -123,4 +123,4 @@ __all__ = [
123
123
  ]
124
124
 
125
125
  #: version number
126
- __version__ = '1.0.3.post2'
126
+ __version__ = '1.1.0.post1'
@@ -18,7 +18,7 @@ from aenum import StrEnum, extend_enum
18
18
  __all__ = ['OptionType']
19
19
 
20
20
  if TYPE_CHECKING:
21
- from typing import DefaultDict, Optional, Type
21
+ from typing import Any, DefaultDict, Optional, Type
22
22
 
23
23
 
24
24
  class OptionType(StrEnum):
@@ -53,6 +53,30 @@ class OptionType(StrEnum):
53
53
  def __str__(self) -> 'str':
54
54
  return '%s [%d]' % (self.opt_name, self.opt_value)
55
55
 
56
+ def __int__(self) -> 'int':
57
+ return self.opt_value
58
+
59
+ def __lt__(self, other: 'OptionType') -> 'bool':
60
+ return self.opt_value < other
61
+
62
+ def __gt__(self, other: 'OptionType') -> 'bool':
63
+ return self.opt_value > other
64
+
65
+ def __le__(self, other: 'OptionType') -> 'bool':
66
+ return self.opt_value <= other
67
+
68
+ def __ge__(self, other: 'OptionType') -> 'bool':
69
+ return self.opt_value >= other
70
+
71
+ def __eq__(self, other: 'Any') -> 'bool':
72
+ return self.opt_value == other
73
+
74
+ def __ne__(self, other: 'Any') -> 'bool':
75
+ return self.opt_value != other
76
+
77
+ def __hash__(self) -> 'int':
78
+ return hash(self.opt_value)
79
+
56
80
  #: opt_endofopt
57
81
  opt_endofopt: 'OptionType' = 0, 'opt_endofopt'
58
82