diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-02-08 18:38:22 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-02-09 02:39:09 +0000 |
commit | 9425d6e9014895fca1301a2d4f5689cead37f1a2 (patch) | |
tree | 67e86e98e42d6f9d1c518ecf5812d514060270aa /wiretap | |
parent | 1f5f63f8ef98bfe9c4d734674cee0df64855555d (diff) |
Remove redundant members from wtap_syscall_header.
No need for len, and call caplen event_filelen and move it after
event_len.
Change-Id: I8b3825d4022ee083ee52f83f7a69f22829ed9fc4
Reviewed-on: https://code.wireshark.org/review/25698
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/pcapng.c | 15 | ||||
-rw-r--r-- | wiretap/wtap.h | 9 |
2 files changed, 11 insertions, 13 deletions
diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c index 1e51bb144a..7aa658e5bf 100644 --- a/wiretap/pcapng.c +++ b/wiretap/pcapng.c @@ -2279,8 +2279,7 @@ pcapng_read_sysdig_event_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *p wblock->rec->ts.secs = (time_t) (ts / 1000000000); wblock->rec->ts.nsecs = (int) (ts % 1000000000); - wblock->rec->rec_header.syscall_header.caplen = block_read; - wblock->rec->rec_header.syscall_header.len = wblock->rec->rec_header.syscall_header.event_len; + wblock->rec->rec_header.syscall_header.event_filelen = block_read; /* "Sysdig Event Block" read event data */ if (!wtap_read_packet_bytes(fh, wblock->frame_buffer, @@ -3236,13 +3235,13 @@ pcapng_write_sysdig_event_block(wtap_dumper *wdh, const wtap_rec *rec, guint16 event_type; /* Don't write anything we're not willing to read. */ - if (rec->rec_header.syscall_header.caplen > WTAP_MAX_PACKET_SIZE_STANDARD) { + if (rec->rec_header.syscall_header.event_filelen > WTAP_MAX_PACKET_SIZE_STANDARD) { *err = WTAP_ERR_PACKET_TOO_LARGE; return FALSE; } - if (rec->rec_header.syscall_header.caplen % 4) { - pad_len = 4 - (rec->rec_header.syscall_header.caplen % 4); + if (rec->rec_header.syscall_header.event_filelen % 4) { + pad_len = 4 - (rec->rec_header.syscall_header.event_filelen % 4); } else { pad_len = 0; } @@ -3267,7 +3266,7 @@ pcapng_write_sysdig_event_block(wtap_dumper *wdh, const wtap_rec *rec, /* write sysdig event block header */ bh.block_type = BLOCK_TYPE_SYSDIG_EVENT; - bh.block_total_length = (guint32)sizeof(bh) + SYSDIG_EVENT_HEADER_SIZE + rec->rec_header.syscall_header.caplen + pad_len + options_total_length + 4; + bh.block_total_length = (guint32)sizeof(bh) + SYSDIG_EVENT_HEADER_SIZE + rec->rec_header.syscall_header.event_filelen + pad_len + options_total_length + 4; if (!wtap_dump_file_write(wdh, &bh, sizeof bh, err)) return FALSE; @@ -3302,9 +3301,9 @@ pcapng_write_sysdig_event_block(wtap_dumper *wdh, const wtap_rec *rec, wdh->bytes_dumped += sizeof event_type; /* write event data */ - if (!wtap_dump_file_write(wdh, pd, rec->rec_header.syscall_header.caplen, err)) + if (!wtap_dump_file_write(wdh, pd, rec->rec_header.syscall_header.event_filelen, err)) return FALSE; - wdh->bytes_dumped += rec->rec_header.syscall_header.caplen; + wdh->bytes_dumped += rec->rec_header.syscall_header.event_filelen; /* write padding (if any) */ if (pad_len != 0) { diff --git a/wiretap/wtap.h b/wiretap/wtap.h index 4ba654637c..09e80b0bf2 100644 --- a/wiretap/wtap.h +++ b/wiretap/wtap.h @@ -1258,15 +1258,14 @@ typedef struct { typedef struct { guint record_type; /* XXX match ft_specific_record_phdr so that we chain off of packet-pcapng_block for now. */ - guint32 caplen; /* data length in the file */ - guint32 len; /* data length on the wire */ int byte_order; - guint16 cpu_id; /* guint32 sentinel; */ - guint64 timestamp; /* ns since epoch */ + guint64 timestamp; /* ns since epoch - XXX dup of ts */ guint64 thread_id; - guint32 event_len; /* XXX dup of wtap_pkthdr.len */ + guint32 event_len; /* length of the event */ + guint32 event_filelen; /* event data length in the file */ guint16 event_type; + guint16 cpu_id; /* ... Event ... */ } wtap_syscall_header; |