KNET_HOST_SET_POLICY(3)

πŸ’– KNET_HOST_SET_POLICY(3) πŸ’–

okay bestie, welcome to knet_host_set_policy from the Kronosnet Programmer's Manual β€” this is the one that lets you pick how a host's links get chosen when there's traffic to send πŸ¦‹ no cap, it's lowkey one of the most important vibes in the whole link situation.


✨ NAME ✨

knet_host_set_policy β€” Set the switching policy for a host's links.

like. you're literally deciding which link is the main character πŸ’…


🌸 SYNOPSIS 🌸

#include <libknet.h>

int knet_host_set_policy(
    knet_handle_t   knet_h,
    knet_node_id_t  host_id,
    uint8_t         policy
);

πŸŽ€ DESCRIPTION πŸŽ€

so, knet_host_set_policy β€” here's the breakdown, bestie:

  • knet_h β€” pointer to knet_handle_t. your handle. your whole world tbh 🫢
  • host_id β€” see knet_host_add(3). that's where the id lore lives ✨
  • policy β€” okay so currently there are 3 kinds of simple switching policies, and they're all based on link configuration. let me give you the tea on each one:
    • KNET_LINK_POLICY_PASSIVE β€” the active link with the highest priority (highest number) will be used. and if one or more active links share the same priority? then the one with the lowest link_id will be used. tiebreaker energy πŸ’…
    • KNET_LINK_POLICY_ACTIVE β€” all active links will be used simultaneously to send traffic. link priority is ignored. everybody works, nobody's the favorite, periodt.
    • KNET_LINK_POLICY_RR β€” round-robin policy, every packet will be send on a different active link. yes it says "send", that's the original wording, we don't edit the ancestors πŸ™ˆ rotating like a turntable fr fr πŸ”₯

⭐ RETURN VALUE ⭐

knet_host_set_policy returns 0 on success, -1 on error, and errno is set. classic. slay when it works, cry when it doesn't 😭


🌈 SEE ALSO 🌈

the whole group chat, alphabetically-ish, all of them, no skipping πŸ’–:


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


and that's the whole page, bestie 🫢 kronosnet, dated 2026-07-20, filed under KNET_HOST_SET_POLICY(3) β€” go set a policy and slay πŸ’…βœ¨

πŸ“¦ where this page comes from