luainkernel / lunatik

Lunatik is a framework for scripting the Linux kernel with Lua.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[GSoC 2024] update README.md with the base API for luanetfilter

lneto opened this issue · comments

Add the documentation for the base API for luanetfilter; that is, only for the functions that are strictly necessary for the base functionality of calling Lua from Netfilter rules. It shouldn't contain packet handling yet; just callbacks registering and actions (e.g., PASS, DROP). Thus, you can create issues, after discussing this specification, for implementing this foundation.

For xtables match and target, we need to implement the following :

  • register_pernet_subsys()
  • xt_(un)register_match(es)()
  • xt_(un)register_target(s)()

For netfilter hooks, we need to implement :

  • struct nf_hook_ops
  • Netfilter verdict helpers (NF_ACCEPT, NF_DROP, NF_STOLEN, NF_REPEAT,
    NF_STOP)
  • Implement nf_(un)register_hook(s)

This will provide the base functionality of registering callbacks and actions.
Future work will require implementing user-space libraries, skb handlers, packet handling, conntrack, luasocket port, netlink support

@sheharyaar this issue is to create the proper documentation on README.md for the base API you expose to the Lua scripts, you can use any Lunatik library documentation as reference (e.g., device). I would expect you to create a PR specifying such base/minimal API for the hooks.