cipso_v4_map_cat_rng_hton(9)
π cipso_v4_map_cat_rng_hton(9) β the kernel API manual, but make it make sense π
okay so bestie, this is a page from the Kernel API Manual and honestly? it's kind of iconic. it's a <pink>section 9</pink> situation (that's kernel functions, iykyk), and it's all about translating your local MLS category bitmap into a CIPSO category list. slay. let's get into it π
β¨ NAME β¨
cipso_v4_map_cat_rng_hton β Perform a category mapping from host to network π
like, literally the host-to-network glow-up for your categories. one direction only, bestie.
β¨ SYNOPSIS β¨
int cipso_v4_map_cat_rng_hton (const struct cipso_v4_doi *doi_def ,
const struct netlbl_lsm_secattr *secattr , unsigned char *net_cat , u32
net_cat_len );
that's the whole signature, int return, four arguments, no notes. copy it exactly if you're writing it down, don't try to be cute with it π
β¨ ARGUMENTS β¨
doi_defβ the DOI definition π«Ά like, the rulebook for how this whole mapping thing goes down.secattrβ the security attributes π your local security vibes that need translating.net_catβ the zero'd out category list in network/CIPSO format β key detail: it's zero'd out before it gets here. pre-cleared. main character energy only.net_cat_lenβ the length of the CIPSO category list in bytes π measured in bytes, not vibes.
β¨ DESCRIPTION β¨
so what does it actually do? π¦ Perform a label mapping to translate a local MLS category bitmap to the correct CIPSO category list using the given DOI definition.
that's the whole bit. local bitmap goes in, correct CIPSO category list comes out, and the DOI definition is the blueprint that makes it happen. no cap.
Returns the size in bytes of the network category bitmap on success π₯ β and negative values otherwise π so yeah, check your return value, bestie, negative means something went sideways and it's not trying to hide it.
lowkey important: those negative values on failure are the whole "otherwise" branch, so don't be out here assuming success and reading garbage. vibe check your int. π
β¨ SEE ALSO β¨
the lore is deep, and it lives in the kernel file ./net/ipv4/cipso_ipv4.c π§ β here's the full friend group, no one left out:
cipso_v4_cache_entry_free(9)cipso_v4_map_cache_hash(9)cipso_v4_cache_init(9)cipso_v4_cache_invalidate(9)cipso_v4_cache_check(9)cipso_v4_cache_add(9)cipso_v4_doi_search(9)cipso_v4_doi_add(9)cipso_v4_doi_free(9)cipso_v4_doi_free_rcu(9)cipso_v4_doi_remove(9)cipso_v4_doi_getdef(9)cipso_v4_doi_putdef(9)cipso_v4_doi_walk(9)cipso_v4_map_lvl_valid(9)cipso_v4_map_lvl_hton(9)cipso_v4_map_lvl_ntoh(9)cipso_v4_map_cat_rbm_valid(9)cipso_v4_map_cat_rbm_hton(9)cipso_v4_map_cat_rbm_ntoh(9)cipso_v4_map_cat_enum_valid(9)cipso_v4_map_cat_enum_hton(9)cipso_v4_map_cat_enum_ntoh(9)cipso_v4_map_cat_rng_valid(9)cipso_v4_map_cat_rng_ntoh(9)cipso_v4_gentag_hdr(9)cipso_v4_gentag_rbm(9)cipso_v4_parsetag_rbm(9)cipso_v4_gentag_enum(9)cipso_v4_parsetag_enum(9)cipso_v4_gentag_rng(9)cipso_v4_parsetag_rng(9)cipso_v4_gentag_loc(9)cipso_v4_parsetag_loc(9)cipso_v4_optptr(9)cipso_v4_validate(9)cipso_v4_error(9)cipso_v4_genopt(9)cipso_v4_sock_setattr(9)cipso_v4_req_setattr(9)cipso_v4_delopt(9)cipso_v4_sock_delattr(9)cipso_v4_req_delattr(9)cipso_v4_getattr(9)cipso_v4_sock_getattr(9)cipso_v4_skbuff_setattr(9)cipso_v4_skbuff_delattr(9)cipso_v4_init(9)
and that's the page, bestie π«Ά hope the category mapping is giving everything it needs to give for you. mwah π
π sign-off szn: this one comes from./net/ipv4, dated October 2026, and yes β the page is literallycipso_v4_map_cat_rng_hton(9). same name, top to bottom, no plot twist. πΈ
π¦ 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