calipso_map_cat_hton(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… calipso_map_cat_hton β€” the Kernel API Manual glow-up ✨

okay so bestie, you found calipso_map_cat_hton(9) and honestly? it's giving "small function, big job." it lives in the kernel API manual, and i'm about to explain it so well you'll feel like a main character who actually read the docs πŸŽ€


🌸 NAME 🌸

calipso_map_cat_hton β€” literally just "Perform a category mapping from host to network." that's it, that's the whole vibe: host categories go in, network categories come out πŸ’«


✨ SYNOPSIS ✨

int calipso_map_cat_hton (const struct calipso_doi *doi_def , const
       struct netlbl_lsm_secattr *secattr , unsigned char *net_cat , u32
       net_cat_len );

look at that signature. iconic. returns an int, takes four args, no cap 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • doi_def β€” the DOI definition. yes, that DOI. the domain of interpretation, the whole point of reference, the blueprint πŸ’–
  • secattr β€” the security attributes. all the security metadata is hanging out in here 🌸
  • net_cat β€” the zero'd out category bitmap in network/CALIPSO format. note the "zero'd out" part, bestie, that's not a suggestion, it's a requirement β€” it has to be all zeros going in ⭐
  • net_cat_len β€” the length of the CALIPSO bitmap in bytes. u32, so a big ol' unsigned number πŸ”₯

πŸ’€ DESCRIPTION πŸ’€

so what actually happens? "Perform a label mapping to translate a local MLS category bitmap to the correct CALIPSO bitmap using the given DOI definition."

translation for the group chat: your local MLS category bitmap gets translated into the correct CALIPSO bitmap, and it uses the DOI definition you handed it to know how to do that mapping 🧚

on success it returns the minimum size in bytes of the network bitmap. on anything else? negative values. so like, check your return, bestie, don't just assume it slayed 😭

ngl, "negative values otherwise" is the whole error story here β€” no fancy enum, no detailed codes. just vibes and negativity πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./net/ipv6/calipso.c β€” and the whole calipso cinematic universe, fr fr:

like, that's the entire friend group and calipso_map_cat_hton(9) is right there in it 🫢 the ntoh one is literally its sibling, iykyk 🌈


🌟 cute lil sign-off: this page is from ./net/ipv6, dated October 2026, and it's the calipso_map_cat_hton(9) page β€” go read the source, bestie, it's lowkey fascinating πŸ’œ
πŸ“¦ where this page comes from