diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-09-19 17:22:11 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-09-19 17:22:11 +0000 |
commit | e191760a7b3aad620f13f23345f9a070785468da (patch) | |
tree | 789188aaf465a5519d2099280a89c1c01311168c /wiretap/wtap-int.h | |
parent | 706bd5e1fc964615a2df8240fe0f522f11145ced (diff) | |
download | wireshark-e191760a7b3aad620f13f23345f9a070785468da.tar.gz |
Add support for reading pppd log files in wiretap.
svn path=/trunk/; revision=2448
Diffstat (limited to 'wiretap/wtap-int.h')
-rw-r--r-- | wiretap/wtap-int.h | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/wiretap/wtap-int.h b/wiretap/wtap-int.h index 44abd47fbb..b18ce6ad9c 100644 --- a/wiretap/wtap-int.h +++ b/wiretap/wtap-int.h @@ -1,6 +1,6 @@ /* wtap-int.h * - * $Id: wtap-int.h,v 1.8 2000/09/07 05:34:21 gram Exp $ + * $Id: wtap-int.h,v 1.9 2000/09/19 17:22:10 gram Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org> @@ -141,6 +141,7 @@ struct wtap { netxray_t *netxray; ascend_t *ascend; csids_t *csids; + void *generic; } capture; subtype_read_func subtype_read; @@ -267,4 +268,32 @@ struct wtap_dumper { (guint32)*((guint8 *)p+0)<<0) #endif + +#define wtap_file_read_unknown_bytes(target, num_bytes, fh, err) \ + G_STMT_START \ + { \ + int _bytes_read; \ + _bytes_read = file_read((target), 1, (num_bytes), (fh)); \ + if (_bytes_read != (num_bytes)) { \ + *(err) = file_error((fh)); \ + return FALSE; \ + } \ + } \ + G_STMT_END + +#define wtap_file_read_expected_bytes(target, num_bytes, fh, err) \ + G_STMT_START \ + { \ + int _bytes_read; \ + _bytes_read = file_read((target), 1, (num_bytes), (fh)); \ + if (_bytes_read != (num_bytes)) { \ + *(err) = file_error((fh)); \ + if (*(err) == 0 && _bytes_read > 0) { \ + *(err) = WTAP_ERR_SHORT_READ; \ + } \ + return FALSE; \ + } \ + } \ + G_STMT_END + #endif /* __WTAP_INT_H__ */ |