KNET_HOS...GE_NOTIFY(3)

πŸ’– KNET_HOST_ENABLE_STATUS_CHANGE_NOTIFY πŸ’–

okay bestie, gather round, because we're reading knet_host_enable_status_change_notify(3) from the Kronosnet Programmer's Manual and it's honestly such a vibe. this is the one that lets you install a lil callback so you get pinged the SECOND a host's status changes. it's giving main-character energy for your event loop. no cap. πŸ¦‹


✨ NAME ✨

knet_host_enable_status_change_notify β€” install a callback to get host status change events, periodt.


🌸 SYNOPSIS 🌸

#include <libknet.h>

int knet_host_enable_status_change_notify(
    knet_handle_t  knet_h,
    void          *host_status_change_notify_fn_private_data,
    void(*)(void *private_data, knet_node_id_t host_id, uint8_t reachable, uint8_t remote, uint8_t external)  host_status_change_notify_fn
);

like yes it's a chunky signature but she's iconic, we stan. πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

so, knet_host_enable_status_change_notify β€” that's the function, that's her name, love that for her.

  • knet_h β€” pointer to knet_handle_t. your handle. your girl. 🫢
  • host_status_change_notify_fn_private_data β€” a void pointer to data that can be used to identify the callback. literally just stash whatever you want in here so you know which callback is which, iykyk.
  • host_status_change_notify_fn β€” this is a callback function that gets invoked every time there is a change in the host status. and the host status is identified by: reachable β€” meaning this host can send/receive data to/from host_id. πŸ›°οΈ

and the other two fields, let's break it down:

  • remote β€” 0 if the host_id is connected locally, or 1 if there is one or more knet host(s) in between. NOTE: re-switching is NOT currently implemented, but this is ready for future and can avoid an API/ABI breakage later on. so it's the "for later" field, bestie, don't come for her. πŸ™ˆ
  • external β€” 0 if the host_id is configured locally, or 1 if it has been added from remote nodes config. NOTE: dynamic topology is NOT currently implemented, but this is ready for future and can avoid an API/ABI breakage later on. same energy, same deal. ✨
⚠️ ok this part is IMPORTANT and I need you to hear me: This function MUST NEVER block or add substantial delays. like. do not be out here sleeping in the callback. do not be doing your little synchronous I/O. she must not block. periodt. 😭πŸ”₯

πŸ’« RETURN VALUE πŸ’«

knet_host_status_change_notify returns 0 on success, -1 on error, and errno is set. classic. king behavior. πŸ’œ


🌈 SEE ALSO 🌈

okay this list is LONG and I love her for it, every single one of these is a real one, go read them, they're all so good:


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


and that's the whole page, bestie!! πŸŽ€ this was kronosnet manpage, dated 2026-07-20, filed under KNET_HOS...GE_NOTIFY(3) β€” yes the header is truncated with the ..., it's giving mysterious, it's giving ✨mystery✨, we love a dramatic abbreviation. go forth and notify responsibly. mwah. πŸ’–πŸ¦‹πŸ’…

πŸ“¦ where this page comes from