summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2017-11-13 15:08:16 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2017-11-16 14:35:35 +0100
commit9200bfc50653612033d58774f422fc20150d3301 (patch)
tree04b81823a43a38cf67fe10b7dd836cbbef85f567 /include
parent657fdefc7d5c70056b8738da214d3d78f421b19c (diff)
libnftables: Unexport enum nftables_exit_codes
Apart from SUCCESS/FAILURE, these codes were not used by library functions simply because NOMEM and NONL conditions lead to calling exit() instead of propagating the error condition back up the call stack. Instead, make nft_run_cmd_from_*() return either 0 or -1 on error. Usually errno will then contain more details about what happened and/or there are messages in erec. Calls to exit()/return in main() are adjusted to stay compatible. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r--include/nftables.h7
-rw-r--r--include/nftables/nftables.h10
2 files changed, 7 insertions, 10 deletions
diff --git a/include/nftables.h b/include/nftables.h
index d69079fe..3bfa33e5 100644
--- a/include/nftables.h
+++ b/include/nftables.h
@@ -35,6 +35,13 @@ struct nft_ctx {
uint32_t flags;
};
+enum nftables_exit_codes {
+ NFT_EXIT_SUCCESS = 0,
+ NFT_EXIT_FAILURE = 1,
+ NFT_EXIT_NOMEM = 2,
+ NFT_EXIT_NONL = 3,
+};
+
struct input_descriptor;
struct location {
const struct input_descriptor *indesc;
diff --git a/include/nftables/nftables.h b/include/nftables/nftables.h
index 4211be76..8e59f2b2 100644
--- a/include/nftables/nftables.h
+++ b/include/nftables/nftables.h
@@ -38,16 +38,6 @@ enum nft_numeric_level {
*/
#define NFT_CTX_DEFAULT 0
-/**
- * Exit codes returned by nft_run_cmd_from_*()
- */
-enum nftables_exit_codes {
- NFT_EXIT_SUCCESS = 0,
- NFT_EXIT_FAILURE = 1,
- NFT_EXIT_NOMEM = 2,
- NFT_EXIT_NONL = 3,
-};
-
struct nft_ctx *nft_ctx_new(uint32_t flags);
void nft_ctx_free(struct nft_ctx *ctx);