diff options
author | Peter Wu <peter@lekensteyn.nl> | 2016-08-11 23:30:06 +0200 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-08-13 21:43:23 +0000 |
commit | 620f5721b176ab4cd0cd87ec618925c91664f2ee (patch) | |
tree | e0e41ad25778956aad0e5a3b0fec38c81f0e8462 /epan/dissectors/packet-netlink.h | |
parent | 5ae7076b3ead0d3c7ae3ad4d9d05d9a89930d848 (diff) |
netlink: fully dissect NLA Type, add length restriction
NLA types consist of a type and two flags, add new fields for this.
Add a new parameter to restrict the data consumed by the
dissect_netlink_attributes function, this is needed when implementing
nested attributes using another call to this function. This also avoids
adding padding to the payload and matches the comment in
include/uapi/linux/netlink.h (Linux 4.7).
Change-Id: I34dbfa466081b6c6c4580941aff568bd120b4210
Reviewed-on: https://code.wireshark.org/review/17030
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-netlink.h')
-rw-r--r-- | epan/dissectors/packet-netlink.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/epan/dissectors/packet-netlink.h b/epan/dissectors/packet-netlink.h index 168310cd53..673fd019ad 100644 --- a/epan/dissectors/packet-netlink.h +++ b/epan/dissectors/packet-netlink.h @@ -93,6 +93,10 @@ struct packet_netlink_data { typedef int netlink_attributes_cb_t(tvbuff_t *, void *data, proto_tree *, int nla_type, int offset, int len); -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); +int dissect_netlink_attributes(tvbuff_t *tvb, header_field_info *hfi_type, int ett, void *data, proto_tree *tree, int offset, int length, netlink_attributes_cb_t cb); + +#define NLA_F_NESTED 0x8000 +#define NLA_F_NET_BYTEORDER 0x4000 +#define NLA_TYPE_MASK 0x3fff #endif /* __PACKET_NETLINK_H__ */ |