1.6.0 – 2026-11-05¶
1.6.0 puts the protocol pairs that wanted a shared abstract base on one: ICMPv4
and ICMPv6, the two Linux cooked-capture headers, and SSLv2, TLS and DTLS. It adds
dissectors for IGMP and DCCP, which had none, and for each arphrd_type the
cooked-capture headers do not read as an EtherType, along with the IP
pseudo-header, verified and computed one’s-complement checksums, stricter
handling of a malformed IPv6 extension header, and HTTP dispatched to its
HTTP/1 and HTTP/2 classes under the RFC names.
Added –
LinuxSLL1andLinuxSLL2, dissectors for the Linux “cooked” capture headerstcpdump -i anywrites, underLINKTYPE_LINUX_SLL(113) andLINKTYPE_LINUX_SLL2(276), on aLinuxSLLfamily base; PCAP and PCAP-NG frames of either link type dispatch to them (#2438, #2443).'LinuxSLL'selects either version, and each version’s own name selects that version alone.protocol_typedispatches onward as an EtherType, except under thearphrd_typevalues that carry none –FRAD,NETLINK,IPGRE/IP6GREandIEEE80211_RADIOTAP– each of which has a dissector of its own, below (#2460), reached throughLinuxSLL’s own registry keyed byarphrd_type, whichregister_arphrd()extends (#2510, #2527), as does a protocol class declaringcode=ARPHRD.X, sinceARPHRDnamesLinuxSLLas its__proto_dest__(#2533, #2598). A parse told to stop there – atLinuxSLL, the version itself or the link layer – keeps the payloadRawon either path (#2532, #2587). The hardware types areARPHRD, generated bypcapkit.vendor.linux.arphrd.ARPHRDfrom a hand-maintained table. It names only the<linux/if_arp.h>values that table lists, so any other,ARPHRD_ETHERincluded, reads asUnassigned(#2495, #2497), andpcapkit.constexports it asLinux_ARPHRD(#2661, #2663).Added –
FRAD, a dissector for Frame Relay’s multiprotocol encapsulation (RFC 2427, obsoleting RFC 1490), whichLinuxSLLdispatches to forARPHRD_FRAD(#2499), as do PCAP and PCAP-NG frames ofLINKTYPE_FRELAY(107) (#2649, #2667). The direct NLPID and SNAP-encapsulated forms both dispatch onward, to IPv4/IPv6 and (via the EtherType registry every Ethernet/VLAN/LinuxSLL frame shares) ARP among others; any other NLPID or SNAP OUI is kept asRaw, andregister_frad()registers a dissector for a further NLPID (#2527). A Q.922 address other than the 2-octet form, its EA bits other than 0 then 1, is refused withProtocolErrorunless the capture cut it short, and is kept asRawwith nothing logged behindLinuxSLLor aLINKTYPE_FRELAYcapture. A header the capture cut short, before its NLPID included, rebuilds as captured and logs nothing (#2710, #2719). The data model records aspadwhether the one0x00pad octet RFC 2427 Section 3 allows ahead of an NLPID was captured, so a frame rebuilds with its pad or without it, as captured;make()takespad, by default writing one ahead of a SNAP header or an NLPID of 0, and refusespad=Falsewith an NLPID of 0 (#2716, #2721).Added –
Netlink, a dissector for the fixed 16-octetnlmsghdrframing of Linux’s kernel/userspace IPC transport (the kernel’snetlink(7)man page; RFC 3549 Section 2.3.2), whichLinuxSLLdispatches to forARPHRD_NETLINK(#2500, #2507). Netlink is IPC rather than a wire format, so the header’s byte order is ambiguous;nlmsg_byteorder()guesses it the way Wireshark’s netlink dissector does. Only the first message’s header is dissected: what follows it, its per-family payload and any further message in the same capture, is kept asRawunlessregister_netlink()registers a dissector for itsnlmsg_type(#2527).Added –
GRE, a dissector for the Generic Routing Encapsulation base header (RFC 2784) plus the optional Key and Sequence Number extensions (RFC 2890), whichLinuxSLLdispatches to for bothARPHRD_IPGREandARPHRD_IP6GRE– the same GRE framing either way, the two differing only in the tunnel’s outer IP version (#2501, #2508), as does an IP layer for IP protocol 47, through the registry (Internet.__proto__) IPv4 and IPv6 share (#2649, #2667). So with reassembly and tracing on, analysis follows a GRE tunnel: TCP inside GRE over IP reassembles under its inner addresses, and a fragmented GRE datagram reassembles to a parsed GRE layer. The Protocol Type field dispatches onward as an EtherType, through the family registry (Link.__proto__) Ethernet, VLAN and LinuxSLL share. A non-zero Version, RFC 2637’s Enhanced GRE, is kept asRawrather than misread.Added –
Radiotap, a dissector for the radiotap header (<https://www.radiotap.org/>) capture tools prepend to an 802.11 frame, whichLinuxSLLdispatches to forARPHRD_IEEE80211_RADIOTAP(#2502, #2509), as do PCAP and PCAP-NG frames ofLINKTYPE_IEEE802_11_RADIOTAP(127) (#2608, #2632). It decodes the fixed 8-octet start (it_version,it_pad,it_len) and records every present-flags word, following bit 31 from one word to the next. The optional fields those words select are kept whole asfields, which a rebuild writes, and decoded asdecoded, an entry in wire order for each bit that selects a radiotap field or switches namespace, each field aligned from the start of the header as radiotap.org lays it out (#2576, #2657). That covers radiotap.org’s defined fields, the RTS and data retries of bits 16 and 17, the radiotap and vendor namespace switches, a vendor namespace’s data kept raw, and the items of TLV mode, a vendor item split into its header and raw data. An item a producer cut short of its layout, as radiotap.org allows, decodes with the octets it lacks as zeros and rebuilds as captured (#2655, #2690). A bit no field is defined for, or a field running past the region, ends the walk as anUnknownentry holding the rest, andmake()takes the fields decoded as well as raw. Each field type has a concreteRadiotapFieldschema, and is read and made throughRadiotap.__field__, whichRadiotap.register_fieldandregister_radiotap_field()extend. A bitmap radiotap.org defines bit by bit is a member of its flag registry, which keeps the bits it does not name. One mixing value subfields with flags – MCSflags, HEdata1anddata2, HE-MUflags1andflags2and U-SIGcommon– decodes into a data model of its subfields, each anint, and, except in MCS’s, its other bits asknown, a member of a known-bits registry such asHEData1Known;make()takes it as a mapping, refusing a subfield its bits cannot hold or aknownsetting a subfield’s bit withProtocolError(#2647, #2696).BitmapFieldreads such a word, an integer in its byte order split into subfields counted from its least-significant bit. The field types and those registries arepcapkit.const.radiotap, crawled from radiotap.org’s pages; a flag takes the name of its macro in Linux’sieee80211_radiotap.h, or in Wireshark where Linux defines none, and radiotap.org’s wording where neither does. The 802.11 MAC frame behind the header is dissected asIEEE802_11, below, looked up inRadiotap’s own registry underLinkType.IEEE802_11, andregister_radiotap()replaces that dissector (#2575, #2607).Added –
IEEE802_11, a dissector for the IEEE 802.11 MAC header of a protocol version 0 frame, whichRadiotapdispatches to (#2575, #2607), as do PCAP and PCAP-NG frames ofLINKTYPE_IEEE802_11(105) (#2608, #2632). It reads Frame Control, the Control Frame Extension and S1G Beacon layouts included, and the address, sequence, QoS Control and HT Control fields each frame type carries; a Control frame of a subtype it does not model, and an Extension frame, are read as the minimal header. The frame body is kept asRaw, with the FCS and radiotap’s pad octets where captured, asRadiotapdecodes the Flags that mark them but does not pass them on, and any other protocol version is refused. The frame types and subtypes arepcapkit.const.ieee802_11, from hand-maintained tables of IEEE Std 802.11-2020’s Table 9-1.Added –
ICMPv4(RFC 792) andICMPv6(RFC 4443), on an abstractICMPbase, for IP protocols 1 and 58, which were kept asRaw(#2436, #2446); a protochain namesICMPv6where it namedIPv6_ICMP. Echo, Destination Unreachable, Time Exceeded and Parameter Problem bodies are decoded, and ICMPv6’s Packet Too Big; every other type, Neighbor Discovery and MLD included, keeps its body raw. ICMPv4 takes the plainICMPof RFC 792 as itsid()and alias.register_icmp_type()registers a message-body parser. The type and code registries arepcapkit.const.icmpandpcapkit.const.icmpv6, crawled from IANA.Added – IGMPv1 (RFC 1112), IGMPv2 (RFC 2236) and IGMPv3 (RFC 3376), as
IGMPv1,IGMPv2andIGMPv3, each named after its module (#2529, #2542), on an abstractIGMPbase bound at IP protocol 2, which picks the version from the message type alone except for a Membership Query: one of 8 octets is IGMPv1 if its Max Resp Time is zero and IGMPv2 otherwise, one of 12 or more IGMPv3 (#2439, #2448, #2444, #2465). An IGMPv3 Query carries its source list and a Membership Report its group records, and an IGMPv3 Query’s Max Resp Code and QQIC are decoded from their floating-point form. An IGMPv3 message the capture cut short, a Report cut inside its group records included, parses and rebuilds as captured, whether parsed on its own or carried by IPv4, and IGMPv3’smake()takesnum_group_records, from the record count to0xFFFF(#2650, #2660, #2662, #2672). The octets it lacks read as zeros, in the group record the cut lands inside included, and a Report’s header schema cut inside the Additional Data past its records packs back as captured (#2686, #2687, #2701); no group record past the cut is read, however the Report is framed (#2756, #2758), and no source address past it either, in a Query or a group record. A Query’s data model carriesnum_sources, whichmake()takes, so one cut inside its sources keeps the count it declared and one whose sources are edited recounts them (#2760, #2766). A Report parsed on its own sizes its group records by its record count, so one cut before the records it counts readsTRUNCATED, as it does behind IPv4, holding the records captured and none made up, and a count no IP payload could carry raisesProtocolError(#2711, #2738); one cut inside a counted record reads quietly (#2749, #2755). Any other message, a 9- to 11-octet Query included, is kept asRaw. IGMPv1 takes the plainIGMPof RFC 1112 as itsid()and alias, and IGMPv2’s and IGMPv3’sid()are their own names alone,('IGMPv2',)and('IGMPv3',); the base’s is('IGMP', 'IGMPv2', 'IGMPv3'), each member’s canonical name (#2512, #2506, #2518). IGMPv2’s and IGMPv3’snamecarries the version,'Internet Group Management Protocol version 2'say, while IGMPv1’s, as in RFC 1112, does not (#2558, #2590). The registries arepcapkit.const.igmp: the types crawled from IANA, the group record types from a hand-maintained table.Added – construction through a versioned family’s base:
IPandL2TP, which raisedTypeErrorin 1.5.x, and theICMP,IGMPandLinuxSLLbases above give a member, never an instance of the base, on parsing octets, building from fields andfrom_data(#2574, #2639). Theversionkeyword names the member. Without it, IP’s, IGMP’s and L2TP’s octets give the member they describe, andfrom_datathe one its data names, IGMP’s data models carrying aversionfor it. Building from fields without it raisesProtocolError, whose message asks forversion, and so do ICMP and Linux cooked-capture octets, which carry no version; theirfrom_dataon adictraises it too, as does a version a family has no member for, such as L2TP’s3. A member built directly takesversionas well, which must be its own. HTTP’s base follows the same rules, a breaking change given below (#2628, #2651). IPv4 and IPv6 check the Version field before the rest of the header, so octets of the other version raise[IPv4] invalid version: 6say, where IPv4’s error named whichever field they broke first.Added –
DCCP(RFC 4340) for IP protocol 33, which was kept asRaw(#2489, #2593). It reads and builds the generic header with short and long sequence numbers, the fields of every packet type, DCCP-Listen (RFC 5596) and the options; the Data Checksum option’s CRC-32c is recorded rather than checked. Its checksum is verified and computed as TCP’s is, below, over the enclosing IP layer’s pseudo-header and the part of the packet its Checksum Coverage gives (RFC 4340 Section 9.2): a coverage running past the packet isINVALIDand warns, and amake()that computes the checksum writes a coverage reaching the end of the packet as 0, as Linux did.register_dccp()registers a port’s dissector, andregister_dccp_option()an option parser. The registries arepcapkit.const.dccp, crawled from IANA. Itsmake()refuses a value a field cannot hold withProtocolErrornaming the field (#2614, #2670), and an option given as empty raw octets (#2723, #2728).Added –
TLS(SSLv3 and TLS 1.0 to 1.3) at TCP 443 andDTLS(DTLS 1.0, 1.2 and 1.3) at UDP 5684, on an abstractSSLbase (#2437, #2441). Each reads every version of its record layer and reports it throughalias, asARPdoes by operation, telling 1.3 apart by itssupported_versionsextension;id()stays('TLS',)or('DTLS',). A cleartext handshake record is decoded – ClientHello and ServerHello down to their cipher suites, compression methods and extensions, EncryptedExtensions down to its extensions, any other message at type and length – as are an alert and ChangeCipherSpec, while encrypted records stay opaque octets. An extension’s body is read and built forserver_name,supported_groups,signature_algorithms, ALPN,supported_versionsandkey_share, a HelloRetryRequest’s included, and kept as octets for any other type or for a body its parser rejects, which logs nothing;register_tls_extension()registers a parser and constructor for a further type (#2514, #2595).make()refuses a value too wide for its field, in the record header or in the content it builds, withStructError(#2614, #2638), and a name, or a code too wide, for an enumeration field withProtocolError, as the other makers do, below (#2594, #2692). Each whole TLS record in a TCP segment is a layer of its own, the previous record’s payload, so each alias names its own version –TCP:TLS 1.3:TLS 1.2– and one that fails to decode isRawwith the rest of the segment (#2517, #2537).SSLv3, inpcapkit.protocols.application.sslv3(#2529, #2602), exists for explicit construction only. A record split across TCP segments is not reassembled and staysRaw. DTLS also reads and builds the DTLS 1.3 unified-header records of RFC 9147 Section 4.1 (#2467, #2494) and RFC 9146tls12_cidrecords. ADTLSContext, given toextract()as itscontext, resolves the connection ID of atls12_cidrecord, or of a unified-header record with itsCbit set (#2625, #2643), from those the capture’s hellos negotiate in theirconnection_idextension, which TLS and DTLS both decode, or from thecid_lengththe caller gives it, and one it cannot resolve stays Raw. An ID a DTLS 1.3NewConnectionIdissues is encrypted, so only the caller can give it. A unified-header record’sinfocarries its ID ascid,Nonewhen theCbit is clear, aslengthis when theLbit is, so that the one header keeps one data model, as settled on #2625; itsmake()takes acidand sets theCbit. Atls12_cidrecord’s schema and data model areDTLSCIDCiphertext, in the DTLS package, and the extension’s data model isConnectionId, in the SSL package’s (#2515, #2631, #2641). Each whole DTLS record in a UDP datagram is likewise a layer of its own – a DTLS 1.2 record then a DTLS 1.3 unified-header record readDTLS 1.2:DTLS 1.3– a unified-header record with no length running to the end of the datagram, and one that fails to decode isRawwith the rest of the datagram (#2535, #2603). The content, handshake and extension types arepcapkit.const.tls, crawled from IANA (#2495, #2514, #2503, #2595). Each record, an SSLv2 one TLS adopts and a DTLS 1.3 unified-header ortls12_cidrecord included, rebuilds from itsto_dict()as from its data model (#2762, #2764).Added –
SSLv2, a dissector for SSL version 2 (draft-hickman-netscape-ssl-00), whose record layer shares nothing with TLS’s (#2457, #2466). It is bound to no port: on TCP 443 a segment’s first record that TLS rejects is tried as SSLv2, and kept only as a complete CLIENT-HELLO or SERVER-HELLO whose length fields agree, so anything else staysRaw; a kept one drops the rejected TLS trial’s warnings (#2525, #2537). Each whole record after the first in a TCP segment, whatever its message type, is a further SSLv2 layer, the previous record’s payload, as with TLS – aCLIENT-HELLOthen aCLIENT-MASTER-KEYreadSSLv2:SSLv2– and one that fails to decode isRawwith the rest of the segment (#2567, #2585). Its constants arepcapkit.const.sslv2, from a hand-maintained table.Added – dissection of every whole HTTP/2 frame in a TCP segment: each after the first, which was kept as
Raw, is a furtherHTTPv2layer, the previous frame’s payload, as with TLS – aSETTINGSthen aWINDOW_UPDATEframe readTCP:HTTP/2:HTTP/2(#2536, #2609). One that fails to decode isRawwith the rest of the segment and the parser’serror, and a frame the segment ends inside staysRawwith none. A parse told to stop at HTTP/2 keeps the rest of the segment raw, andFRAME_LAYER_LIMITbounds how many frames are dissected.Added –
pcapkit.foundation.reassembly.dtls.DTLS, exported asDTLS_Reassembly, which reassembles a DTLS handshake message fragmented across records (RFC 6347 Section 4.2.3), keyed by the UDP 4-tuple and the epoch, accepting overlapping fragments and holding a buffer until it completes (#2440, #2451). It is opt-in, asdtls=Truewithreassembly=TruetoExtractororextract(), and runs on the default engine alone, fed bydtls_reassembly()and itspcapkit.toolkit.pcapngcounterpart from the first record of each datagram only; any other engine turns it off with a warning.dtls_handshake()decodes a reassembled message (#2496, #2528). A reassembledDatagramholds that decode aspacket, run on its first read as an IP or TCP datagram’s is, andNonefor an incomplete message (#2531, #2605). Both run the classmethodDTLS.analyze_handshake–packetthrough the reassembly class’s own__protocol_type__– which keeps a body that does not decode as raw octets, logging nothing (#2622, #2634).Added –
ip_datagram()andtcp_datagram(), siblings ofdtls_handshake, above, which parse the payload of a datagram that IPv4, IPv6 or TCP reassembly reports, by its payload protocol or by its port pair, and returnNonefor the tuple of received runsstrict=Truereports for an incomplete one (#2581, #2619).Added –
IP_Pseudo, the IPv4 (RFC 793) or IPv6 (RFC 8200 Section 8.1) pseudo-header an upper-layer checksum covers, built from an IPv4 or IPv6 layer, explicit values, or both (#2471, #2479). From a layer it takes the final destination of a source route or of a Routing header with segments left, a Home Address option’s address as the IPv6 source, and the upper-layer length, from UDP’s Length or a jumbogram’s Jumbo Payload Length where those apply; a fragment of a larger packet, or a header it cannot walk at any depth of the chain, raisesProtocolError(#2513, #2543). It is not a layer on the wire.Added – verification and computation of the one’s-complement Internet checksum (RFC 1071) of the IPv4 header, TCP, UDP, ICMP, ICMPv6 and OSPFv2, in
pcapkit.corekit.checksum.internet(#2470, #2472, #2473, #2474, #2475, #2543), and of IGMP and GRE (#2618, #2654), wherepcapkit.corekit.checksumholds a module per checksum family and imports nothing frompcapkit.protocols(#2580, #2586). Parsing verifies only underPCAPKIT_CHECKSUM_VERIFY, off by default, recording aChecksumStatusaschecksum_statusand warning on a mismatch withChecksumWarning, aProtocolWarninga filter can silence alone. Construction computes a checksum the caller leaves out, unlessPCAPKIT_CHECKSUM_COMPUTEis off. An IPv4 or IPv6 layer verifies and computes its upper layer’s checksum over theIP_Pseudoit builds, andmake()of TCP, UDP and ICMPv6 also takes apseudo. What checksum offload leaves on the sending host isNOT_COMPUTEDrather than a mismatch; a fragment’s TCP, UDP, ICMP, ICMPv6, IGMP or GRE checksum, which covers octets the fragment lacks, isNO_PSEUDO_HEADER.verify_message()verifies a checksum that covers its own message alone, as ICMP’s, IGMP’s and GRE’s do, givingNO_PSEUDO_HEADERfor a fragment’s payload. GRE verifies only with itsCbit set, and isNOT_COMPUTEDwith it clear; itsmake()takeschecksum_presentto set the bit and compute the checksum. GRE states no length, so outside an IP layer, which states one, it takes the captured and original lengths of its frame, and a GRE layer the capture cut short isTRUNCATEDeither way (#2653, #2668). ICMP’s, IGMP’s and GRE’s checksums take those lengths as well behind an IPv4 Total Length of 0, as TCP segmentation offload leaves it, and behind an AH there, so one the capture cut short isTRUNCATEDwith no warning; a GRE or IGMP layer read directly from octets that end inside its header or message isTRUNCATEDtoo (#2689, #2699). A layerfrom_datarebuilds from a cut capture, from its data model or itsdict, verifies as its parse did, so a cut GRE, ICMP, IGMP or OSPF layer isTRUNCATEDwith no warning (#2703, #2712). Each of these cuts, a TSO IPv4 payload’s included, is recorded on the message’s own header, so the message rebuilt on its own readsTRUNCATEDtoo, an ICMPv4 one included (#2711, #2738).Added –
register_ipx(),register_loopback(),register_sctp_chunk(),register_sctp_parameter()andregister_sctp_cause(), wrapping IPX’s packet-type map, Loopback’s address-family map and SCTP’s chunk, chunk-parameter and error-cause parser maps with the validation the other wrappers carry, and theIPX.registerandLoopback.registerclassmethods the IPX and Loopback wrappers call (#2511, #2521).Added –
pcapkit.corekit.schema.padding.pad_length(), the octets of padding that take a length to analign-octet boundary, and aPaddingFieldsized by it, givenalignandafter– the boundary, and the field or callable whose length the padding follows – in place oflength(#2614, #2624), in thepcapkit.corekit.schemapackage of helpers shared across the schema layer, given below (#2674, #2704).Added –
pcapkit.utilities.contextvars, holding the context variables more than one module sets or reads –beholding,frame_depth,frame_lengthandrebuilding– and importing nothing frompcapkit(#2616, #2623).frame_lengthholds the captured and original length of the frame being dissected, as its PCAP record or PCAP-NG packet block states them, and isNoneoutside a frame and inside an IP layer’s payload (#2653, #2668), unless the layer states no length for it: an IPv4 Total Length of 0, or an AH that IPv4 carries, hands the frame’s lengths on (#2689, #2699).Added –
pcapkit.utilities.pickle, holding thepicklereductions classes share (#2714, #2722):ReduceAsProtocol2, which reduces under every protocol as protocol 2 does;ReduceToName, which reduces a singleton to the name holding it;ReduceToItems, which reduces a multi-valued mapping to a call of its class on its item pairs; andreduce_to(), which makes one instance reduce to a given call.Info,Schemaand the reassembly engines takeReduceAsProtocol2, so on GraalPy they pickle under protocols 0 and 1, where 1.5.x raisedTypeError: typing.Generic() takes no arguments.pcapkit.corekit.fields.numbers._reduce_unregistered_memberis removed with no alias,reduce_toinstalling the reduction it built.Added –
pcapkit.utilities.inspect, holdingisabstract(), which tells an abstract class from a concrete one from its own namespace and its bases’__abstractmethods__, asabc.ABCMetacomputes them, rather than from the interpreter’s abstract flag, so it answers alike on every interpreter, while__init_subclass__()runs and once the class is made (#2784, #2785). AProtocolsubclass’s registration, below, decides with it.Changed – a breaking change to the IPv6 extension-header walk: a known extension header whose dedicated parser raises is now the upper layer, parsed once as
Raw, and the walk stops there, as RFC 8200 Section 4 has a node discard such a packet (#2477, #2480). It used to fall back to the genericIPv6_Extand walk on;IPv6_Extnow parses only Shim6, which has no dedicated parser, andIPv6.__generic_ext_codes__, the headers that fell back, is removed. The library no longer passesIPv6_Ext.read()anerror=, soIPv6_Ext.errorisNoneunless a caller supplies one; theRawlayer’sinfo.errorholds the failure instead.Changed – a breaking change to parsing a CALIPSO, SMF_DPD or MPL option in
HOPOPTorIPv6_Opts: an Opt Data Len too short for the option raisesProtocolError, where 1.5.x raisedFieldValueError, so code catchingFieldValueErrorfor it catchesProtocolErrorinstead, both beingValueError; inside IPv6 the header is kept asRawwith nothing logged, where 1.5.x logged it atCRITICAL(#2727, #2737). So do the length callbacks ofpcapkit.protocols.internet.ipv6_ext.schemathat size those options –calipso_pad_len,mpl_opt_pad_len,smf_i_dpd_id_lenandsmf_dpd_data_selector. A capture cut after such an option’s type octet reads as a short read, a CALIPSO or SMF_DPD option kept and rebuilt as captured and an MPL option refused quietly, where 1.5.x raisedFieldValueError: HOPOPT: invalid CALIPSO option length: 0logged atCRITICAL.Changed – a breaking change to parsing a Mobility Header or a Multipath TCP DSS option whose length does not fit its fields: it raises
ProtocolError, where 1.5.x read the fields it lacked as zeros, or dropped the octets past them, and rebuilt it longer than captured (#2669, #2683).MHrefuses a whole message whose Header Len is short of its type’s fixed fields, a message RFC 6275 Section 9.2 has discarded, so a Home Test with Header Len 1 raisesMH: [Type 3] invalid header length: 1, where its 24 octets rebuilt as 32. Inside IPv6 it is the upper layer, kept asRawby the walk above, and the packet rebuilds as captured, where its 64 octets rebuilt as 72.TCPrefuses a DSS Length other than the one RFC 8684 gives itsA,a,Mandmflags, or that plus the 2-octet checksum withMset, so a DSS of Length 6 carrying a 4-octet Data ACK, which takes 8, raisesTCP: [OptNo 30] invalid format, where its 40-octet segment rebuilt as 44; inside IPv4 the segment is kept asRawand the packet rebuilds as captured. A capture cut inside an MH message whose Header Len is short of it rebuilds with the Header Len it declared, where 1.5.x wrote the one its type takes. A mobility option whose fields do not take its Length is refused too, and so are such a sub-option, QoS attribute or CGA extension inside one, a target care-of address neither IPv4 nor IPv6, and CGA Parameters whose fixed fields or public key run past the option, where 1.5.x read octets that were not the option’s and rebuilt another (#2684, #2700). So an MN-ID option of Length 0 raisesMH: [OptNo 8] invalid option length: 0, where 1.5.x read its fields from the octets after it and rebuilt it with Length 17, and a Flow Identification option’s 8-octet target care-of address raisesMH: [FID SubOpt 5] invalid sub-option length: 10, where 1.5.x parsed it and raisedFieldValueErrorrebuilding it; inside IPv6 the header isRawand the packet rebuilds as captured.Changed – a breaking change to MH option data models.
QualityOfServiceOption, the Quality-of-Service option’s, gains a requiredtc_reservedafterdscp: the two reserved bits of the traffic class, which 1.5.x dropped, so a traffic class of0xB9rebuilt as0xB8(#2684, #2700). Building the model without it raisesTypeError, andMH’smake()takes it,0by default. The MN-ID and Service Selection makers count the octets an identifier packs as, so an NAI of'usér@x'takes Length 8, where 1.5.x wrote 7 from its characters, and a service identifier parsed from octets that are not UTF-8 rebuilds as captured, where 1.5.x re-encoded its text, under Length 4 where 3 were captured. A CGA public key of more than 127 octets, as a 1024-bit RSA key is, parses through the long form of its DER length, where 1.5.x misread the length and raisedProtocolError.MobileNetworkPrefixOption, the Mobile Network Prefix option’s, gains a requiredprefix_length, and itsprefixis theIPv6Addresscaptured, where it was anIPv6Network, so a prefix with bits set past its length, or a length past 128, parses and rebuilds, where 1.5.x raised a bareValueErrorsuch as2001:db8::1/64 has host bits set(#2702, #2709). Its maker takesprefix_length, from 0 to 255, where 1.5.x ignored it and wrote the lengthprefixgave, 128 for an address; and it takesprefixas an address, a network or anint, keeping any bits past the length. InTimestampOption,timestampisNonepast the year 9999,pmip_timestampholding the value, where 1.5.x raisedValueErrorfor a time past it, or late enough in its last second to round up to the year 10000. It is read without summing the second and its fraction as afloat, which was off by up to 15 microseconds past2**36seconds.Changed – a breaking change to construction: a checksum left out of
make()is computed rather than zero, so the octets built change (#2471, #2543).IPv4computes its header checksum, an IPv4 or IPv6 layer that of a TCP or UDP payload built without one, andOSPFthat of an OSPFv2 packet. A checksum given is written as given, and turningPCAPKIT_CHECKSUM_COMPUTEoff restores zero.Changed – a breaking change to building a Quick-Start option in
IPv4,HOPOPT,IPv6_OptsandTCP: a value its field cannot carry raisesProtocolError, where 1.5.x built it (#2617, #2630). That is a negative or non-integer rate, a TCP rate from 1 to 79 kbps, a Request TTL outside 0 to 255, an IPv4 reserved value of 4 or more, andTrueas a TTL, nonce or reserved value. IPv4’s maker also refusesTrueas its function, and a Report of Approved Rate’s not-used octet outside 0 to 255 (#2614, #2677). Refusing a TCP rate under 80 kbps reverses 1.5.0’s rounding of one down to zero (#1119); a rate between two codes still rounds down to the lower. HOPOPT’s and IPv6_Opts’ Quick-Start maker builds an unassigned function code as the unassigned option their reader keeps it as, as IPv4’s does.Changed – a breaking change to building
TCP,UDPandSCTP: a header or option field given an integer it cannot hold raisesProtocolErrornaming the field, where 1.5.x wrote it masked to the field’s width, and a fixed-size octet field given the wrong number of octets raises, where it was padded or cut (#2614, #2670). SoTCP(window=70000)raisesTCP: invalid window: 70000, where it wrote0x1170;TCP(seq_no=-1)andSCTP(vtag=-1)raise, where they wrote0xFFFFFFFF; a UDP payload of0xFFF8octets raises, where its Length was written0; andTCP(checksum=b'\x01')raises, where it wrote0100. The TCP User Timeout refuses a negative,Trueor non-numeric timeout by name, where a negative one raised a bareValueErrorandTruebuilt one second. The Quick-Start TTL Diff, which RFC 4782 defines modulo 256, wraps as in 1.5.x.Changed – a breaking change to building
IPv4,HOPOPT,IPv6_Opts,IPv6_Route,MHandHIP, as TCP’s, UDP’s and SCTP’s above: a header, option or parameter field given an integer it cannot hold, orTruewhere it is wider than one bit, raisesProtocolErrornaming the field, where 1.5.x wrote it masked to the field’s width, and so does a header too long for its length field (#2614, #2677). SoIPv4(ttl=256)raisesIPv4: invalid TTL: 256, where it wrote0, andIPv4(id=True)raises, where it wrote1; a Binding Update’s sequence number of-1raisesMH: invalid sequence number: -1, where it wrote0xFFFF; and a HOPOPT or HIP header too long for its length field raisesHOPOPT: invalid Hdr Ext Len: 256orHIPv2: invalid header length: 256, where that field was written0. A bit field raisedFieldValueErrorfor a value too wide and a bareValueErrororOverflowErrorfor a negative one, where IPv4 options too long for the IHL, say, raiseIPv4: invalid IHL: 16. A PDM scale past 255, given or needed for its delta, raisesHOPOPT: invalid PDM scale of delta time last received: 256say, where it warned withProtocolWarningand was written wrapped. HIP’s lifetimes refuseTrue, which built as1, and a NaN or infinite one, which raised a bareValueErrororOverflowError. An MH prefix length is held to its field’s width alone, as a parse keeps it – 0 to 63 in the IPv4 Address Acknowledgement and the IPv4 Home Address Request and Reply, 0 to 255 in the Delegated Mobile Network Prefix – so a 33 builds and a parsed 63 rebuilds, where 1.5.x refused one past the address, asMH: [OptNo 30] invalid prefix length: 33(#2684, #2700). Where one of these checks replaces a refusal 1.5.x made, its message drops the option’s or parameter’s tag, asHOPOPT: invalid RPL reserved flags: 32, where it readHOPOPT: [OptNo 99] invalid RPL reserved flags: 32.MH._decode_signed, which decoded the geo-location degrees, is removed with no alias; the base class’s_read_sintdecodes them. A fixed-size octet field given octets of any other width raises as well, where 1.5.x padded or cut them, soIPv4(checksum=b'\x01')raisesIPv4: invalid checksum: must be 2 octets, not b'\x01', where it wrote0100, and a 300-octet CALIPSO checksum raises, where its first two octets were written (#2676, #2691). The fields are the IPv4, MH, HIP, IPX and OSPF checksums, the CALIPSO checksum, MH cookies and keygen tokens, HIP opaque and payload data, IPX addresses, and the reserved and unused octets of the IPv6 extension headers, MH, HIP and OSPF; ICMP’s, IGMP’s and IP_Pseudo’s makers, added above, check theirs the same way. A model parsed from a capture, one cut inside such a field included, rebuilds as captured. IPv4’s Timestamp option refuses a slot count past what its 40 octets hold, nine timestamps or four address and timestamp pairs, asIPv4: invalid timestamp count: 10, where 1.5.x cut it to fit.Changed – a breaking change to building
PCAPNGblocks: a field given a value it cannot hold raisesProtocolError, where 1.5.x wrote it masked (#2614, #2671). The Section Header Block’s Section Length takes-2**63to2**64 - 1,-1and0xFFFFFFFFFFFFFFFFwriting the same octets, and refuses anything else, where2**64wrote0,Truewrote1andNonethe-1sentinel. The obsolete Packet Block’s Drops Count takes0to0xFFFF, where-1wrote0xFFFF,0x10000wrote0andTruewrote1. Theif_tzoneandif_tsoffsetoptions refuse a value outside their signed 32 and 64 bits, where they wrote it masked, and the Interface Description Block’s snaplen refusal readsPCAP-NG: invalid [IDB] snaplen: 4294967296, where it readPCAP-NG: [IDB] snaplen must be in range 0 to 0xFFFFFFFF: 4294967296. A ZigBee NWK or APS key of other than 16 octets raisesPCAP-NG: invalid [ZigBee NWK Key] key: must be 16 octets, not ...say, where 1.5.x zero-filled or cut it (#2676, #2691).Changed – a breaking change to construction: a
make()field holding an enumeration takes the member or anintcode, resolved with the enumeration’sget, and theX_default,X_namespaceandX_reversedkeywords beside such a field are removed with no alias (#2594, #2692). The makers of IPv4, IPv6 and its extension headers, IPX, TCP, ARP, Ethernet, VLAN, L2TPv2, OSPF, HTTP, the PCAP header and PCAP-NG took them in 1.5.x, and construction given one raisesUnsupportedCall, asIPv4: unexpected keyword(s): 'protocol_default' (did you mean 'protocol'?). A name raisesProtocolError, asIPv4: invalid protocol: 'TCP', where 1.5.x resolved it against the field’sX_namespaceor an enumeration it inferred from the caller’s frame. So does a name given as NGAP’sprocedureorcriticality, which 1.5.x resolved to its member. A caller holding a name resolves it first withProtocol.resolve_index, given the namespace, a default and whether adictnamespace maps names to codes. A code is checked against the field’s width as an integer field’s is, above, soIPv4(protocol=256)raisesIPv4: invalid protocol: 256, where it wrote0x00, andIPv4(protocol=True)raises, where it wrote0x01. So is the code of an option, sub-option or chunk given as a(code, arguments)pair: MH’s option type 300 raisesMH: invalid option type: 300and TCP’s option kind 300TCP: invalid option kind: 300, where 1.5.x wrote0x2C(#2693). AnintHTTP/1 status given without amessagewrites its registry phrase, as a member did, so404writes404 Not Found,299299 Unassignedand600600 Unknown, where 1.5.x wrote the code with an empty phrase.Changed – a breaking change to
DRARPandInARP, which move frompcapkit.protocols.application.rarptopcapkit.protocols.application.drarpand frompcapkit.protocols.link.arptopcapkit.protocols.link.inarp, with no re-export at the old paths, as a package holds one protocol class (#2529, #2540, #2596).pcapkit.DRARP,pcapkit.InARP, theirpcapkit.protocolsexports and a parsed RARP’sDRARPor ARP’sInARPalias are unchanged.Changed – a breaking change to
NoPayload, which moves frompcapkit.protocols.misc.nulltopcapkit.protocols.misc.no_payload, and its data model and header schema frompcapkit.protocols.data.misc.nullandpcapkit.protocols.schema.misc.nullto that package’sdataandschema, with no re-export at the old paths, as a protocol class takes its package’s name (#2529, #2636). The class keeps its name, andpcapkit.NoPayloadand the package exports of that name are unchanged. A frame pickled by 1.5.x fails to load, as any 1.5.x pickle of a data model does, below.Changed – a breaking change to the layout of
pcapkit.protocols: each protocol is a package holding its dissector, header schema and data model asprotocol,schemaanddatamodules, aspcapkit.protocols.internet.ipv4holdsprotocol,schemaanddata, where 1.5.x kept the schemas and data models in the separatepcapkit.protocols.schemaandpcapkit.protocols.datatrees (#2534, #2753). Those trees and their aggregate exports are removed with no alias, soimport pcapkit.protocols.data.internet.ipv4andfrom pcapkit.protocols.data import PCAPNG_IF_NameOptionraiseImportError. A package’s__init__.pyexports its protocol class and binds each schema and data class asSchema_<name>andData_<name>, sofrom pcapkit.protocols.internet.ipv4 import IPv4, Data_IPv4, Schema_IPv4reads as before, andpcapkit.protocols.misc.pcapng.Data_IF_NameOptionreplaces the aggregatePCAPNG_IF_NameOption. The other names of a 1.5.x protocol module are in its package’sprotocolmodule, and aversionremovednote in the API reference gives each one that moved elsewhere.pcapkit.protocols.schemaandpcapkit.protocols.dataare modules holding the base classes,SchemaandDataamong them, and the IPv6 option helpers ofpcapkit.protocols.schema.internet.ipv6_optionare inpcapkit.protocols.internet.ipv6_ext.schema.pcapkit.IPv4and thepcapkit.protocolsexports are unchanged. A data model pickled by 1.5.x fails to load, as the pickle names its 1.5.x module, raisingModuleNotFoundError: No module named 'pcapkit.protocols.data.internet'say.Changed – a breaking change to the registry of protocol classes by name:
pcapkit.protocols.__proto__, adictkeyed by the upper-cased name in 1.5.x, is removed with no alias, and the registry isProtocolBase.__registry__, which lists every built-in protocol as aModuleDescriptorand imports it on first lookup (#2763, #2770). Sofrom pcapkit.protocols import __proto__raisesImportError, andProtocolBase.get_protocolreads a name, in any case, where__proto__['IPV4']did, returning the class or thedefaultgiven.ProtocolBase.register_protocolwrites an entry, whichregister_protocol()calls, and each protocol class’sregistry, a property ofProtocolMeta, is a read-only view of the entries as stored, importing nothing. A subclass ofProtocolregisters itself as it is defined, as in 1.5.x, but an abstract one is skipped, where 1.5.x registered it too, and one whose name is taken leaves the existing entry in place, warning withRegistryWarning, where 1.5.x replaced the entry and warned that it was overwriting it. The built-in entries are grouped by layer, and a name a released registration hands back goes throughregister_protocol, so putting the displaced class back over the registered one warns that it is overwriting, as handing a code back does, where 1.5.x put the name back with no warning (#2773, #2779).Changed – a breaking change to the schema helpers that code outside the schema layer calls, which move to
pcapkit.corekit.schema, a package with a module per group, with no re-export at their old paths (#2674, #2704).parse_ip_address()moves frompcapkit.corekit.fields.ipaddresstopcapkit.corekit.schema.ipaddress;packet_byteorder()andbyteorder_callback()frompcapkit.corekit.fields.byteorder, which is removed with no alias, topcapkit.corekit.schema.byteorder;jumbo_payload_length()frompcapkit.protocols.schema.internet.ipv6topcapkit.corekit.schema.jumbogram; andkeep_short_read()andreplay_short_read()frompcapkit.protocols.schema.schematopcapkit.corekit.schema.shortread. The header schema framework stayspcapkit.protocols.schema.Changed – a breaking change to the mapping values a caller reads as a
dict: each is anInfoor a data model, not adict(#2726, #2734).FrameRecord, the frame a third-party engine’s flow tracing reports, is anInfowhere 1.5.x subclasseddict, soisinstance(record, dict)is false, setting a key raisesTypeError, andto_dict()exports the engine’s mapping as anOrderedMultiDictwithout thepacket,frame_infoandtime_epochattributes, which stay attributes, as in 1.5.x. A parsed TLS key log’sTLSKeyLog.entriesis aTLSKeyLogEntrieskeyed by label, whichpcapkit.protocols.misc.pcapngbinds asData_TLSKeyLogEntries, where it was adict; a mapping given for it is stored as one, andto_dict()exports it as anOrderedMultiDict, where it gave adict.AppType.__registries__is anInfokeyed byTransportProtocol, where 1.5.x held adictsubclass, so setting a key raisesTypeError(#2729, #2735).Changed – a breaking change to HTTP: parsing octets through
HTTP, building it from fields and itsfrom_datagive theHTTPv1orHTTPv2member, never an instance of the base, and so does a TCP or UDP payload on an HTTP port, whose data sits underhttpv1orhttpv2where it sat underhttp(#2524, #2544). Building it from fields takesversion,1or2, as the other versioned bases above do, and raisesProtocolErrorwithout it, where 1.5.x built an HTTP/1.1 message; itsfrom_datatakes the member from the data model’s class and refuses adict, where 1.5.x took one (#2628, #2651). The members are renamed after their modules,httpv1.HTTPandhttpv2.HTTPbecomingHTTPv1andHTTPv2along with their schema and data classes, with no re-export at the old paths (#2529);pcapkit.HTTPv1,pcapkit.HTTPv2and the package exports of those names are unchanged.id()takes the RFC names,('HTTP/1',)and('HTTP/2',), and the base’s lists both, where they were('HTTP', 'HTTPv1'),('HTTP', 'HTTPv2')and('HTTP', 'HTTPv1', 'HTTPv2'). So a layer no longer compares equal to'HTTP','HTTPv1'or'HTTPv2';'HTTP'still selects either version, and each version’s own name,'HTTP/1'or'HTTPv1'say, selects it alone, where any HTTP layer matched'HTTPv1'and'HTTPv2'both. On the transport path a payload neither version recognises, a bare connection preface included, isRawwith noerror, where it carried'HTTP: unknown version'or'HTTP/2: connection preface with no frame'; a directHTTP(...)on it still raisesProtocolError. One that passes for an HTTP/2 frame header butHTTPv2refuses carries that parser’s own error on either path, where it was'HTTP: unknown version'.HTTPv2itself now parses a payload opening with the connection preface, kept aspreface, and itsmake()takespreface, whichHTTPv1refuses, where 1.5.x wrote the HTTP/2 preface ahead of the HTTP/1 message (#2628, #2651).Changed – a breaking change to IPv6 reassembly: a fragment overlapping another of its datagram, other than an exact duplicate, abandons the datagram, reported as
Completion.OVERLAP, as RFC 8200 Section 4.5 requires; 1.5.x overwrote the octets it overlapped, as IPv4 still does under RFC 791 (#2547, #2569).Buffergains a requiredextentfield.Changed – a breaking change to TCP reassembly’s gap cap:
pcapkit.foundation.reassembly.tcp.TCP.__window__is removed with no alias, and the cap isTCP_GAP_LIMIT, set byPCAPKIT_TCP_GAP_LIMIT, 16 MiB by default as before and-1for no limit (#2546, #2579). It is a safety limit, read each timeTCP.reassemblyruns, and-1or a value above the default warns withConfigWarning.Changed – a breaking change to
Extractorandextract(): theirdtlsparameter, above, followstcp, so a positional argument frombuffer_sizeon moves one place along, andReassemblyManagertakes a requireddtls(#2496, #2528).Changed –
pcapkit.foundation.registry.protocolsis a package with a submodule per layer –link,internet,transport,applicationandmisc, with the shared registrars inprotocol– and exports every public function they define, so eachregister_*imports from it and frompcapkit.foundation.registryas before (#2578, #2635). A registrar’s__module__names its submodule, and its log records carry that submodule’s logger name, a child of the package’s, so configuring the package’s logger still applies.Changed – a
pcapkit.constpackage imports each of its enumeration modules on first use rather than with itself, andpcapkit.constits packages, throughpcapkit.utilities.importlib.lazy_exports(), which builds a package’s PEP 562__getattr__and__dir__from its exports (#2729, #2735). Each package’s__all__,dir()and members are as in 1.5.x. The SCTP and DCCP application-type registries load on first use, as TCP’s and UDP’s did in 1.5.x, where importingpcapkit.constloaded both. So dopcapkit.protocols, its layer packages,pcapandchecksum, each importing a protocol’s package when its class is first reached, andpcapkitits protocol classes, while a protocol’s own package imports its modules with itself (#2730, #2757), and the registry of protocol classes by name, given above, imports each class when it is first looked up.dir(pcapkit)lists no incidental names, where 1.5.x listedos,sys,ROOT,warningsandtbtrim. Each first resolution of a lazy name, and of aModuleDescriptorwhose module is not yet imported, holdspcapkit.utilities.importlib.import_lock, a shared re-entrant lock, so threads making first imports at once wait their turn rather than holding package locks against each other (#2771, #2781).Changed –
SCTP’s chunk makers refuse flags that are not one octet, and its Invalid Stream Identifier cause maker reserved octets that are not two, asSCTP: invalid [Chunk 132] flags: must be 1 octet, not b''andSCTP: invalid [Cause 1] reserved: must be 2 octets, not b'', where they readSCTP: [Chunk 132] invalid flags: must be one octet, not b''andSCTP: [Cause 1] invalid reserved: must be two octets, not b''(#2614, #2638). A one-characterstrgiven as flags, which passed the check and failed to pack, is refused the same way.Changed – a protocol’s
__index__returns its value in the LinkType, EtherType, TransType or AppType registry wherever one names it, and a class an AppType member names returns that member’s port as anint(#2627, #2652). SoL2TPv2,FTP,FTP_DATA, the HTTP classes andNGAP, which raised in 1.5.x, return 1701, 21, 20, 80 and 38412, and TLS, SSLv3 and DTLS the ports TCP and UDP dispatch them at, 443 and 5684; Radiotap, FRAD and GRE return their LinkType or TransType member. SSLv2 and the SSL base, which nothing dispatches to, raise as before, and no value 1.5.x returned changes.Changed – protocol class bodies are reordered to the member-order convention, with no change in behaviour, and a project test guards the order (#2490, #2491, #2522, #2523, #2538, #2539, #2541, #2613), including a registry’s readers and makers in its enumeration’s order, the helpers nothing reaches last, and the registry maps in enumeration order (#2765). SCTP’s readers precede its makers; the protocol pages list members in source order, and a project test keeps them so (#2780); and PCAP-NG’s option schemas keep their namespaces alphabetically, so a clash
Option.registerreports names those it displaced in alphabetical order,'dsb', 'epb', 'if', ...foropt_comment, where 1.5.x named them in its namespace map’s order,'opt', 'if', 'epb', ...(#2772, #2779).Changed – the house conventions record that a protocol class takes its package’s name, one to a package (#2529, #2542); that a versioned family’s base dispatches on every path, so parsing, building and
from_datagive a member rather than the base (#2524, #2544); that a docstring or prose block carries oneversionaddedper version, without a body that only names the thing added (#2530, #2542); and that each class-level registry map has a wrapper inpcapkit.foundation.registry(#2511, #2521).constis a label added alongside a commit type rather than a type, in the pull request template andCONTRIBUTING.mdtoo, and a span the transport registries assign to a service keeps its bare name, the mint criterion’s exception to code-suffixing (#2549, #2550, #2570). The registry conventions record the exceptions to their case-folding rules – the crawlers that re-case the names they generate, theMethodconstructor’s fold, andCommand.getandMethod.getanswering a name miss with an unregistered member – and the folds that live outside any registry (#2551, #2552, #2553, #2556, #2565, #2582, #2583). They also record the SSL family’s grouping, and that a family base is bound, and dispatches, only where the registry code cannot tell its members apart; that a pseudo-header protocol belongs inpcapkit.protocols.misc; thatpcapkit.utilities.compatholds compatibility implementations and re-exports only, behind version gates; and how a ruling given in a pull request’s review is cited (#2557, #2563, #2599). The test conventions record that a test class whose tests each need a fresh import purges insetUp, with a comment saying why, rather than importing once per class (#2562, #2611), and that a round trip gives back the values its parse read as well as the octets (#2761, #2767). Where a registry’s primary source is paywalled, the const-vendor pairing accepts a pinned secondary revision as a crawler’sDATAonce its values are cross-checked against independent implementations (#2575, #2607). A context variable more than one module uses lives inpcapkit.utilities.contextvars, and one that only its own module uses stays private there (#2616, #2623). Each:issue:and:pr:role in the documentation names a number of its own kind, a ruling given in a pull request’s review cited by the issue that pull request closes, and a project test checks each role’s kind against a snapshot of the tracker (#2561, #2626). A registry wrapper goes in the submodule ofpcapkit.foundation.registry.protocolsfor the layer of the class owning its map (#2578, #2635). A protocol class owns the parse of a reassembled outcome, which eachpcapkit.foundation.analysisfunction wraps without parsing of its own, and a project test fails on a module underpcapkit.protocolsimportingpcapkit.foundationoutsideTYPE_CHECKING,pcapkit.foundation.registry.protocolsaside (#2622, #2634). A versioned family’s base takes its member from theversionkeyword, or else from the octets or the data model, never from a field, has no default member, and refuses octets that carry no version unlessversionnames one (#2574, #2639); HTTP’s base follows that rule, itsfrom_datareading the data model’s class, since the HTTP data models carry noversion(#2628, #2651). The member-order convention’s reference class isARP, where it wasEthernet, whose MAC address helpers moved to the base class (#2614, #2638). A protocol’s__index__returns its LinkType, EtherType, TransType or AppType value ahead of any other registry’s code, an AppType value as its port (#2627, #2652). A protocol’s table from a code to the layout read under it is a class-level registry map, with itsregister_<kind>classmethod and wrapper, never a module-level dictionary, and each layout is a concrete schema with typed fields, never built inside the map (#2576, #2657). Amake()field holding an enumeration takes the member or anintcode, never a name, checked against the field’s width and resolved with thegetof an enumeration named at the call, never one read from the caller’s frame, and no keyword group sits beside it (#2594, #2692). A helper that code outside the schema layer calls lives inpcapkit.corekit.schema, a module per group, as does a helper in one protocol’s schema module once code outside that protocol uses it and it is generic enough to reuse, with no re-export at its old path (#2674, #2704). A protocol reads and rebuilds a capture cut through the schema’s built-in short read, never anunpackoverride of its own or a length callable clamped to the octets present (#2680, #2694, #2731); a field callback leaves a value the cut left as zero to that short read, and refuses one read withProtocolError(#2727, #2737); and a cut header’s rebuild is read at the width its parse was given (#2761, #2777). The member-order page orders every registry’s readers before any registry’s makers, a map’s integer keys with no enumeration by value and its string keys alphabetically (#2772, #2779). Apcapkit.constpackage imports its enumerations on first use, throughlazy_exports(), and a crawler never writes a package’s__init__.py(#2729, #2735). A next-layer refusal in a payload a layer rebuilds is quiet, as the layer’s own parse reports it once (#2711, #2738). A protocol is a package ofprotocol,schemaanddatamodules, whose__init__.pyexports its protocol class and binds its schema and data classes asSchema_*andData_*outside__all__, which a[tool.isort]section keeps isort off (#2534, #2753), and the packages above it import it on first use throughlazy_exports(#2730, #2757). The by-name protocol registry is a class-level map on the internal base, which a concrete subclass of the public one fills as it is defined (#2763, #2770).Changed – a project test fails on a shipped module with no documentation entry, the placeholder sources under
NotImplemented/excepted, and the modules this release adds that had none –pcapkit.const.linux, thepcapkit.vendor.tlsandpcapkit.vendor.sslv2crawlers and the checksum packages – now have one (#2559, #2584).Changed – the
docsextra pinssphinx-autodoc-typehints3.17.4, where 1.5.x pinned 3.17.2 (#2742).Changed – the CPython unit-test legs run
pytest -n logical, a worker per logical CPU, where-n autocounted physical cores and ran 2 workers on the 4-CPU runner; the weekly CI timing report reads the latest Python’s leg too (#2571, #2572). The integration, engine, parity, project-test and gate jobs and the experimental workflow’s Windows and free-threaded 3.14t legs run-n logicaltoo, and a project test fails on a bare-n auto(#2573, #2606). A PyPy leg runstests/protocols/internet,tests/protocols/applicationandtests/protocols/miscas shards of their own ahead of the rest oftests/protocols, which run whole outgrew the runner’s memory and stalled at its tail (#2600, #2604). The experimental workflow’s Windows leg passes pytest the modules it ignores as an@-prefixed argument file, where they went on its command line and had outgrown Windows’ limit, so the leg failed before pytest started (#2678, #2681). The GraalPy leg there splits the long shards whose xdist workers outgrew their heap and died, each sized from its tests’ JUnit seconds to run in under 5 minutes (#2713, #2720). Its tests’ timeout is 180 minutes, where it was 110, and the internet and application protocol shards are split too, as a slower runner ran out of time with no worker lost (#2739, #2741). Thelatestleg’sLATESTtest tier runs in a job of its own, in halves, and aCoveragejob combines the coverage legs’ parts, posting no total unless every part arrived (#2751, #2754). The plain unittest ordering leg runs the rest oftests/protocolsin two halves, as the cell had reached its 20-minute step cap with no test failed (#2751).Changed – once a release’s milestone is closed while
__version__still names that release, the milestone workflow gives an item the lowest open release milestone above it, compared as numbers sov1.10followsv1.9, and a backfill starts above the closed milestone’s items (#2548, #2591).Changed – a weekly Issue and PR Kinds workflow regenerates, with
util/issue_pr_kinds.py, the snapshot of the tracker that the project test of each role’s kind reads, and opens or updates a pull request frombot/issue-pr-kindswhen it changes, never pushingmain(#2561, #2626).Changed – of the workflows, only Create Release waits for a deployment approval: the
prjobs of the Issue and PR Kinds and Python Versions workflows read the release App’s key from therelease-appenvironment, which has no required reviewer, where they enteredgithub-releaseand waited on its approval, and skip with a warning while that environment holds no key (#2648, #2658).Changed – a pull request no longer adds its own changelog bullet: an unreleased version’s entries are written centrally by the maintainer, and
CONTRIBUTING.mdand the pull request template say so (#2449, #2483).Fixed –
AppType.gettakes thedefaultEnumLookup.getadvertises, a registered member’s value that it never mints, and a miss raisesEnumValueError, still aValueError, where it raised a builtin one (#2545, #2568).Fixed – under
beholder, a next layer captured at full length whose parse raised, such as a malformed TCP header, reported its warnings before being replaced withRaw. Its trial now holds them however much was captured and drops them with the layer, so a kept layer’s warnings follow those of the layers it carries (#2516, #2519). AProtocolErrorbuilt whilebeholderruns a next layer is now quiet, so a refusal kept asRawis recorded on that layer’serroralone, where a loud one logged atCRITICALand installed the exception hooks, andbeholderlogged it again atWARNING; building the refused layer directly stays loud (#2588, #2597).Fixed – the PyPCAPFile engine’s header checks reported the warnings of a trial parse they rejected. The extension-header trial now drops them as under
beholder, and the IPv4 and TCP header check holds its trial’s and discards them when it raises (#2526, #2577).Fixed – an extraction with the PyShark engine could end in pyshark’s
TSharkCrashExceptionwithretcode: 255for atsharkthat exited cleanly, when aPopen.poll()reaped it before theasynciochild watcher could, which then reported255(CPython gh-87744). Closing the capture absorbs that crash, logging it atlogging.DEBUG, on every Python, when the capture was read to its end and eachtsharkit lists reports255toasyncioand0to itsPopen; any other error is raised (#2633, #2642).Fixed – selecting
'IPv6_Ext'matched none of the dedicated extension headers:IPv6_Ext.id()now lists its direct concrete subclasses – HOPOPT, IPv6_Route, IPv6_Frag, ESP, AH, IPv6_Opts, MH and HIP – each of which keeps its own name alone, as AH and ESP do under IPsec (#2462, #2464).Fixed – a membership test such as
'ESP' in layeron an extension header parsed by the IPv6 header’s walk – AH, HOPOPT, IPv6_Route, IPv6_Frag, IPv6_Opts, MH, HIP or the generic IPv6_Ext – raisedAttributeError. The layer now holdsNoPayload, the upper layer belonging to the enclosing IPv6 header (#2484, #2487, #2486, #2488).Fixed –
ListField.unpackreads a list of schema items the data ends inside up to the end of the data, the item the cut lands inside read with its missing octets as zeros, asFieldBase.unpackreads any other field, so a schema cut inside one packs back as captured, where the first item past the data raisedFieldValueErrorfor consuming nothing (#2686, #2701). No item that would start past the captured octets is read, so a cut list holds no zero item the capture never held (#2756, #2758). A list of plain values ends with the data too, inside a zero-filled schema item as well, the value the cut lands inside read with its missing octets as zeros, where 1.5.x read as many values as its length left room for, those past the cut as zeros: a Type 0 Routing header cut after the first of its three addresses listed2001:db8::1,::and::(#2760, #2766). The fill is of schema objects rather than zero octets, soZERO_PAD_BUDGET_RATIObounds it from its first octet, with neither the free band ofMAX_ZERO_PAD_SHORTFALLnor a one-off allowance, the zeros left unread going back to the budget, and a cut list declaring more thanMAX_ZERO_PAD_LENGTHis refused. If the items then fail, the fill stays charged, as a field’s does, and the octets it counted as read are given back (#2705, #2706). AListFieldgiven acountreports a list whose octets hold fewer items than it counts as a short read, the absent items never made up (#2711, #2738), and reads an item it counts that the data ends inside as a quiet short read (#2749, #2755). A TCPSACKoption running past the data raisesProtocolError,Field options has an option that runs past the end of the data: <Option.SACK: 5> ..., where it raised thatFieldValueError,Field sack has an item that consumed no data: ....Fixed – an HTTP/2
SETTINGSframe the capture cut short inside its settings raisedFieldValueErrorfrom the list of settings, so a segment carrying one was kept asRaw. It parses, the setting the cut lands inside read with its missing octets as zeros, as a cutDATAframe’s data is, and no setting past it, and rebuilds as captured (#2659, #2686, #2666, #2701), at its declared Length, or at one recomputed from its settings once they are edited (#2756, #2758). A frame of any type the capture cut short after the connection preface rebuilds as captured too, wherefrom_datagave the preface’s first octets, as many as were captured of the frame (#2665, #2675).Fixed – an
SCTPpacket the capture cut short of the length declared for it, by an IPv4 Total Length, an IPv6 Payload Length or a caller’slength, rebuilt throughfrom_datawithout the octets after its last whole chunk, which its header schema’sbytes()counted twice. It rebuilds as captured, as one parsed with no length declared did (#2673, #2679). Its header schema cut inside the padding of its last chunk, parameter or cause, or such an item’s own schema cut inside its padding, packs back as captured, where 1.5.x packed it at full width, 34 octets in and 36 out; and a header schema cut inside an option area packs back the octets read, where a TCP header schema of data offset 8 cut 25 octets in gave 32 octets frombytes()and 23 frompack()(#2680, #2685, #2682).Fixed – a capture cut inside or in front of an option area reads as a short read, as a cut elsewhere in a header does (#2694, #2731). So an
MHmessage cut inside its options or reserved octets, and aHOPOPTorIPv6_Optsheader cut short, parse alone or inside IPv6 and rebuild as captured, logging nothing, where 1.5.x raisedFieldValueErrororProtocolErrorlogged atCRITICAL, asField options has an option that consumed no data: <Option.Pad1: 0> at offset 0for a HOPOPT header cut to 2 octets. A cut option stands only if its maker writes the captured octets back, and is refused quietly otherwise; one whose fields run past its area is refused, as in 1.5.x. HOPOPT’s and IPv6-Opts’make()takelen, the Hdr Ext Len a cut header declared. An MH item list its length leaves part of an item in, as a Flow Summary option of an odd length, raisesProtocolError, quiet inside IPv6, where 1.5.x raisedFieldValueError: Field fid has invalid length.logged atCRITICAL.Fixed –
TCP’s maker, given an option as raw octets, raisedEnumValueErrorfor a kind its registry does not name, such as 255, andIndexErrorfor empty octets. The kind resolves as a(code, arguments)pair’s does, so 255 builds, and empty octets raiseProtocolError(#2708, #2724). The other makers taking a raw item refuse empty octets the same way, asIPv4: invalid option: b'' holds no type octet(#2723, #2728). IPv4’s, HOPOPT’s and IPv6-Opts’ options raisedIndexError. SCTP’s parameters and error causes, and MH’s options, sub-options, QoS attributes and CGA extensions, raised a bareAttributeErroralone – or, for MH’s access network identifier and LMA-controlled MAG sub-options, aProtocolErrorfor an option of length 0 – and were dropped beside a whole item. HIP’s parameters were dropped. PCAP-NG’s options and Name Resolution records refuse octets shorter than their 2-octet code, where 1.5.x wrote empty or zero octets as an end-of-options or end-of-records marker, and misread one other octet as a code.HIP(next=59)wrote HIP version 6, taking the IP version for it, and writes 2,make()’s default from RFC 7401 Section 5.1. HIP’sENCRYPTEDmaker refuses an IV given with a cipher that takes none, which 1.5.x counted in the parameter’s Length but did not write. A parsedENCRYPTEDparameter takes its cipher from theHIP_CIPHERbefore it, where 1.5.x warnedHIP: [ParamNo 641] missing HIP_CIPHER parameterand read an AES IV as encrypted data. MH’s CGA Parameters maker builds a raw extension in aCGAParameterdata model as its(type, arguments)pair builds, where 1.5.x raisedAttributeError: 'bytes' object has no attribute 'type', and aCGAParameterschema withoutpublic_key_test, leaving the schema given unchanged, where 1.5.x raisedKeyError: 'public_key_test'(#2725, #2732).Fixed – a
PCAPNGDecryption Secrets Block thatmake()built from a parsed ZigBee NWK or APS key shorter than its fixed width was corrupt: it declared that width, 18 or 22 octets, as its Secrets Length and sized the block from it, but wrote only the octets held, so a 5-octet NWK key built a 27-octet block declaring 40, where 28 were captured. It is written as captured, andpcapkit.protocols.misc.pcapng.schema.zigbee_key_heldreturns a schema whosebytesandlen()are those of the octets held, where they were the fixed width’s (#2688, #2697). Rebuilt byfrom_datafrom the block’sdict, a TLS or WireGuard key log was written from its entries under a# generated by PyPCAPKitline, dropping its comments and the lines its entries do not hold, and a ZigBee key cut short of its fixed width was written at that width, zero-filled. The TLS, WireGuard and ZigBee secrets makers take the captured text or octets asdata, so the block rebuilds as captured from itsdict, as from its data model (#2698, #2707).Fixed – rebuilding a layer through
from_datareported its payload’s messages twice, once from the payload’s own rebuild and again from the layer’s parse of it: in 1.5.x,Ethernet.from_dataof a frame cut inside its TCP header logged the refusal twice, where the parse logged it once. Each is reported once (#2711, #2738). IPv4 records a cut inside the payload length it declares as its__short_read__, where 1.5.x recorded none, and so do Ethernet, GRE, ICMP, IGMP and a TSO IPv4 layer for a cut at the end of their frame.Fixed – a header the capture cut short parsed with a
Rawnext layer but rebuilt throughfrom_datawith aNoPayloadone, from the same octets: in 1.5.x anEthernetheader cut inside its type field parsed asEthernet:Rawand rebuilt asEthernet:NoPayload, as did ARP’s family, AH, HIP, the IPv6 extension headers, MH, VLAN, L2TPv2 and Loopback. The rebuild keeps the next layer the parse had, GRE’s, FRAD’s and the Linux cooked-capture headers’ included (#2717, #2759). A next layer a cut header leaves no octets isRawwithout a dispatch on the code the cut left as zeros, and carries noerror, where 1.5.x’s carried the failed dispatch’s, asField padding resolved to a negative length; template='-20s'. A cut header rebuilt on its own reads back the values its parse read, its Reserved octets, option area and length among them, rather than those its maker filled in past the cut (#2761, #2767), as it is read at the width its parse was given, which the data model records as__short_width__andto_dict()carries (#2777).Fixed – a whole header rebuilt through
from_dataread back values its parse had not. An IPv6 extension header parsed withextension=True, as IPv6 parses each header of its chain – HOPOPT, IPv6-Route, IPv6-Frag, IPv6-Opts, MH, AH or HIP – was rebuilt without it, so its info gained__next_type__,__next_name__andnopayload, and a Shim6 headerIPv6_Extparsed was rebuilt with aprotocolofNone. Each rebuilds in the mode its parse used, and Shim6’s keeps itsprotocol(#2768, #2774). A TCP header rebuilt, or built bymake(), read itspaddingpast the End of Option List as empty, where its parse read the octets there; it reads them from the octets, as IPv4 does (#2769, #2775). A PCAP-NG block with octets after itsopt_endofopt, which 1.5.x rebuilt as captured, rebuilt an info holding none of its options and nopadding_opts; it holds both, as its parse did (#2776, #2778).Fixed – the
json,plistandtreedumps of anInfo, and of itsto_dict()export, left out a field named like one of its builtin names, such asitems,keysor a reassembled datagram’spacket. Each is dumped under its own name, and a reassembled datagram’spacketas its parsed layer’sinfo(#2733, #2736).Fixed – importing
pcapkit.vendor.ipx, or running its packet or socket crawler, withoutrequestsinstalled lost an entry ofsys.pathon each failed attempt, so apkgutil.walk_packages()retrying it drainedsys.pathuntil it raisedIndexError. The entry is now restored however the import ends (#2589, #2601).