]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
doc: add nft_ctx_add_var() and nft_ctx_clear_vars() docs
authorFernando Fernandez Mancera <ffmancera@riseup.net>
Mon, 12 Sep 2022 10:52:25 +0000 (12:52 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 16 Sep 2022 07:37:31 +0000 (09:37 +0200)
Add missing documentation for nft_ctx_add_var() and nft_ctx_clear_vars()
functions.

Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
doc/libnftables.adoc

index 3abb95957505d6b20f44383b9ea2bcd97cf8e369..550012b4501084d24344dfa7fbb39ad0103037eb 100644 (file)
@@ -37,6 +37,9 @@ const char *nft_ctx_get_error_buffer(struct nft_ctx* '\*ctx'*);
 int nft_ctx_add_include_path(struct nft_ctx* '\*ctx'*, const char* '\*path'*);
 void nft_ctx_clear_include_paths(struct nft_ctx* '\*ctx'*);
 
+int nft_ctx_add_var(struct nft_ctx* '\*ctx'*, const char* '\*var'*);
+void nft_ctx_clear_vars(struct nft_ctx '\*ctx'*);
+
 int nft_run_cmd_from_buffer(struct nft_ctx* '\*nft'*, const char* '\*buf'*);
 int nft_run_cmd_from_filename(struct nft_ctx* '\*nft'*,
                              const char* '\*filename'*);*
@@ -206,6 +209,14 @@ The function returns zero on success or non-zero if memory allocation failed.
 
 The *nft_ctx_clear_include_paths*() function removes all include paths, even the built-in default one.
 
+=== nft_ctx_add_var() and nft_ctx_clear_vars()
+The *define* command in nftables ruleset allows to define variables.
+
+The *nft_ctx_add_var*() function extends the list of variables in 'ctx'. The variable must be given in the format 'key=value'.
+The function returns zero on success or non-zero if the variable is malformed.
+
+The *nft_ctx_clear_vars*() function removes all variables.
+
 === nft_run_cmd_from_buffer() and nft_run_cmd_from_filename()
 These functions perform the actual work of parsing user input into nftables commands and executing them.