From 4f9f1011db084c6d1e7ed381909cd7d6c6a4b556 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 5 Feb 2018 12:55:00 -0800 Subject: Speak of records, not packets. Not everything wtap_read() returns is a packet. Change-Id: I3784bbfa308da52f4c55db2a90f9b55f8bfbb2ef Reviewed-on: https://code.wireshark.org/review/25617 Reviewed-by: Guy Harris --- file.c | 2 +- mergecap.c | 2 +- wiretap/merge.c | 12 ++++++------ wiretap/merge.h | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/file.c b/file.c index be2441d737..2718c30125 100644 --- a/file.c +++ b/file.c @@ -1246,7 +1246,7 @@ merge_callback(merge_event event, int num _U_, g_get_current_time(&cb_data->start_time); break; - case MERGE_EVENT_PACKET_WAS_READ: + case MERGE_EVENT_RECORD_WAS_READ: { gint64 data_offset = 0; diff --git a/mergecap.c b/mergecap.c index ba95059d17..98a32b8b2d 100644 --- a/mergecap.c +++ b/mergecap.c @@ -211,7 +211,7 @@ merge_callback(merge_event event, int num, fprintf(stderr, "mergecap: ready to merge records\n"); break; - case MERGE_EVENT_PACKET_WAS_READ: + case MERGE_EVENT_RECORD_WAS_READ: /* for this event, num = count */ fprintf(stderr, "Record: %d\n", num); break; diff --git a/wiretap/merge.c b/wiretap/merge.c index 7b42ff9140..f1931052df 100644 --- a/wiretap/merge.c +++ b/wiretap/merge.c @@ -125,7 +125,7 @@ merge_open_in_files(guint in_file_count, const char *const *in_file_names, files[i].filename = in_file_names[i]; files[i].wth = wtap_open_offline(in_file_names[i], WTAP_TYPE_AUTO, err, err_info, FALSE); files[i].data_offset = 0; - files[i].state = PACKET_NOT_PRESENT; + files[i].state = RECORD_NOT_PRESENT; files[i].packet_num = 0; if (!files[i].wth) { @@ -254,7 +254,7 @@ merge_read_packet(int in_file_count, merge_in_file_t in_files[], * with the earliest time stamp. */ for (i = 0; i < in_file_count; i++) { - if (in_files[i].state == PACKET_NOT_PRESENT) { + if (in_files[i].state == RECORD_NOT_PRESENT) { /* * No packet available, and we haven't seen an error or EOF yet, * so try to read the next packet. @@ -266,10 +266,10 @@ merge_read_packet(int in_file_count, merge_in_file_t in_files[], } in_files[i].state = AT_EOF; } else - in_files[i].state = PACKET_PRESENT; + in_files[i].state = RECORD_PRESENT; } - if (in_files[i].state == PACKET_PRESENT) { + if (in_files[i].state == RECORD_PRESENT) { phdr = wtap_phdr(in_files[i].wth); if (is_earlier(&phdr->ts, &tv)) { tv = phdr->ts; @@ -285,7 +285,7 @@ merge_read_packet(int in_file_count, merge_in_file_t in_files[], } /* We'll need to read another packet from this file. */ - in_files[ei].state = PACKET_NOT_PRESENT; + in_files[ei].state = RECORD_NOT_PRESENT; /* Count this packet. */ in_files[ei].packet_num++; @@ -834,7 +834,7 @@ merge_process_packets(wtap_dumper *pdh, const int file_type, count++; if (cb) - stop_flag = cb->callback_func(MERGE_EVENT_PACKET_WAS_READ, count, in_files, in_file_count, cb->data); + stop_flag = cb->callback_func(MERGE_EVENT_RECORD_WAS_READ, count, in_files, in_file_count, cb->data); if (stop_flag) { /* The user decided to abort the merge. */ diff --git a/wiretap/merge.h b/wiretap/merge.h index 76ef3adf2d..ff3daa24f7 100644 --- a/wiretap/merge.h +++ b/wiretap/merge.h @@ -18,8 +18,8 @@ extern "C" { #endif /* __cplusplus */ typedef enum { - PACKET_PRESENT, - PACKET_NOT_PRESENT, + RECORD_PRESENT, + RECORD_NOT_PRESENT, AT_EOF, GOT_ERROR } in_file_state_e; @@ -57,7 +57,7 @@ typedef enum { MERGE_EVENT_INPUT_FILES_OPENED, MERGE_EVENT_FRAME_TYPE_SELECTED, MERGE_EVENT_READY_TO_MERGE, - MERGE_EVENT_PACKET_WAS_READ, + MERGE_EVENT_RECORD_WAS_READ, MERGE_EVENT_DONE } merge_event; -- cgit v1.2.3