*
* derived from the packet-nbns.c
*
- * $Id: packet-netbios.c,v 1.53 2002/12/03 08:24:58 guy Exp $
+ * $Id: packet-netbios.c,v 1.57 2003/04/20 11:36:14 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
&hf_netb_fragment_multiple_tails,
&hf_netb_fragment_too_long_fragment,
&hf_netb_fragment_error,
+ NULL,
"fragments"
};
/*
* Possibly fragmented.
*/
- if (netbios_defragment) {
- len = tvb_length_remaining(tvb, offset);
+ len = tvb_reported_length_remaining(tvb, offset);
+ if (netbios_defragment &&
+ tvb_bytes_exist(tvb, offset, len)) {
fd_head = fragment_add_seq_next(tvb, offset,
pinfo, session_id,
netbios_fragment_table,
}
} else {
/*
- * If this is NB_DATA_FIRST_MIDDLE,
- * just show it as a fragment.
- * (XXX - it'd be nice to dissect it
- * if it's the first fragment, but we'd
- * need to do reassembly in order to
- * discover that.)
+ * Dissect this, regardless of whether
+ * it's NB_DATA_FIRST_MIDDLE or
+ * NB_DATA_ONLY_LAST.
*
- * If this is NB_DATA_ONLY_LAST, dissect
- * it. (XXX - it'd be nice to show it
- * as a fragment if it's part of a
- * fragmented datagram, but we'd need
- * to do reassembly in order to discover
- * that.)
+ * XXX - it'd be nice to show
+ * NB_DATA_FIRST_MIDDLE as a fragment
+ * if it's not the first fragment (i.e.,
+ * MIDDLE rather than FIRST), and show
+ * NB_DATA_ONLY_LAST as a fragment if
+ * it's part of a fragmented datagram
+ * (i.e, LAST rather than ONLY), but
+ * we'd have to do reassembly to
+ * be able to determine that.
*/
- if (command == NB_DATA_FIRST_MIDDLE)
- next_tvb = NULL;
- else {
- next_tvb = tvb_new_subset(tvb, offset,
- -1, -1);
- }
+ next_tvb = tvb_new_subset(tvb, offset, -1, -1);
}
if (next_tvb != NULL)
dissect_netbios_payload(next_tvb, pinfo, tree);
NULL, 0x0, "Fragment contained data past end of packet", HFILL }},
{ &hf_netb_fragment_error,
- {"Defragmentation error", "netbios.fragment.error", FT_NONE, BASE_NONE,
+ {"Defragmentation error", "netbios.fragment.error", FT_FRAMENUM, BASE_NONE,
NULL, 0x0, "Defragmentation error due to illegal fragments", HFILL }},
{ &hf_netb_fragment,
- { "NetBIOS Fragment", "netbios.fragment", FT_NONE, BASE_NONE,
+ { "NetBIOS Fragment", "netbios.fragment", FT_FRAMENUM, BASE_NONE,
NULL, 0x0, "NetBIOS Fragment", HFILL }},
{ &hf_netb_fragments,