| 1 |
/* SPDX-License-Identifier: LGPL-2.1-only */ |
| 2 |
/* |
| 3 |
* Copyright (c) 2003-2008 Thomas Graf <[email protected]> |
| 4 |
* Copyright (c) 2007 Philip Craig <[email protected]> |
| 5 |
* Copyright (c) 2007 Secure Computing Corporation |
| 6 |
* Copyright (c) 2008 Patrick McHardy <[email protected]> |
| 7 |
*/ |
| 8 |
|
| 9 |
#ifndef NETLINK_LOG_MSG_H_ |
| 10 |
#define NETLINK_LOG_MSG_H_ |
| 11 |
|
| 12 |
#include <netlink/netlink.h> |
| 13 |
|
| 14 |
#ifdef __cplusplus |
| 15 |
extern "C" { |
| 16 |
#endif |
| 17 |
|
| 18 |
struct nlmsghdr; |
| 19 |
struct nfnl_log_msg; |
| 20 |
struct nfnl_ct; |
| 21 |
|
| 22 |
extern struct nl_object_ops log_msg_obj_ops; |
| 23 |
|
| 24 |
/* General */ |
| 25 |
extern struct nfnl_log_msg *nfnl_log_msg_alloc(void); |
| 26 |
extern int nfnlmsg_log_msg_parse(struct nlmsghdr *, |
| 27 |
struct nfnl_log_msg **); |
| 28 |
|
| 29 |
extern void nfnl_log_msg_get(struct nfnl_log_msg *); |
| 30 |
extern void nfnl_log_msg_put(struct nfnl_log_msg *); |
| 31 |
|
| 32 |
extern void nfnl_log_msg_set_family(struct nfnl_log_msg *, uint8_t); |
| 33 |
extern uint8_t nfnl_log_msg_get_family(const struct nfnl_log_msg *); |
| 34 |
|
| 35 |
extern void nfnl_log_msg_set_hwproto(struct nfnl_log_msg *, uint16_t); |
| 36 |
extern int nfnl_log_msg_test_hwproto(const struct nfnl_log_msg *); |
| 37 |
extern uint16_t nfnl_log_msg_get_hwproto(const struct nfnl_log_msg *); |
| 38 |
|
| 39 |
extern void nfnl_log_msg_set_hook(struct nfnl_log_msg *, uint8_t); |
| 40 |
extern int nfnl_log_msg_test_hook(const struct nfnl_log_msg *); |
| 41 |
extern uint8_t nfnl_log_msg_get_hook(const struct nfnl_log_msg *); |
| 42 |
|
| 43 |
extern void nfnl_log_msg_set_mark(struct nfnl_log_msg *, uint32_t); |
| 44 |
extern int nfnl_log_msg_test_mark(const struct nfnl_log_msg *); |
| 45 |
extern uint32_t nfnl_log_msg_get_mark(const struct nfnl_log_msg *); |
| 46 |
|
| 47 |
extern void nfnl_log_msg_set_timestamp(struct nfnl_log_msg *, |
| 48 |
struct timeval *); |
| 49 |
extern const struct timeval *nfnl_log_msg_get_timestamp(const struct nfnl_log_msg *); |
| 50 |
|
| 51 |
extern void nfnl_log_msg_set_indev(struct nfnl_log_msg *, uint32_t); |
| 52 |
extern uint32_t nfnl_log_msg_get_indev(const struct nfnl_log_msg *); |
| 53 |
|
| 54 |
extern void nfnl_log_msg_set_outdev(struct nfnl_log_msg *, uint32_t); |
| 55 |
extern uint32_t nfnl_log_msg_get_outdev(const struct nfnl_log_msg *); |
| 56 |
|
| 57 |
extern void nfnl_log_msg_set_physindev(struct nfnl_log_msg *, uint32_t); |
| 58 |
extern uint32_t nfnl_log_msg_get_physindev(const struct nfnl_log_msg *); |
| 59 |
|
| 60 |
extern void nfnl_log_msg_set_physoutdev(struct nfnl_log_msg *, uint32_t); |
| 61 |
extern uint32_t nfnl_log_msg_get_physoutdev(const struct nfnl_log_msg *); |
| 62 |
|
| 63 |
extern void nfnl_log_msg_set_hwaddr(struct nfnl_log_msg *, uint8_t *, int); |
| 64 |
extern const uint8_t * nfnl_log_msg_get_hwaddr(const struct nfnl_log_msg *, int *); |
| 65 |
|
| 66 |
extern int nfnl_log_msg_set_payload(struct nfnl_log_msg *, uint8_t *, int); |
| 67 |
extern const void * nfnl_log_msg_get_payload(const struct nfnl_log_msg *, int *); |
| 68 |
|
| 69 |
extern int nfnl_log_msg_set_prefix(struct nfnl_log_msg *, void *); |
| 70 |
extern const char * nfnl_log_msg_get_prefix(const struct nfnl_log_msg *); |
| 71 |
|
| 72 |
extern void nfnl_log_msg_set_uid(struct nfnl_log_msg *, uint32_t); |
| 73 |
extern int nfnl_log_msg_test_uid(const struct nfnl_log_msg *); |
| 74 |
extern uint32_t nfnl_log_msg_get_uid(const struct nfnl_log_msg *); |
| 75 |
|
| 76 |
extern void nfnl_log_msg_set_gid(struct nfnl_log_msg *, uint32_t); |
| 77 |
extern int nfnl_log_msg_test_gid(const struct nfnl_log_msg *); |
| 78 |
extern uint32_t nfnl_log_msg_get_gid(const struct nfnl_log_msg *); |
| 79 |
|
| 80 |
extern void nfnl_log_msg_set_seq(struct nfnl_log_msg *, uint32_t); |
| 81 |
extern int nfnl_log_msg_test_seq(const struct nfnl_log_msg *); |
| 82 |
extern uint32_t nfnl_log_msg_get_seq(const struct nfnl_log_msg *); |
| 83 |
|
| 84 |
extern void nfnl_log_msg_set_seq_global(struct nfnl_log_msg *, uint32_t); |
| 85 |
extern int nfnl_log_msg_test_seq_global(const struct nfnl_log_msg *); |
| 86 |
extern uint32_t nfnl_log_msg_get_seq_global(const struct nfnl_log_msg *); |
| 87 |
|
| 88 |
extern void nfnl_log_msg_set_hwtype(struct nfnl_log_msg *, uint16_t); |
| 89 |
extern int nfnl_log_msg_test_hwtype(const struct nfnl_log_msg *); |
| 90 |
extern uint16_t nfnl_log_msg_get_hwtype(const struct nfnl_log_msg *); |
| 91 |
|
| 92 |
extern void nfnl_log_msg_set_hwlen(struct nfnl_log_msg *, uint16_t); |
| 93 |
extern int nfnl_log_msg_test_hwlen(const struct nfnl_log_msg *); |
| 94 |
extern uint16_t nfnl_log_msg_get_hwlen(const struct nfnl_log_msg *); |
| 95 |
|
| 96 |
extern int nfnl_log_msg_set_hwheader(struct nfnl_log_msg *, void *, int); |
| 97 |
extern int nfnl_log_msg_test_hwheader(const struct nfnl_log_msg *); |
| 98 |
extern const void * nfnl_log_msg_get_hwheader(const struct nfnl_log_msg *, int *); |
| 99 |
|
| 100 |
extern void nfnl_log_msg_set_vlan_proto(struct nfnl_log_msg *, uint16_t); |
| 101 |
extern int nfnl_log_msg_test_vlan_proto(const struct nfnl_log_msg *); |
| 102 |
extern uint16_t nfnl_log_msg_get_vlan_proto(const struct nfnl_log_msg *); |
| 103 |
extern void nfnl_log_msg_set_vlan_tag(struct nfnl_log_msg *, uint16_t); |
| 104 |
extern int nfnl_log_msg_test_vlan_tag(const struct nfnl_log_msg *); |
| 105 |
extern uint16_t nfnl_log_msg_get_vlan_tag(const struct nfnl_log_msg *); |
| 106 |
extern uint16_t nfnl_log_msg_get_vlan_id(const struct nfnl_log_msg *); |
| 107 |
extern uint16_t nfnl_log_msg_get_vlan_cfi(const struct nfnl_log_msg *); |
| 108 |
extern uint16_t nfnl_log_msg_get_vlan_prio(const struct nfnl_log_msg *); |
| 109 |
|
| 110 |
extern void nfnl_log_msg_set_ct_info(struct nfnl_log_msg *, uint32_t); |
| 111 |
extern int nfnl_log_msg_test_ct_info(const struct nfnl_log_msg *); |
| 112 |
extern uint32_t nfnl_log_msg_get_ct_info(const struct nfnl_log_msg *); |
| 113 |
|
| 114 |
extern void nfnl_log_msg_set_ct(struct nfnl_log_msg *, struct nfnl_ct *); |
| 115 |
extern int nfnl_log_msg_test_ct(const struct nfnl_log_msg *); |
| 116 |
extern struct nfnl_ct * nfnl_log_msg_get_ct(const struct nfnl_log_msg *); |
| 117 |
|
| 118 |
#ifdef __cplusplus |
| 119 |
} |
| 120 |
#endif |
| 121 |
|
| 122 |
#endif |
| 123 |
|