xdr_encode_opaque_fixed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ xdr_encode_opaque_fixed β€” the kernel API manual, bestie edition ✨

okay so picture this: you're deep in net/sunrpc land, you've got a buffer, you've got some bytes, and you need them to land in XDR format correctly β€” this little function is the one that does it. It's giving "unsung hero of the XDR pipeline" ngl πŸ’…


🌸 NAME 🌸

xdr_encode_opaque_fixed β€” encode fixed length opaque data. literally her whole job πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

__be32 * xdr_encode_opaque_fixed (__be32 *p , const void *ptr , unsigned
int nbytes );

πŸ’– ARGUMENTS πŸ’–

  • p β€” pointer to current position in XDR buffer. this is where the magic lands, bestie ✨
  • ptr β€” pointer to the data you wanna encode (or NULL, and yes that's allowed, we'll get to it πŸ‘€)
  • nbytes β€” size of data. how many bytes we're working with, periodt.

πŸ‘‘ DESCRIPTION πŸ‘‘

Copy the array of data of length nbytes at ptr to the XDR buffer at position p, then align to the next 32-bit boundary by padding with zero bytes (see RFC1832). no cap, that's the whole vibe β€” copy, then pad so everything lines up on that 32-bit grid πŸ”₯


🧚 NOTE 🧚

if ptr is NULL, only the padding is performed. that's it, that's the note β€” no data gets copied, just the zero-byte glow-up πŸ’€

Returns the updated current XDR buffer position. so you can keep chaining, main character energy 🫢


🌈 SEE ALSO 🌈

all her sisters and cousins in the XDR cinematic universe πŸ’œ β€” Kernel file ./net/sunrpc/xdr.c:

xdr_encode_opaque(9), xdr_terminate_string(9), xdr_buf_to_bvec(9), xdr_buf_to_sg(9), xdr_buf_to_sg_alloc(9), xdr_inline_pages(9), _shift_data_left_pages(9), _shift_data_right_pages(9), _copy_to_pages(9), _copy_from_pages(9), xdr_buf_pages_zero(9), xdr_shrink_bufhead(9), xdr_shrink_pagelen(9), xdr_stream_pos(9), xdr_page_pos(9), xdr_init_encode(9), xdr_init_encode_pages(9), __xdr_commit_encode(9), xdr_reserve_space(9), xdr_reserve_space_vec(9), xdr_truncate_encode(9), xdr_truncate_decode(9), xdr_restrict_buflen(9), xdr_write_pages(9), xdr_init_decode(9), xdr_init_decode_pages(9), xdr_finish_decode(9), xdr_inline_decode(9), xdr_read_pages(9), xdr_set_pagelen(9), xdr_enter_page(9), xdr_buf_subsegment(9), xdr_stream_subsegment(9), xdr_stream_move_subsegment(9), xdr_stream_zero(9), xdr_buf_trim(9), xdr_stream_decode_string_dup(9), xdr_stream_decode_opaque_auth(9), xdr_stream_encode_opaque_auth(9)


okay that's the whole page, go forth and encode responsibly πŸ’– this one lives at ./net/sunrpc and the page itself is dated October 2026 β€” so yeah, stay cozy out there, read your manpages, and remember: pad your zero bytes, bestie πŸŒΈπŸ¦‹β­

πŸ“¦ where this page comes from