sel_netport_sid(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ sel_netport_sid β€” a Kernel API Manual moment πŸ¦‹

okay so bestie, welcome to the Kernel API Manual β€” yes that's the actual manual name, we're in the big leagues now πŸ’… β€” and today's main character is a lil function called sel_netport_sid. she's small, she's fast, she's literally the lookup girlie for network port SIDs. let's get into it ✨


🌸 NAME 🌸

sel_netport_sid β€” Lookup the SID of a network port

like, that's her whole job. finding the SID for a network port. no cap 🫢


✨ SYNOPSIS ✨

int sel_netport_sid (u8 protocol , u16 pnum , u32 *sid );

three args, one int coming back at you. that's it, that's the whole signature, she's lowkey minimalist πŸ”₯


πŸŽ€ ARGUMENTS πŸŽ€

  • protocol β€” the protocol. that's it. that's the description. the protocol. (yes the original is literally just "protocol", she's a woman of few words πŸ’€)
  • pnum β€” the port. the port number in question, bestie.
  • sid β€” the port SID. this is where the answer lands, it's a u32 * so it's giving "output parameter" main character energy πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

okay so here's the tea β˜• β€” this function determines the SID of a network port using the fastest method possible. like she is not wasting your time, she is not doing extra work, she is efficient and iconic for it πŸ’…

the way it works, step by step:

  1. first, the port table gets queried β€” quick lil lookup, love that for us 🌈
  2. but if an entry can't be found, then the policy gets queried instead
  3. and then the result gets added to the table so future queries are speedup-ed πŸš€ (yes, speedup. she's helping future-you. self-care fr fr)

and the returns? glad you asked:

  • zero on success πŸŽ‰
  • negative values on failure 😭

that's the whole vibe check. no surprises, no plot twists, just a clean lookup with a lil caching glow-up ✨


🌟 SEE ALSO 🌟

go read these, they're the friend group 🫢


okay that's the page!! this whole thing lives in ./security/selinux and the manual itself is dated October 2026 β€” yes, from the future, she's ahead of her time πŸ§šπŸ’œ anyway bestie go read the source, mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from