From 1be55ff3a9866cbee8fcde8d8f9425cb3d8af05d Mon Sep 17 00:00:00 2001 From: Arturo Borrero Date: Mon, 14 Apr 2014 12:17:41 +0200 Subject: netlink: add socket error reporting helper function This patch adds a simple helper function to report errors while opening the Netlink socket. To help users to diagnose problems, a new NFT_EXIT_NONL exit code is included, which is 3. Suggested-by: Pablo Neira Ayuso Signed-off-by: Arturo Borrero Gonzalez Signed-off-by: Pablo Neira Ayuso --- include/netlink.h | 1 + include/nftables.h | 1 + 2 files changed, 2 insertions(+) (limited to 'include') diff --git a/include/netlink.h b/include/netlink.h index 4e3f8aa7..1fb03562 100644 --- a/include/netlink.h +++ b/include/netlink.h @@ -138,6 +138,7 @@ extern void netlink_dump_set(struct nft_set *nls); extern int netlink_batch_send(struct list_head *err_list); extern int netlink_io_error(struct netlink_ctx *ctx, const struct location *loc, const char *fmt, ...); +extern void netlink_open_error(void) __noreturn; extern struct nft_ruleset *netlink_dump_ruleset(struct netlink_ctx *ctx, const struct handle *h, diff --git a/include/nftables.h b/include/nftables.h index 7f3968d4..3394e324 100644 --- a/include/nftables.h +++ b/include/nftables.h @@ -39,6 +39,7 @@ enum nftables_exit_codes { NFT_EXIT_SUCCESS = 0, NFT_EXIT_FAILURE = 1, NFT_EXIT_NOMEM = 2, + NFT_EXIT_NONL = 3, }; struct input_descriptor; -- cgit v1.2.3