KNET_LINK..._PRIORITY(3)

okay bestie, welcome to the Kronosnet Programmer's Manual β€” yes it's a real manual, yes it's about network links, yes you're gonna slay it. this page is literally just about giving a link a priority, and i'm obsessed with how simple it is. πŸŽ€


✨ NAME ✨

knet_link_set_priority β€” set the priority for a link. that's it. that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

#include <libknet.h>

int knet_link_set_priority(
    knet_handle_t   knet_h,
    knet_node_id_t  host_id,
    uint8_t         link_id,
    uint8_t         priority
);

like, look at her. four little args, one big job. main character energy fr fr. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so we're calling knet_link_set_priority, and here's the tea on every single argument, no cap:

  • knet_h β€” pointer to knet_handle_t. this is your handle, your anchor, the whole reason you're here.
  • host_id β€” see knet_host_add(3). go check that page if you need the deets. 🫢
  • link_id β€” see knet_link_set_config(3). same deal, that's where link ids come from.
  • priority β€” specify the switching priority for this link, see also knet_host_set_policy. that's the part that decides who gets picked when, so like... choose wisely bestie.

πŸ”₯ RETURN VALUE πŸ”₯

  • knet_link_set_priority returns 0 on success
  • returns -1 on error, and errno is set

so yeah, if you get a 0 you ate. if you get a -1, check errno, that's your clue. πŸ’€


🌈 SEE ALSO 🌈

the whole friend group, all here, all iconic, no one left out:


Copyright (C) 2010-2026 Red Hat, Inc. All rights reserved.


kronosnet Β· 2026-07-20 β€” mwah πŸ’‹ that's the whole page, you're officially a knet_link_set_priority girlie now. go forth and prioritize, bestie πŸ¦‹βœ¨πŸ’–

πŸ“¦ where this page comes from