KNET_LINK_ADD_ACL(3)

okay bestie, welcome to the Kronosnet Programmer's Manual πŸ’– this is the page for knet_link_add_acl, and yes we're gonna make access lists make sense, fr fr. no cap.


🌸 NAME 🌸

knet_link_add_acl</purgle> β€” add an access list entry to an open link. that's it, that's the whole vibe. it's giving gatekeeper but make it networking πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <libknet.h>

int knet_link_add_acl(
    knet_handle_t              knet_h,
    knet_node_id_t             host_id,
    uint8_t                    link_id,
    struct sockaddr_storage   *ss1,
    struct sockaddr_storage   *ss2,
    check_type_t               type,
    check_acceptreject_t       acceptreject
);

πŸ’œ DESCRIPTION πŸ’œ

so like, knet_link_add_acl is the function, and here's the rundown of every single thing you're handing it:

  • knet_h β€” pointer to knet_handle_t. your main character handle.
  • host_id β€” see knet_host_add(3)
  • link_id β€” see knet_link_set_config(3)
  • ss1 / ss2 / type / acceptreject β€” see the typedef definitions for details (they're right below, keep scrolling babe 🫢)
⚠️ IMPORTANT: the order in which access lists are added is critical and it is left to the user to add them in the right order. knet will not attempt to logically sort them. not me trusting you with the ordering 😭 it's on you bestie.

like, for example:

1 - accept from 10.0.0.0/8
2 - reject from 10.0.0.1/32

is not the same as:

1 - reject from 10.0.0.1/32
2 - accept from 10.0.0.0/8

in the first example, rule number 2 will never match, because packets from 10.0.0.1 will be accepted by rule number 1. πŸ’€ the way rule 2 is just standing there, ignored, irrelevant, not even getting a chance. order matters. periodt.


πŸŽ€ STRUCTURES πŸŽ€

the two enums you need to know, exactly as they are:

enum check_type_t {
      CHECK_TYPE_ADDRESS;
      CHECK_TYPE_MASK;
      CHECK_TYPE_RANGE;
};
enum check_acceptreject_t {
      CHECK_ACCEPT;
      CHECK_REJECT;
};

⭐ RETURN VALUE ⭐

knet_link_add_acl returns 0 on success. -1 on error, and errno is set. so check your errno, bestie, don't be out here guessing πŸ™ˆ


🌈 SEE ALSO 🌈

the whole extended friend group, alphabet-ish, all of them, no skips:


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


and that's the page!! you read the whole thing, so proud of you πŸ₯ΉπŸ’– this was kronosnet, dated 2026-07-20, and the manual page is KNET_LINK_ADD_ACL(3). slay, go order your access lists correctly ✨ πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from