diff options
author | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-12-13 22:34:10 +0000 |
---|---|---|
committer | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-12-13 22:34:10 +0000 |
commit | bbc3e14642e63c3d393d4b632ef81f3b16fbcafc (patch) | |
tree | 60e595226ec9db764b2b81df981e485dbb767872 /epan/dissectors/packet-netlink.c | |
parent | 4cb6a92d93bceb1e5c32045674f3918835a2d671 (diff) |
netlink: update
- set pinfo->p2p_dir based on portid
- check for nlmsg type in dissect_netlink_sock_diag()
- sock diag support LINUX_AF_INET6, LINUX_AF_PACKET
- naming cleanup
svn path=/trunk/; revision=54073
Diffstat (limited to 'epan/dissectors/packet-netlink.c')
-rw-r--r-- | epan/dissectors/packet-netlink.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/epan/dissectors/packet-netlink.c b/epan/dissectors/packet-netlink.c index 8d05112a2a..c7cf9af05e 100644 --- a/epan/dissectors/packet-netlink.c +++ b/epan/dissectors/packet-netlink.c @@ -35,6 +35,9 @@ #include "packet-netlink.h" +void proto_register_netlink(void); +void proto_reg_handoff_netlink(void); + /* * A DLT_LINUX_SLL fake link-layer header. */ @@ -206,8 +209,6 @@ dissect_netlink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *_data proto_tree_add_item(fh_tree, &hfi_netlink_family, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; - pinfo->p2p_dir = P2P_DIR_SENT; /* XXX */ - /* DISSECTOR_ASSERT(offset == 16); */ while (tvb_reported_length_remaining(tvb, offset) >= 16) { @@ -215,6 +216,7 @@ dissect_netlink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *_data int pkt_end_offset; guint32 pkt_len; + guint32 port_id; proto_tree *fh_msg; proto_tree *fh_hdr; @@ -245,8 +247,15 @@ dissect_netlink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *_data offset += 4; proto_tree_add_item(fh_hdr, &hfi_netlink_hdr_pid, tvb, offset, 4, encoding); + port_id = tvb_get_letohl(tvb, offset); offset += 4; + /* XXX */ + if (port_id == 0x00) + pinfo->p2p_dir = P2P_DIR_SENT; /* userspace -> kernel */ + else + pinfo->p2p_dir = P2P_DIR_RECV; /* userspace or kernel -> userspace */ + if (pkt_len > 16) { data.magic = PACKET_NETLINK_MAGIC; data.encoding = encoding; |