diff options
author | Ken-ichirou MATSUZAWA <chamaken@gmail.com> | 2015-08-21 09:30:33 +0900 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-08-24 20:42:29 +0200 |
commit | 6b2f3c08adc2c84c0b5f969af6cfb4d44940e560 (patch) | |
tree | 3ce6910ba96235b223c0b951af38188ad2b0c292 /include | |
parent | 7ceefe50a1690d9b6d0125c9b9f53c959ae7a128 (diff) |
nlmsg: add printf function in conjunction with libmnl
To printf nflog netlink message in XML, nflog_snprintf_xml can be
used after converting nflog nlattrs to nflog_data, but we should not
have any code that mixes both new and old, which handles nflog_data,
APIs. The idea is to deprecate libnfnetlink and any client of that
library at some point, that will take quite time though since we'll
have to mark those old interfaces as deprecated.
Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp>
Diffstat (limited to 'include')
-rw-r--r-- | include/internal.h | 9 | ||||
-rw-r--r-- | include/libnetfilter_log/libnetfilter_log.h | 8 |
2 files changed, 17 insertions, 0 deletions
diff --git a/include/internal.h b/include/internal.h new file mode 100644 index 0000000..7839fd8 --- /dev/null +++ b/include/internal.h @@ -0,0 +1,9 @@ +#ifndef _LIBNETFILTER_LOG_INTERNAL_H +#define _LIBNETFILTER_LOG_INTERNAL_H + +struct nflog_data +{ + struct nfattr **nfa; +}; + +#endif diff --git a/include/libnetfilter_log/libnetfilter_log.h b/include/libnetfilter_log/libnetfilter_log.h index 5087f6f..46767eb 100644 --- a/include/libnetfilter_log/libnetfilter_log.h +++ b/include/libnetfilter_log/libnetfilter_log.h @@ -89,4 +89,12 @@ extern int nflog_attr_put_cfg_mode(struct nlmsghdr *nlh, uint8_t mode, uint32_t extern int nflog_attr_put_cfg_cmd(struct nlmsghdr *nlh, uint8_t cmd); extern int nflog_nlmsg_parse(const struct nlmsghdr *nlh, struct nlattr **attr); +enum nflog_output_type { + NFLOG_OUTPUT_XML = 0, +}; + +int nflog_nlmsg_snprintf(char *buf, size_t bufsiz, const struct nlmsghdr *nlh, + struct nlattr **attr, enum nflog_output_type type, + uint32_t flags); + #endif /* __LIBNETFILTER_LOG_H */ |