Ethereal-dev: Re: [Ethereal-dev] Problems registering a new protocol

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

From: Guy Harris <gharris@xxxxxxxxxxxx>
Date: Sun, 22 Oct 2000 13:18:57 -0700
On Sun, Oct 22, 2000 at 04:01:43PM -0400, Ed Warnicke wrote:
> OK, here is my packet-mgcp.c, it's almost unaltered from what the 
> build-dissector.pl script produced, so it's absolutely useless 
> as a dissector, but if I can just figure out why it won't register 
> I'll correct that.

Given that I extracted your "packet-mgcp.c" and "packet-mgcp.h"
(although "packet-mgcp.h" is unnecessary; "dissect_mgcp()" is not called
directly from outside "packet-mgcp.c", it's registered as a dissector
for the MGCP port, and called through a pointer, so it should be
static), added "packet-mgcp.c" to "Makefile.am", and rebuilt, and

	1) "mgcp" showed up in the list from "Edit->Protocols"

and

	2) "mgcp" as a packet filter worked just fine

I've no idea why it's not working for you.

I'd suggest using a debugger to see whether "proto_register_mgcp()" is
being called - as far as I can tell, the call to
"proto_register_protocol()" in "proto_register_mgcp()" cannot fail, so
if "proto_register_mgcp()" is being called, you'd have to go debugging
in the core of Ethereal to see why "mgcp" isn't showing up in the
"Edit->Protocols" list and isn't considered a valid packet filter value.