diff options
author | Fernando Fernandez Mancera <ffmancera@riseup.net> | 2022-09-12 12:52:25 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2022-09-16 09:37:31 +0200 |
commit | 8dcf0b2437ea6747b8233e5bdb3d34f089aa78e8 (patch) | |
tree | 765716e3bbbc21b5bd1442d64cb7b622570c9ef7 /doc/libnftables.adoc | |
parent | 39b1f4b550a9c11951845581e939f17289de9589 (diff) |
doc: add nft_ctx_add_var() and nft_ctx_clear_vars() docs
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>
Diffstat (limited to 'doc/libnftables.adoc')
-rw-r--r-- | doc/libnftables.adoc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/libnftables.adoc b/doc/libnftables.adoc index 3abb9595..550012b4 100644 --- a/doc/libnftables.adoc +++ b/doc/libnftables.adoc @@ -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. |