Ethereal-dev: Re: [Ethereal-dev] Q on data structure in Ethereal & FCIP

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: Thu, 17 Oct 2002 14:36:06 -0700
On Thu, Oct 17, 2002 at 01:59:05PM -0700, ddutt@xxxxxxxxx wrote:
> I've finished adding a decoder to FCIP and some FC protocols as well. Before I
> go about releasing it, I have a couple of questions on how people would like to
> see the code structured.
> 
> 1. When decoding FC frames, I decided to display FC addresses instead of TCP/IP
>    or Ethernet address in the protocol summary window. I also wanted to carry
>    the FC addresses forward to other protocols and to this end, I've written
>    the code to set the src and dst fields in the pinfo structure to the
>    equivalent FC fields. 
> 
>    Do people see a problem with this ?

No.  Presumably you've added a new AT_ value to "epan/packet_info.h",
for FC addresses, and added code to "col_set_addr()" in
"epan/column-utils.c" to handle that new AT_ value.

> 2. I've added OXID and RXID fields to the pinfo structure as I'd like to add
>    these fields as columns to the protocol summary field. Hope this is OK.

I may be reading the FC-FS Draft Standard I got from the T11 site
incorrectly, but it sounds as if an Exchange is something like a
connection; if so, the OX_ID and RX_ID might be something like port
numbers, in which case you could add a new PT_ value to
"epan/packet_info.h", put the OX_ID and RX_ID into the "srcport" and
"destport" fields of the "packet_info" structure, and add code to
"col_set_port()" in "epan/column-utils.c" to handle the new PT_ value.

> 2. I've added routines to print WWN and such as strings and have added them to
>    the to_str.c file. Would people prefer that I add them to a separate file 
>    such as to_fcwwn.c ?

In a number of cases, those routines are in protocol-specific files,
e.g. "atalk-utils.c", "osi-utils.c", and "sna-utils.c"; arguably, the
exceptions should be put in "ether-utils.c", "ip-utils.c",
"ip6-utils.c", "ipx-utils.c", and "vines-utils.c".  I'd vote for
"fc-utils.c".

BTW, note that I will probably be checking in Don Lee's IP-over-FC
support at some point, so the FC dissector would probably call that
dissector for RFC 2625 IP-over-FC.