STRUCT SSH_PACKET(9)
π 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 beNULLif 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 viaSSH_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) π. seeenum ssh_packet_flagsfor the possible options.timestampβ aktime_ttimestamp saying when the latest transmission of a currently pending packet got started β°. it may beKTIME_MAXbefore, 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):
- kernel file
./include/linux/surface_aggregator/serial_hub.h enum ssh_frame_type(9)struct ssh_frame(9)enum ssh_payload_type(9)struct ssh_command(9)SSH_MESSAGE_LENGTH(9)SSH_COMMAND_MESSAGE_LENGTH(9)SSH_MSGOFFSET_FRAME(9)SSH_MSGOFFSET_COMMAND(9)ssh_crc(9)ssh_rqid_next_valid(9)ssh_rqid_to_event(9)ssh_rqid_is_event(9)ssh_tc_to_rqid(9)ssh_tid_to_index(9)ssh_tid_is_valid(9)struct ssam_span(9)enum ssam_ssh_tid(9)enum ssh_packet_base_priority(9)SSH_PACKET_PRIORITY(9)ssh_packet_priority_get_try(9)ssh_packet_priority_get_base(9)struct ssh_packet_ops(9)ssh_packet_set_data(9)struct ssh_request_ops(9)struct ssh_request(9)to_ssh_request(9)ssh_request_get(9)ssh_request_put(9)ssh_request_set_data(9)
π«Ά quick vibe check reminder: thatpriorityandtimestamplock rule is not a suggestion, bestie. queue lock forpriority, pending lock fortimestamp, 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms