libnetfilter_cthelper.h
#ifndef _LIBNETFILTER_ACCT_H_
#define _LIBNETFILTER_ACCT_H_
#include <sys/types.h>
#include <linux/netfilter/nfnetlink_cthelper.h>
struct nfct_helper_policy;
enum nfct_helper_policy_attr_type {
NFCTH_ATTR_POLICY_NAME = 0,
NFCTH_ATTR_POLICY_TIMEOUT,
NFCTH_ATTR_POLICY_MAX,
};
struct nfct_helper_policy *nfct_helper_policy_alloc(void);
void nfct_helper_policy_free(struct nfct_helper_policy *p);
void nfct_helper_policy_attr_set(struct nfct_helper_policy *p, enum nfct_helper_policy_attr_type type, const void *data);
void nfct_helper_policy_attr_set_str(struct nfct_helper_policy *p, enum nfct_helper_policy_attr_type type, const char *name);
void nfct_helper_policy_attr_set_u32(struct nfct_helper_policy *p, enum nfct_helper_policy_attr_type type, uint32_t value);
void nfct_helper_policy_attr_unset(struct nfct_helper_policy *p, enum nfct_helper_policy_attr_type type);
enum nfct_helper_attr_type {
NFCTH_ATTR_NAME = 0,
NFCTH_ATTR_QUEUE_NUM,
NFCTH_ATTR_PROTO_L3NUM,
NFCTH_ATTR_PROTO_L4NUM,
NFCTH_ATTR_PRIV_DATA_LEN,
NFCTH_ATTR_POLICY,
NFCTH_ATTR_POLICY1 = NFCTH_ATTR_POLICY,
NFCTH_ATTR_POLICY2,
NFCTH_ATTR_POLICY3,
NFCTH_ATTR_POLICY4,
NFCTH_ATTR_STATUS,
};
struct nfct_helper;
struct nfct_helper *nfct_helper_alloc(void);
void nfct_helper_free(struct nfct_helper *h);
void nfct_helper_attr_set(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type, const void *data);
void nfct_helper_attr_set_str(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type, const char *name);
void nfct_helper_attr_set_u8(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type, uint8_t value);
void nfct_helper_attr_set_u16(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type, uint16_t value);
void nfct_helper_attr_set_u32(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type, uint32_t value);
void nfct_helper_attr_unset(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type);
const void *nfct_helper_attr_get(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type);
const char *nfct_helper_attr_get_str(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type);
uint8_t nfct_helper_attr_get_u8(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type);
uint16_t nfct_helper_attr_get_u16(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type);
uint32_t nfct_helper_attr_get_u32(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type);
struct nlmsghdr;
struct nlmsghdr *nfct_helper_nlmsg_build_hdr(char *buf, uint8_t cmd, uint16_t flags, uint32_t seq);
void nfct_helper_nlmsg_build_payload(struct nlmsghdr *nlh, struct nfct_helper *nfct_helper);
int nfct_helper_nlmsg_parse_payload(const struct nlmsghdr *nlh, struct nfct_helper *nfct_helper);
int nfct_helper_snprintf(char *buf, size_t size, struct nfct_helper *nfct_helper, unsigned int type, unsigned int flags);
#endif
nfct_helper_attr_get
const void * nfct_helper_attr_get(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type)
Definition libnetfilter_cthelper.c:308
nfct_helper_policy_attr_set_str
void nfct_helper_policy_attr_set_str(struct nfct_helper_policy *p, enum nfct_helper_policy_attr_type type, const char *name)
Definition libnetfilter_cthelper.c:177
nfct_helper_attr_get_u32
uint32_t nfct_helper_attr_get_u32(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type)
Definition libnetfilter_cthelper.c:404
nfct_helper_policy_free
void nfct_helper_policy_free(struct nfct_helper_policy *p)
Definition libnetfilter_cthelper.c:137
nfct_helper_policy_alloc
struct nfct_helper_policy * nfct_helper_policy_alloc(void)
Definition libnetfilter_cthelper.c:128
nfct_helper_snprintf
int nfct_helper_snprintf(char *buf, size_t size, struct nfct_helper *nfct_helper, unsigned int type, unsigned int flags)
Definition libnetfilter_cthelper.c:421
nfct_helper_policy_attr_set
void nfct_helper_policy_attr_set(struct nfct_helper_policy *p, enum nfct_helper_policy_attr_type type, const void *data)
Definition libnetfilter_cthelper.c:149
nfct_helper_attr_unset
void nfct_helper_attr_unset(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type)
Definition libnetfilter_cthelper.c:287
nfct_helper_attr_get_str
const char * nfct_helper_attr_get_str(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type)
Definition libnetfilter_cthelper.c:359
nfct_helper_attr_get_u16
uint16_t nfct_helper_attr_get_u16(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type)
Definition libnetfilter_cthelper.c:389
nfct_helper_attr_get_u8
uint8_t nfct_helper_attr_get_u8(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type)
Definition libnetfilter_cthelper.c:374
nfct_helper_attr_set_str
void nfct_helper_attr_set_str(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type, const char *name)
Definition libnetfilter_cthelper.c:254
nfct_helper_alloc
struct nfct_helper * nfct_helper_alloc(void)
Definition libnetfilter_cthelper.c:102
nfct_helper_free
void nfct_helper_free(struct nfct_helper *h)
Definition libnetfilter_cthelper.c:111
nfct_helper_attr_set
void nfct_helper_attr_set(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type, const void *data)
Definition libnetfilter_cthelper.c:199
nfct_helper_nlmsg_build_payload
void nfct_helper_nlmsg_build_payload(struct nlmsghdr *nlh, struct nfct_helper *nfct_helper)
Definition libnetfilter_cthelper.c:519
nfct_helper_nlmsg_parse_payload
int nfct_helper_nlmsg_parse_payload(const struct nlmsghdr *nlh, struct nfct_helper *nfct_helper)
Definition libnetfilter_cthelper.c:782
nfct_helper_nlmsg_build_hdr
struct nlmsghdr * nfct_helper_nlmsg_build_hdr(char *buf, uint8_t cmd, uint16_t flags, uint32_t seq)
Definition libnetfilter_cthelper.c:480
nfct_helper_policy
Definition libnetfilter_cthelper.c:68
nfct_helper
Definition libnetfilter_cthelper.c:75