From 3cba46070ca162b8095160e87c9bdfb9ba4bc5c6 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Fri, 8 Aug 2008 19:27:58 +0000 Subject: Add Winsock AF_ values to epan/aftypes.h; the DirectPlay and ActiveSync Desktop Pass-Through protocols use them. Use those values in the dissectors for those protocols. In the Desktop Pass-Through dissector, define the Winsock SOCK_ values ourselves, and get the IP protocol values from . Don't include now-unnecessary system headers in that dissector. svn path=/trunk/; revision=25959 --- epan/dissectors/packet-dplay.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'epan/dissectors/packet-dplay.c') diff --git a/epan/dissectors/packet-dplay.c b/epan/dissectors/packet-dplay.c index d3f63da740..9b5b6daf27 100644 --- a/epan/dissectors/packet-dplay.c +++ b/epan/dissectors/packet-dplay.c @@ -32,6 +32,7 @@ #include #include #include +#include #include /* function declarations */ @@ -43,21 +44,10 @@ static gint dissect_type1a_message(proto_tree *tree, tvbuff_t *tvb, gint offset) static int proto_dplay = -1; static dissector_handle_t dplay_handle; -/* - * Address family definitions used in the protocol; we don't use the AF_ - * values for the OS for which we're building, as there's no guarantee - * that the definitions for that OS match the ones used in the protocol. - * - * XXX - check that these match what's used in the protocol; what's - * used in the protocol is probably what's defined in Winsock. - */ -#define DPLAY_AF_INET 2 -#define DPLAY_AF_IPX 6 /* XXX - sys/socket.h: AF_IPX is 4 ? */ - /* Common data fields */ static int hf_dplay_size = -1; /* Size of the whole data */ static int hf_dplay_token = -1; -static int hf_dplay_saddr_af = -1; /* DPLAY_AF_INET, as this dissector does not handle IPX yet */ +static int hf_dplay_saddr_af = -1; /* WINSOCK_AF_INET, as this dissector does not handle IPX yet */ static int hf_dplay_saddr_port = -1; /* port to use for the reply to this packet */ static int hf_dplay_saddr_ip = -1; /* IP to use for the reply to this packet, or 0.0.0.0, then use the same IP as this packet used. */ @@ -366,8 +356,8 @@ static const value_string dplay_command_val[] = { }; static const value_string dplay_af_val[] = { - { DPLAY_AF_INET, "AF_INET" }, - { DPLAY_AF_IPX, "AF_IPX" }, + { WINSOCK_AF_INET, "AF_INET" }, + { WINSOCK_AF_IPX, "AF_IPX" }, { 0 , NULL}, }; @@ -1209,7 +1199,7 @@ static gboolean heur_dissect_dplay(tvbuff_t *tvb, packet_info *pinfo, proto_tree token = (token & 0xfff00000) >> 20; if (token == 0xfab || token == 0xbab || token == 0xcab) { /* Check the s_addr_in structure */ - if (tvb_get_letohs(tvb, 4) == DPLAY_AF_INET) { + if (tvb_get_letohs(tvb, 4) == WINSOCK_AF_INET) { int offset; for (offset = 12; offset <= 20; offset++) if (tvb_get_guint8(tvb, offset) != 0) -- cgit v1.2.3