Initial import package libnl: Convenience library for kernel netlink sockets
[external/libnl.git] / include / netlink / netfilter / log.h
1 /*
2  * netlink/netfilter/log.h      Netfilter Log
3  *
4  *      This library is free software; you can redistribute it and/or
5  *      modify it under the terms of the GNU Lesser General Public
6  *      License as published by the Free Software Foundation version 2.1
7  *      of the License.
8  *
9  * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
10  * Copyright (c) 2007 Philip Craig <philipc@snapgear.com>
11  * Copyright (c) 2007 Secure Computing Corporation
12  */
13
14 #ifndef NETLINK_LOG_H_
15 #define NETLINK_LOG_H_
16
17 #include <netlink/netlink.h>
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 struct nl_handle;
24 struct nlmsghdr;
25 struct nfnl_log;
26
27 extern struct nl_object_ops log_obj_ops;
28
29 /* General */
30 extern struct nfnl_log *nfnl_log_alloc(void);
31 extern struct nfnl_log *nfnlmsg_log_parse(struct nlmsghdr *);
32
33 extern void             nfnl_log_get(struct nfnl_log *);
34 extern void             nfnl_log_put(struct nfnl_log *);
35
36 extern struct nl_msg *  nfnl_log_build_bind(uint16_t);;
37 extern int              nfnl_log_bind(struct nl_handle *, uint16_t);
38 extern struct nl_msg *  nfnl_log_build_unbind(uint16_t);
39 extern int              nfnl_log_unbind(struct nl_handle *, uint16_t);
40 extern struct nl_msg *  nfnl_log_build_pf_bind(uint8_t);
41 extern int              nfnl_log_pf_bind(struct nl_handle *, uint8_t);
42 extern struct nl_msg *  nfnl_log_build_pf_unbind(uint8_t);
43 extern int              nfnl_log_pf_unbind(struct nl_handle *, uint8_t);
44 extern struct nl_msg *  nfnl_log_build_mode(uint16_t, uint8_t, uint32_t);
45 extern int              nfnl_log_set_mode(struct nl_handle *, uint16_t,
46                                           uint8_t, uint32_t);
47
48 extern void             nfnl_log_set_family(struct nfnl_log *, uint8_t);
49 extern uint8_t          nfnl_log_get_family(const struct nfnl_log *);
50
51 extern void             nfnl_log_set_hwproto(struct nfnl_log *, uint16_t);
52 extern int              nfnl_log_test_hwproto(const struct nfnl_log *);
53 extern uint16_t         nfnl_log_get_hwproto(const struct nfnl_log *);
54
55 extern void             nfnl_log_set_hook(struct nfnl_log *, uint8_t);
56 extern int              nfnl_log_test_hook(const struct nfnl_log *);
57 extern uint8_t          nfnl_log_get_hook(const struct nfnl_log *);
58
59 extern void             nfnl_log_set_mark(struct nfnl_log *, uint32_t);
60 extern int              nfnl_log_test_mark(const struct nfnl_log *);
61 extern uint32_t         nfnl_log_get_mark(const struct nfnl_log *);
62
63 extern void             nfnl_log_set_timestamp(struct nfnl_log *,
64                                                struct timeval *);
65 extern const struct timeval *nfnl_log_get_timestamp(const struct nfnl_log *);
66
67 extern void             nfnl_log_set_indev(struct nfnl_log *, uint32_t);
68 extern uint32_t         nfnl_log_get_indev(const struct nfnl_log *);
69
70 extern void             nfnl_log_set_outdev(struct nfnl_log *, uint32_t);
71 extern uint32_t         nfnl_log_get_outdev(const struct nfnl_log *);
72
73 extern void             nfnl_log_set_physindev(struct nfnl_log *, uint32_t);
74 extern uint32_t         nfnl_log_get_physindev(const struct nfnl_log *);
75
76 extern void             nfnl_log_set_physoutdev(struct nfnl_log *, uint32_t);
77 extern uint32_t         nfnl_log_get_physoutdev(const struct nfnl_log *);
78
79 extern void             nfnl_log_set_hwaddr(struct nfnl_log *, uint8_t *, int);
80 extern const uint8_t *  nfnl_log_get_hwaddr(const struct nfnl_log *, int *);
81
82 extern int              nfnl_log_set_payload(struct nfnl_log *, uint8_t *, int);
83 extern const void *     nfnl_log_get_payload(const struct nfnl_log *, int *);
84
85 extern int              nfnl_log_set_prefix(struct nfnl_log *, void *);
86 extern const char *     nfnl_log_get_prefix(const struct nfnl_log *);
87
88 extern void             nfnl_log_set_uid(struct nfnl_log *, uint32_t);
89 extern int              nfnl_log_test_uid(const struct nfnl_log *);
90 extern uint32_t         nfnl_log_get_uid(const struct nfnl_log *);
91
92 extern void             nfnl_log_set_seq(struct nfnl_log *, uint32_t);
93 extern int              nfnl_log_test_seq(const struct nfnl_log *);
94 extern uint32_t         nfnl_log_get_seq(const struct nfnl_log *);
95
96 extern void             nfnl_log_set_seq_global(struct nfnl_log *, uint32_t);
97 extern int              nfnl_log_test_seq_global(const struct nfnl_log *);
98 extern uint32_t         nfnl_log_get_seq_global(const struct nfnl_log *);
99
100 #ifdef __cplusplus
101 }
102 #endif
103
104 #endif
105