aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ap1394.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2009-05-05 03:50:06 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2009-05-05 03:50:06 +0000
commit5e7da5600391c29969424cb88c783c42cc3118ab (patch)
treec72b97063d83ecec989b091ce16a2347f000ba1e /epan/dissectors/packet-ap1394.c
parent8481287fb71fd0693b0888681c6b2e65ca9c1a62 (diff)
Get rid of some other uses of ethertype() for protocols that don't have
a trailer. Clean up the NHRP dissector's handling of the protocol ID to fully implement RFC 2332 (and mention that 2332 is the RFC for NHRP). Don't compute the checksum unless we have all the packet data, and don't use the captured length as the actual packet length. Check for an invalid extension offset value. Get rid of some unneeded tvb_ensure_bytes_exist() calls. Dissect - and set the columns - regardless of whether we're building the protocol tree. Mark the packet in error reports as an error packet. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28273 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-ap1394.c')
-rw-r--r--epan/dissectors/packet-ap1394.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/epan/dissectors/packet-ap1394.c b/epan/dissectors/packet-ap1394.c
index 1b19d4e820..e1ac60513c 100644
--- a/epan/dissectors/packet-ap1394.c
+++ b/epan/dissectors/packet-ap1394.c
@@ -41,6 +41,10 @@ static int hf_ap1394_type = -1;
static gint ett_ap1394 = -1;
+static dissector_table_t ethertype_subdissector_table;
+
+static dissector_handle_t data_handle;
+
void
capture_ap1394(const guchar *pd, int offset, int len, packet_counts *ld)
{
@@ -66,6 +70,7 @@ dissect_ap1394(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *fh_tree = NULL;
const guint8 *src_addr, *dst_addr;
guint16 etype;
+ tvbuff_t *next_tvb;
if (check_col(pinfo->cinfo, COL_PROTOCOL))
col_set_str(pinfo->cinfo, COL_PROTOCOL, "IP/IEEE1394");
@@ -88,7 +93,12 @@ dissect_ap1394(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_bytes(fh_tree, hf_ap1394_src, tvb, 8, 8, src_addr);
}
etype = tvb_get_ntohs(tvb, 16);
- ethertype(etype, tvb, 18, pinfo, tree, fh_tree, hf_ap1394_type, -1, 0);
+ if (tree)
+ proto_tree_add_uint(fh_tree, hf_ap1394_type, tvb, 16, 2, etype);
+ next_tvb = tvb_new_subset(tvb, 18, -1, -1);
+ if (!dissector_try_port(ethertype_subdissector_table, etype, next_tvb,
+ pinfo, tree))
+ call_dissector(data_handle, next_tvb, pinfo, tree);
}
void
@@ -120,6 +130,10 @@ proto_reg_handoff_ap1394(void)
{
dissector_handle_t ap1394_handle;
+ data_handle = find_dissector("data");
+
+ ethertype_subdissector_table = find_dissector_table("ethertype");
+
ap1394_handle = create_dissector_handle(dissect_ap1394, proto_ap1394);
dissector_add("wtap_encap", WTAP_ENCAP_APPLE_IP_OVER_IEEE1394, ap1394_handle);
}