aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-dplay.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2008-08-08 19:27:58 +0000
committerGuy Harris <guy@alum.mit.edu>2008-08-08 19:27:58 +0000
commit3cba46070ca162b8095160e87c9bdfb9ba4bc5c6 (patch)
treee884f5e4551bded93e3675c7a31992792f536a33 /epan/dissectors/packet-dplay.c
parent652343e2d1501be5fc596c036817d9b5ddfe4892 (diff)
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 <epan/ipproto.h>. Don't include now-unnecessary system headers in that dissector. svn path=/trunk/; revision=25959
Diffstat (limited to 'epan/dissectors/packet-dplay.c')
-rw-r--r--epan/dissectors/packet-dplay.c20
1 files changed, 5 insertions, 15 deletions
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 <epan/packet.h>
#include <epan/prefs.h>
#include <epan/emem.h>
+#include <epan/aftypes.h>
#include <string.h>
/* 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)