From Motonori Shindo: get rid of "send output to /dev/null" hack in

Ascend/Lucent trace reading code's Flex scanner.

svn path=/trunk/; revision=4346
This commit is contained in:
Guy Harris 2001-12-06 08:25:52 +00:00
parent 10b79123ef
commit 31519a0ff0
4 changed files with 9 additions and 17 deletions

View File

@ -793,6 +793,8 @@ Motonori Shindo <mshindo[AT]mshindo.net> {
CBCP support in PPP
Fix Ascend/Lucent trace reading code to handle later trace
formats that have an ASCII dump at the end of the line
Get rid of "send output to /dev/null" hack in Ascend/Lucent
trace reading code's Flex scanner
}
Terje Krogdahl <tekr[AT]nextra.com> {

View File

@ -1,7 +1,7 @@
%{
/* ascend-grammar.y
*
* $Id: ascend-grammar.y,v 1.22 2001/12/04 10:07:30 guy Exp $
* $Id: ascend-grammar.y,v 1.23 2001/12/06 08:25:51 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@ -115,7 +115,6 @@ XMIT-Max7:20: (task "_brouterControlTask" at 0xb094ac20, time: 1481.51) 20 octet
#include "ascend.h"
#include "ascend-int.h"
#define NFH_PATH "/dev/null"
#define NO_USER "<none>"
extern int at_eof;
@ -128,7 +127,6 @@ guint32 start_time, secs, usecs, caplen, wirelen;
ascend_pkthdr *header;
struct ascend_phdr *pseudo_header;
char *pkt_data;
FILE *nfh = NULL;
%}
@ -375,13 +373,6 @@ init_parse_ascend()
bcur = 0;
at_eof = 0;
start_time = 0; /* we haven't see a date/time yet */
/* In order to keep flex from printing a lot of newlines while reading
the capture data, we open up /dev/null and point yyout at the null
file handle. */
if (! nfh) {
nfh = fopen(NFH_PATH, "r");
}
}
/* Parse the capture file. Return the offset of the next packet, or zero
@ -392,7 +383,7 @@ parse_ascend(FILE_T fh, void *pd, struct ascend_phdr *phdr,
{
/* yydebug = 1; */
ascend_init_lexer(fh, nfh);
ascend_init_lexer(fh);
pkt_data = pd;
pseudo_header = phdr;
header = hdr;

View File

@ -2,7 +2,7 @@
* Definitions for routines common to multiple modules in the Lucent/Ascend
* capture file reading code code, but not used outside that code.
*
* $Id: ascend-int.h,v 1.7 2000/11/11 03:15:07 guy Exp $
* $Id: ascend-int.h,v 1.8 2001/12/06 08:25:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -44,7 +44,7 @@ extern struct ascend_phdr *pseudo_header;
int ascendlex(void);
void init_parse_ascend(void);
void ascend_init_lexer(FILE_T fh, FILE *nfh);
void ascend_init_lexer(FILE_T fh);
int parse_ascend(FILE_T fh, void *pd, struct ascend_phdr *phdr,
ascend_pkthdr *hdr, int len);

View File

@ -1,7 +1,7 @@
%{
/* ascend-scanner.l
*
* $Id: ascend-scanner.l,v 1.22 2001/12/04 10:07:30 guy Exp $
* $Id: ascend-scanner.l,v 1.23 2001/12/06 08:25:52 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@ -277,16 +277,15 @@ task:|task|at|time:|octets { return KEYWORD; }
<<EOF>> { at_eof++; yyterminate(); }
. ;
(.|\n) ;
%%
int ascendwrap() { return 1; }
void ascend_init_lexer(FILE_T fh, FILE *nfh)
void ascend_init_lexer(FILE_T fh)
{
yyrestart(0);
yyout = nfh;
yy_fh = fh;
BEGIN(INITIAL);
}