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 --- src/internal.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/internal.h') diff --git a/src/internal.h b/src/internal.h index ba994c8..6595e70 100644 --- a/src/internal.h +++ b/src/internal.h @@ -136,6 +136,12 @@ int nft_get_value(enum nft_type type, void *val, void *out); #include int nft_fprintf(FILE *fp, void *obj, uint32_t type, uint32_t flags, int (*snprintf_cb)(char *buf, size_t bufsiz, void *obj, uint32_t type, uint32_t flags)); +int nft_event_header_snprintf(char *buf, size_t bufsize, + uint32_t format, uint32_t flags); +int nft_event_header_fprintf(FILE *fp, uint32_t format, uint32_t flags); +int nft_event_footer_snprintf(char *buf, size_t bufsize, + uint32_t format, uint32_t flags); +int nft_event_footer_fprintf(FILE *fp, uint32_t format, uint32_t flags); void xfree(const void *ptr); -- cgit v1.2.3