From Martin Warnes: support for VMS UCX$TRACE output in wiretap.

svn path=/trunk/; revision=7692
This commit is contained in:
Guy Harris 2003-05-19 20:58:18 +00:00
parent 5ed9fd0ca9
commit f921aee54d
7 changed files with 80 additions and 40 deletions

View File

@ -1700,6 +1700,10 @@ Can Erkin Acar <canacar [AT] eee.metu.edu.tr> {
Support for new DLT_PFLOG format Support for new DLT_PFLOG format
} }
Martin Warnes <martin.warnes [AT] ntlworld.com> {
Support for VMS UCX$TRACE output in wiretap
}
And assorted fixes and enhancements by the people listed above and by: And assorted fixes and enhancements by the people listed above and by:
Pavel Roskin <proski [AT] gnu.org> Pavel Roskin <proski [AT] gnu.org>

View File

@ -33,14 +33,14 @@ WAN/LAN analyzer, B<Lucent/Ascend> router debug output, HP-UX's
B<nettl>, the dump output from B<Toshiba's> ISDN routers, the output B<nettl>, the dump output from B<Toshiba's> ISDN routers, the output
from B<i4btrace> from the ISDN4BSD project, the output in B<IPLog> from B<i4btrace> from the ISDN4BSD project, the output in B<IPLog>
format from the Cisco Secure Intrusion Detection System, B<pppd logs> format from the Cisco Secure Intrusion Detection System, B<pppd logs>
(pppdump format), the output from VMS's B<TCPIPtrace> utility, the text (pppdump format), the output from VMS's B<TCPIPtrace> and B<UCX$TRACE>
output from the B<DBS Etherwatch> VMS utility, traffic capture files utilities, the text output from the B<DBS Etherwatch> VMS utility,
from Visual Networks' Visual UpTime and the output from B<CoSine> L2 traffic capture files from Visual Networks' Visual UpTime and the output
debug. There is no need to tell B<Editcap> what type of file you are from B<CoSine> L2 debug. There is no need to tell B<Editcap> what type
reading; it will determine the file type by itself. B<Editcap> is also of file you are reading; it will determine the file type by itself.
capable of reading any of these file formats if they are compressed B<Editcap> is also capable of reading any of these file formats if they
using gzip. B<Editcap> recognizes this directly from the file; the are compressed using gzip. B<Editcap> recognizes this directly from the
'.gz' extension is not required for this purpose. file; the '.gz' extension is not required for this purpose.
By default, it writes the capture file in B<libpcap> format, and writes By default, it writes the capture file in B<libpcap> format, and writes
all of the packets in the capture file to the output file. The B<-F> all of the packets in the capture file to the output file. The B<-F>

View File

@ -49,14 +49,15 @@ B<RADCOM>'s WAN/LAN analyzer, B<Lucent/Ascend> router debug output,
HP-UX's B<nettl>, the dump output from B<Toshiba's> ISDN routers, the HP-UX's B<nettl>, the dump output from B<Toshiba's> ISDN routers, the
output from B<i4btrace> from the ISDN4BSD project, the output in output from B<i4btrace> from the ISDN4BSD project, the output in
B<IPLog> format from the Cisco Secure Intrusion Detection System, B<pppd B<IPLog> format from the Cisco Secure Intrusion Detection System, B<pppd
logs> (pppdump format), the output from VMS's B<TCPIPtrace> utility, the logs> (pppdump format), the output from VMS's B<TCPIPtrace> and
text output from the B<DBS Etherwatch> VMS utility, traffic capture B<UCX$TRACE> utilities, the text output from the B<DBS Etherwatch> VMS
files from Visual Networks' Visual UpTime, and the output from B<CoSine> utility, traffic capture files from Visual Networks' Visual UpTime, and
L2 debug. There is no need to tell B<Ethereal> what type of file you the output from B<CoSine> L2 debug. There is no need to tell
are reading; it will determine the file type by itself. B<Ethereal> B<Ethereal> what type of file you are reading; it will determine the
is also capable of reading any of these file formats if they are file type by itself. B<Ethereal> is also capable of reading any of
compressed using gzip. B<Ethereal> recognizes this directly from the these file formats if they are compressed using gzip. B<Ethereal>
file; the '.gz' extension is not required for this purpose. recognizes this directly from the file; the '.gz' extension is not
required for this purpose.
Like other protocol analyzers, B<Ethereal>'s main window shows 3 views Like other protocol analyzers, B<Ethereal>'s main window shows 3 views
of a packet. It shows a summary line, briefly describing what the of a packet. It shows a summary line, briefly describing what the

View File

@ -30,14 +30,15 @@ WAN/LAN analyzer, B<Lucent/Ascend> router debug output, HP-UX's
B<nettl>, the dump output from B<Toshiba's> ISDN routers, the output B<nettl>, the dump output from B<Toshiba's> ISDN routers, the output
from B<i4btrace> from the ISDN4BSD project, the output in B<IPLog> from B<i4btrace> from the ISDN4BSD project, the output in B<IPLog>
format from the Cisco Secure Intrusion Detection System, B<pppd logs> format from the Cisco Secure Intrusion Detection System, B<pppd logs>
(pppdump format), the output from VMS's B<TCPIPtrace> utility, the text (pppdump format), the output from VMS's B<TCPIPtrace> and B<UCX$TRACE>
output from the B<DBS Etherwatch> VMS utility, traffic capture files utilities, the text output from the B<DBS Etherwatch> VMS utility,
from Visual Networks' Visual UpTime, and the output from B<CoSine> L2 traffic capture files from Visual Networks' Visual UpTime, and the
debug. There is no need to tell B<Mergecap> what type of file you are output from B<CoSine> L2 debug. There is no need to tell B<Mergecap>
reading; it will determine the file type by itself. B<Mergecap> is what type of file you are reading; it will determine the file type by
also capable of reading any of these file formats if they are compressed itself. B<Mergecap> is also capable of reading any of these file
using gzip. B<Mergecap> recognizes this directly from the file; the formats if they are compressed using gzip. B<Mergecap> recognizes this
'.gz' extension is not required for this purpose. directly from the file; the '.gz' extension is not required for this
purpose.
By default, it writes the capture file in B<libpcap> format, and writes By default, it writes the capture file in B<libpcap> format, and writes
all of the packets in both input capture files to the output file. The all of the packets in both input capture files to the output file. The

View File

@ -50,13 +50,13 @@ B<Lucent/Ascend> router debug output, HP-UX's B<nettl>, the dump output
from B<Toshiba's> ISDN routers, the output from B<i4btrace> from the from B<Toshiba's> ISDN routers, the output from B<i4btrace> from the
ISDN4BSD project, the output in B<IPLog> format from the Cisco Secure ISDN4BSD project, the output in B<IPLog> format from the Cisco Secure
Intrusion Detection System, B<pppd logs> (pppdump format), the output Intrusion Detection System, B<pppd logs> (pppdump format), the output
from VMS's B<TCPIPtrace> utility, the text output from the B<DBS from VMS's B<TCPIPtrace> and B<UCX$TRACE> utilities, the text output
Etherwatch> VMS utility, traffic capture files from Visual Networks' from the B<DBS Etherwatch> VMS utility, traffic capture files from
Visual UpTime, and the output from B<CoSine> L2 debug. There is no Visual Networks' Visual UpTime, and the output from B<CoSine> L2 debug.
need to tell B<Tethereal> what type of file you are reading; it will There is no need to tell B<Tethereal> what type of file you are reading;
determine the file type by itself. B<Tethereal> is also capable of it will determine the file type by itself. B<Tethereal> is also capable
reading any of these file formats if they are compressed using gzip. of reading any of these file formats if they are compressed using gzip.
B<Tethereal> recognizes this directly from the file; the '.gz' extension B<Tethereal> recognizes this directly from the file; the '.gz' extension
is not required for this purpose. is not required for this purpose.
If the B<-w> flag is not specified, B<Tethereal> prints a decoded form If the B<-w> flag is not specified, B<Tethereal> prints a decoded form

View File

@ -16,3 +16,4 @@ Ronnie Sahlberg <sahlberg[AT]optushome.com.au>
Motonori Shindo <mshindo[AT]mshindo.net> Motonori Shindo <mshindo[AT]mshindo.net>
Markus Steinmann <ms[AT]seh.de> Markus Steinmann <ms[AT]seh.de>
Mark C. Brown <mbrown[AT]nosila.net> Mark C. Brown <mbrown[AT]nosila.net>
Martin Warnes <martin.warnes[AT]ntlworld.com>

View File

@ -1,6 +1,6 @@
/* vms.c /* vms.c
* *
* $Id: vms.c,v 1.16 2003/01/17 23:54:19 guy Exp $ * $Id: vms.c,v 1.17 2003/05/19 20:58:18 guy Exp $
* *
* Wiretap Library * Wiretap Library
* Copyright (c) 2001 by Marc Milgram <ethereal@mmilgram.NOSPAMmail.net> * Copyright (c) 2001 by Marc Milgram <ethereal@mmilgram.NOSPAMmail.net>
@ -40,7 +40,8 @@
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
/* This module reads the output of the 'TCPIPTRACE' command in VMS /* This module reads the output of the 'TCPIPTRACE' and 'UCX$TRACE'
* commands in VMS.
* It was initially based on toshiba.c. * It was initially based on toshiba.c.
*/ */
@ -65,13 +66,36 @@
06000000 01000000 A5860100 00000000 0040 ................ 06000000 01000000 A5860100 00000000 0040 ................
00000000 0050 .... 00000000 0050 ....
Example UCX INTERnet (UCX$TRACE) output data:
UCX INTERnet trace RCV packet seq # = 1 at 14-MAY-2003 11:32:10.93
IP Version = 4, IHL = 5, TOS = 00, Total Length = 583 = ^x0247
IP Identifier = ^x702E, Flags (0=0,DF=0,MF=0),
Fragment Offset = 0 = ^x0000, Calculated Offset = 0 = ^x0000
IP TTL = 128 = ^x80, Protocol = 17 = ^x11, Header Checksum = ^x70EC
IP Source Address = 10.20.4.159
IP Destination Address = 10.20.4.255
UDP Source Port = 138, UDP Destination Port = 138
UDP Header and Datagram Length = 563 = ^x0233, Checksum = ^xB913
9F04140A 70EC1180 0000702E 47020045 0000 E..G.p.....p....
B1B80E11 | B9133302 8A008A00 | FF04140A 0010 .........3......
46484648 45200000 1D028A00 9F04140A 0020 ...........EHFHF
43414341 4341434D 454D4546 45454550 0030 PEEEFEMEMCACACAC
The only difference between the 2 Utilities is the Packet header line, primarily
the utility identifier and the packet sequencing.
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
*/ */
/* Magic text to check for VMS-ness of file */ /* Magic text to check for VMS-ness of file, common to both
* TCPIPtrace and UCX$TRACE
*/
static const char vms_hdr_magic[] = static const char vms_hdr_magic[] =
{ 'T', 'C', 'P', 'I', 'P', 't', 'r', 'a', 'c', 'e', ' '}; { 'R','C','V',' ','p', 'a', 'c', 'k', 'e', 't',' '};
#define VMS_HDR_MAGIC_SIZE (sizeof vms_hdr_magic / sizeof vms_hdr_magic[0]) #define VMS_HDR_MAGIC_SIZE (sizeof vms_hdr_magic / sizeof vms_hdr_magic[0])
/* Magic text for start of packet */ /* Magic text for start of packet */
@ -87,7 +111,6 @@ static gboolean parse_vms_hex_dump(FILE_T fh, int pkt_len, guint8* buf,
int *err); int *err);
static int parse_vms_rec_hdr(wtap *wth, FILE_T fh, int *err); static int parse_vms_rec_hdr(wtap *wth, FILE_T fh, int *err);
#ifdef TCPIPTRACE_FRAGMENTS_HAVE_HEADER_LINE #ifdef TCPIPTRACE_FRAGMENTS_HAVE_HEADER_LINE
/* Seeks to the beginning of the next packet, and returns the /* Seeks to the beginning of the next packet, and returns the
byte offset. Returns -1 on failure, and sets "*err" to the error. */ byte offset. Returns -1 on failure, and sets "*err" to the error. */
@ -329,12 +352,22 @@ parse_vms_rec_hdr(wtap *wth, FILE_T fh, int *err)
if ((csec == 101) && (p = strstr(line, "packet ")) if ((csec == 101) && (p = strstr(line, "packet "))
&& (! strstr(line, "could not save "))) { && (! strstr(line, "could not save "))) {
/* Find text in line starting with "packet ". */ /* Find text in line starting with "packet ". */
num_items_scanned = sscanf(p,
"packet %d at %d-%3s-%d %d:%d:%d.%d", /* First look for the TCPIPtrace format */
&pktnum, &time.tm_mday, mon, num_items_scanned = sscanf(p,
"packet %d at %d-%3s-%d %d:%d:%d.%d",
&pktnum, &time.tm_mday, mon,
&time.tm_year, &time.tm_hour, &time.tm_year, &time.tm_hour,
&time.tm_min, &time.tm_sec, &csec); &time.tm_min, &time.tm_sec, &csec);
/* if not TCPIPtrace then try the UCX$TRACE format */
if (num_items_scanned != 8) {
num_items_scanned = sscanf(p,
"packet seq # = %d at %d-%3s-%d %d:%d:%d.%d",
&pktnum, &time.tm_mday, mon,
&time.tm_year, &time.tm_hour,
&time.tm_min, &time.tm_sec, &csec);
}
/* if neither then exit with error */
if (num_items_scanned != 8) { if (num_items_scanned != 8) {
*err = WTAP_ERR_BAD_RECORD; *err = WTAP_ERR_BAD_RECORD;
return -1; return -1;