Ethereal-dev: Re: [Ethereal-dev] Adding Dissector

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

From: "Lars Roland" <Lars.Roland@xxxxxxx>
Date: Thu, 02 Feb 2006 07:50:35 +0100
Am 01.02.2006, 22:10 Uhr, schrieb Jasim Tariq <jasimtariqjt@xxxxxxxxxxx>:

Given that Ethereal is supplied in source form, yes, you could do that.
You'd put the source in >the "epan/dissectors" directory, and update
"epan/dissectors/Makefile.common" to include its ".c" >file in the list of
protocol dissectors. The "register" and "register handoff" routines are
done a bit >differently for built-in dissectors; see the dissector files in
"epan/dissector" to see how that's done.

I have tried the above suggestion. ALso,  I added :

{extern void proto_register_xxx (void); proto_register_xxx ();}      and
{extern void proto_reg_handoff_xxx (void); proto_reg_handoff_xxx ();}

routines to "register.c" in epan/dissectors folder. But when I give the
following commands in DOS prompt:


You shouldn't need to modify register.c . It will be done automatically during the build process.

nmake -f Makefile.nmake distclean     or
nmake -f Makefile.nmake all

I get the following errors:
____________________________
nmake -f Makefile.nmake distclean:
____________________________
/usr/bin/rm: cannot remove `\\': Is a directory
NMAKE : fatal error U1077: 'c:\cygwin\bin\rm.exe' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual
Studio\VC98\bin\N
MAKE.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual
Studio\VC98\bin\N
MAKE.EXE"' : return code '0x2'
Stop.



There is something terribly wrong in your build environment and probably not in your dissector sources.
You should first try to get distclean working.
If such a simple thing like removing files doesn't work, you have serious problems.
First you should check your settings in config.nmake.
Check also your PATH environment variable (Not only in config.nmake, but also in system settings). It shouldn't contain unnecessary folders. Less is more in this case.

Use a clean copy of ethereal sources and try to build ethereal without changing anything except the necessary options in config.nmake. If that works, add your dissector to the sources and to the list in epan\dissectors\Makefile.common and build again. Don't change anything else. It should work this way in a correct build environment.

If distclean or building still fails, we will need more info about your build environment, your config.nmake and the whole output of nmake, not just the end.

Regards,
Lars