Skip to content

refactor(corekit): move the Internet checksum helpers to corekit.internet_checksum #2580

Open

Description

@JarryShaw

From the owner on #2543: pcapkit.protocols.misc.checksum.checksum belongs in foundation or corekit, under a name that says it is the Internet checksum (RFC 1071), not a generic one. It is new in 1.6.0 and unreleased, so it moves with no versionremoved.

Where it can go. The module imports pcapkit.protocols.protocol._rebuilding, and IPv4/IPv6/TCP/UDP/ICMP/OSPF call it from read(). Since #2528, protocol read code imports nothing from pcapkit.foundation, so foundation would invert the layers. utilities-or-corekit.rst puts what protocols are made of in corekit.

Decision needed:

  1. (a) Split. The protocol-independent part becomes pcapkit.corekit.internet_checksum: ChecksumStatus, the RFC 1071 sum (internet_checksum, compute_checksum, partial_checksum), verify_checksum, fragment_payload, with _rebuilding moving there from protocols.protocol. The IP-specific pseudo_header and verify_upper stay next to IP_Pseudo in protocols.misc.checksum.
    (b) Move the whole module to pcapkit.foundation.internet_checksum, and accept protocols importing foundation.
  2. The ChecksumWarning class stays in pcapkit.utilities.warnings.

Recommendation: 1(a). It keeps protocol read free of foundation imports, and corekit takes only what has no protocol dependency.

Activity

  1. added
    refactorRestructuring for its own sake — neither a fix nor a new capability (refactor: prefix)
    needs: decisionWaiting on the maintainer to decide — not blocked by other work
    on Nov 1, 2026
  2. JarryShaw commented on Nov 1, 2026

    @JarryShaw
    OwnerAuthor

    1(a), but name probably should be corekit.checkum.internet, save room for future other checksum calculations that will live aside in the corekit.checksum module.

  3. JarryShaw commented on Nov 1, 2026

    @JarryShaw
    OwnerAuthor

    Owner chose 1(a), with a different name, paraphrased: pcapkit.corekit.checksum becomes a package, so other checksum families can sit beside it later, and the Internet checksum goes in pcapkit.corekit.checksum.internet.

    • Moves there: ChecksumStatus, the RFC 1071 sum, verify_checksum and fragment_payload, with _rebuilding moving from protocols.protocol.
    • Stays beside IP_Pseudo: the IP-specific pseudo_header and verify_upper.
    • No versionremoved: the module is unreleased.

    Dispatched.

  4. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    needs: decisionWaiting on the maintainer to decide — not blocked by other work
    on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorRestructuring for its own sake — neither a fix nor a new capability (refactor: prefix)wipWork in flight - a covering PR is open or an agent is actively on it

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions