From 612698d4cedb3fbc2a02480c05b9a9d8cb13d3a8 Mon Sep 17 00:00:00 2001 From: Arturo Borrero Date: Tue, 15 Apr 2014 20:12:58 +0200 Subject: src: add flag to add event wrapping in output functions This patch uses the flag option of each output function to print an event wrapper string in each object. In order to use this functionality, the caller must pass the corresponding flags: NFT_OF_EVENT_NEW / NFT_OF_EVENT_DEL. (I have slightly refactorized the original code to add the xml/json header and footer --pablo). Signed-off-by: Arturo Borrero Gonzalez Signed-off-by: Pablo Neira Ayuso --- include/libnftnl/common.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/libnftnl/common.h') diff --git a/include/libnftnl/common.h b/include/libnftnl/common.h index f0c20f0..04d2906 100644 --- a/include/libnftnl/common.h +++ b/include/libnftnl/common.h @@ -15,6 +15,12 @@ enum nft_output_type { NFT_OUTPUT_JSON, }; +enum nft_output_flags { + NFT_OF_EVENT_NEW = (1 << 0), + NFT_OF_EVENT_DEL = (1 << 1), + NFT_OF_EVENT_ANY = (NFT_OF_EVENT_NEW | NFT_OF_EVENT_DEL), +}; + enum nft_parse_type { NFT_PARSE_NONE = 0, NFT_PARSE_XML, -- cgit v1.2.3