calipso_genopt(9)
π calipso_genopt(9) β the Kernel API Manual, but make it cute
okay so bestie, welcome to calipso_genopt(9), a page from the Kernel API Manual, and it's literally about generating a CALIPSO option. That's the whole vibe. Let's get into it β¨
β¨ NAME β¨
calipso_genopt β Generate a CALIPSO option π
πΈ SYNOPSIS πΈ
Ngl the signature is a whole mood, so here it is verbatim, no cap:
int calipso_genopt (unsigned char *buf , u32 start , u32 buf_len , const
struct calipso_doi *doi_def , const struct netlbl_lsm_secattr *secattr
);
π¦ ARGUMENTS π¦
Okay so these are the five besties you're handing to this function. Know them, love them:
bufβ the option buffer. It's the canvas, the stage, the main character. πstartβ the offset from which to write. Like where the pen first touches the paper βοΈbuf_lenβ the size ofopt_buf. Yes, the manpage literally saysopt_bufβ that's the name it uses, so we're keeping it exactly like that, periodt. π«Άdoi_defβ the CALIPSO DOI to use. The chosen one πsecattrβ the security attributes. The lore, the backstory π§
π₯ DESCRIPTION π₯
So what does it do?? It generates a CALIPSO option using the DOI definition and the security attributes you passed to the function. Iconic behaviour honestly.
But wait, there's more β it also generates upto three bytes of leading padding, and that padding is the thing that ensures the option is 4n + 2 aligned. The way that alignment just works πβ¨
And then it returns the number of bytes written, which includes any initial padding. So the return value is your lil receipt for the whole operation π§Ύπ
π SEE ALSO π
Okay this list is long but we do not skip a single one, because every soul here matters. First up, the kernel file:
./net/ipv6/calipso.c
And now the whole squad, in order, no one left behind:
calipso_cache_entry_free(9)calipso_map_cache_hash(9)calipso_cache_init(9)calipso_cache_invalidate(9)calipso_cache_check(9)calipso_cache_add(9)calipso_doi_search(9)calipso_doi_add(9)calipso_doi_free(9)calipso_doi_free_rcu(9)calipso_doi_remove(9)calipso_doi_getdef(9)calipso_doi_putdef(9)calipso_doi_walk(9)calipso_validate(9)calipso_map_cat_hton(9)calipso_map_cat_ntoh(9)calipso_pad_write(9)calipso_opt_update(9)calipso_tlv_len(9)calipso_opt_find(9)calipso_opt_insert(9)calipso_opt_del(9)calipso_opt_getattr(9)calipso_sock_getattr(9)calipso_sock_setattr(9)calipso_sock_delattr(9)calipso_req_setattr(9)calipso_req_delattr(9)calipso_skbuff_optptr(9)calipso_skbuff_setattr(9)calipso_skbuff_delattr(9)calipso_init(9)
bestie reminder: the return value counts the padding too, so don't come for the byte count and act surprised. π
and that's the page!! mwah π signed off from ./net/ipv6, dated October 2026, and yes the footer says calipso_genopt(9) because we always bring it back to where we started πβ¨π«Ά
π¦ 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