STRUCT SSH_PACKET(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct ssh_packet(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual ✨ β€” today's main character is struct ssh_packet, which is, and I cannot stress this enough, the SSH transport packet. periodt. πŸŽ€


✨ NAME ✨

struct ssh_packet β€” SSH transport packet. that's it, that's the vibe πŸ¦‹


🌸 SYNOPSIS 🌸

struct ssh_packet {
    struct ssh_ptl *ptl;
    struct kref refcnt;
    u8 priority;
    struct {
      size_t len;
      u8 *ptr;
    } data;
    unsigned long state;
    ktime_t timestamp;
    struct list_head queue_node;
    struct list_head pending_node;
    const struct ssh_packet_ops *ops;
 };

like… look at her. iconic structure. no notes. πŸ‘‘


🫢 Members 🫢

okay so let's go through the whole squad, member by member, no skips:

  • ptl β€” pointer to the packet transport layer πŸ’…. this one may be NULL if the packet (or the enclosing request) hasn't been submitted yet. so like, she's not committed yet. relatable.
  • refcnt β€” the reference count of the packet. keep track of who's holding on, bestie 🧡.
  • priority β€” priority of the packet. it must be computed via SSH_PACKET_PRIORITY, no freestyling πŸ”₯. and lowkey important: it must only be accessed while holding the queue lock, and only after first submission. iykyk.
  • data β€” the raw message data. the actual content, the substance, the moment πŸ’«.
    • data.len β€” length of the raw message data. how much data we're working with πŸ“.
    • data.ptr β€” pointer to the raw message data buffer. the address, the location, the spot 🎯.
  • state β€” state and type flags describing the current packet state (that part's dynamic, it moves) and type (that part's static, she's set in stone) 🌈. see enum ssh_packet_flags for the possible options.
  • timestamp β€” a ktime_t timestamp saying when the latest transmission of a currently pending packet got started ⏰. it may be KTIME_MAX before, or in-between, transmission attempts. this is literally what the packet timeout implementation runs on. and β€” heads up β€” it must only be accessed while holding the pending lock, and only after first submission. same rule as priority, fr fr.
  • queue_node β€” the list node for the packet queue. the little link in the chain πŸ“.
  • pending_node β€” the list node for the set of pending packets. our girl is pending πŸ’€.
  • ops β€” packet operations. the behavior pack, the whole personality πŸŽ€.

πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, bestie, they're all connected (main character energy throughout):


🫢 quick vibe check reminder: that priority and timestamp lock rule is not a suggestion, bestie. queue lock for priority, pending lock for timestamp, and only after first submission. don't test her. πŸ’…

aaand that's the whole page, we ate and left no crumbs πŸ“βœ¨ this one lives over at ./include/linux/surface_aggreg..., dated October 2026, and it's filed under struct ssh_packet(9) β€” mwah, bye bestie! πŸ’œπŸŒˆπŸŽ€

πŸ“¦ where this page comes from