diff options
Diffstat (limited to 'utils/nf-log.c')
-rw-r--r-- | utils/nf-log.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/utils/nf-log.c b/utils/nf-log.c index d575b77..5f2a192 100644 --- a/utils/nf-log.c +++ b/utils/nf-log.c @@ -14,6 +14,7 @@ static int log_cb(const struct nlmsghdr *nlh, void *data) struct nfulnl_msg_packet_hdr *ph = NULL; const char *prefix = NULL; uint32_t mark = 0; + char buf[4096]; int ret; ret = nflog_nlmsg_parse(nlh, attrs); @@ -31,6 +32,12 @@ static int log_cb(const struct nlmsghdr *nlh, void *data) prefix ? prefix : "", ntohs(ph->hw_protocol), ph->hook, mark); + ret = nflog_nlmsg_snprintf(buf, sizeof(buf), nlh, attrs, + NFLOG_OUTPUT_XML, NFLOG_XML_ALL); + if (ret < 0) + return MNL_CB_ERROR; + printf("%s (ret=%d)\n", buf, ret); + return MNL_CB_OK; } |