1 #ifndef _LIBNETFILTER_ACCT_H_
2 #define _LIBNETFILTER_ACCT_H_
5 #include <linux/netfilter/nfnetlink_acct.h>
13 enum nfacct_attr_type {
24 void nfacct_attr_set(
struct nfacct *nfacct,
enum nfacct_attr_type type,
const void *data);
25 void nfacct_attr_set_str(
struct nfacct *nfacct,
enum nfacct_attr_type type,
const char *name);
26 void nfacct_attr_set_u64(
struct nfacct *nfacct,
enum nfacct_attr_type type, uint64_t value);
29 const void *
nfacct_attr_get(
struct nfacct *nfacct,
enum nfacct_attr_type type);
39 #define NFACCT_SNPRINTF_F_FULL (1 << 0)
40 #define NFACCT_SNPRINTF_F_TIME (1 << 1)
42 #define NFACCT_SNPRINTF_T_PLAIN 0
43 #define NFACCT_SNPRINTF_T_XML 1
44 #define NFACCT_SNPRINTF_T_JSON 2
46 int nfacct_snprintf(
char *buf,
size_t size,
struct nfacct *nfacct, uint16_t type, uint16_t flags);
const void * nfacct_attr_get(struct nfacct *nfacct, enum nfacct_attr_type type)
void nfacct_nlmsg_build_payload(struct nlmsghdr *nlh, struct nfacct *nfacct)
void nfacct_attr_set(struct nfacct *nfacct, enum nfacct_attr_type type, const void *data)
const char * nfacct_attr_get_str(struct nfacct *nfacct, enum nfacct_attr_type type)
void nfacct_attr_unset(struct nfacct *nfacct, enum nfacct_attr_type type)
void nfacct_free(struct nfacct *nfacct)
uint64_t nfacct_attr_get_u64(struct nfacct *nfacct, enum nfacct_attr_type type)
int nfacct_nlmsg_parse_payload(const struct nlmsghdr *nlh, struct nfacct *nfacct)
struct nlmsghdr * nfacct_nlmsg_build_hdr(char *buf, uint8_t cmd, uint16_t flags, uint32_t seq)
struct nfacct * nfacct_alloc(void)
int nfacct_snprintf(char *buf, size_t size, struct nfacct *nfacct, uint16_t type, uint16_t flags)
void nfacct_attr_set_str(struct nfacct *nfacct, enum nfacct_attr_type type, const char *name)
void nfacct_attr_set_u64(struct nfacct *nfacct, enum nfacct_attr_type type, uint64_t value)