1 /*
2 * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
3 * Copyright (c) 2016-2021 The strace developers.
4 * All rights reserved.
5 *
6 * SPDX-License-Identifier: LGPL-2.1-or-later
7 */
8
9 #ifndef STRACE_NETLINK_SOCK_DIAG_H
10 # define STRACE_NETLINK_SOCK_DIAG_H
11
12 # define DECL_NETLINK_DIAG_DECODER(diag_decode_name) \
13 void \
14 diag_decode_name(struct tcb *tcp, \
15 const struct nlmsghdr *nlmsghdr, \
16 uint8_t family, \
17 kernel_ulong_t addr, \
18 unsigned int len) \
19 /* End of DECL_NETLINK_DIAG_DECODER definition. */
20
21 extern DECL_NETLINK_DIAG_DECODER(decode_inet_diag_msg);
22 extern DECL_NETLINK_DIAG_DECODER(decode_inet_diag_req);
23 extern DECL_NETLINK_DIAG_DECODER(decode_netlink_diag_msg);
24 extern DECL_NETLINK_DIAG_DECODER(decode_netlink_diag_req);
25 extern DECL_NETLINK_DIAG_DECODER(decode_packet_diag_msg);
26 extern DECL_NETLINK_DIAG_DECODER(decode_packet_diag_req);
27 extern DECL_NETLINK_DIAG_DECODER(decode_smc_diag_msg);
28 extern DECL_NETLINK_DIAG_DECODER(decode_smc_diag_req);
29 extern DECL_NETLINK_DIAG_DECODER(decode_unix_diag_msg);
30 extern DECL_NETLINK_DIAG_DECODER(decode_unix_diag_req);
31
32 struct inet_diag_sockid;
33
34 extern void
35 print_inet_diag_sockid(const struct inet_diag_sockid *, const uint8_t family);
36
37 # define PRINT_FIELD_INET_DIAG_SOCKID(where_, field_, af_) \
38 do { \
39 tprints_field_name(#field_); \
40 print_inet_diag_sockid(&(where_).field_, (af_)); \
41 } while (0)
42
43
44 #endif /* !STRACE_NETLINK_SOCK_DIAG_H */