pypcapkit 1.3.1.post7__pp38-none-any.whl → 1.3.5.post6__pp38-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 (66) hide show
  1. pcapkit/__init__.py +1 -3
  2. pcapkit/__main__.py +2 -2
  3. pcapkit/const/ftp/command.py +2 -2
  4. pcapkit/const/ftp/return_code.py +11 -21
  5. pcapkit/const/http/status_code.py +7 -3
  6. pcapkit/const/ipv6/extension_header.py +3 -0
  7. pcapkit/const/ipv6/router_alert.py +1 -1
  8. pcapkit/const/ipv6/routing.py +2 -4
  9. pcapkit/const/ipx/packet.py +3 -0
  10. pcapkit/const/ipx/socket.py +2 -2
  11. pcapkit/const/mh/status_code.py +1 -1
  12. pcapkit/const/reg/apptype.py +94 -32
  13. pcapkit/const/reg/ethertype.py +8 -10
  14. pcapkit/const/reg/linktype.py +48 -81
  15. pcapkit/const/reg/transtype.py +9 -3
  16. pcapkit/const/tcp/option.py +2 -2
  17. pcapkit/corekit/infoclass.py +2 -0
  18. pcapkit/dumpkit/pcap.py +13 -5
  19. pcapkit/protocols/data/application/ftp.py +2 -2
  20. pcapkit/protocols/data/application/httpv1.py +2 -1
  21. pcapkit/protocols/data/application/httpv2.py +2 -1
  22. pcapkit/protocols/data/internet/ah.py +2 -2
  23. pcapkit/protocols/data/internet/hip.py +2 -1
  24. pcapkit/protocols/data/internet/hopopt.py +2 -1
  25. pcapkit/protocols/data/internet/ipv4.py +2 -1
  26. pcapkit/protocols/data/internet/ipv6.py +2 -2
  27. pcapkit/protocols/data/internet/ipv6_frag.py +2 -2
  28. pcapkit/protocols/data/internet/ipv6_opts.py +2 -1
  29. pcapkit/protocols/data/internet/ipv6_route.py +2 -2
  30. pcapkit/protocols/data/internet/ipx.py +2 -1
  31. pcapkit/protocols/data/internet/mh.py +2 -1
  32. pcapkit/protocols/data/link/arp.py +2 -1
  33. pcapkit/protocols/data/link/ethernet.py +2 -1
  34. pcapkit/protocols/data/link/l2tp.py +4 -2
  35. pcapkit/protocols/data/link/ospf.py +4 -2
  36. pcapkit/protocols/data/link/vlan.py +2 -1
  37. pcapkit/protocols/data/misc/null.py +2 -2
  38. pcapkit/protocols/data/misc/pcap/frame.py +4 -2
  39. pcapkit/protocols/data/misc/pcap/header.py +2 -1
  40. pcapkit/protocols/data/misc/pcapng.py +16 -8
  41. pcapkit/protocols/data/misc/raw.py +3 -5
  42. pcapkit/protocols/data/protocol.py +8 -0
  43. pcapkit/protocols/data/transport/tcp.py +6 -3
  44. pcapkit/protocols/data/transport/udp.py +2 -2
  45. pcapkit/protocols/internet/internet.py +15 -6
  46. pcapkit/protocols/internet/ipv6.py +54 -3
  47. pcapkit/protocols/internet/ipv6_route.py +5 -7
  48. pcapkit/protocols/link/link.py +1 -1
  49. pcapkit/protocols/misc/pcap/frame.py +1 -1
  50. pcapkit/protocols/misc/pcapng.py +5 -2
  51. pcapkit/protocols/misc/raw.py +0 -1
  52. pcapkit/protocols/protocol.py +4 -1
  53. pcapkit/protocols/schema/__init__.py +0 -1
  54. pcapkit/protocols/schema/internet/ipv6_route.py +2 -3
  55. pcapkit/protocols/schema/schema.py +1 -1
  56. pcapkit/protocols/transport/tcp.py +1 -1
  57. pcapkit/protocols/transport/udp.py +1 -1
  58. pcapkit/toolkit/pcapng.py +1 -1
  59. pcapkit/utilities/decorators.py +4 -2
  60. pcapkit/utilities/exceptions.py +5 -5
  61. {pypcapkit-1.3.1.post7.dist-info → pypcapkit-1.3.5.post6.dist-info}/METADATA +1 -1
  62. {pypcapkit-1.3.1.post7.dist-info → pypcapkit-1.3.5.post6.dist-info}/RECORD +66 -66
  63. {pypcapkit-1.3.1.post7.dist-info → pypcapkit-1.3.5.post6.dist-info}/WHEEL +1 -1
  64. {pypcapkit-1.3.1.post7.dist-info → pypcapkit-1.3.5.post6.dist-info}/LICENSE +0 -0
  65. {pypcapkit-1.3.1.post7.dist-info → pypcapkit-1.3.5.post6.dist-info}/entry_points.txt +0 -0
  66. {pypcapkit-1.3.1.post7.dist-info → pypcapkit-1.3.5.post6.dist-info}/top_level.txt +0 -0
@@ -31,25 +31,20 @@ class LinkType(IntEnum):
31
31
  #: [``DLT_AX25``] AX.25 packet, with nothing preceding it.
32
32
  AX25 = 3
33
33
 
34
- #: [``DLT_PRONET``] Proteon ProNET Token Ring.
34
+ #: [``DLT_PRONET``] Reserved for Proteon ProNET Token Ring.
35
35
  PRONET = 4
36
36
 
37
- #: [``DLT_CHAOS``] Chaos.
37
+ #: [``DLT_CHAOS``] Reserved for MIT Chaosnet.
38
38
  CHAOS = 5
39
39
 
40
40
  #: [``DLT_IEEE802``] IEEE 802.5 Token Ring; the IEEE802, without \_5, in the
41
41
  #: DLT\_ name is historical.
42
42
  IEEE802_5 = 6
43
43
 
44
- #: [``DLT_ARCNET``] ARCNET Data Packets, as described by the ARCNET Trade
45
- #: Association standard ATA 878.1-1999, but without the Starting Delimiter,
46
- #: Information Length, or Frame Check Sequence fields, and with only the first
47
- #: ISU of the Destination Identifier. For most packet types, ARCNET Trade
48
- #: Association draft standard ATA 878.2 is also used. See also RFC 1051 and RFC
49
- #: 1201; for RFC 1051 frames, ATA 878.2 is not used.
44
+ #: [``DLT_ARCNET``] Reserved for ARCNET Data Packets with BSD encapsulation.
50
45
  ARCNET_BSD = 7
51
46
 
52
- #: [``DLT_SLIP``] SLIP, encapsulated with a LINKTYPE\_SLIP header.
47
+ #: [``DLT_SLIP``] SLIP, with a header giving packet direction
53
48
  SLIP = 8
54
49
 
55
50
  #: [``DLT_PPP``] PPP, as per RFC 1661 and RFC 1662; if the first 2 bytes are
@@ -136,8 +131,8 @@ class LinkType(IntEnum):
136
131
  #: [``DLT_CISCO_IOS``] Cisco internal use.
137
132
  CISCO_IOS = 118
138
133
 
139
- #: [``DLT_PRISM_HEADER``] Prism monitor mode information followed by an 802.11
140
- #: header.
134
+ #: [``DLT_PRISM_HEADER``] Prism monitor mode information, followed by an 802.11
135
+ #: frame.
141
136
  IEEE802_11_PRISM = 119
142
137
 
143
138
  #: [``DLT_AIRONET_HEADER``] Reserved for Aironet 802.11 cards, with an Aironet
@@ -148,8 +143,7 @@ class LinkType(IntEnum):
148
143
  #: header being the Network\_Header as described in that RFC.
149
144
  IP_OVER_FC = 122
150
145
 
151
- #: [``DLT_SUNATM``] ATM traffic, encapsulated as per the scheme used by SunATM
152
- #: devices.
146
+ #: [``DLT_SUNATM``] ATM traffic captured from a SunATM device.
153
147
  SUNATM = 123
154
148
 
155
149
  #: [``DLT_RIO``] RapidIO.
@@ -170,15 +164,8 @@ class LinkType(IntEnum):
170
164
  #: the packet, e.g. signal strength and channel for 802.11 packets.
171
165
  TZSP = 128
172
166
 
173
- #: [``DLT_ARCNET_LINUX``] ARCNET Data Packets, as described by the ARCNET Trade
174
- #: Association standard ATA 878.1-1999, but without the Starting Delimiter,
175
- #: Information Length, or Frame Check Sequence fields, with only the first ISU
176
- #: of the Destination Identifier, and with an extra two-ISU offset field
177
- #: following the Destination Identifier. For most packet types, ARCNET Trade
178
- #: Association draft standard ATA 878.2 is also used; however, no exception
179
- #: frames are supplied, and reassembled frames, rather than fragments, are
180
- #: supplied. See also RFC 1051 and RFC 1201; for RFC 1051 frames, ATA 878.2 is
181
- #: not used.
167
+ #: [``DLT_ARCNET_LINUX``] Reserved for ARCNET Data Packets with Linux
168
+ #: encapsulation.
182
169
  ARCNET_LINUX = 129
183
170
 
184
171
  #: [``DLT_JUNIPER_MLPPP``] Juniper Networks private data link type.
@@ -232,9 +219,7 @@ class LinkType(IntEnum):
232
219
  #: MAC frames.
233
220
  DOCSIS = 143
234
221
 
235
- #: [``DLT_LINUX_IRDA``] Linux-IrDA packets, with a LINKTYPE\_LINUX\_IRDA
236
- #: header, with the payload for IrDA frames beginning with by the IrLAP header
237
- #: as defined by the IrDA Link Access Protocol specification.
222
+ #: [``DLT_LINUX_IRDA``] Linux-IrDA packets
238
223
  LINUX_IRDA = 144
239
224
 
240
225
  #: [``DLT_IBM_SP``] IBM SP switch.
@@ -342,10 +327,7 @@ class LinkType(IntEnum):
342
327
  #: [``DLT_ERF_POS``] An ERF header followed by Packet-over-SONET.
343
328
  ERF_POS = 176
344
329
 
345
- #: [``DLT_LINUX_LAPD``] Link Access Procedures on the D Channel (LAPD) frames,
346
- #: as specified by ITU-T Recommendation Q.920 and ITU-T Recommendation Q.921,
347
- #: captured via vISDN, with a LINKTYPE\_LINUX\_LAPD header, followed by the
348
- #: Q.921 frame, starting with the address field.
330
+ #: [``DLT_LINUX_LAPD``] Linux vISDN LAPD frames
349
331
  LINUX_LAPD = 177
350
332
 
351
333
  #: [``DLT_JUNIPER_ETHER``] Juniper Networks private data link type. Ethernet
@@ -480,24 +462,26 @@ class LinkType(IntEnum):
480
462
  C_HDLC_WITH_DIR = 205
481
463
 
482
464
  #: [``DLT_FRELAY_WITH_DIR``] Frame Relay LAPF frames, beginning with a one-byte
483
- #: pseudo-header with a zero value meaning "received by this host" (DCE->DTE)
484
- #: and a non-zero value meaning "sent by this host" (DTE->DCE), followed by an
465
+ #: pseudo-header with a zero value meaning "received by this host" (DCEDTE)
466
+ #: and a non-zero value meaning "sent by this host" (DTEDCE), followed by an
485
467
  #: ITU-T Recommendation Q.922 LAPF header starting with the address field, and
486
468
  #: without an FCS at the end of the frame.
487
469
  FRELAY_WITH_DIR = 206
488
470
 
489
471
  #: [``DLT_LAPB_WITH_DIR``] Link Access Procedure, Balanced (LAPB), as specified
490
472
  #: by ITU-T Recommendation X.25, preceded with a one-byte pseudo-header with a
491
- #: zero value meaning "received by this host" (DCE->DTE) and a non-zero value
492
- #: meaning "sent by this host" (DTE->DCE).
473
+ #: zero value meaning "received by this host" (DCEDTE) and a non-zero value
474
+ #: meaning "sent by this host" (DTEDCE).
493
475
  LAPB_WITH_DIR = 207
494
476
 
495
- #: [``DLT_IPMB_LINUX``] IPMB over an I2C circuit, with a Linux-specific pseudo-
496
- #: header.
477
+ #: [``DLT_IPMB_LINUX``] Legacy names (do not use) for Linux I2C below.
497
478
  IPMB_LINUX = 209
498
479
 
480
+ #: [``DLT_I2C_LINUX``] Linux I2C packets.
481
+ I2C_LINUX = 209
482
+
499
483
  #: [``DLT_FLEXRAY``] FlexRay automotive bus frames or symbols, preceded by a
500
- #: pseudo-header.
484
+ #: pseudo-header
501
485
  FLEXRAY = 210
502
486
 
503
487
  #: [``DLT_MOST``] Media Oriented Systems Transport (MOST) bus for multimedia
@@ -505,7 +489,7 @@ class LinkType(IntEnum):
505
489
  MOST = 211
506
490
 
507
491
  #: [``DLT_LIN``] Local Interconnect Network (LIN) automotive bus, preceded by a
508
- #: pseudo-header.
492
+ #: pseudo-header
509
493
  LIN = 212
510
494
 
511
495
  #: [``DLT_X2E_SERIAL``] X2E-private data link type used for serial line
@@ -570,8 +554,7 @@ class LinkType(IntEnum):
570
554
  #: 0xBC 0xB5 0x55 0x55.
571
555
  FC_2_WITH_FRAME_DELIMS = 225
572
556
 
573
- #: [``DLT_IPNET``] Solaris ipnet pseudo-header, followed by an IPv4 or IPv6
574
- #: datagram.
557
+ #: [``DLT_IPNET``] Solaris ipnet
575
558
  IPNET = 226
576
559
 
577
560
  #: [``DLT_CAN_SOCKETCAN``] CAN (Controller Area Network) frames, with a pseudo-
@@ -622,14 +605,12 @@ class LinkType(IntEnum):
622
605
  #: [``DLT_NFLOG``] Linux netlink NETLINK NFLOG socket log messages.
623
606
  NFLOG = 239
624
607
 
625
- #: [``DLT_NETANALYZER``] Pseudo-header for Hilscher Gesellschaft für
626
- #: Systemautomation mbH netANALYZER devices, followed by an Ethernet frame,
627
- #: beginning with the MAC header and ending with the FCS.
608
+ #: [``DLT_NETANALYZER``] Ethernet frames, preceded by a Hilscher netANALYZER
609
+ #: pseudo-header.
628
610
  NETANALYZER = 240
629
611
 
630
- #: [``DLT_NETANALYZER_TRANSPARENT``] Pseudo-header for Hilscher Gesellschaft
631
- #: für Systemautomation mbH netANALYZER devices, followed by an Ethernet frame,
632
- #: beginning with the preamble, SFD, and MAC header, and ending with the FCS.
612
+ #: [``DLT_NETANALYZER_TRANSPARENT``] Ethernet frames, including the preamble
613
+ #: and SFD, preceded by a Hilscher netANALYZER pseudo-header.
633
614
  NETANALYZER_TRANSPARENT = 241
634
615
 
635
616
  #: [``DLT_IPOIB``] IP-over-InfiniBand, as specified by RFC 4391 section 6.
@@ -640,17 +621,11 @@ class LinkType(IntEnum):
640
621
  #: 2.4.3.2 "Transport Stream packet layer").
641
622
  MPEG_2_TS = 243
642
623
 
643
- #: [``DLT_NG40``] Pseudo-header for ng4T GmbH's UMTS Iub/Iur-over-ATM and
644
- #: Iub/Iur-over-IP format as used by their ng40 protocol tester, followed by
645
- #: frames for the Frame Protocol as specified by 3GPP TS 25.427 for dedicated
646
- #: channels and 3GPP TS 25.435 for common/shared channels in the case of ATM
647
- #: AAL2 or UDP traffic, by SSCOP packets as specified by ITU-T Recommendation
648
- #: Q.2110 for ATM AAL5 traffic, and by NBAP packets for SCTP traffic.
624
+ #: [``DLT_NG40``] Frames from ng4T GmbH's ng40 protocol tester.
649
625
  NG40 = 244
650
626
 
651
- #: [``DLT_NFC_LLCP``] Pseudo-header for NFC LLCP packet captures, followed by
652
- #: frame data for the LLCP Protocol as specified by the Logical Link Control
653
- #: Protocol Technical Specification.
627
+ #: [``DLT_NFC_LLCP``] NFC Logical Link Control Protocol frames, with a pseudo-
628
+ #: header.
654
629
  NFC_LLCP = 245
655
630
 
656
631
  #: Packet filter state syncing.
@@ -668,9 +643,8 @@ class LinkType(IntEnum):
668
643
  #: [``DLT_USBPCAP``] USB packets, beginning with a USBPcap header.
669
644
  USBPCAP = 249
670
645
 
671
- #: [``DLT_RTAC_SERIAL``] Serial-line packet header for the Schweitzer
672
- #: Engineering Laboratories "RTAC" product, followed by a payload for one of a
673
- #: number of industrial control protocols.
646
+ #: [``DLT_RTAC_SERIAL``] Serial-line packets from the Schweitzer Engineering
647
+ #: Laboratories "RTAC" product.
674
648
  RTAC_SERIAL = 250
675
649
 
676
650
  #: [``DLT_BLUETOOTH_LE_LL``] Bluetooth Low Energy air interface Link Layer
@@ -725,9 +699,8 @@ class LinkType(IntEnum):
725
699
  #: Recommendation G.9959, with some MAC layer fields moved.
726
700
  ZWAVE_R3 = 262
727
701
 
728
- #: [``DLT_WATTSTOPPER_DLM``] Formats for WattStopper Digital Lighting
729
- #: Management (DLM) and Legrand Nitoo Open protocol common packet structure
730
- #: captures.
702
+ #: [``DLT_WATTSTOPPER_DLM``] WattStopper Digital Lighting Management (DLM) and
703
+ #: Legrand Nitoo Open protocol packets.
731
704
  WATTSTOPPER_DLM = 263
732
705
 
733
706
  #: [``DLT_ISO_14443``] Messages between ISO 14443 contactless smartcards
@@ -736,12 +709,11 @@ class LinkType(IntEnum):
736
709
  #: for ISO14443 specification.
737
710
  ISO_14443 = 264
738
711
 
739
- #: [``DLT_RDS``] Radio data system (RDS) groups, as per IEC 62106, encapsulated
740
- #: in this form.
712
+ #: [``DLT_RDS``] IEC 62106 Radio data system (RDS) groups.
741
713
  RDS = 265
742
714
 
743
- #: [``DLT_USB_DARWIN``] USB packets, beginning with a Darwin (macOS, etc.) USB
744
- #: header.
715
+ #: [``DLT_USB_DARWIN``] USB packets captured on a Darwin-based operating system
716
+ #: (macOS, etc.).
745
717
  USB_DARWIN = 266
746
718
 
747
719
  #: [``DLT_OPENFLOW``] OpenFlow messages with an additional 12-octet header, as
@@ -767,7 +739,7 @@ class LinkType(IntEnum):
767
739
  VSOCK = 271
768
740
 
769
741
  #: [``DLT_NORDIC_BLE``] Messages to and from a Nordic Semiconductor nRF Sniffer
770
- #: for Bluetooth LE packets, beginning with a pseudo-header.
742
+ #: for Bluetooth LE packets.
771
743
  NORDIC_BLE = 272
772
744
 
773
745
  #: [``DLT_DOCSIS31_XRA31``] DOCSIS packets and bursts, preceded by a pseudo-
@@ -778,8 +750,7 @@ class LinkType(IntEnum):
778
750
  #: 99-4, starting with the preamble and always ending with a CRC field.
779
751
  ETHERNET_MPACKET = 274
780
752
 
781
- #: [``DLT_DISPLAYPORT_AUX``] DisplayPort AUX channel monitoring data as
782
- #: specified by VESA DisplayPort (DP) Standard preceded by a pseudo-header.
753
+ #: [``DLT_DISPLAYPORT_AUX``] DisplayPort AUX channel monitoring messages.
783
754
  DISPLAYPORT_AUX = 275
784
755
 
785
756
  #: [``DLT_LINUX_SLL2``] Linux "cooked" capture encapsulation v2.
@@ -788,7 +759,7 @@ class LinkType(IntEnum):
788
759
  #: [``DLT_SERCOS_MONITOR``] Sercos Monitor.
789
760
  SERCOS_MONITOR = 277
790
761
 
791
- #: [``DLT_OPENVIZSLA``] Openvizsla FPGA-based USB sniffer.
762
+ #: [``DLT_OPENVIZSLA``] OpenVizsla FPGA-based USB sniffer frames.
792
763
  OPENVIZSLA = 278
793
764
 
794
765
  #: [``DLT_EBHSCR``] Elektrobit High Speed Capture and Replay (EBHSCR) format.
@@ -798,25 +769,23 @@ class LinkType(IntEnum):
798
769
  #: dispatch tracer, in the the graph dispatcher trace format.
799
770
  VPP_DISPATCH = 280
800
771
 
801
- #: [``DLT_DSA_TAG_BRCM``] Ethernet frames, with a switch tag inserted between
802
- #: the source address field and the type/length field in the Ethernet header.
772
+ #: [``DLT_DSA_TAG_BRCM``] Ethernet frames, with a Broadcom switch tag inserted.
803
773
  DSA_TAG_BRCM = 281
804
774
 
805
- #: [``DLT_DSA_TAG_BRCM_PREPEND``] Ethernet frames, with a switch tag inserted
806
- #: before the destination address in the Ethernet header.
775
+ #: [``DLT_DSA_TAG_BRCM_PREPEND``] Ethernet frames, with a Broadcom switch tag
776
+ #: prepended.
807
777
  DSA_TAG_BRCM_PREPEND = 282
808
778
 
809
779
  #: [``DLT_IEEE802_15_4_TAP``] IEEE 802.15.4 Low-Rate Wireless Networks, with a
810
780
  #: pseudo-header containing TLVs with metadata preceding the 802.15.4 header.
811
781
  IEEE802_15_4_TAP = 283
812
782
 
813
- #: [``DLT_DSA_TAG_DSA``] Ethernet frames, with a switch tag inserted between
814
- #: the source address field and the type/length field in the Ethernet header.
783
+ #: [``DLT_DSA_TAG_DSA``] Ethernet frames, with a Marvell DSA switch tag
784
+ #: inserted.
815
785
  DSA_TAG_DSA = 284
816
786
 
817
- #: [``DLT_DSA_TAG_EDSA``] Ethernet frames, with a programmable Ethernet type
818
- #: switch tag inserted between the source address field and the type/length
819
- #: field in the Ethernet header.
787
+ #: [``DLT_DSA_TAG_EDSA``] Ethernet frames, with a Marvell EDSA switch tag
788
+ #: inserted.
820
789
  DSA_TAG_EDSA = 285
821
790
 
822
791
  #: [``DLT_ELEE``] Payload of lawful intercept packets using the ELEE protocol.
@@ -840,16 +809,14 @@ class LinkType(IntEnum):
840
809
  #: standards page, beginning with a Base Header.
841
810
  ATSC_ALP = 289
842
811
 
843
- #: [``DLT_ETW``] Event Tracing for Windows messages, beginning with a pseudo-
844
- #: header.
812
+ #: [``DLT_ETW``] Event Tracing for Windows messages.
845
813
  ETW = 290
846
814
 
847
815
  #: [``DLT_NETANALYZER_NG``] Reserved for Hilscher Gesellschaft fuer
848
816
  #: Systemautomation mbH netANALYZER NG hardware and software.
849
817
  NETANALYZER_NG = 291
850
818
 
851
- #: [``DLT_ZBOSS_NCP``] Serial NCP (Network Co-Processor) protocol for Zigbee
852
- #: stack ZBOSS by DSR. ZBOSS NCP protocol, beginning with a header.
819
+ #: [``DLT_ZBOSS_NCP``] ZBOSS NCP Serial Protocol, with a pseudo-header.
853
820
  ZBOSS_NCP = 292
854
821
 
855
822
  #: [``DLT_USB_2_0_LOW_SPEED``] Low-Speed USB 2.0, 1.1, or 1.0 packet, beginning
@@ -376,7 +376,7 @@ class TransType(IntEnum):
376
376
  #: IPX in IP [CJ Lee]
377
377
  IPX_in_IP = 111
378
378
 
379
- #: Virtual Router Redundancy Protocol [RFC-ietf-rtgwg-vrrp-rfc5798bis-18]
379
+ #: Virtual Router Redundancy Protocol [:rfc:`9568`]
380
380
  VRRP = 112
381
381
 
382
382
  #: PGM Reliable Transport Protocol [Tony Speakman]
@@ -407,7 +407,7 @@ class TransType(IntEnum):
407
407
  SMP = 121
408
408
 
409
409
  #: Simple Multicast Protocol (deprecated)) [Jon Crowcroft][draft-perlman-
410
- #: simple-multicast]
410
+ #: simple-multicast-03]
411
411
  SM = 122
412
412
 
413
413
  #: Performance Transparency Protocol [Michael Welzl]
@@ -479,6 +479,12 @@ class TransType(IntEnum):
479
479
  #: Network Service Header [:rfc:`9491`]
480
480
  NSH = 145
481
481
 
482
+ #: Homa [HomaModule][John Ousterhout]
483
+ Homa = 146
484
+
485
+ #: Bit-stream Emulation [RFC-ietf-pals-ple-14]
486
+ BIT_EMU = 147
487
+
482
488
  #: Use for experimentation and testing [:rfc:`3692`]
483
489
  Use_for_experimentation_and_testing_253 = 253
484
490
 
@@ -514,7 +520,7 @@ class TransType(IntEnum):
514
520
  """
515
521
  if not (isinstance(value, int) and 0 <= value <= 255):
516
522
  raise ValueError('%r is not a valid %s' % (value, cls.__name__))
517
- if 146 <= value <= 252:
523
+ if 148 <= value <= 252:
518
524
  #: Unassigned [Internet Assigned Numbers Authority]
519
525
  return extend_enum(cls, 'Unassigned_%d' % value, value)
520
526
  return super()._missing_(value)
@@ -139,14 +139,14 @@ class Option(IntEnum):
139
139
  Reserved_78 = 78
140
140
 
141
141
  #: Accurate ECN Order 0 (AccECN0) (TEMPORARY - registered 2022-08-03, extension
142
- #: registered 2023-06-13, expires 2024-08-03) [draft-ietf-tcpm-accurate-ecn-20]
142
+ #: registered 2024-07-11, expires 2025-08-03) [draft-ietf-tcpm-accurate-ecn-20]
143
143
  Accurate_ECN_Order_0 = 172
144
144
 
145
145
  #: Reserved
146
146
  Reserved_173 = 173
147
147
 
148
148
  #: Accurate ECN Order 1 (AccECN1) (TEMPORARY - registered 2022-08-03, extension
149
- #: registered 2023-06-13, expires 2024-08-03) [draft-ietf-tcpm-accurate-ecn-20]
149
+ #: registered 2024-07-11, expires 2025-08-03) [draft-ietf-tcpm-accurate-ecn-20]
150
150
  Accurate_ECN_Order_1 = 174
151
151
 
152
152
  #: RFC3692-style Experiment 1 (also improperly used for shipping
@@ -325,6 +325,8 @@ class Info(Mapping[str, VT], Generic[VT], metaclass=InfoMeta):
325
325
 
326
326
  def __iter__(self) -> 'Iterator[str]':
327
327
  for key in self.__dict__:
328
+ if key in self.__excluded__:
329
+ continue
328
330
  yield self.__map_reverse__.get(key, key)
329
331
 
330
332
  def __getitem__(self, name: 'str') -> 'VT':
pcapkit/dumpkit/pcap.py CHANGED
@@ -13,6 +13,7 @@ import sys
13
13
  from typing import TYPE_CHECKING
14
14
 
15
15
  from pcapkit.dumpkit.common import DumperBase as Dumper
16
+ from pcapkit.protocols.data.misc.pcap.header import Header as Data_Header
16
17
  from pcapkit.protocols.misc.pcap.frame import Frame
17
18
  from pcapkit.protocols.misc.pcap.header import Header
18
19
 
@@ -24,6 +25,7 @@ if TYPE_CHECKING:
24
25
  from typing_extensions import Literal
25
26
 
26
27
  from pcapkit.const.reg.linktype import LinkType as Enum_LinkType
28
+ from pcapkit.protocols.data.misc.pcap.frame import Frame as Data_Frame
27
29
 
28
30
  __all__ = [
29
31
  'PCAPIO',
@@ -41,6 +43,9 @@ class PCAPIO(Dumper):
41
43
  **kwargs: arbitrary keyword arguments
42
44
 
43
45
  """
46
+ if TYPE_CHECKING:
47
+ #: PCAP file global header.
48
+ _ghdr: 'Data_Header'
44
49
 
45
50
  ##########################################################################
46
51
  # Properties.
@@ -77,7 +82,7 @@ class PCAPIO(Dumper):
77
82
 
78
83
  super().__init__(fname, protocol=protocol, byteorder=byteorder, nanosecond=nanosecond, **kwargs)
79
84
 
80
- def __call__(self, value: 'Frame', name: 'Optional[str]' = None) -> 'PCAPIO':
85
+ def __call__(self, value: 'Data_Frame', name: 'Optional[str]' = None) -> 'PCAPIO':
81
86
  """Dump a new frame.
82
87
 
83
88
  Args:
@@ -108,15 +113,17 @@ class PCAPIO(Dumper):
108
113
  **kwargs: arbitrary keyword arguments
109
114
 
110
115
  """
111
- packet = Header(
116
+ header = Header(
112
117
  network=protocol,
113
118
  byteorder=byteorder,
114
119
  nanosecond=nanosecond,
115
- ).data
120
+ )
121
+ packet = header.data
116
122
  with open(self._file, 'wb') as file:
117
123
  file.write(packet)
124
+ self._ghdr = header.info
118
125
 
119
- def _append_value(self, value: 'Frame', file: 'IO[bytes]', name: 'str') -> 'None': # pylint: disable=unused-argument
126
+ def _append_value(self, value: 'Data_Frame', file: 'IO[bytes]', name: 'str') -> 'None': # pylint: disable=unused-argument
120
127
  """Call this function to write contents.
121
128
 
122
129
  Args:
@@ -130,7 +137,8 @@ class PCAPIO(Dumper):
130
137
  num=self._fnum,
131
138
  proto=self._link,
132
139
  packet=value.packet,
133
- **value.info.frame_info,
140
+ header=self._ghdr,
141
+ **value.frame_info,
134
142
  ).data
135
143
  file.write(packet)
136
144
  self._fnum += 1
@@ -5,7 +5,7 @@
5
5
  from typing import TYPE_CHECKING
6
6
 
7
7
  from pcapkit.corekit.infoclass import info_final
8
- from pcapkit.protocols.data.data import Data
8
+ from pcapkit.protocols.data.protocol import Protocol
9
9
 
10
10
  if TYPE_CHECKING:
11
11
  from typing_extensions import Literal
@@ -20,7 +20,7 @@ __all__ = [
20
20
  ]
21
21
 
22
22
 
23
- class FTP(Data):
23
+ class FTP(Protocol):
24
24
  """Data model for FTP protocol."""
25
25
 
26
26
  #: Type.
@@ -5,6 +5,7 @@ from typing import TYPE_CHECKING
5
5
 
6
6
  from pcapkit.corekit.infoclass import info_final
7
7
  from pcapkit.protocols.data.data import Data
8
+ from pcapkit.protocols.data.protocol import Protocol
8
9
 
9
10
  if TYPE_CHECKING:
10
11
  from typing import Any
@@ -23,7 +24,7 @@ __all__ = [
23
24
 
24
25
 
25
26
  @info_final
26
- class HTTP(Data):
27
+ class HTTP(Protocol):
27
28
  """Data model for HTTP/1.* protocol."""
28
29
 
29
30
  #: HTTP receipt.
@@ -5,6 +5,7 @@ from typing import TYPE_CHECKING
5
5
 
6
6
  from pcapkit.corekit.infoclass import info_final
7
7
  from pcapkit.protocols.data.data import Data
8
+ from pcapkit.protocols.data.protocol import Protocol
8
9
 
9
10
  if TYPE_CHECKING:
10
11
  from typing import Optional
@@ -38,7 +39,7 @@ class Flags(Data):
38
39
  __value__: 'FrameType.Flags'
39
40
 
40
41
 
41
- class HTTP(Data):
42
+ class HTTP(Protocol):
42
43
  """Data model for HTTP/2 protocol."""
43
44
 
44
45
  #: Length.
@@ -4,7 +4,7 @@
4
4
  from typing import TYPE_CHECKING
5
5
 
6
6
  from pcapkit.corekit.infoclass import info_final
7
- from pcapkit.protocols.data.data import Data
7
+ from pcapkit.protocols.data.protocol import Protocol
8
8
 
9
9
  if TYPE_CHECKING:
10
10
  from pcapkit.const.reg.transtype import TransType
@@ -13,7 +13,7 @@ __all__ = ['AH']
13
13
 
14
14
 
15
15
  @info_final
16
- class AH(Data):
16
+ class AH(Protocol):
17
17
  """Data model for AH protocol."""
18
18
 
19
19
  #: Next header.
@@ -5,6 +5,7 @@ from typing import TYPE_CHECKING
5
5
 
6
6
  from pcapkit.corekit.infoclass import info_final
7
7
  from pcapkit.protocols.data.data import Data
8
+ from pcapkit.protocols.data.protocol import Protocol
8
9
 
9
10
  if TYPE_CHECKING:
10
11
  from datetime import timedelta
@@ -82,7 +83,7 @@ class Parameter(Data):
82
83
 
83
84
 
84
85
  @info_final
85
- class HIP(Data):
86
+ class HIP(Protocol):
86
87
  """Data model for HIP header."""
87
88
 
88
89
  #: Next header.
@@ -5,6 +5,7 @@ from typing import TYPE_CHECKING
5
5
 
6
6
  from pcapkit.corekit.infoclass import info_final
7
7
  from pcapkit.protocols.data.data import Data
8
+ from pcapkit.protocols.data.protocol import Protocol
8
9
 
9
10
  if TYPE_CHECKING:
10
11
  from datetime import timedelta
@@ -50,7 +51,7 @@ class Option(Data):
50
51
 
51
52
 
52
53
  @info_final
53
- class HOPOPT(Data):
54
+ class HOPOPT(Protocol):
54
55
  """Data model for HOPOPT protocol."""
55
56
 
56
57
  #: Next header.
@@ -7,6 +7,7 @@ from pcapkit.const.ipv4.option_class import OptionClass
7
7
  from pcapkit.const.ipv4.tos_del import ToSDelay
8
8
  from pcapkit.corekit.infoclass import info_final
9
9
  from pcapkit.protocols.data.data import Data
10
+ from pcapkit.protocols.data.protocol import Protocol
10
11
 
11
12
  if TYPE_CHECKING:
12
13
  from datetime import timedelta
@@ -88,7 +89,7 @@ class Flags(Data):
88
89
 
89
90
 
90
91
  @info_final
91
- class IPv4(Data):
92
+ class IPv4(Protocol):
92
93
  """Data model for IPv4 packet."""
93
94
 
94
95
  #: Version.
@@ -4,7 +4,7 @@
4
4
  from typing import TYPE_CHECKING
5
5
 
6
6
  from pcapkit.corekit.infoclass import info_final
7
- from pcapkit.protocols.data.data import Data
7
+ from pcapkit.protocols.data.protocol import Protocol
8
8
 
9
9
  if TYPE_CHECKING:
10
10
  from ipaddress import IPv6Address
@@ -21,7 +21,7 @@ __all__ = [
21
21
 
22
22
 
23
23
  @info_final
24
- class IPv6(Data):
24
+ class IPv6(Protocol):
25
25
  """Data model for Internet Protocol version 6.
26
26
 
27
27
  Important:
@@ -4,7 +4,7 @@
4
4
  from typing import TYPE_CHECKING
5
5
 
6
6
  from pcapkit.corekit.infoclass import info_final
7
- from pcapkit.protocols.data.data import Data
7
+ from pcapkit.protocols.data.protocol import Protocol
8
8
 
9
9
  if TYPE_CHECKING:
10
10
  from pcapkit.const.reg.transtype import TransType
@@ -13,7 +13,7 @@ __all__ = ['IPv6_Frag']
13
13
 
14
14
 
15
15
  @info_final
16
- class IPv6_Frag(Data):
16
+ class IPv6_Frag(Protocol):
17
17
  """Data model for IPv6 fragment header."""
18
18
 
19
19
  #: Next header.
@@ -5,6 +5,7 @@ from typing import TYPE_CHECKING
5
5
 
6
6
  from pcapkit.corekit.infoclass import info_final
7
7
  from pcapkit.protocols.data.data import Data
8
+ from pcapkit.protocols.data.protocol import Protocol
8
9
 
9
10
  if TYPE_CHECKING:
10
11
  from datetime import timedelta
@@ -50,7 +51,7 @@ class Option(Data):
50
51
 
51
52
 
52
53
  @info_final
53
- class IPv6_Opts(Data):
54
+ class IPv6_Opts(Protocol):
54
55
  """Data model for IPv6-Opts protocol."""
55
56
 
56
57
  #: Next header.
@@ -4,7 +4,7 @@
4
4
  from typing import TYPE_CHECKING
5
5
 
6
6
  from pcapkit.corekit.infoclass import info_final
7
- from pcapkit.protocols.data.data import Data
7
+ from pcapkit.protocols.data.protocol import Protocol
8
8
 
9
9
  if TYPE_CHECKING:
10
10
  from ipaddress import IPv6Address
@@ -19,7 +19,7 @@ __all__ = [
19
19
  ]
20
20
 
21
21
 
22
- class IPv6_Route(Data):
22
+ class IPv6_Route(Protocol):
23
23
  """Data model for IPv6-Route protocol."""
24
24
 
25
25
  #: Next header.
@@ -5,6 +5,7 @@ from typing import TYPE_CHECKING
5
5
 
6
6
  from pcapkit.corekit.infoclass import info_final
7
7
  from pcapkit.protocols.data.data import Data
8
+ from pcapkit.protocols.data.protocol import Protocol
8
9
 
9
10
  if TYPE_CHECKING:
10
11
  from pcapkit.const.ipx.packet import Packet
@@ -35,7 +36,7 @@ class Address(Data):
35
36
 
36
37
 
37
38
  @info_final
38
- class IPX(Data):
39
+ class IPX(Protocol):
39
40
  """Data model for Internetwork Packet Exchange."""
40
41
 
41
42
  #: Checksum.
@@ -5,6 +5,7 @@ from typing import TYPE_CHECKING
5
5
 
6
6
  from pcapkit.corekit.infoclass import info_final
7
7
  from pcapkit.protocols.data.data import Data
8
+ from pcapkit.protocols.data.protocol import Protocol
8
9
 
9
10
  if TYPE_CHECKING:
10
11
  from datetime import datetime as dt_type
@@ -84,7 +85,7 @@ __all__ = [
84
85
  ]
85
86
 
86
87
 
87
- class MH(Data):
88
+ class MH(Protocol):
88
89
  """Data model for MH protocol."""
89
90
 
90
91
  #: Next header.