Ethereal-cvs: [Ethereal-cvs] cvs commit: ethereal/wiretap snoop.c

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

From: Guy Harris <guy@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 24 Aug 2001 21:56:32 -0500 (CDT)
guy         2001/08/24 21:56:32 CDT

  Modified files:
    wiretap              snoop.c 
  Log:
  Sigh.  Shomiti apparently didn't know that the RFC 1761 data link types
  were just DLPI data link types, and didn't know that the list had
  expanded at some point and that Sun *used* some of the new types (e.g.,
  in atmsnoop), or decided on their own to go beyond those types to encode
  an Oh-So-Useful link speed indication, or just didn't *care* that they
  were just DLPI data link types.
  
  Therefore, we have to map Shomiti link types to wiretap types using a
  different mapping table.  For now, we assume files with a version number
  of 2 are snoop files, and version numbers of 3, 4, and 5 are Shomiti
  files; Shomiti claims to use a version number of 2 as well, but to
  determine whether a file with a version number of 2 is a snoop file or a
  Shomiti file requires that we look at the header of the first packet and
  assume that if there's more than 3 bytes of padding it's a Shomiti file.
  
  The return value from "fwrite()" is a "size_t"; make the variable into
  which we store it a "size_t", and then fix up the bugs that were
  revealed by the compiler warnings that produced - "fwrite()" returns 0,
  not a negative number, on an I/O error.
  
  Revision  Changes    Path
  1.35      +99 -16    ethereal/wiretap/snoop.c