Ethereal-dev: Re: [ethereal-dev] Diameter (Third time a charm?)

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

From: David Frascone <dave@xxxxxxxxxxxx>
Date: Sun, 30 Jul 2000 06:37:53 -0500
Sounds great.  I'll change the SCTP port when I add the code for SCTP.  Right
now, the dissector does not allow sub-dissectors, but that will be fixed in 
a couple of weeks.

On Sun, Jul 30, 2000 at 12:24:08AM -0700, Guy Harris wrote:
> On Thu, Jul 27, 2000 at 10:08:08PM -0500, David Frascone wrote:
> > Ok, megga changes this time.  I think this is un-obtrusive enough that it 
> > might even get checked in!
> 
> Checked in.
> 
> I renamed the "packet-diameter.h" file to "packet-diameter-defs.h", and
> put the declaration of "dissect_diameter()" into "packet-diameter.h",
> which both "packet-diameter.c" and "packet-radius.c" include (I
> generally prefer declarations of functions to be in a header file
> included both by callers of the function *and* the module that defines
> the function, to increase the chances that the compiler will complain if
> the declaration and the definition get out of sync; the convention used
> in Ethereal is that functions defined in "dissect-foo.c" that are
> exported from "dissect-foo.c" are declared in "dissect-foo.h").
> 
> I've attached a patch to "diameter-dict2h.pl" to make it generate
> "packet-diameter-defs.h".
> 
> > The diameter dissector also registers for UDP port 2645, TCP port 2645, 
> > and, when sub-dissectors are available, SCTP port 2645.  It will dissect any
> > diameter messages on any of those ports.  The extra UDP and TCP (and SCTP)
> > ports are configurable via preferences.
> 
> The draft says that the SCTP port for DIAMETER is 1812; it doesn't say
> what port should be used for TCP (although it also says
> 
> 	DIAMETER SHOULD be transported over SCTP [26].
> 
> ).

> *** diameter-dict2h.pl.orig	Wed Jun 28 06:09:34 2000
> --- diameter-dict2h.pl	Sun Jul 30 00:18:03 2000
> ***************
> *** 13,19 ****
>   
>   my $USAGE="USAGE: $0 [-o outputFile] inputFile\n";
>   
> ! my $outputFile="packet-diameter.h";
>   my $inputFile;
>   
>   use vars qw($opt_o);
> --- 13,19 ----
>   
>   my $USAGE="USAGE: $0 [-o outputFile] inputFile\n";
>   
> ! my $outputFile="packet-diameter-defs.h";
>   my $inputFile;
>   
>   use vars qw($opt_o);
> ***************
> *** 147,159 ****
>   # HEADERS AND TRAILERS
>   
>   my $HEADER="/*
> !  * Filename: packet-diameter.h
> !  * WARNING:  This file was automatically generated by dict2h.pl.  Modifications
> !  *           will be erased by next invocation of dictionary parser.
>    */
>   
> ! #ifndef _PACKET_DIAMETER_H
> ! #define _PACKET_DIAMETER_H
>   ";
>   
>   my $ATT_DEFS_HEADER="
> --- 147,160 ----
>   # HEADERS AND TRAILERS
>   
>   my $HEADER="/*
> !  * Filename: packet-diameter-defs.h
> !  * WARNING:  This file was automatically generated by diameter-dict2h.pl.
> !  *           Modifications will be erased by next invocation of dictionary
> !  *           parser.
>    */
>   
> ! #ifndef _PACKET_DIAMETER_DEFS_H
> ! #define _PACKET_DIAMETER_DEFS_H
>   ";
>   
>   my $ATT_DEFS_HEADER="
> ***************
> *** 177,183 ****
>   
>   my $VALUES_HEADER = "\n\n        /* Values Structures */\n";
>   
> ! my $TRAILER="\n\n#endif /* _PACKET_DIAMETER_H */\n";
>   
>   # This routine will write our output
>   sub writeOutput($;) {
> --- 178,184 ----
>   
>   my $VALUES_HEADER = "\n\n        /* Values Structures */\n";
>   
> ! my $TRAILER="\n\n#endif /* _PACKET_DIAMETER_DEFS_H */\n";
>   
>   # This routine will write our output
>   sub writeOutput($;) {