15 #ifndef NETLINK_LOG_H_
16 #define NETLINK_LOG_H_
18 #include <netlink/netlink.h>
28 extern struct nl_object_ops log_obj_ops;
30 enum nfnl_log_copy_mode {
37 NFNL_LOG_FLAG_SEQ = 0x1,
38 NFNL_LOG_FLAG_SEQ_GLOBAL = 0x2,
42 extern struct nfnl_log * nfnl_log_alloc(
void);
43 extern int nfnlmsg_log_parse(
struct nlmsghdr *,
46 extern void nfnl_log_get(
struct nfnl_log *);
47 extern void nfnl_log_put(
struct nfnl_log *);
50 extern void nfnl_log_set_group(
struct nfnl_log *, uint16_t);
51 extern int nfnl_log_test_group(
const struct nfnl_log *);
52 extern uint16_t nfnl_log_get_group(
const struct nfnl_log *);
54 extern void nfnl_log_set_copy_mode(
struct nfnl_log *,
55 enum nfnl_log_copy_mode);
56 extern int nfnl_log_test_copy_mode(
const struct nfnl_log *);
57 extern enum nfnl_log_copy_mode nfnl_log_get_copy_mode(
const struct nfnl_log *);
59 extern char * nfnl_log_copy_mode2str(
enum nfnl_log_copy_mode,
61 extern enum nfnl_log_copy_mode nfnl_log_str2copy_mode(
const char *);
63 extern void nfnl_log_set_copy_range(
struct nfnl_log *, uint32_t);
64 extern int nfnl_log_test_copy_range(
const struct nfnl_log *);
65 extern uint32_t nfnl_log_get_copy_range(
const struct nfnl_log *);
67 extern void nfnl_log_set_flush_timeout(
struct nfnl_log *, uint32_t);
68 extern int nfnl_log_test_flush_timeout(
const struct nfnl_log *);
69 extern uint32_t nfnl_log_get_flush_timeout(
const struct nfnl_log *);
71 extern void nfnl_log_set_alloc_size(
struct nfnl_log *, uint32_t);
72 extern int nfnl_log_test_alloc_size(
const struct nfnl_log *);
73 extern uint32_t nfnl_log_get_alloc_size(
const struct nfnl_log *);
75 extern void nfnl_log_set_queue_threshold(
struct nfnl_log *, uint32_t);
76 extern int nfnl_log_test_queue_threshold(
const struct nfnl_log *);
77 extern uint32_t nfnl_log_get_queue_threshold(
const struct nfnl_log *);
79 extern void nfnl_log_set_flags(
struct nfnl_log *,
unsigned int);
80 extern void nfnl_log_unset_flags(
struct nfnl_log *,
unsigned int);
81 extern unsigned int nfnl_log_get_flags(
const struct nfnl_log *);
83 extern char * nfnl_log_flags2str(
unsigned int,
char *,
size_t);
84 extern unsigned int nfnl_log_str2flags(
const char *);
86 extern int nfnl_log_build_pf_bind(uint8_t,
struct nl_msg **);
87 extern int nfnl_log_pf_bind(
struct nl_sock *, uint8_t);
89 extern int nfnl_log_build_pf_unbind(uint8_t,
struct nl_msg **);
90 extern int nfnl_log_pf_unbind(
struct nl_sock *, uint8_t);
92 extern int nfnl_log_build_create_request(
const struct nfnl_log *,
94 extern int nfnl_log_create(
struct nl_sock *,
const struct nfnl_log *);
96 extern int nfnl_log_build_change_request(
const struct nfnl_log *,
98 extern int nfnl_log_change(
struct nl_sock *,
const struct nfnl_log *);
100 extern int nfnl_log_build_delete_request(
const struct nfnl_log *,
102 extern int nfnl_log_delete(
struct nl_sock *,
const struct nfnl_log *);