sshp_parse_frame(9)
π sshp_parse_frame(9) β the Kernel API Manual, bestie edition π¦
okay so real talk, we're looking at sshp_parse_frame today, from the sshp_parse_frame(9) page of the Kernel API Manual. it's the little parser that could, and she is iconic. buckle up π
β¨ NAME β¨
sshp_parse_frame β Parse SSH frame. that's it, that's the whole vibe. she parses the frame. π
πΈ SYNOPSIS πΈ
int sshp_parse_frame (const struct device *dev , const struct ssam_span
*source , struct ssh_frame **frame , struct ssam_span *payload , size_t
maxlen );
look at her, all signed and int-returning π no cap, copy it exactly, spaces and all, i'm not kidding π
π ARGUMENTS π
devβ the device that gets used for logging. she's just here so we have somewhere to gossip, yk? π¬sourceβ the source we're parsing from. the origin story β¨frameβ the parsed frame. this one's an output, so she's getting written to, not read. main character actually π«Άpayloadβ the parsed payload, also output. the little friend that comes with the frame π«maxlenβ the maximum supported message length, i.e. the vibe check for how big this message is allowed to be π₯
π¦ DESCRIPTION π¦
so what she does is: she parses and validates an SSH frame β payload included, ngl, the whole package π
β from the given source. then she sets the provided frame pointer to the start of the frame, and writes the limits of the frame payload into the provided payload span pointer. two pointers, two jobs, she's multitasking and she ate.
the important thing, and the way that i need you to understand this: this function does not copy any data. not a single byte. she's not moving anything around, she's just looking at the message data, validating it, and setting pointers (and length values) so everyone knows where each respective part lives. she's giving pure inspector energy, not mover energy ππ
and if no complete SSH frame could be found? then the frame pointer gets set to the NULL pointer, and the payload span gets set to the null span β that's start pointer NULL, size zero β so nothing's dangling, everything's tidy β¨ no crashy vibes.
π₯ RETURN π₯
- returns zero on success, or if the frame is incomplete β incomplete is chillin, she's not mad β€οΈ
-ENOMSGif the start of the message is invalid π«-EBADMSGif any CRC is invalid β frame-header CRC or payload CRC, doesn't matter, either one π-EMSGSIZEif the SSH message is bigger than the maximum message length specified in themaxlenparameter π
π SEE ALSO π
- Kernel file
./drivers/platform/surface/aggregator/ssh_parser.cβ go read the source bestie, it's right there π sshp_validate_crc(9)sshp_starts_with_syn(9)sshp_find_syn(9)sshp_parse_command(9)
the whole friend group, honestly π«Άβ
okay and finally, the sign-off π this page comes from source ./drivers/platform/surface/agg... and it's dated October 2026 β so go forth, parse those frames, and remember: no copying, only validating. periodt π
ππΈ
π¦ 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