aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/ascend-grammar.y
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-11-11 01:44:05 +0000
committerGuy Harris <guy@alum.mit.edu>2000-11-11 01:44:05 +0000
commit6ba1bf3f8346e81cf1b031ee70bf8c3986df3926 (patch)
tree6528a23ac1bc799da29f454be96a5c687319aaee /wiretap/ascend-grammar.y
parent49865d0bef69b133bde841df657c075db3574ce2 (diff)
Add some comments, and fix one comment.
Remove what appear to be a pair of dangling "else"s. Before calling "mktime()" on a "struct tm", you have to set "tm_isdst", so it knows what to do about daylight savings time; set it to -1, so it picks the appropriate time (except, presumably, for those times that don't exist, when the clock is moved forward, where there is no appropriate time, and those times that exist twice, when the clock is moved backward, where there are *two* times and you can't tell which is appropriate). svn path=/trunk/; revision=2604
Diffstat (limited to 'wiretap/ascend-grammar.y')
-rw-r--r--wiretap/ascend-grammar.y13
1 files changed, 9 insertions, 4 deletions
diff --git a/wiretap/ascend-grammar.y b/wiretap/ascend-grammar.y
index 8e5d0ced04..aea845816f 100644
--- a/wiretap/ascend-grammar.y
+++ b/wiretap/ascend-grammar.y
@@ -1,7 +1,7 @@
%{
/* ascend-grammar.y
*
- * $Id: ascend-grammar.y,v 1.14 2000/08/25 21:25:36 gram Exp $
+ * $Id: ascend-grammar.y,v 1.15 2000/11/11 01:44:05 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -110,9 +110,11 @@ hexnum: HEXNUM;
wds_hdr: wds_prefix string decnum KEYWORD hexnum KEYWORD decnum decnum decnum KEYWORD HEXNUM {
wirelen = $9;
caplen = ($9 < ASCEND_MAX_PKT_LEN) ? $9 : ASCEND_MAX_PKT_LEN;
+ /* If we don't have as many bytes of data as the octet count in
+ the header, make the capture length the number of bytes we
+ actually have. */
if (bcount > 0 && bcount <= caplen)
caplen = bcount;
- else
secs = $7;
usecs = $8;
if (pseudo_header != NULL) {
@@ -133,7 +135,7 @@ Cause an attempt to place call to 14082750382
WD_DIALOUT_DISP: chunk 2515EE type IP.
(task: 251790, time: 994953.28) 44 octets @ 2782B8
*/
-/* 1 2 3 4 5 6 6 6 9 10 11 12 13 14 15 16 17 18 19 20 21*/
+/* 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21*/
wdd_hdr: KEYWORD decnum decnum decnum KEYWORD decnum decnum decnum KEYWORD string KEYWORD hexnum KEYWORD KEYWORD hexnum KEYWORD decnum decnum decnum KEYWORD HEXNUM {
wddt.tm_sec = $4;
wddt.tm_min = $3;
@@ -141,12 +143,15 @@ wdd_hdr: KEYWORD decnum decnum decnum KEYWORD decnum decnum decnum KEYWORD strin
wddt.tm_mday = $6;
wddt.tm_mon = $7;
wddt.tm_year = ($8 > 1970) ? $8 - 1900 : 70;
+ wddt.tm_isdst = -1;
wirelen = $19;
caplen = ($19 < ASCEND_MAX_PKT_LEN) ? $19 : ASCEND_MAX_PKT_LEN;
+ /* If we don't have as many bytes of data as the octet count in
+ the header, make the capture length the number of bytes we
+ actually have. */
if (bcount > 0 && bcount <= caplen)
caplen = bcount;
- else
secs = mktime(&wddt);
usecs = $18;
if (pseudo_header != NULL) {