aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/address.h3
-rw-r--r--epan/column-utils.c11
-rw-r--r--epan/dissectors/packet-idp.c10
-rw-r--r--epan/dissectors/packet-smb.c2
-rw-r--r--epan/dissectors/packet-spp.c22
-rw-r--r--plugins/stats_tree/pinfo_stats_tree.c7
6 files changed, 48 insertions, 7 deletions
diff --git a/epan/address.h b/epan/address.h
index c373275a8c..4d7b753f63 100644
--- a/epan/address.h
+++ b/epan/address.h
@@ -113,7 +113,8 @@ typedef enum {
PT_NCP, /* NCP connection */
PT_EXCHG, /* Fibre Channel exchange */
PT_DDP, /* DDP AppleTalk connection */
- PT_SBCCS /* FICON */
+ PT_SBCCS, /* FICON */
+ PT_IDP /* XNS IDP sockets */
} port_type;
/* Types of circuit IDs Ethereal knows about. */
diff --git a/epan/column-utils.c b/epan/column-utils.c
index facb458097..d38002ad48 100644
--- a/epan/column-utils.c
+++ b/epan/column-utils.c
@@ -719,6 +719,17 @@ col_set_port(packet_info *pinfo, int col, gboolean is_res, gboolean is_src)
pinfo->cinfo->col_expr_val[col][COL_MAX_LEN - 1] = '\0';
break;
+ case PT_IDP:
+ /* XXX - resolve IDP socket numbers */
+ snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "0x%04x", port);
+ if (is_src)
+ strcpy(pinfo->cinfo->col_expr[col], "idp.src.socket");
+ else
+ strcpy(pinfo->cinfo->col_expr[col], "idp.dst.socket");
+ snprintf(pinfo->cinfo->col_expr_val[col], COL_MAX_LEN, "0x%04x", port);
+ pinfo->cinfo->col_expr_val[col][COL_MAX_LEN - 1] = '\0';
+ break;
+
default:
break;
}
diff --git a/epan/dissectors/packet-idp.c b/epan/dissectors/packet-idp.c
index ef150c89a9..6a73bb7e5e 100644
--- a/epan/dissectors/packet-idp.c
+++ b/epan/dissectors/packet-idp.c
@@ -109,15 +109,21 @@ dissect_idp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
type = tvb_get_guint8(tvb, 5);
proto_tree_add_uint(idp_tree, hf_idp_packet_type, tvb, 5, 1, type);
+ pinfo->ptype = PT_IDP;
+
/* Destination */
proto_tree_add_item(idp_tree, hf_idp_dnet, tvb, 6, 4, FALSE);
proto_tree_add_item(idp_tree, hf_idp_dnode, tvb, 10, 6, FALSE);
- proto_tree_add_item(idp_tree, hf_idp_dsocket, tvb, 16, 2, FALSE);
+ pinfo->destport = tvb_get_ntohs(tvb, 16);
+ proto_tree_add_uint(idp_tree, hf_idp_dsocket, tvb, 16, 2,
+ pinfo->destport);
/* Source */
proto_tree_add_item(idp_tree, hf_idp_snet, tvb, 18, 4, FALSE);
proto_tree_add_item(idp_tree, hf_idp_snode, tvb, 22, 6, FALSE);
- proto_tree_add_item(idp_tree, hf_idp_ssocket, tvb, 28, 2, FALSE);
+ pinfo->srcport = tvb_get_ntohs(tvb, 28);
+ proto_tree_add_uint(idp_tree, hf_idp_ssocket, tvb, 28, 2,
+ pinfo->srcport);
/* Make the next tvbuff */
next_tvb = tvb_new_subset(tvb, IDP_HEADER_LEN, -1, -1);
diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c
index d2ea3ab4b2..1be2f13424 100644
--- a/epan/dissectors/packet-smb.c
+++ b/epan/dissectors/packet-smb.c
@@ -44,6 +44,7 @@
#include <epan/reassemble.h>
#include <epan/tap.h>
#include "packet-ipx.h"
+#include "packet-idp.h"
#include "packet-windows-common.h"
#include "packet-smb-common.h"
@@ -17306,4 +17307,5 @@ proto_reg_handoff_smb(void)
dissector_add("ipx.socket", IPX_SOCKET_NWLINK_SMB_REDIR, smb_handle);
dissector_add("ipx.socket", IPX_SOCKET_NWLINK_SMB_MESSENGER,
smb_handle);
+ dissector_add("spp.socket", IDP_SOCKET_SMB, smb_handle);
}
diff --git a/epan/dissectors/packet-spp.c b/epan/dissectors/packet-spp.c
index 0c77fca963..3ab9931153 100644
--- a/epan/dissectors/packet-spp.c
+++ b/epan/dissectors/packet-spp.c
@@ -1,6 +1,6 @@
/* packet-spp.c
* Routines for XNS SPP
- * Based on the Netware SPP dissector by Gilbert Ramirez <gram@alumni.rice.edu>
+ * Based on the Netware SPX dissector by Gilbert Ramirez <gram@alumni.rice.edu>
*
* $Id$
*
@@ -50,6 +50,8 @@ static gint ett_spp_connctrl = -1;
static dissector_handle_t data_handle;
+static dissector_table_t spp_socket_dissector_table;
+
/*
* See
*
@@ -123,6 +125,7 @@ dissect_spp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
const char *datastream_type_string;
guint16 spp_seq;
const char *spp_msg_string;
+ guint16 low_socket, high_socket;
if (check_col(pinfo->cinfo, COL_PROTOCOL))
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SPP");
@@ -185,7 +188,21 @@ dissect_spp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tvb_reported_length_remaining(tvb, SPP_HEADER_LEN) > 0) {
+ if (pinfo->srcport > pinfo->destport) {
+ low_socket = pinfo->destport;
+ high_socket = pinfo->srcport;
+ } else {
+ low_socket = pinfo->srcport;
+ high_socket = pinfo->destport;
+ }
+
next_tvb = tvb_new_subset(tvb, SPP_HEADER_LEN, -1, -1);
+ if (dissector_try_port(spp_socket_dissector_table, low_socket,
+ next_tvb, pinfo, tree))
+ return;
+ if (dissector_try_port(spp_socket_dissector_table, high_socket,
+ next_tvb, pinfo, tree))
+ return;
call_dissector(data_handle, next_tvb, pinfo, tree);
}
}
@@ -265,6 +282,9 @@ proto_register_spp(void)
"SPP", "spp");
proto_register_field_array(proto_spp, hf_spp, array_length(hf_spp));
proto_register_subtree_array(ett, array_length(ett));
+
+ spp_socket_dissector_table = register_dissector_table("spp.socket",
+ "SPP socket", FT_UINT16, BASE_HEX);
}
void
diff --git a/plugins/stats_tree/pinfo_stats_tree.c b/plugins/stats_tree/pinfo_stats_tree.c
index cdd9f13b6f..726525e9bd 100644
--- a/plugins/stats_tree/pinfo_stats_tree.c
+++ b/plugins/stats_tree/pinfo_stats_tree.c
@@ -39,9 +39,10 @@ static const gchar* port_type_to_str (port_type type) {
case PT_UDP: return "UDP";
case PT_IPX: return "IPX";
case PT_NCP: return "NCP";
- case PT_EXCHG: return "FC EXCHG";
- case PT_DDP: return "DDP";
- case PT_SBCCS: return "FICON SBCCS";
+ case PT_EXCHG: return "FC EXCHG";
+ case PT_DDP: return "DDP";
+ case PT_SBCCS: return "FICON SBCCS";
+ case PT_IDp: return "IDP";
}
g_assert_not_reached();