Ethereal-dev: Re: [Ethereal-dev] Patch for a heuristic SIP dissector

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxx>
Date: Wed, 8 May 2002 13:31:17 -0700
On Wed, May 08, 2002 at 09:58:29PM +0200, Stefan Wenk wrote:
> Attached is a patch for making the SIP dissector heuristic.
> This is quite handy for SIP testing when other ports than 5060 are used.

Checked in.

Unfortunately, the patch wasn't an attachment, so one line got
"helpfully" split by some piece of mail software:

> +      /* check for a response */
> +      if ((eol > (gint)SIP2_HDR_LEN) && (tvb_strneql(tvb, eol -
> SIP2_HDR_LEN + 1, SIP2_HDR , SIP2_HDR_LEN - 1) != 0))
> +   return FALSE;

Fortunately, it was easy to fix that.

Note, BTW, that:

> +static gboolean
> +dissect_sip_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
> +{
> +        gint eol, next_offset;
> +
> +  if (!proto_is_protocol_enabled(proto_sip))
> +   return FALSE; /* SIP has been disabled */

isn't necessary - heuristic dissectors aren't even called if their
protocol is disabled - so I removed that check.