calipso_map_cat_hton(9)
π 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:
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_ntoh(9)calipso_pad_write(9)calipso_genopt(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)
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 thecalipso_map_cat_hton(9)page β go read the source, bestie, it's lowkey fascinating π
π¦ 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