summaryrefslogtreecommitdiffstats
path: root/include/netlink/netfilter/log_msg.h
blob: b3672da646e963bf73dbb5e569d964092a95a8c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/* SPDX-License-Identifier: LGPL-2.1-only */
/*
 * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch>
 * Copyright (c) 2007 Philip Craig <philipc@snapgear.com>
 * Copyright (c) 2007 Secure Computing Corporation
 * Copyright (c) 2008 Patrick McHardy <kaber@trash.net>
 */

#ifndef NETLINK_LOG_MSG_H_
#define NETLINK_LOG_MSG_H_

#include <netlink/netlink.h>

#ifdef __cplusplus
extern "C" {
#endif

struct nlmsghdr;
struct nfnl_log_msg;
struct nfnl_ct;

extern struct nl_object_ops log_msg_obj_ops;

/* General */
extern struct nfnl_log_msg *nfnl_log_msg_alloc(void);
extern int		nfnlmsg_log_msg_parse(struct nlmsghdr *,
					      struct nfnl_log_msg **);

extern void		nfnl_log_msg_get(struct nfnl_log_msg *);
extern void		nfnl_log_msg_put(struct nfnl_log_msg *);

extern void		nfnl_log_msg_set_family(struct nfnl_log_msg *, uint8_t);
extern uint8_t		nfnl_log_msg_get_family(const struct nfnl_log_msg *);

extern void		nfnl_log_msg_set_hwproto(struct nfnl_log_msg *, uint16_t);
extern int		nfnl_log_msg_test_hwproto(const struct nfnl_log_msg *);
extern uint16_t		nfnl_log_msg_get_hwproto(const struct nfnl_log_msg *);

extern void		nfnl_log_msg_set_hook(struct nfnl_log_msg *, uint8_t);
extern int		nfnl_log_msg_test_hook(const struct nfnl_log_msg *);
extern uint8_t		nfnl_log_msg_get_hook(const struct nfnl_log_msg *);

extern void		nfnl_log_msg_set_mark(struct nfnl_log_msg *, uint32_t);
extern int		nfnl_log_msg_test_mark(const struct nfnl_log_msg *);
extern uint32_t		nfnl_log_msg_get_mark(const struct nfnl_log_msg *);

extern void		nfnl_log_msg_set_timestamp(struct nfnl_log_msg *,
					       struct timeval *);
extern const struct timeval *nfnl_log_msg_get_timestamp(const struct nfnl_log_msg *);

extern void		nfnl_log_msg_set_indev(struct nfnl_log_msg *, uint32_t);
extern uint32_t		nfnl_log_msg_get_indev(const struct nfnl_log_msg *);

extern void		nfnl_log_msg_set_outdev(struct nfnl_log_msg *, uint32_t);
extern uint32_t		nfnl_log_msg_get_outdev(const struct nfnl_log_msg *);

extern void		nfnl_log_msg_set_physindev(struct nfnl_log_msg *, uint32_t);
extern uint32_t		nfnl_log_msg_get_physindev(const struct nfnl_log_msg *);

extern void		nfnl_log_msg_set_physoutdev(struct nfnl_log_msg *, uint32_t);
extern uint32_t		nfnl_log_msg_get_physoutdev(const struct nfnl_log_msg *);

extern void		nfnl_log_msg_set_hwaddr(struct nfnl_log_msg *, uint8_t *, int);
extern const uint8_t *	nfnl_log_msg_get_hwaddr(const struct nfnl_log_msg *, int *);

extern int		nfnl_log_msg_set_payload(struct nfnl_log_msg *, uint8_t *, int);
extern const void *	nfnl_log_msg_get_payload(const struct nfnl_log_msg *, int *);

extern int		nfnl_log_msg_set_prefix(struct nfnl_log_msg *, void *);
extern const char *	nfnl_log_msg_get_prefix(const struct nfnl_log_msg *);

extern void		nfnl_log_msg_set_uid(struct nfnl_log_msg *, uint32_t);
extern int		nfnl_log_msg_test_uid(const struct nfnl_log_msg *);
extern uint32_t		nfnl_log_msg_get_uid(const struct nfnl_log_msg *);

extern void		nfnl_log_msg_set_gid(struct nfnl_log_msg *, uint32_t);
extern int		nfnl_log_msg_test_gid(const struct nfnl_log_msg *);
extern uint32_t		nfnl_log_msg_get_gid(const struct nfnl_log_msg *);

extern void		nfnl_log_msg_set_seq(struct nfnl_log_msg *, uint32_t);
extern int		nfnl_log_msg_test_seq(const struct nfnl_log_msg *);
extern uint32_t		nfnl_log_msg_get_seq(const struct nfnl_log_msg *);

extern void		nfnl_log_msg_set_seq_global(struct nfnl_log_msg *, uint32_t);
extern int		nfnl_log_msg_test_seq_global(const struct nfnl_log_msg *);
extern uint32_t		nfnl_log_msg_get_seq_global(const struct nfnl_log_msg *);

extern void		nfnl_log_msg_set_hwtype(struct nfnl_log_msg *, uint16_t);
extern int		nfnl_log_msg_test_hwtype(const struct nfnl_log_msg *);
extern uint16_t		nfnl_log_msg_get_hwtype(const struct nfnl_log_msg *);

extern void		nfnl_log_msg_set_hwlen(struct nfnl_log_msg *, uint16_t);
extern int		nfnl_log_msg_test_hwlen(const struct nfnl_log_msg *);
extern uint16_t		nfnl_log_msg_get_hwlen(const struct nfnl_log_msg *);

extern int		nfnl_log_msg_set_hwheader(struct nfnl_log_msg *, void *, int);
extern int		nfnl_log_msg_test_hwheader(const struct nfnl_log_msg *);
extern const void *	nfnl_log_msg_get_hwheader(const struct nfnl_log_msg *, int *);

extern void		nfnl_log_msg_set_vlan_proto(struct nfnl_log_msg *, uint16_t);
extern int		nfnl_log_msg_test_vlan_proto(const struct nfnl_log_msg *);
extern uint16_t		nfnl_log_msg_get_vlan_proto(const struct nfnl_log_msg *);
extern void		nfnl_log_msg_set_vlan_tag(struct nfnl_log_msg *, uint16_t);
extern int		nfnl_log_msg_test_vlan_tag(const struct nfnl_log_msg *);
extern uint16_t		nfnl_log_msg_get_vlan_tag(const struct nfnl_log_msg *);
extern uint16_t		nfnl_log_msg_get_vlan_id(const struct nfnl_log_msg *);
extern uint16_t		nfnl_log_msg_get_vlan_cfi(const struct nfnl_log_msg *);
extern uint16_t		nfnl_log_msg_get_vlan_prio(const struct nfnl_log_msg *);

extern void		nfnl_log_msg_set_ct_info(struct nfnl_log_msg *, uint32_t);
extern int		nfnl_log_msg_test_ct_info(const struct nfnl_log_msg *);
extern uint32_t		nfnl_log_msg_get_ct_info(const struct nfnl_log_msg *);

extern void		nfnl_log_msg_set_ct(struct nfnl_log_msg *, struct nfnl_ct *);
extern int		nfnl_log_msg_test_ct(const struct nfnl_log_msg *);
extern struct nfnl_ct * nfnl_log_msg_get_ct(const struct nfnl_log_msg *);

#ifdef __cplusplus
}
#endif

#endif