3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 2001 Gerald Combs
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef __PACKET_NETLINK_H__
23 #define __PACKET_NETLINK_H__
25 #include <epan/value_string.h>
27 /* from <linux/netlink.h> prefixed with WS_ */
30 WS_NETLINK_UNUSED = 1,
31 WS_NETLINK_USERSOCK = 2,
32 WS_NETLINK_FIREWALL = 3,
33 WS_NETLINK_SOCK_DIAG = 4,
36 WS_NETLINK_SELINUX = 7,
39 WS_NETLINK_FIB_LOOKUP = 10,
40 WS_NETLINK_CONNECTOR = 11,
41 WS_NETLINK_NETFILTER = 12,
42 WS_NETLINK_IP6_FW = 13,
43 WS_NETLINK_DNRTMSG = 14,
44 WS_NETLINK_KOBJECT_UEVENT = 15,
45 WS_NETLINK_GENERIC = 16,
46 /* leave room for NETLINK_DM (DM Events) */
47 WS_NETLINK_SCSITRANSPORT = 18,
48 WS_NETLINK_ECRYPTFS = 19,
50 WS_NETLINK_CRYPTO = 21
53 /* from <linux/netlink.h> prefixed with WS_ */
55 WS_NLM_F_REQUEST = 1, /* It is request message.*/
56 WS_NLM_F_MULTI = 2, /* Multipart message, terminated by NETLINK_MSG_DONE */
57 WS_NLM_F_ACK = 4, /* Reply with ack, with zero or error code */
58 WS_NLM_F_ECHO = 8, /* Echo this request */
60 /* Modifiers to Get request */
61 WS_NLM_F_ROOT = 0x100, /* specify tree root */
62 WS_NLM_F_MATCH = 0x200, /* return all matching */
63 WS_NLM_F_ATOMIC = 0x400, /* = (NETLINK_MSG_F_ROOT | NETLINK_MSG_F_MATCH) */
65 /* Modifiers to NEW request */
66 WS_NLM_F_REPLACE = 0x100, /* Override existing */
67 WS_NLM_F_EXCL = 0x200, /* Do not touch, if it exists */
68 WS_NLM_F_CREATE = 0x400, /* Create, if it does */
69 WS_NLM_F_APPEND = 0x800 /* Add to end of list */
73 extern value_string_ext netlink_family_vals_ext;
77 WS_NLMSG_ERROR = 0x02,
79 WS_NLMSG_OVERRUN = 0x04,
80 WS_NLMSG_MIN_TYPE = 0x10 /** type < WS_NLMSG_MIN_TYPE are reserved */
84 NETLINK_RTM_BASE = 16,
86 NETLINK_RTM_NEWLINK = 16,
91 NETLINK_RTM_NEWADDR = 20,
95 NETLINK_RTM_NEWROUTE = 24,
100 #define PACKET_NETLINK_MAGIC 0x4A5ACCCE
102 struct packet_netlink_data {
103 guint32 magic; /* PACKET_NETLINK_MAGIC */
109 typedef int netlink_attributes_cb_t(tvbuff_t *, void *data, proto_tree *, int nla_type, int offset, int len);
111 int dissect_netlink_attributes(tvbuff_t *tvb, header_field_info *hfi_type, int ett, void *data, proto_tree *tree, int offset, netlink_attributes_cb_t cb);
113 #endif /* __PACKET_NETLINK_H__ */