libnl 3.5.0

log_msg.h
1 /*
2 * netlink/netfilter/log_msg.h Netfilter Log Message
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-2008 Thomas Graf <tgraf@suug.ch>
10 * Copyright (c) 2007 Philip Craig <philipc@snapgear.com>
11 * Copyright (c) 2007 Secure Computing Corporation
12 * Copyright (c) 2008 Patrick McHardy <kaber@trash.net>
13 */
14
15 #ifndef NETLINK_LOG_MSG_H_
16 #define NETLINK_LOG_MSG_H_
17
18 #include <netlink/netlink.h>
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 struct nlmsghdr;
25 struct nfnl_log_msg;
26
27 extern struct nl_object_ops log_msg_obj_ops;
28
29 /* General */
30 extern struct nfnl_log_msg *nfnl_log_msg_alloc(void);
31 extern int nfnlmsg_log_msg_parse(struct nlmsghdr *,
32 struct nfnl_log_msg **);
33
34 extern void nfnl_log_msg_get(struct nfnl_log_msg *);
35 extern void nfnl_log_msg_put(struct nfnl_log_msg *);
36
37 extern void nfnl_log_msg_set_family(struct nfnl_log_msg *, uint8_t);
38 extern uint8_t nfnl_log_msg_get_family(const struct nfnl_log_msg *);
39
40 extern void nfnl_log_msg_set_hwproto(struct nfnl_log_msg *, uint16_t);
41 extern int nfnl_log_msg_test_hwproto(const struct nfnl_log_msg *);
42 extern uint16_t nfnl_log_msg_get_hwproto(const struct nfnl_log_msg *);
43
44 extern void nfnl_log_msg_set_hook(struct nfnl_log_msg *, uint8_t);
45 extern int nfnl_log_msg_test_hook(const struct nfnl_log_msg *);
46 extern uint8_t nfnl_log_msg_get_hook(const struct nfnl_log_msg *);
47
48 extern void nfnl_log_msg_set_mark(struct nfnl_log_msg *, uint32_t);
49 extern int nfnl_log_msg_test_mark(const struct nfnl_log_msg *);
50 extern uint32_t nfnl_log_msg_get_mark(const struct nfnl_log_msg *);
51
52 extern void nfnl_log_msg_set_timestamp(struct nfnl_log_msg *,
53 struct timeval *);
54 extern const struct timeval *nfnl_log_msg_get_timestamp(const struct nfnl_log_msg *);
55
56 extern void nfnl_log_msg_set_indev(struct nfnl_log_msg *, uint32_t);
57 extern uint32_t nfnl_log_msg_get_indev(const struct nfnl_log_msg *);
58
59 extern void nfnl_log_msg_set_outdev(struct nfnl_log_msg *, uint32_t);
60 extern uint32_t nfnl_log_msg_get_outdev(const struct nfnl_log_msg *);
61
62 extern void nfnl_log_msg_set_physindev(struct nfnl_log_msg *, uint32_t);
63 extern uint32_t nfnl_log_msg_get_physindev(const struct nfnl_log_msg *);
64
65 extern void nfnl_log_msg_set_physoutdev(struct nfnl_log_msg *, uint32_t);
66 extern uint32_t nfnl_log_msg_get_physoutdev(const struct nfnl_log_msg *);
67
68 extern void nfnl_log_msg_set_hwaddr(struct nfnl_log_msg *, uint8_t *, int);
69 extern const uint8_t * nfnl_log_msg_get_hwaddr(const struct nfnl_log_msg *, int *);
70
71 extern int nfnl_log_msg_set_payload(struct nfnl_log_msg *, uint8_t *, int);
72 extern const void * nfnl_log_msg_get_payload(const struct nfnl_log_msg *, int *);
73
74 extern int nfnl_log_msg_set_prefix(struct nfnl_log_msg *, void *);
75 extern const char * nfnl_log_msg_get_prefix(const struct nfnl_log_msg *);
76
77 extern void nfnl_log_msg_set_uid(struct nfnl_log_msg *, uint32_t);
78 extern int nfnl_log_msg_test_uid(const struct nfnl_log_msg *);
79 extern uint32_t nfnl_log_msg_get_uid(const struct nfnl_log_msg *);
80
81 extern void nfnl_log_msg_set_gid(struct nfnl_log_msg *, uint32_t);
82 extern int nfnl_log_msg_test_gid(const struct nfnl_log_msg *);
83 extern uint32_t nfnl_log_msg_get_gid(const struct nfnl_log_msg *);
84
85 extern void nfnl_log_msg_set_seq(struct nfnl_log_msg *, uint32_t);
86 extern int nfnl_log_msg_test_seq(const struct nfnl_log_msg *);
87 extern uint32_t nfnl_log_msg_get_seq(const struct nfnl_log_msg *);
88
89 extern void nfnl_log_msg_set_seq_global(struct nfnl_log_msg *, uint32_t);
90 extern int nfnl_log_msg_test_seq_global(const struct nfnl_log_msg *);
91 extern uint32_t nfnl_log_msg_get_seq_global(const struct nfnl_log_msg *);
92
93 #ifdef __cplusplus
94 }
95 #endif
96
97 #endif
98