aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/pcapng.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2022-04-22 18:14:29 -0700
committerGuy Harris <gharris@sonic.net>2022-04-22 18:14:29 -0700
commit1ee8ead845e8cee449f9dad87fd69a0f21bc6160 (patch)
treecfe9d9348b26d9bca54a42dfabcbf4873b16efbc /wiretap/pcapng.c
parent7286e2982accea447d6d971d4821c2d316228133 (diff)
Provide the section number for blocks, and show it.
Add a "section number" field to wtap_rec, with a presence flag, and provide the section number (0-based) for pcapng files. Display it (1-based) if present.
Diffstat (limited to 'wiretap/pcapng.c')
-rw-r--r--wiretap/pcapng.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c
index 7e60cfc040..8e96ebe38a 100644
--- a/wiretap/pcapng.c
+++ b/wiretap/pcapng.c
@@ -3710,6 +3710,10 @@ pcapng_read(wtap *wth, wtap_rec *rec, Buffer *buf, int *err,
/*ws_debug("Read length: %u Packet length: %u", bytes_read, rec->rec_header.packet_header.caplen);*/
ws_debug("data_offset is finally %" PRId64, *data_offset);
+ /* Provide the section number */
+ rec->presence_flags |= WTAP_HAS_SECTION_NUMBER;
+ rec->section_number = pcapng->current_section_number;
+
return TRUE;
}
@@ -3781,6 +3785,11 @@ pcapng_seek_read(wtap *wth, gint64 seek_off,
}
wtap_block_unref(wblock.block);
+
+ /* Provide the section number */
+ rec->presence_flags |= WTAP_HAS_SECTION_NUMBER;
+ rec->section_number = section_number;
+
return TRUE;
}