/* packet-nbns.c
* Routines for NetBIOS-over-TCP packet disassembly (the name dates back
* to when it had only NBNS)
- * Gilbert Ramirez <gram@xiexie.org>
- * Much stuff added by Guy Harris <guy@alum.mit.edu>
+ * Guy Harris <guy@alum.mit.edu>
*
- * $Id: packet-nbns.c,v 1.61 2001/09/30 23:14:43 guy Exp $
+ * $Id: packet-nbns.c,v 1.66 2001/12/03 03:59:37 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
proto_tree *nbdgm_tree = NULL;
proto_item *ti = NULL;
struct nbdgm_header header;
- int msglen;
int flags;
int message_index;
tvbuff_t *next_tvb;
* Here we can pass the packet off to the next protocol.
* Set the length of our top-level tree item to include
* only our stuff.
+ *
+ * XXX - take the datagram length into account?
*/
proto_item_set_len(ti, offset);
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
static void
dissect_nbss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- struct tcpinfo *tcpinfo = pinfo->private;
+ struct tcpinfo *tcpinfo = pinfo->private_data;
int offset = 0;
int max_data;
guint8 msg_type;
* there should be no compression), and we
* shouldn't have more than 128 bytes (actually,
* we shouldn't have that many).
+ *
+ * XXX - actually, MacOS X 10.1 (yes, that's
+ * redundant, but that's what Apple calls it,
+ * not MacOS X.1) puts names longer than 16
+ * characters into session request messages,
+ * so we can have more than 32 bytes of
+ * name value, so we can have more than 128
+ * bytes of data.
*/
- if (length < 2 || length > 128)
+ if (length < 2 || length > 256)
goto continuation;
break;
void
proto_reg_handoff_nbt(void)
{
- dissector_add("udp.port", UDP_PORT_NBNS, dissect_nbns, proto_nbns);
- dissector_add("udp.port", UDP_PORT_NBDGM, dissect_nbdgm, proto_nbdgm);
- dissector_add("tcp.port", TCP_PORT_NBSS, dissect_nbss, proto_nbss);
- dissector_add("tcp.port", TCP_PORT_CIFS, dissect_nbss, proto_nbss);
+ dissector_handle_t nbns_handle, nbdgm_handle, nbss_handle;
+
+ nbns_handle = create_dissector_handle(dissect_nbns, proto_nbns);
+ dissector_add("udp.port", UDP_PORT_NBNS, nbns_handle);
+ nbdgm_handle = create_dissector_handle(dissect_nbdgm, proto_nbdgm);
+ dissector_add("udp.port", UDP_PORT_NBDGM, nbdgm_handle);
+ nbss_handle = create_dissector_handle(dissect_nbss, proto_nbss);
+ dissector_add("tcp.port", TCP_PORT_NBSS, nbss_handle);
+ dissector_add("tcp.port", TCP_PORT_CIFS, nbss_handle);
}