aboutsummaryrefslogtreecommitdiffstats
path: root/packet-sip.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-08-23 00:18:57 +0000
committerGuy Harris <guy@alum.mit.edu>2001-08-23 00:18:57 +0000
commitecccb6e0618fd88921ad9dfe7281b4e7f5ad1179 (patch)
treeadba3b134d9af260f0f70cb23df50794482da83a /packet-sip.c
parent7111f8301309f49ba6185f76ff157023247cf74c (diff)
"sip_is_request()" is intended to indicate whether a given SIP packet is
a request or reply; make its return value "gboolean", and have it just return TRUE or FALSE. Also make an array index variable unsigned, to squelch a GCC warning. Support for additional SIP methods, from Jean-Francois Mule. svn path=/trunk/; revision=3865
Diffstat (limited to 'packet-sip.c')
-rw-r--r--packet-sip.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/packet-sip.c b/packet-sip.c
index f8edbf3f74..8de25e128e 100644
--- a/packet-sip.c
+++ b/packet-sip.c
@@ -4,13 +4,21 @@
*
* TODO: Pay attention to Content-Type: It might not always be SDP.
* Add hf_* fields for filtering support.
+ * Add sip msg body dissection based on Content-Type for:
+ * SDP, MIME, and other types
+ * Align SIP methods with recent Internet Drafts or RFC
+ * (SIP INFO, rfc2976 - done)
+ * (SIP SUBSCRIBE-NOTIFY - done)
+ * (SIP REFER - done)
+ * check for other
*
* Copyright 2000, Heikki Vatiainen <hessu@cs.tut.fi>
+ * Copyright 2001, Jean-Francois Mule <jfm@clarent.com>
*
- * $Id: packet-sip.c,v 1.15 2001/06/18 02:17:52 guy Exp $
+ * $Id: packet-sip.c,v 1.16 2001/08/23 00:18:56 guy Exp $
*
* Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
+ * By Gerald Combs <gerald@ethereal.com>
* Copyright 1998 Gerald Combs
*
* Copied from packet-cops.c
@@ -59,10 +67,14 @@ static const char *sip_methods[] = {
"OPTIONS",
"BYE",
"CANCEL",
- "REGISTER"
+ "REGISTER",
+ "INFO",
+ "REFER",
+ "SUBSCRIBE",
+ "NOTIFY"
};
-static int sip_is_request(tvbuff_t *tvb, guint32 offset);
+static gboolean sip_is_request(tvbuff_t *tvb, guint32 offset);
static gint sip_get_msg_offset(tvbuff_t *tvb, guint32 offset);
static dissector_handle_t sdp_handle;
@@ -164,16 +176,16 @@ static gint sip_get_msg_offset(tvbuff_t *tvb, guint32 offset)
return -1;
}
-static int sip_is_request(tvbuff_t *tvb, guint32 offset)
+static gboolean sip_is_request(tvbuff_t *tvb, guint32 offset)
{
- int i;
+ u_int i;
for (i = 1; i < array_length(sip_methods); i++) {
if (tvb_strneql(tvb, offset, sip_methods[i], strlen(sip_methods[i])) == 0)
- return i;
+ return TRUE;
}
- return 0;
+ return FALSE;
}
/* Register the protocol with Ethereal */