cipso_v4_map_lvl_ntoh(9)
π cipso_v4_map_lvl_ntoh β a kernel API manual moment (section 9, bestie)
okay so this is a page straight out of the Kernel API Manual, and it's lowkey one of those tiny functions that does one job and does it slayfully. no cap, it's giving "quiet luxury" β small, specific, absolutely essential if you're doing CIPSO MLS label stuff.
β¨ NAME β¨
cipso_v4_map_lvl_ntoh β literally just "Perform a level mapping from the network to the host". that's it, that's the whole vibe π¦
π SYNOPSIS π
int cipso_v4_map_lvl_ntoh (const struct cipso_v4_doi *doi_def , u32
net_lvl , u32 *host_lvl );
likeβ¦ look at her. three params, returns an int, no drama. main character energy honestly π
πΈ ARGUMENTS πΈ
doi_defβ the DOI definition. yes, that DOI definition. she's the one who knows all the mapping rules, you're just borrowing her notes πnet_lvlβ the network/CIPSO MLS level. this is the level as it arrives over the wire, in network/foreign-label form π°οΈhost_lvlβ the host MLS level. this is where the translated, local-flavored level gets written βοΈ
π₯ DESCRIPTION π₯
so what's actually happening here? this function performs a label mapping to translate a CIPSO level into the correct local MLS level, using the DOI definition you handed it. that's the whole task. it's a translator, but make it security labels π§
returns zero on success, negative values otherwise. that's the whole contract β non-zero and negative means something went sideways, and you should go check your inputs, bestie π
ngl, this is a "trust the return value" situation. zero = we ate. negative = we did not eat. check it. always check it. π
π SEE ALSO π
the whole friend group, fr fr β and also where the source lives:
- Kernel file
./net/ipv4/cipso_ipv4.c 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_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_hton(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)
like, that's the entire crew and they're all icons, no skips π
and that's the page!! mwah π«Ά
this one ships from source ./net/ipv4, dated October 2026, in the Kernel API Manual β and honestly? iconic of her. go read the neighbors, they're all linked above. bye bestie πβ¨
π¦ 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