aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2021-06-06 17:18:33 +0100
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-06-06 19:48:54 +0000
commit4e4bef09f9a6a288486167fb73d04698263e2ab6 (patch)
treea37ced68bc6bdb987684e9b1dae4b1f0e787e364
parentc015257c9f9eba0569720a8405ea65ba19b37982 (diff)
wiretap: Remove some redundant debug information
It is not necessary to include the function name and/or locations, ws_debug() includes that information,
-rw-r--r--wiretap/ipfix.c24
-rw-r--r--wiretap/merge.c48
-rw-r--r--wiretap/pcapng.c317
3 files changed, 192 insertions, 197 deletions
diff --git a/wiretap/ipfix.c b/wiretap/ipfix.c
index 7d63c26fa8..64740f4cd0 100644
--- a/wiretap/ipfix.c
+++ b/wiretap/ipfix.c
@@ -128,7 +128,7 @@ ipfix_read_message_header(ipfix_message_header_t *pfx_hdr, FILE_T fh, int *err,
/* go back to before header */
if (file_seek(fh, 0 - IPFIX_MSG_HDR_SIZE, SEEK_CUR, err) == -1) {
- ws_debug("ipfix_read: couldn't go back in file before header");
+ ws_debug("couldn't go back in file before header");
return FALSE;
}
@@ -179,7 +179,7 @@ ipfix_open(wtap *wth, int *err, gchar **err_info)
ipfix_message_header_t msg_hdr;
ipfix_set_header_t set_hdr;
- ws_debug("ipfix_open: opening file");
+ ws_debug("opening file");
/* number of records to scan before deciding if this really is IPFIX */
if ((s = getenv("IPFIX_RECORDS_TO_CHECK")) != NULL) {
@@ -196,7 +196,7 @@ ipfix_open(wtap *wth, int *err, gchar **err_info)
for (i = 0; i < records_for_ipfix_check; i++) {
/* read first message header to check version */
if (!ipfix_read_message_header(&msg_hdr, wth->fh, err, err_info)) {
- ws_debug("ipfix_open: couldn't read message header #%d with err code #%d (%s)",
+ ws_debug("couldn't read message header #%d with err code #%d (%s)",
i, *err, *err_info);
if (*err == WTAP_ERR_BAD_FILE) {
*err = 0; /* not actually an error in this case */
@@ -220,7 +220,7 @@ ipfix_open(wtap *wth, int *err, gchar **err_info)
break;
}
if (file_seek(wth->fh, IPFIX_MSG_HDR_SIZE, SEEK_CUR, err) == -1) {
- ws_debug("ipfix_open: failed seek to next message in file, %d bytes away",
+ ws_debug("failed seek to next message in file, %d bytes away",
msg_hdr.message_length);
return WTAP_OPEN_NOT_MINE;
}
@@ -232,7 +232,7 @@ ipfix_open(wtap *wth, int *err, gchar **err_info)
err, err_info)) {
if (*err == WTAP_ERR_SHORT_READ) {
/* Not a valid IPFIX Set, so not an IPFIX file. */
- ws_debug("ipfix_open: error %d reading set", *err);
+ ws_debug("error %d reading set", *err);
return WTAP_OPEN_NOT_MINE;
}
@@ -242,7 +242,7 @@ ipfix_open(wtap *wth, int *err, gchar **err_info)
set_hdr.set_length = g_ntohs(set_hdr.set_length);
if ((set_hdr.set_length < IPFIX_SET_HDR_SIZE) ||
((set_hdr.set_length + checked_len) > msg_hdr.message_length)) {
- ws_debug("ipfix_open: found invalid set_length of %d",
+ ws_debug("found invalid set_length of %d",
set_hdr.set_length);
return WTAP_OPEN_NOT_MINE;
}
@@ -250,7 +250,7 @@ ipfix_open(wtap *wth, int *err, gchar **err_info)
if (file_seek(wth->fh, set_hdr.set_length - IPFIX_SET_HDR_SIZE,
SEEK_CUR, err) == -1)
{
- ws_debug("ipfix_open: failed seek to next set in file, %d bytes away",
+ ws_debug("failed seek to next set in file, %d bytes away",
set_hdr.set_length - IPFIX_SET_HDR_SIZE);
return WTAP_OPEN_ERROR;
}
@@ -290,10 +290,10 @@ ipfix_read(wtap *wth, wtap_rec *rec, Buffer *buf, int *err,
gchar **err_info, gint64 *data_offset)
{
*data_offset = file_tell(wth->fh);
- ws_debug("ipfix_read: offset is initially %" G_GINT64_MODIFIER "d", *data_offset);
+ ws_debug("offset is initially %" G_GINT64_MODIFIER "d", *data_offset);
if (!ipfix_read_message(wth->fh, rec, buf, err, err_info)) {
- ws_debug("ipfix_read: couldn't read message header with code: %d\n, and error '%s'",
+ ws_debug("couldn't read message header with code: %d\n, and error '%s'",
*err, *err_info);
return FALSE;
}
@@ -309,15 +309,15 @@ ipfix_seek_read(wtap *wth, gint64 seek_off, wtap_rec *rec,
{
/* seek to the right file position */
if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1) {
- ws_debug("ipfix_seek_read: couldn't read message header with code: %d\n, and error '%s'",
+ ws_debug("couldn't read message header with code: %d\n, and error '%s'",
*err, *err_info);
return FALSE; /* Seek error */
}
- ws_debug("ipfix_seek_read: reading at offset %" G_GINT64_MODIFIER "u", seek_off);
+ ws_debug("reading at offset %" G_GINT64_MODIFIER "u", seek_off);
if (!ipfix_read_message(wth->random_fh, rec, buf, err, err_info)) {
- ws_debug("ipfix_seek_read: couldn't read message header");
+ ws_debug("couldn't read message header");
if (*err == 0)
*err = WTAP_ERR_SHORT_READ;
return FALSE;
diff --git a/wiretap/merge.c b/wiretap/merge.c
index e3496d18ae..829ab8a431 100644
--- a/wiretap/merge.c
+++ b/wiretap/merge.c
@@ -474,7 +474,7 @@ is_duplicate_idb(const wtap_block_t idb1, const wtap_block_t idb2)
(idb1_mand->wtap_encap == idb2_mand->wtap_encap) ? "TRUE":"FALSE");
if (idb1_mand->wtap_encap != idb2_mand->wtap_encap) {
/* Clearly not the same interface. */
- ws_debug("merge::is_duplicate_idb() returning FALSE");
+ ws_debug("returning FALSE");
return FALSE;
}
@@ -485,7 +485,7 @@ is_duplicate_idb(const wtap_block_t idb1, const wtap_block_t idb2)
* Probably not the same interface, and we can't combine them
* in any case.
*/
- ws_debug("merge::is_duplicate_idb() returning FALSE");
+ ws_debug("returning FALSE");
return FALSE;
}
@@ -496,7 +496,7 @@ is_duplicate_idb(const wtap_block_t idb1, const wtap_block_t idb2)
* Probably not the same interface, and we can't combine them
* in any case.
*/
- ws_debug("merge::is_duplicate_idb() returning FALSE");
+ ws_debug("returning FALSE");
return FALSE;
}
@@ -504,7 +504,7 @@ is_duplicate_idb(const wtap_block_t idb1, const wtap_block_t idb2)
ws_debug("idb1_mand->snap_len == idb2_mand->snap_len: %s",
(idb1_mand->snap_len == idb2_mand->snap_len) ? "TRUE":"FALSE");
if (idb1_mand->snap_len != idb2_mand->snap_len) {
- ws_debug("merge::is_duplicate_idb() returning FALSE");
+ ws_debug("returning FALSE");
return FALSE;
}
@@ -515,7 +515,7 @@ is_duplicate_idb(const wtap_block_t idb1, const wtap_block_t idb2)
ws_debug("idb1_if_speed == idb2_if_speed: %s",
(idb1_if_speed == idb2_if_speed) ? "TRUE":"FALSE");
if (idb1_if_speed != idb2_if_speed) {
- ws_debug("merge::is_duplicate_idb() returning FALSE");
+ ws_debug("returning FALSE");
return FALSE;
}
}
@@ -527,7 +527,7 @@ is_duplicate_idb(const wtap_block_t idb1, const wtap_block_t idb2)
ws_debug("idb1_if_tsresol == idb2_if_tsresol: %s",
(idb1_if_tsresol == idb2_if_tsresol) ? "TRUE":"FALSE");
if (idb1_if_tsresol != idb2_if_tsresol) {
- ws_debug("merge::is_duplicate_idb() returning FALSE");
+ ws_debug("returning FALSE");
return FALSE;
}
}
@@ -539,7 +539,7 @@ is_duplicate_idb(const wtap_block_t idb1, const wtap_block_t idb2)
ws_debug("idb1_if_fcslen == idb2_if_fcslen: %s",
(idb1_if_fcslen == idb2_if_fcslen) ? "TRUE":"FALSE");
if (idb1_if_fcslen == idb2_if_fcslen) {
- ws_debug("merge::is_duplicate_idb() returning FALSE");
+ ws_debug("returning FALSE");
return FALSE;
}
}
@@ -557,7 +557,7 @@ is_duplicate_idb(const wtap_block_t idb1, const wtap_block_t idb2)
ws_debug("g_strcmp0(idb1_opt_comment, idb2_opt_comment) == 0: %s",
(g_strcmp0(idb1_opt_comment, idb2_opt_comment) == 0) ? "TRUE":"FALSE");
if (g_strcmp0(idb1_opt_comment, idb2_opt_comment) != 0) {
- ws_debug("merge::is_duplicate_idb() returning FALSE");
+ ws_debug("returning FALSE");
return FALSE;
}
}
@@ -569,7 +569,7 @@ is_duplicate_idb(const wtap_block_t idb1, const wtap_block_t idb2)
ws_debug("g_strcmp0(idb1_if_name, idb2_if_name) == 0: %s",
(g_strcmp0(idb1_if_name, idb2_if_name) == 0) ? "TRUE":"FALSE");
if (g_strcmp0(idb1_if_name, idb2_if_name) != 0) {
- ws_debug("merge::is_duplicate_idb() returning FALSE");
+ ws_debug("returning FALSE");
return FALSE;
}
}
@@ -581,7 +581,7 @@ is_duplicate_idb(const wtap_block_t idb1, const wtap_block_t idb2)
ws_debug("g_strcmp0(idb1_if_description, idb2_if_description) == 0: %s",
(g_strcmp0(idb1_if_description, idb2_if_description) == 0) ? "TRUE":"FALSE");
if (g_strcmp0(idb1_if_description, idb2_if_description) != 0) {
- ws_debug("merge::is_duplicate_idb() returning FALSE");
+ ws_debug("returning FALSE");
return FALSE;
}
}
@@ -593,7 +593,7 @@ is_duplicate_idb(const wtap_block_t idb1, const wtap_block_t idb2)
ws_debug("g_strcmp0(idb1_if_hardware, idb2_if_hardware) == 0: %s",
(g_strcmp0(idb1_if_hardware, idb2_if_hardware) == 0) ? "TRUE":"FALSE");
if (g_strcmp0(idb1_if_hardware, idb2_if_hardware) != 0) {
- ws_debug("merge::is_duplicate_idb() returning FALSE");
+ ws_debug("returning FALSE");
return FALSE;
}
}
@@ -605,13 +605,13 @@ is_duplicate_idb(const wtap_block_t idb1, const wtap_block_t idb2)
ws_debug("g_strcmp0(idb1_if_os, idb2_if_os) == 0: %s",
(g_strcmp0(idb1_if_os, idb2_if_os) == 0) ? "TRUE":"FALSE");
if (g_strcmp0(idb1_if_os, idb2_if_os) != 0) {
- ws_debug("merge::is_duplicate_idb() returning FALSE");
+ ws_debug("returning FALSE");
return FALSE;
}
}
/* does not compare filters nor interface statistics */
- ws_debug("merge::is_duplicate_idb() returning TRUE");
+ ws_debug("returning TRUE");
return TRUE;
}
@@ -642,7 +642,7 @@ all_idbs_are_duplicates(const merge_in_file_t *in_files, const guint in_file_cou
other_idb_list_size = other_idb_list->interface_data->len;
if (other_idb_list_size != first_idb_list_size) {
- ws_debug("merge::all_idbs_are_duplicates: sizes of IDB lists don't match: first=%u, other=%u",
+ ws_debug("sizes of IDB lists don't match: first=%u, other=%u",
first_idb_list_size, other_idb_list_size);
g_free(other_idb_list);
g_free(first_idb_list);
@@ -654,7 +654,7 @@ all_idbs_are_duplicates(const merge_in_file_t *in_files, const guint in_file_cou
other_file_idb = g_array_index(other_idb_list->interface_data, wtap_block_t, j);
if (!is_duplicate_idb(first_file_idb, other_file_idb)) {
- ws_debug("merge::all_idbs_are_duplicates: IDBs at index %d do not match, returning FALSE", j);
+ ws_debug("IDBs at index %d do not match, returning FALSE", j);
g_free(other_idb_list);
g_free(first_idb_list);
return FALSE;
@@ -663,7 +663,7 @@ all_idbs_are_duplicates(const merge_in_file_t *in_files, const guint in_file_cou
g_free(other_idb_list);
}
- ws_debug("merge::all_idbs_are_duplicates: returning TRUE");
+ ws_debug("returning TRUE");
g_free(first_idb_list);
@@ -747,7 +747,7 @@ generate_merged_idbs(merge_in_file_t *in_files, const guint in_file_count, const
if (mode == IDB_MERGE_MODE_ALL_SAME && all_idbs_are_duplicates(in_files, in_file_count)) {
guint num_idbs;
- ws_debug("merge::generate_merged_idbs: mode ALL set and all IDBs are duplicates");
+ ws_debug("mode ALL set and all IDBs are duplicates");
/* they're all the same, so just get the first file's IDBs */
input_file_idb_list = wtap_file_get_idb_info(in_files[0].wth);
@@ -782,7 +782,7 @@ generate_merged_idbs(merge_in_file_t *in_files, const guint in_file_count, const
if (mode == IDB_MERGE_MODE_ANY_SAME &&
find_duplicate_idb(input_file_idb, merged_idb_list, &merged_index))
{
- ws_debug("merge::generate_merged_idbs: mode ANY set and found a duplicate");
+ ws_debug("mode ANY set and found a duplicate");
/*
* It's the same as a previous IDB, so we're going to "merge"
* them into one by adding a map from its old IDB index to the new
@@ -791,7 +791,7 @@ generate_merged_idbs(merge_in_file_t *in_files, const guint in_file_count, const
add_idb_index_map(&in_files[i], itf_count, merged_index);
}
else {
- ws_debug("merge::generate_merged_idbs: mode NONE set or did not find a duplicate");
+ ws_debug("mode NONE set or did not find a duplicate");
/*
* This IDB does not match a previous (or we want to save all IDBs),
* so add the IDB to the merge file, and add a map of the indices.
@@ -822,7 +822,7 @@ map_rec_interface_id(wtap_rec *rec, const merge_in_file_t *in_file)
if (current_interface_id >= in_file->idb_index_map->len) {
/* this shouldn't happen, but in a malformed input file it could */
- ws_debug("merge::map_rec_interface_id: current_interface_id (%u) >= in_file->idb_index_map->len (%u) (ERROR?)",
+ ws_debug("current_interface_id (%u) >= in_file->idb_index_map->len (%u) (ERROR?)",
current_interface_id, in_file->idb_index_map->len);
return FALSE;
}
@@ -1015,7 +1015,7 @@ merge_files_common(const gchar* out_filename, /* normal output mode */
/* open the input files */
if (!merge_open_in_files(in_file_count, in_filenames, &in_files, cb,
err, err_info, err_fileno)) {
- ws_debug("merge_files: merge_open_in_files() failed with err=%d", *err);
+ ws_debug("merge_open_in_files() failed with err=%d", *err);
*err_framenum = 0;
return MERGE_ERR_CANT_OPEN_INFILE;
}
@@ -1033,7 +1033,7 @@ merge_files_common(const gchar* out_filename, /* normal output mode */
* whether we can merge IDBs into one or not.
*/
frame_type = merge_select_frame_type(in_file_count, in_files);
- ws_debug("merge_files: got frame_type=%d", frame_type);
+ ws_debug("got frame_type=%d", frame_type);
if (cb)
cb->callback_func(MERGE_EVENT_FRAME_TYPE_SELECTED, frame_type, in_files, in_file_count, cb->data);
@@ -1052,10 +1052,10 @@ merge_files_common(const gchar* out_filename, /* normal output mode */
if (wtap_file_type_subtype_supports_block(file_type,
WTAP_BLOCK_IF_ID_AND_INFO) != BLOCK_NOT_SUPPORTED) {
shb_hdrs = create_shb_header(in_files, in_file_count, app_name);
- ws_debug("merge_files: SHB created");
+ ws_debug("SHB created");
idb_inf = generate_merged_idbs(in_files, in_file_count, mode);
- ws_debug("merge_files: IDB merge operation complete, got %u IDBs", idb_inf ? idb_inf->interface_data->len : 0);
+ ws_debug("IDB merge operation complete, got %u IDBs", idb_inf ? idb_inf->interface_data->len : 0);
/* XXX other blocks like NRB are now discarded. */
params.shb_hdrs = shb_hdrs;
diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c
index 96ace93e5f..f8472f98d0 100644
--- a/wiretap/pcapng.c
+++ b/wiretap/pcapng.c
@@ -512,7 +512,7 @@ pcapng_read_option(FILE_T fh, const section_info_t *section_info,
/* read option header */
if (!wtap_read_bytes(fh, oh, sizeof (*oh), err, err_info)) {
- ws_debug("%s: failed to read option", G_STRFUNC);
+ ws_debug("failed to read option");
return -1;
}
block_read = sizeof (*oh);
@@ -539,7 +539,7 @@ pcapng_read_option(FILE_T fh, const section_info_t *section_info,
/* read option content */
if (!wtap_read_bytes(fh, content, oh->option_length, err, err_info)) {
- ws_debug("%s: failed to read content of option %u", G_STRFUNC, oh->option_code);
+ ws_debug("failed to read content of option %u", oh->option_code);
return -1;
}
block_read += oh->option_length;
@@ -712,7 +712,7 @@ pcapng_read_section_header_block(FILE_T fh, pcapng_block_header_t *bh,
version_major = shb.version_major;
version_minor = shb.version_minor;
- ws_debug("%s: SHB (our byte order) V%u.%u, len %u", G_STRFUNC,
+ ws_debug("SHB (our byte order) V%u.%u, len %u",
version_major, version_minor, bh->block_total_length);
break;
case(0x4D3C2B1A):
@@ -724,7 +724,7 @@ pcapng_read_section_header_block(FILE_T fh, pcapng_block_header_t *bh,
/* tweak the block length to meet current swapping that we know now */
bh->block_total_length = GUINT32_SWAP_LE_BE(bh->block_total_length);
- ws_debug("%s: SHB (byte-swapped) V%u.%u, len %u", G_STRFUNC,
+ ws_debug("SHB (byte-swapped) V%u.%u, len %u",
version_major, version_minor, bh->block_total_length);
break;
default:
@@ -813,13 +813,13 @@ pcapng_read_section_header_block(FILE_T fh, pcapng_block_header_t *bh,
*err = ENOMEM; /* we assume we're out of memory */
return PCAPNG_BLOCK_ERROR;
}
- ws_debug("%s: Options %u bytes", G_STRFUNC, to_read);
+ ws_debug("Options %u bytes", to_read);
while (to_read != 0) {
/* read option */
- ws_debug("%s: Options %u bytes remaining", G_STRFUNC, to_read);
+ ws_debug("Options %u bytes remaining", to_read);
bytes_read = pcapng_read_option(fh, section_info, &oh, option_content, opt_cont_buf_len, to_read, err, err_info, "section_header");
if (bytes_read <= 0) {
- ws_debug("%s: failed to read option", G_STRFUNC);
+ ws_debug("failed to read option");
g_free(option_content);
return PCAPNG_BLOCK_ERROR;
}
@@ -845,11 +845,11 @@ pcapng_read_section_header_block(FILE_T fh, pcapng_block_header_t *bh,
switch (oh.option_code) {
case(OPT_EOFOPT):
if (to_read != 0) {
- ws_debug("%s: %u bytes after opt_endofopt", G_STRFUNC, to_read);
+ ws_debug("%u bytes after opt_endofopt", to_read);
/* padding should be ok here, just get out of this */
to_read = 0;
} else {
- ws_debug("%s: opt_endofopt", G_STRFUNC);
+ ws_debug("opt_endofopt");
}
break;
case(OPT_COMMENT):
@@ -912,7 +912,7 @@ pcapng_read_if_descr_block(wtap *wth, FILE_T fh, pcapng_block_header_t *bh,
/* read block content */
if (!wtap_read_bytes(fh, &idb, sizeof idb, err, err_info)) {
- ws_debug("%s: failed to read IDB", G_STRFUNC);
+ ws_debug("failed to read IDB");
return FALSE;
}
@@ -931,7 +931,7 @@ pcapng_read_if_descr_block(wtap *wth, FILE_T fh, pcapng_block_header_t *bh,
if_descr_mand->time_units_per_second = time_units_per_second;
if_descr_mand->tsprecision = tsprecision;
- ws_debug("%s: IDB link_type %u (%s), snap %u", G_STRFUNC,
+ ws_debug("IDB link_type %u (%s), snap %u",
link_type,
wtap_encap_description(if_descr_mand->wtap_encap),
if_descr_mand->snap_len);
@@ -941,7 +941,7 @@ pcapng_read_if_descr_block(wtap *wth, FILE_T fh, pcapng_block_header_t *bh,
* We do not use this value, maybe we should check the
* snap_len of the packets against it. For now, only warn.
*/
- ws_debug("%s: snapshot length %u unrealistic.", G_STRFUNC,
+ ws_debug("snapshot length %u unrealistic.",
if_descr_mand->snap_len);
/*if_descr_mand->snap_len = WTAP_MAX_PACKET_SIZE_STANDARD;*/
}
@@ -961,7 +961,7 @@ pcapng_read_if_descr_block(wtap *wth, FILE_T fh, pcapng_block_header_t *bh,
/* read option */
bytes_read = pcapng_read_option(fh, section_info, &oh, option_content, opt_cont_buf_len, to_read, err, err_info, "if_descr");
if (bytes_read <= 0) {
- ws_debug("%s: failed to read option", G_STRFUNC);
+ ws_debug("failed to read option");
g_free(option_content);
return FALSE;
}
@@ -987,7 +987,7 @@ pcapng_read_if_descr_block(wtap *wth, FILE_T fh, pcapng_block_header_t *bh,
switch (oh.option_code) {
case(OPT_EOFOPT): /* opt_endofopt */
if (to_read != 0) {
- ws_debug("%s: %u bytes after opt_endofopt", G_STRFUNC, to_read);
+ ws_debug("%u bytes after opt_endofopt", to_read);
}
/* padding should be ok here, just get out of this */
to_read = 0;
@@ -1027,7 +1027,7 @@ pcapng_read_if_descr_block(wtap *wth, FILE_T fh, pcapng_block_header_t *bh,
time_units_per_second = G_MAXUINT64;
}
if (time_units_per_second > (((guint64)1) << 32)) {
- ws_debug("%s: time conversion might be inaccurate", G_STRFUNC);
+ ws_debug("time conversion might be inaccurate");
}
if_descr_mand->time_units_per_second = time_units_per_second;
/* Fails with multiple options; we silently ignore the failure */
@@ -1045,10 +1045,10 @@ pcapng_read_if_descr_block(wtap *wth, FILE_T fh, pcapng_block_header_t *bh,
else
tsprecision = WTAP_TSPREC_SEC;
if_descr_mand->tsprecision = tsprecision;
- ws_debug("%s: if_tsresol %u, units/s %" G_GINT64_MODIFIER "u, tsprecision %d",
- G_STRFUNC, if_tsresol, if_descr_mand->time_units_per_second, tsprecision);
+ ws_debug("if_tsresol %u, units/s %" G_GINT64_MODIFIER "u, tsprecision %d",
+ if_tsresol, if_descr_mand->time_units_per_second, tsprecision);
} else {
- ws_debug("%s: if_tsresol length %u not 1 as expected", G_STRFUNC, oh.option_length);
+ ws_debug("if_tsresol length %u not 1 as expected", oh.option_length);
}
break;
/*
@@ -1064,7 +1064,7 @@ pcapng_read_if_descr_block(wtap *wth, FILE_T fh, pcapng_block_header_t *bh,
if (option_content[0] == 0) {
if_filter.type = if_filter_pcap;
if_filter.data.filter_str = g_strndup((char *)option_content+1, oh.option_length-1);
- ws_debug("%s: filter_str %s oh.option_length %u", G_STRFUNC,
+ ws_debug("filter_str %s oh.option_length %u",
if_filter.data.filter_str, oh.option_length);
/* Fails with multiple options; we silently ignore the failure */
wtap_block_add_if_filter_option(wblock->block, oh.option_code, &if_filter);
@@ -1106,7 +1106,7 @@ pcapng_read_if_descr_block(wtap *wth, FILE_T fh, pcapng_block_header_t *bh,
g_free(if_filter.data.bpf_prog.bpf_prog);
}
} else {
- ws_debug("%s: if_filter length %u seems strange", G_STRFUNC, oh.option_length);
+ ws_debug("if_filter length %u seems strange", oh.option_length);
}
break;
case(OPT_IDB_OS): /* if_os */
@@ -1121,10 +1121,10 @@ pcapng_read_if_descr_block(wtap *wth, FILE_T fh, pcapng_block_header_t *bh,
if (oh.option_length == 1) {
/* Fails with multiple options; we silently ignore the failure */
wtap_block_add_uint8_option(wblock->block, oh.option_code, option_content[0]);
- ws_debug("%s: if_fcslen %u", G_STRFUNC, option_content[0]);
+ ws_debug("if_fcslen %u", option_content[0]);
/* XXX - add sanity check */
} else {
- ws_debug("%s: if_fcslen length %u not 1 as expected", G_STRFUNC, oh.option_length);
+ ws_debug("if_fcslen length %u not 1 as expected", oh.option_length);
}
break;
case(OPT_IDB_HARDWARE): /* if_hardware */
@@ -1233,7 +1233,7 @@ pcapng_read_decryption_secrets_block(FILE_T fh, pcapng_block_header_t *bh,
/* read block content */
if (!wtap_read_bytes(fh, &dsb, sizeof(dsb), err, err_info)) {
- ws_debug("%s: failed to read DSB", G_STRFUNC);
+ ws_debug("failed to read DSB");
return FALSE;
}
@@ -1255,14 +1255,14 @@ pcapng_read_decryption_secrets_block(FILE_T fh, pcapng_block_header_t *bh,
}
dsb_mand->secrets_data = (guint8 *)g_malloc0(dsb_mand->secrets_len);
if (!wtap_read_bytes(fh, dsb_mand->secrets_data, dsb_mand->secrets_len, err, err_info)) {
- ws_debug("%s: failed to read DSB", G_STRFUNC);
+ ws_debug("failed to read DSB");
return FALSE;
}
/* Skip past padding and discard options (not supported yet). */
to_read = bh->block_total_length - MIN_DSB_SIZE - dsb_mand->secrets_len;
if (!wtap_read_bytes(fh, NULL, to_read, err, err_info)) {
- ws_debug("%s: failed to read DSB options", G_STRFUNC);
+ ws_debug("failed to read DSB options");
return FALSE;
}
@@ -1312,7 +1312,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh,
return FALSE;
}
if (!wtap_read_bytes(fh, &epb, sizeof epb, err, err_info)) {
- ws_debug("%s: failed to read packet data", G_STRFUNC);
+ ws_debug("failed to read packet data");
return FALSE;
}
block_read = (guint)sizeof epb;
@@ -1332,8 +1332,8 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh,
packet.cap_len = epb.captured_len;
packet.packet_len = epb.packet_len;
}
- ws_debug("%s: EPB on interface_id %d, cap_len %d, packet_len %d",
- G_STRFUNC, packet.interface_id, packet.cap_len, packet.packet_len);
+ ws_debug("EPB on interface_id %d, cap_len %d, packet_len %d",
+ packet.interface_id, packet.cap_len, packet.packet_len);
} else {
/*
* Is this block long enough to be a PB?
@@ -1348,7 +1348,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh,
return FALSE;
}
if (!wtap_read_bytes(fh, &pb, sizeof pb, err, err_info)) {
- ws_debug("%s: failed to read packet data", G_STRFUNC);
+ ws_debug("failed to read packet data");
return FALSE;
}
block_read = (guint)sizeof pb;
@@ -1368,8 +1368,8 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh,
packet.cap_len = pb.captured_len;
packet.packet_len = pb.packet_len;
}
- ws_debug("%s: PB on interface_id %d, cap_len %d, packet_len %d",
- G_STRFUNC, packet.interface_id, packet.cap_len, packet.packet_len);
+ ws_debug("PB on interface_id %d, cap_len %d, packet_len %d",
+ packet.interface_id, packet.cap_len, packet.packet_len);
}
/*
@@ -1387,7 +1387,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh,
} else {
block_total_length = bh->block_total_length;
}
- ws_debug("%s: block_total_length %d", G_STRFUNC, block_total_length);
+ ws_debug("block_total_length %d", block_total_length);
/*
* Is this block long enough to hold the packet data?
@@ -1416,8 +1416,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh,
}
}
- ws_debug("%s: packet data: packet_len %u captured_len %u interface_id %u",
- G_STRFUNC,
+ ws_debug("packet data: packet_len %u captured_len %u interface_id %u",
packet.packet_len,
packet.cap_len,
packet.interface_id);
@@ -1443,8 +1442,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh,
wblock->rec->rec_type = REC_TYPE_PACKET;
wblock->rec->presence_flags = WTAP_HAS_TS|WTAP_HAS_CAP_LEN|WTAP_HAS_INTERFACE_ID;
- ws_debug("%s: encapsulation = %d (%s), pseudo header size = %d.",
- G_STRFUNC,
+ ws_debug("encapsulation = %d (%s), pseudo header size = %d.",
iface_info.wtap_encap,
wtap_encap_description(iface_info.wtap_encap),
pcap_get_phdr_size(iface_info.wtap_encap, &wblock->rec->rec_header.packet_header.pseudo_header));
@@ -1529,7 +1527,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh,
option_content = opt_ptr + sizeof (pcapng_option_header_t);
bytes_read = pcapng_read_option(fh, section_info, oh, option_content, opt_cont_buf_len, to_read, err, err_info, "packet");
if (bytes_read <= 0) {
- ws_debug("%s: failed to read option", G_STRFUNC);
+ ws_debug("failed to read option");
/* XXX - free anything? */
return FALSE;
}
@@ -1555,7 +1553,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh,
switch (oh->option_code) {
case(OPT_EOFOPT):
if (to_read != 0) {
- ws_debug("%s: %u bytes after opt_endofopt", G_STRFUNC, to_read);
+ ws_debug("%u bytes after opt_endofopt", to_read);
}
/* padding should be ok here, just get out of this */
to_read = 0;
@@ -1565,10 +1563,10 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh,
wblock->rec->presence_flags |= WTAP_HAS_COMMENTS;
g_free(wblock->rec->opt_comment);
wblock->rec->opt_comment = g_strndup((char *)option_content, oh->option_length);
- ws_debug("%s: length %u opt_comment '%s'", G_STRFUNC,
+ ws_debug("length %u opt_comment '%s'",
oh->option_length, wblock->rec->opt_comment);
} else {
- ws_debug("%s: opt_comment length %u seems strange", G_STRFUNC,
+ ws_debug("opt_comment length %u seems strange",
oh->option_length);
}
break;
@@ -1594,12 +1592,12 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh,
/* The FCS length is present */
fcslen = PACK_FLAGS_FCS_LENGTH(wblock->rec->rec_header.packet_header.pack_flags);
}
- ws_debug("%s: pack_flags 0x%08x", G_STRFUNC,
+ ws_debug("pack_flags 0x%08x",
wblock->rec->rec_header.packet_header.pack_flags);
break;
case(OPT_EPB_HASH):
- ws_debug("%s: epb_hash %u currently not handled - ignoring %u bytes",
- G_STRFUNC, oh->option_code, oh->option_length);
+ ws_debug("epb_hash %u currently not handled - ignoring %u bytes",
+ oh->option_code, oh->option_length);
break;
case(OPT_EPB_DROPCOUNT):
if (oh->option_length != 8) {
@@ -1620,7 +1618,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh,
memcpy(option_content, &wblock->rec->rec_header.packet_header.drop_count, sizeof(guint64));
}
- ws_debug("%s: drop_count %" G_GINT64_MODIFIER "u", G_STRFUNC,
+ ws_debug("drop_count %" G_GINT64_MODIFIER "u",
wblock->rec->rec_header.packet_header.drop_count);
break;
case(OPT_EPB_PACKETID):
@@ -1641,7 +1639,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh,
wblock->rec->rec_header.packet_header.packet_id = GUINT64_SWAP_LE_BE(wblock->rec->rec_header.packet_header.packet_id);
memcpy(option_content, &wblock->rec->rec_header.packet_header.packet_id, sizeof(guint64));
}
- ws_debug("%s: packet_id %" G_GINT64_MODIFIER "u", G_STRFUNC,
+ ws_debug("packet_id %" G_GINT64_MODIFIER "u",
wblock->rec->rec_header.packet_header.packet_id);
break;
case(OPT_EPB_QUEUE):
@@ -1662,7 +1660,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh,
wblock->rec->rec_header.packet_header.interface_queue = GUINT32_SWAP_LE_BE(wblock->rec->rec_header.packet_header.interface_queue);
memcpy(option_content, &wblock->rec->rec_header.packet_header.interface_queue, sizeof(guint32));
}
- ws_debug("%s: queue %u", G_STRFUNC,
+ ws_debug("queue %u",
wblock->rec->rec_header.packet_header.interface_queue);
break;
case(OPT_EPB_VERDICT):
@@ -1707,11 +1705,11 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh,
oh->option_length,
g_free,
option_content_copy));
- ws_debug("%s: verdict type %u, data len %u", G_STRFUNC,
+ ws_debug("verdict type %u, data len %u",
option_content[0], oh->option_length - 1);
break;
default:
- ws_debug("%s: unknown option %u - ignoring %u bytes", G_STRFUNC,
+ ws_debug("unknown option %u - ignoring %u bytes",
oh->option_code, oh->option_length);
break;
}
@@ -1758,7 +1756,7 @@ pcapng_read_simple_packet_block(FILE_T fh, pcapng_block_header_t *bh,
/* "Simple Packet Block" read fixed part */
if (!wtap_read_bytes(fh, &spb, sizeof spb, err, err_info)) {
- ws_debug("%s: failed to read packet data", G_STRFUNC);
+ ws_debug("failed to read packet data");
return FALSE;
}
@@ -1800,7 +1798,7 @@ pcapng_read_simple_packet_block(FILE_T fh, pcapng_block_header_t *bh,
} else {
block_total_length = bh->block_total_length;
}
- ws_debug("%s: block_total_length %d", G_STRFUNC, block_total_length);
+ ws_debug("block_total_length %d", block_total_length);
/*
* Is this block long enough to hold the packet data?
@@ -1825,11 +1823,11 @@ pcapng_read_simple_packet_block(FILE_T fh, pcapng_block_header_t *bh,
wtap_max_snaplen_for_encap(iface_info.wtap_encap));
return FALSE;
}
- ws_debug("%s: packet data: packet_len %u",
- G_STRFUNC, simple_packet.packet_len);
+ ws_debug("packet data: packet_len %u",
+ simple_packet.packet_len);
- ws_debug("%s: Need to read pseudo header of size %d",
- G_STRFUNC, pcap_get_phdr_size(iface_info.wtap_encap, &wblock->rec->rec_header.packet_header.pseudo_header));
+ ws_debug("Need to read pseudo header of size %d",
+ pcap_get_phdr_size(iface_info.wtap_encap, &wblock->rec->rec_header.packet_header.pseudo_header));
/* No time stamp in a simple packet block; no options, either */
wblock->rec->rec_type = REC_TYPE_PACKET;
@@ -1968,7 +1966,7 @@ pcapng_read_name_resolution_block(FILE_T fh, pcapng_block_header_t *bh,
to_read = bh->block_total_length - 8 - 4; /* We have read the header and should not read the final block_total_length */
- ws_debug("%s: total %d bytes", G_STRFUNC, bh->block_total_length);
+ ws_debug("total %d bytes", bh->block_total_length);
/* Ensure we have a name resolution block */
if (wblock->block == NULL) {
@@ -1996,7 +1994,7 @@ pcapng_read_name_resolution_block(FILE_T fh, pcapng_block_header_t *bh,
}
if (!wtap_read_bytes(fh, &nrb, sizeof nrb, err, err_info)) {
ws_buffer_free(&nrb_rec);
- ws_debug("%s: failed to read record header", G_STRFUNC);
+ ws_debug("failed to read record header");
return FALSE;
}
block_read += (int)sizeof nrb;
@@ -2045,7 +2043,7 @@ pcapng_read_name_resolution_block(FILE_T fh, pcapng_block_header_t *bh,
if (!wtap_read_bytes(fh, ws_buffer_start_ptr(&nrb_rec),
nrb.record_len, err, err_info)) {
ws_buffer_free(&nrb_rec);
- ws_debug("%s: failed to read IPv4 record data", G_STRFUNC);
+ ws_debug("failed to read IPv4 record data");
return FALSE;
}
block_read += nrb.record_len;
@@ -2143,7 +2141,7 @@ pcapng_read_name_resolution_block(FILE_T fh, pcapng_block_header_t *bh,
block_read += PADDING4(nrb.record_len);
break;
default:
- ws_debug("%s: unknown record type 0x%x", G_STRFUNC, nrb.record_type);
+ ws_debug("unknown record type 0x%x", nrb.record_type);
if (!wtap_read_bytes(fh, NULL, nrb.record_len + PADDING4(nrb.record_len), err, err_info)) {
ws_buffer_free(&nrb_rec);
return FALSE;
@@ -2179,7 +2177,7 @@ read_options:
/* read option */
bytes_read = pcapng_read_option(fh, section_info, &oh, option_content, opt_cont_buf_len, to_read, err, err_info, "name_resolution");
if (bytes_read <= 0) {
- ws_debug("%s: failed to read option", G_STRFUNC);
+ ws_debug("failed to read option");
g_free(option_content);
ws_buffer_free(&nrb_rec);
return FALSE;
@@ -2206,7 +2204,7 @@ read_options:
switch (oh.option_code) {
case(OPT_EOFOPT):
if (to_read != 0) {
- ws_debug("%s: %u bytes after opt_endofopt", G_STRFUNC, to_read);
+ ws_debug("%u bytes after opt_endofopt", to_read);
}
/* padding should be ok here, just get out of this */
to_read = 0;
@@ -2260,7 +2258,7 @@ pcapng_read_interface_statistics_block(FILE_T fh, pcapng_block_header_t *bh,
/* "Interface Statistics Block" read fixed part */
if (!wtap_read_bytes(fh, &isb, sizeof isb, err, err_info)) {
- ws_debug("%s: failed to read packet data", G_STRFUNC);
+ ws_debug("failed to read packet data");
return FALSE;
}
@@ -2275,7 +2273,7 @@ pcapng_read_interface_statistics_block(FILE_T fh, pcapng_block_header_t *bh,
if_stats_mand->ts_high = isb.timestamp_high;
if_stats_mand->ts_low = isb.timestamp_low;
}
- ws_debug("%s: interface_id %u", G_STRFUNC, if_stats_mand->interface_id);
+ ws_debug("interface_id %u", if_stats_mand->interface_id);
/* Options */
to_read = bh->block_total_length -
@@ -2293,7 +2291,7 @@ pcapng_read_interface_statistics_block(FILE_T fh, pcapng_block_header_t *bh,
/* read option */
bytes_read = pcapng_read_option(fh, section_info, &oh, option_content, opt_cont_buf_len, to_read, err, err_info, "interface_statistics");
if (bytes_read <= 0) {
- ws_debug("%s: failed to read option", G_STRFUNC);
+ ws_debug("failed to read option");
g_free(option_content);
return FALSE;
}
@@ -2319,7 +2317,7 @@ pcapng_read_interface_statistics_block(FILE_T fh, pcapng_block_header_t *bh,
switch (oh.option_code) {
case(OPT_EOFOPT): /* opt_endofopt */
if (to_read != 0) {
- ws_debug("%s: %u bytes after opt_endofopt", G_STRFUNC, to_read);
+ ws_debug("%u bytes after opt_endofopt", to_read);
}
/* padding should be ok here, just get out of this */
to_read = 0;
@@ -2403,8 +2401,8 @@ pcapng_read_sysdig_event_block(FILE_T fh, pcapng_block_header_t *bh,
block_total_length = bh->block_total_length;
}
- ws_debug("%s: block_total_length %u",
- G_STRFUNC, bh->block_total_length);
+ ws_debug("block_total_length %u",
+ bh->block_total_length);
wblock->rec->rec_type = REC_TYPE_SYSCALL;
wblock->rec->rec_header.syscall_header.record_type = bh->block_type;
@@ -2412,28 +2410,28 @@ pcapng_read_sysdig_event_block(FILE_T fh, pcapng_block_header_t *bh,
wblock->rec->tsprec = WTAP_TSPREC_NSEC;
if (!wtap_read_bytes(fh, &cpu_id, sizeof cpu_id, err, err_info)) {
- ws_debug("%s: failed to read sysdig event cpu id", G_STRFUNC);
+ ws_debug("failed to read sysdig event cpu id");
return FALSE;
}
if (!wtap_read_bytes(fh, &wire_ts, sizeof wire_ts, err, err_info)) {
- ws_debug("%s: failed to read sysdig event timestamp", G_STRFUNC);
+ ws_debug("failed to read sysdig event timestamp");
return FALSE;
}
if (!wtap_read_bytes(fh, &thread_id, sizeof thread_id, err, err_info)) {
- ws_debug("%s: failed to read sysdig event thread id", G_STRFUNC);
+ ws_debug("failed to read sysdig event thread id");
return FALSE;
}
if (!wtap_read_bytes(fh, &event_len, sizeof event_len, err, err_info)) {
- ws_debug("%s: failed to read sysdig event length", G_STRFUNC);
+ ws_debug("failed to read sysdig event length");
return FALSE;
}
if (!wtap_read_bytes(fh, &event_type, sizeof event_type, err, err_info)) {
- ws_debug("%s: failed to read sysdig event type", G_STRFUNC);
+ ws_debug("failed to read sysdig event type");
return FALSE;
}
if (bh->block_type == BLOCK_TYPE_SYSDIG_EVENT_V2) {
if (!wtap_read_bytes(fh, &nparams, sizeof nparams, err, err_info)) {
- ws_debug("%s: failed to read sysdig number of parameters", G_STRFUNC);
+ ws_debug("failed to read sysdig number of parameters");
return FALSE;
}
}
@@ -2507,7 +2505,7 @@ pcapng_read_systemd_journal_export_block(wtap *wth, FILE_T fh, pcapng_block_head
block_total_length = bh->block_total_length;
}
- ws_debug("%s: block_total_length %u", G_STRFUNC, bh->block_total_length);
+ ws_debug("block_total_length %u", bh->block_total_length);
entry_length = block_total_length - MIN_BLOCK_SIZE;
@@ -2535,7 +2533,7 @@ pcapng_read_systemd_journal_export_block(wtap *wth, FILE_T fh, pcapng_block_head
return FALSE;
}
- ws_debug("%s: entry_length %u", G_STRFUNC, entry_length);
+ ws_debug("entry_length %u", entry_length);
size_t rt_ts_len = strlen(SDJ__REALTIME_TIMESTAMP);
@@ -2543,15 +2541,15 @@ pcapng_read_systemd_journal_export_block(wtap *wth, FILE_T fh, pcapng_block_head
char *ts_pos = strstr(buf_ptr, SDJ__REALTIME_TIMESTAMP);
if (!ts_pos) {
- ws_debug("%s: no timestamp", G_STRFUNC);
+ ws_debug("no timestamp");
} else if (ts_pos+rt_ts_len >= (char *) buf_ptr+entry_length) {
- ws_debug("%s: timestamp past end of buffer", G_STRFUNC);
+ ws_debug("timestamp past end of buffer");
} else {
const char *ts_end;
have_ts = ws_strtou64(ts_pos+rt_ts_len, &ts_end, &rt_ts);
if (!have_ts) {
- ws_debug("%s: invalid timestamp", G_STRFUNC);
+ ws_debug("invalid timestamp");
}
}
@@ -2655,7 +2653,7 @@ pcapng_read_and_check_block_trailer(FILE_T fh, pcapng_block_header_t *bh,
/* sanity check: first and second block lengths must match */
if (!wtap_read_bytes(fh, &block_total_length, sizeof block_total_length,
err, err_info)) {
- ws_debug("%s: couldn't read second block length", G_STRFUNC);
+ ws_debug("couldn't read second block length");
return FALSE;
}
@@ -2685,7 +2683,7 @@ pcapng_read_block(wtap *wth, FILE_T fh, pcapng_t *pn,
/* Try to read the (next) block header */
if (!wtap_read_bytes_or_eof(fh, &bh, sizeof bh, err, err_info)) {
- ws_debug("%s: wtap_read_bytes_or_eof() failed, err = %d.", G_STRFUNC, *err);
+ ws_debug("wtap_read_bytes_or_eof() failed, err = %d.", *err);
return FALSE;
}
@@ -2712,7 +2710,7 @@ pcapng_read_block(wtap *wth, FILE_T fh, pcapng_t *pn,
*/
wblock->type = bh.block_type;
- ws_debug("%s: block_type 0x%08x", G_STRFUNC, bh.block_type);
+ ws_debug("block_type 0x%08x", bh.block_type);
/*
* Fill in the section_info_t passed to us for use when
@@ -2742,7 +2740,7 @@ pcapng_read_block(wtap *wth, FILE_T fh, pcapng_t *pn,
wblock->type = bh.block_type;
- ws_debug("%s: block_type 0x%08x", G_STRFUNC, bh.block_type);
+ ws_debug("block_type 0x%08x", bh.block_type);
/* Don't try to allocate memory for a huge number of options, as
that might fail and, even if it succeeds, it might not leave
@@ -2806,8 +2804,8 @@ pcapng_read_block(wtap *wth, FILE_T fh, pcapng_t *pn,
return FALSE;
break;
default:
- ws_debug("%s: Unknown block_type: 0x%08x (block ignored), block total length %d",
- G_STRFUNC, bh.block_type, bh.block_total_length);
+ ws_debug("Unknown block_type: 0x%08x (block ignored), block total length %d",
+ bh.block_type, bh.block_total_length);
if (!pcapng_read_unknown_block(fh, &bh, section_info, wblock, err, err_info))
return FALSE;
break;
@@ -2878,14 +2876,14 @@ pcapng_open(wtap *wth, int *err, gchar **err_info)
gint64 saved_offset;
section_info_t first_section, new_section, *current_section;
- ws_debug("%s: opening file", G_STRFUNC);
+ ws_debug("opening file");
/*
* Read first block.
*
* First, try to read the block header.
*/
if (!wtap_read_bytes_or_eof(wth->fh, &bh, sizeof bh, err, err_info)) {
- ws_debug("%s: wtap_read_bytes_or_eof() failed, err = %d.", G_STRFUNC, *err);
+ ws_debug("wtap_read_bytes_or_eof() failed, err = %d.", *err);
if (*err == 0 || *err == WTAP_ERR_SHORT_READ) {
/*
* Short read or EOF.
@@ -2913,11 +2911,11 @@ pcapng_open(wtap *wth, int *err, gchar **err_info)
* between Windows and UN*X as text rather than
* binary data?
*/
- ws_debug("%s: first block type 0x%08x not SHB", G_STRFUNC, bh.block_type);
+ ws_debug("first block type 0x%08x not SHB", bh.block_type);
return WTAP_OPEN_NOT_MINE;
}
- ws_debug("%s: got an SHB", G_STRFUNC);
+ ws_debug("got an SHB");
/*
* Now try to read the block body, filling in the section_info_t
@@ -3032,11 +3030,11 @@ pcapng_open(wtap *wth, int *err, gchar **err_info)
if (!wtap_read_bytes_or_eof(wth->fh, &bh, sizeof bh, err, err_info)) {
if (*err == 0) {
/* EOF */
- ws_debug("%s: No more IDBs available...", G_STRFUNC);
+ ws_debug("No more IDBs available...");
break;
}
- ws_debug("%s: Check for more IDBs, wtap_read_bytes_or_eof() failed, err = %d.",
- G_STRFUNC, *err);
+ ws_debug("Check for more IDBs, wtap_read_bytes_or_eof() failed, err = %d.",
+ *err);
return WTAP_OPEN_ERROR;
}
@@ -3053,8 +3051,8 @@ pcapng_open(wtap *wth, int *err, gchar **err_info)
bh.block_type = GUINT32_SWAP_LE_BE(bh.block_type);
}
- ws_debug("%s: Check for more IDBs, block_type 0x%08x",
- G_STRFUNC, bh.block_type);
+ ws_debug("Check for more IDBs, block_type 0x%08x",
+ bh.block_type);
if (bh.block_type != BLOCK_TYPE_IDB) {
break; /* No more IDBs */
@@ -3064,17 +3062,17 @@ pcapng_open(wtap *wth, int *err, gchar **err_info)
&new_section, &wblock, err, err_info)) {
wtap_block_free(wblock.block);
if (*err == 0) {
- ws_debug("%s: No more IDBs available...", G_STRFUNC);
+ ws_debug("No more IDBs available...");
break;
} else {
- ws_debug("%s: couldn't read IDB", G_STRFUNC);
+ ws_debug("couldn't read IDB");
return WTAP_OPEN_ERROR;
}
}
pcapng_process_idb(wth, current_section, &wblock);
wtap_block_free(wblock.block);
- ws_debug("%s: Read IDB number_of_interfaces %u, wtap_encap %i",
- G_STRFUNC, wth->interface_data->len, wth->file_encap);
+ ws_debug("Read IDB number_of_interfaces %u, wtap_encap %i",
+ wth->interface_data->len, wth->file_encap);
}
return WTAP_OPEN_MINE;
}
@@ -3102,7 +3100,7 @@ pcapng_read(wtap *wth, wtap_rec *rec, Buffer *buf, int *err,
/* read next block */
while (1) {
*data_offset = file_tell(wth->fh);
- ws_debug("%s: data_offset is %" G_GINT64_MODIFIER "d", G_STRFUNC, *data_offset);
+ ws_debug("data_offset is %" G_GINT64_MODIFIER "d", *data_offset);
/*
* Get the section_info_t for the current section.
@@ -3115,8 +3113,8 @@ pcapng_read(wtap *wth, wtap_rec *rec, Buffer *buf, int *err,
*/
if (!pcapng_read_block(wth, wth->fh, pcapng, current_section,
&new_section, &wblock, err, err_info)) {
- ws_debug("%s: data_offset is finally %" G_GINT64_MODIFIER "d", G_STRFUNC, *data_offset);
- ws_debug("%s: couldn't read packet block", G_STRFUNC);
+ ws_debug("data_offset is finally %" G_GINT64_MODIFIER "d", *data_offset);
+ ws_debug("couldn't read packet block");
wtap_block_free(wblock.block);
return FALSE;
}
@@ -3125,7 +3123,7 @@ pcapng_read(wtap *wth, wtap_rec *rec, Buffer *buf, int *err,
/*
* This is a block type we return to the caller to process.
*/
- ws_debug("%s: rec_type %u", G_STRFUNC, wblock.rec->rec_type);
+ ws_debug("rec_type %u", wblock.rec->rec_type);
break;
}
@@ -3136,7 +3134,7 @@ pcapng_read(wtap *wth, wtap_rec *rec, Buffer *buf, int *err,
switch (wblock.type) {
case(BLOCK_TYPE_SHB):
- ws_debug("%s: another section header block", G_STRFUNC);
+ ws_debug("another section header block");
g_array_append_val(wth->shb_hdrs, wblock.block);
/*
@@ -3152,21 +3150,21 @@ pcapng_read(wtap *wth, wtap_rec *rec, Buffer *buf, int *err,
case(BLOCK_TYPE_IDB):
/* A new interface */
- ws_debug("%s: block type BLOCK_TYPE_IDB", G_STRFUNC);
+ ws_debug("block type BLOCK_TYPE_IDB");
pcapng_process_idb(wth, current_section, &wblock);
wtap_block_free(wblock.block);
break;
case(BLOCK_TYPE_DSB):
/* Decryption secrets. */
- ws_debug("%s: block type BLOCK_TYPE_DSB", G_STRFUNC);
+ ws_debug("block type BLOCK_TYPE_DSB");
pcapng_process_dsb(wth, &wblock);
/* Do not free wblock.block, it is consumed by pcapng_process_dsb */
break;
case(BLOCK_TYPE_NRB):
/* More name resolution entries */
- ws_debug("%s: block type BLOCK_TYPE_NRB", G_STRFUNC);
+ ws_debug("block type BLOCK_TYPE_NRB");
if (wth->nrb_hdrs == NULL) {
wth->nrb_hdrs = g_array_new(FALSE, FALSE, sizeof(wtap_block_t));
}
@@ -3194,18 +3192,18 @@ pcapng_read(wtap *wth, wtap_rec *rec, Buffer *buf, int *err,
* that would be the best way of showing "summary"
* statistics.
*/
- ws_debug("%s: block type BLOCK_TYPE_ISB", G_STRFUNC);
+ ws_debug("block type BLOCK_TYPE_ISB");
if_stats_mand_block = (wtapng_if_stats_mandatory_t*)wtap_block_get_mandatory_data(wblock.block);
if (wth->interface_data->len <= if_stats_mand_block->interface_id) {
- ws_debug("%s: BLOCK_TYPE_ISB wblock.if_stats.interface_id %u >= number_of_interfaces",
- G_STRFUNC, if_stats_mand_block->interface_id);
+ ws_debug("BLOCK_TYPE_ISB wblock.if_stats.interface_id %u >= number_of_interfaces",
+ if_stats_mand_block->interface_id);
} else {
/* Get the interface description */
wtapng_if_descr = g_array_index(wth->interface_data, wtap_block_t, if_stats_mand_block->interface_id);
wtapng_if_descr_mand = (wtapng_if_descr_mandatory_t*)wtap_block_get_mandatory_data(wtapng_if_descr);
if (wtapng_if_descr_mand->num_stat_entries == 0) {
/* First ISB found, no previous entry */
- ws_debug("%s: block type BLOCK_TYPE_ISB. First ISB found, no previous entry", G_STRFUNC);
+ ws_debug("block type BLOCK_TYPE_ISB. First ISB found, no previous entry");
wtapng_if_descr_mand->interface_statistics = g_array_new(FALSE, FALSE, sizeof(wtap_block_t));
}
@@ -3224,13 +3222,13 @@ pcapng_read(wtap *wth, wtap_rec *rec, Buffer *buf, int *err,
default:
/* XXX - improve handling of "unknown" blocks */
- ws_debug("%s: Unknown block type 0x%08x", G_STRFUNC, wblock.type);
+ ws_debug("Unknown block type 0x%08x", wblock.type);
break;
}
}
- /*ws_debug("%s: Read length: %u Packet length: %u", G_STRFUNC, bytes_read, rec->rec_header.packet_header.caplen);*/
- ws_debug("%s: data_offset is finally %" G_GINT64_MODIFIER "d", G_STRFUNC, *data_offset);
+ /*ws_debug("Read length: %u Packet length: %u", bytes_read, rec->rec_header.packet_header.caplen);*/
+ ws_debug("data_offset is finally %" G_GINT64_MODIFIER "d", *data_offset);
return TRUE;
}
@@ -3251,7 +3249,7 @@ pcapng_seek_read(wtap *wth, gint64 seek_off,
if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) < 0) {
return FALSE; /* Seek error */
}
- ws_debug("%s: reading at offset %" G_GINT64_MODIFIER "u", G_STRFUNC, seek_off);
+ ws_debug("reading at offset %" G_GINT64_MODIFIER "u", seek_off);
/*
* Find the section_info_t for the section in which this block
@@ -3290,15 +3288,15 @@ pcapng_seek_read(wtap *wth, gint64 seek_off,
/* read the block */
if (!pcapng_read_block(wth, wth->random_fh, pcapng, section_info,
&new_section, &wblock, err, err_info)) {
- ws_debug("%s: couldn't read packet block (err=%d).", G_STRFUNC, *err);
+ ws_debug("couldn't read packet block (err=%d).", *err);
wtap_block_free(wblock.block);
return FALSE;
}
/* block must not be one we process internally rather than supplying */
if (wblock.internal) {
- ws_debug("%s: block type 0x%08x is not one we return",
- G_STRFUNC, wblock.type);
+ ws_debug("block type 0x%08x is not one we return",
+ wblock.type);
wtap_block_free(wblock.block);
return FALSE;
}
@@ -3314,7 +3312,7 @@ pcapng_close(wtap *wth)
{
pcapng_t *pcapng = (pcapng_t *)wth->priv;
- ws_debug("%s: closing file", G_STRFUNC);
+ ws_debug("closing file");
/*
* Free up the interfaces tables for all the sections.
@@ -3540,7 +3538,7 @@ pcapng_write_section_header_block(wtap_dumper *wdh, int *err)
block_size.size = 0;
bh.block_total_length = (guint32)(sizeof(bh) + sizeof(shb) + 4);
if (wdh_shb) {
- ws_debug("%s: Have shb_hdr", G_STRFUNC);
+ ws_debug("Have shb_hdr");
/* Compute block size */
wtap_block_foreach_option(wdh_shb, compute_shb_option_size, &block_size);
@@ -3553,7 +3551,7 @@ pcapng_write_section_header_block(wtap_dumper *wdh, int *err)
bh.block_total_length += block_size.size;
}
- ws_debug("%s: Total len %u", G_STRFUNC, bh.block_total_length);
+ ws_debug("Total len %u", bh.block_total_length);
/* write block header */
bh.block_type = BLOCK_TYPE_SHB;
@@ -3815,8 +3813,8 @@ pcapng_write_enhanced_packet_block(wtap_dumper *wdh, const wtap_rec *rec,
wdh->bytes_dumped += 4;
/* Write the comments string */
- ws_debug("%s: comment:'%s' comment_len %u comment_pad_len %u",
- G_STRFUNC, rec->opt_comment, comment_len, comment_pad_len);
+ ws_debug("comment:'%s' comment_len %u comment_pad_len %u",
+ rec->opt_comment, comment_len, comment_pad_len);
if (!wtap_dump_file_write(wdh, rec->opt_comment, comment_len, err))
return FALSE;
wdh->bytes_dumped += comment_len;
@@ -3828,8 +3826,8 @@ pcapng_write_enhanced_packet_block(wtap_dumper *wdh, const wtap_rec *rec,
wdh->bytes_dumped += comment_pad_len;
}
- ws_debug("%s: Wrote Options comments: comment_len %u, comment_pad_len %u",
- G_STRFUNC, comment_len, comment_pad_len);
+ ws_debug("Wrote Options comments: comment_len %u, comment_pad_len %u",
+ comment_len, comment_pad_len);
}
if (rec->presence_flags & WTAP_HAS_PACK_FLAGS) {
option_hdr.type = OPT_EPB_FLAGS;
@@ -3840,8 +3838,8 @@ pcapng_write_enhanced_packet_block(wtap_dumper *wdh, const wtap_rec *rec,
if (!wtap_dump_file_write(wdh, &rec->rec_header.packet_header.pack_flags, 4, err))
return FALSE;
wdh->bytes_dumped += 4;
- ws_debug("%s: Wrote Options packet flags: %x",
- G_STRFUNC, rec->rec_header.packet_header.pack_flags);
+ ws_debug("Wrote Options packet flags: %x",
+ rec->rec_header.packet_header.pack_flags);
}
if (rec->presence_flags & WTAP_HAS_DROP_COUNT) {
option_hdr.type = OPT_EPB_DROPCOUNT;
@@ -3852,8 +3850,8 @@ pcapng_write_enhanced_packet_block(wtap_dumper *wdh, const wtap_rec *rec,
if (!wtap_dump_file_write(wdh, &rec->rec_header.packet_header.drop_count, 8, err))
return FALSE;
wdh->bytes_dumped += 8;
- ws_debug("%s: Wrote Options drop count: %" G_GINT64_MODIFIER "u",
- G_STRFUNC, rec->rec_header.packet_header.drop_count);
+ ws_debug("Wrote Options drop count: %" G_GINT64_MODIFIER "u",
+ rec->rec_header.packet_header.drop_count);
}
if (rec->presence_flags & WTAP_HAS_PACKET_ID) {
option_hdr.type = OPT_EPB_PACKETID;
@@ -3864,8 +3862,8 @@ pcapng_write_enhanced_packet_block(wtap_dumper *wdh, const wtap_rec *rec,
if (!wtap_dump_file_write(wdh, &rec->rec_header.packet_header.packet_id, 8, err))
return FALSE;
wdh->bytes_dumped += 8;
- ws_debug("%s: Wrote Options packet id: %" G_GINT64_MODIFIER "u",
- G_STRFUNC, rec->rec_header.packet_header.packet_id);
+ ws_debug("Wrote Options packet id: %" G_GINT64_MODIFIER "u",
+ rec->rec_header.packet_header.packet_id);
}
if (rec->presence_flags & WTAP_HAS_INT_QUEUE) {
option_hdr.type = OPT_EPB_QUEUE;
@@ -3876,8 +3874,8 @@ pcapng_write_enhanced_packet_block(wtap_dumper *wdh, const wtap_rec *rec,
if (!wtap_dump_file_write(wdh, &rec->rec_header.packet_header.interface_queue, 4, err))
return FALSE;
wdh->bytes_dumped += 4;
- ws_debug("%s: Wrote Options queue: %u",
- G_STRFUNC, rec->rec_header.packet_header.interface_queue);
+ ws_debug("Wrote Options queue: %u",
+ rec->rec_header.packet_header.interface_queue);
}
if (rec->presence_flags & WTAP_HAS_VERDICT && rec->packet_verdict != NULL) {
@@ -3904,8 +3902,8 @@ pcapng_write_enhanced_packet_block(wtap_dumper *wdh, const wtap_rec *rec,
return FALSE;
wdh->bytes_dumped += plen;
}
- ws_debug("%s: Wrote Options verdict: %u",
- G_STRFUNC, verdict_data[0]);
+ ws_debug("Wrote Options verdict: %u",
+ verdict_data[0]);
}
}
}
@@ -4058,8 +4056,8 @@ pcapng_write_systemd_journal_export_block(wtap_dumper *wdh, const wtap_rec *rec,
bh.block_type = BLOCK_TYPE_SYSTEMD_JOURNAL;
bh.block_total_length = (guint32)sizeof(bh) + rec->rec_header.systemd_journal_header.record_len + pad_len + 4;
- ws_debug("%s: writing %u bytes, %u padded",
- G_STRFUNC, rec->rec_header.systemd_journal_header.record_len,
+ ws_debug("writing %u bytes, %u padded",
+ rec->rec_header.systemd_journal_header.record_len,
bh.block_total_length);
if (!wtap_dump_file_write(wdh, &bh, sizeof bh, err))
@@ -4098,7 +4096,7 @@ pcapng_write_decryption_secrets_block(wtap_dumper *wdh, wtap_block_t sdata, int
/* write block header */
bh.block_type = BLOCK_TYPE_DSB;
bh.block_total_length = MIN_DSB_SIZE + mand_data->secrets_len + pad_len;
- ws_debug("%s: Total len %u", G_STRFUNC, bh.block_total_length);
+ ws_debug("Total len %u", bh.block_total_length);
if (!wtap_dump_file_write(wdh, &bh, sizeof bh, err))
return FALSE;
@@ -4383,8 +4381,8 @@ pcapng_write_name_resolution_block(wtap_dumper *wdh, int *err)
/* Copy the block trailer. */
memcpy(block_data + block_off, &bh.block_total_length, sizeof(bh.block_total_length));
- ws_debug("%s: Write bh.block_total_length bytes %d, block_off %u",
- G_STRFUNC, bh.block_total_length, block_off);
+ ws_debug("Write bh.block_total_length bytes %d, block_off %u",
+ bh.block_total_length, block_off);
if (!wtap_dump_file_write(wdh, block_data, bh.block_total_length, err)) {
g_free(block_data);
@@ -4407,8 +4405,8 @@ pcapng_write_name_resolution_block(wtap_dumper *wdh, int *err)
block_off += namelen;
memset(block_data + block_off, 0, PADDING4(namelen));
block_off += PADDING4(namelen);
- ws_debug("%s: added IPv4 record for %s",
- G_STRFUNC, ipv4_hash_list_entry->name);
+ ws_debug("added IPv4 record for %s",
+ ipv4_hash_list_entry->name);
i++;
ipv4_hash_list_entry = (hashipv4_t *)g_list_nth_data(wdh->addrinfo_lists->ipv4_addr_list, i);
@@ -4465,8 +4463,8 @@ pcapng_write_name_resolution_block(wtap_dumper *wdh, int *err)
/* Copy the block trailer. */
memcpy(block_data + block_off, &bh.block_total_length, sizeof(bh.block_total_length));
- ws_debug("%s: write bh.block_total_length bytes %d, block_off %u",
- G_STRFUNC, bh.block_total_length, block_off);
+ ws_debug("write bh.block_total_length bytes %d, block_off %u",
+ bh.block_total_length, block_off);
if (!wtap_dump_file_write(wdh, block_data, bh.block_total_length, err)) {
g_free(block_data);
@@ -4489,8 +4487,8 @@ pcapng_write_name_resolution_block(wtap_dumper *wdh, int *err)
block_off += namelen;
memset(block_data + block_off, 0, PADDING4(namelen));
block_off += PADDING4(namelen);
- ws_debug("%s: added IPv6 record for %s",
- G_STRFUNC, ipv6_hash_list_entry->name);
+ ws_debug("added IPv6 record for %s",
+ ipv6_hash_list_entry->name);
i++;
ipv6_hash_list_entry = (hashipv6_t *)g_list_nth_data(wdh->addrinfo_lists->ipv6_addr_list, i);
@@ -4517,8 +4515,8 @@ pcapng_write_name_resolution_block(wtap_dumper *wdh, int *err)
/* Copy the block trailer. */
memcpy(block_data + block_off, &bh.block_total_length, sizeof(bh.block_total_length));
- ws_debug("%s: Write bh.block_total_length bytes %d, block_off %u",
- G_STRFUNC, bh.block_total_length, block_off);
+ ws_debug("Write bh.block_total_length bytes %d, block_off %u",
+ bh.block_total_length, block_off);
if (!wtap_dump_file_write(wdh, block_data, bh.block_total_length, err)) {
g_free(block_data);
@@ -4618,7 +4616,7 @@ pcapng_write_interface_statistics_block(wtap_dumper *wdh, wtap_block_t if_stats,
struct pcapng_option_header option_hdr;
wtapng_if_stats_mandatory_t* mand_data = (wtapng_if_stats_mandatory_t*)wtap_block_get_mandatory_data(if_stats);
- ws_debug("%s", G_STRFUNC);
+ ws_debug("entering function");
/* Compute block size */
block_size.size = 0;
@@ -4632,7 +4630,7 @@ pcapng_write_interface_statistics_block(wtap_dumper *wdh, wtap_block_t if_stats,
/* write block header */
bh.block_type = BLOCK_TYPE_ISB;
bh.block_total_length = (guint32)(sizeof(bh) + sizeof(isb) + block_size.size + 4);
- ws_debug("%s: Total len %u", G_STRFUNC, bh.block_total_length);
+ ws_debug("Total len %u", bh.block_total_length);
if (!wtap_dump_file_write(wdh, &bh, sizeof bh, err))
return FALSE;
@@ -4883,8 +4881,7 @@ pcapng_write_if_descr_block(wtap_dumper *wdh, wtap_block_t int_data, int *err)
wtapng_if_descr_mandatory_t* mand_data = (wtapng_if_descr_mandatory_t*)wtap_block_get_mandatory_data(int_data);
int link_type;
- ws_debug("%s: encap = %d (%s), snaplen = %d",
- G_STRFUNC,
+ ws_debug("encap = %d (%s), snaplen = %d",
mand_data->wtap_encap,
wtap_encap_description(mand_data->wtap_encap),
mand_data->snap_len);
@@ -4909,7 +4906,7 @@ pcapng_write_if_descr_block(wtap_dumper *wdh, wtap_block_t int_data, int *err)
/* write block header */
bh.block_type = BLOCK_TYPE_IDB;
bh.block_total_length = (guint32)(sizeof(bh) + sizeof(idb) + block_size.size + 4);
- ws_debug("%s: Total len %u", G_STRFUNC, bh.block_total_length);
+ ws_debug("Total len %u", bh.block_total_length);
if (!wtap_dump_file_write(wdh, &bh, sizeof bh, err))
return FALSE;
@@ -4981,7 +4978,7 @@ static gboolean pcapng_dump(wtap_dumper *wdh,
* reading packet blocks. */
if (wdh->dsbs_growing) {
for (guint i = wdh->dsbs_growing_written; i < wdh->dsbs_growing->len; i++) {
- ws_debug("%s: writing DSB %u", G_STRFUNC, i);
+ ws_debug("writing DSB %u", i);
wtap_block_t dsb = g_array_index(wdh->dsbs_growing, wtap_block_t, i);
if (!pcapng_write_decryption_secrets_block(wdh, dsb, err)) {
return FALSE;
@@ -4991,7 +4988,7 @@ static gboolean pcapng_dump(wtap_dumper *wdh,
}
- ws_debug("%s: encap = %d (%s) rec type = %u", G_STRFUNC,
+ ws_debug("encap = %d (%s) rec type = %u",
rec->rec_header.packet_header.pkt_encap,
wtap_encap_description(rec->rec_header.packet_header.pkt_encap),
rec->rec_type);
@@ -5076,8 +5073,7 @@ static gboolean pcapng_dump_finish(wtap_dumper *wdh, int *err,
wtap_block_t if_stats;
if_stats = g_array_index(int_data_mand->interface_statistics, wtap_block_t, j);
- ws_debug("%s: write ISB for interface %u",
- G_STRFUNC,
+ ws_debug("write ISB for interface %u",
((wtapng_if_stats_mandatory_t*)wtap_block_get_mandatory_data(if_stats))->interface_id);
if (!pcapng_write_interface_statistics_block(wdh, if_stats, err)) {
return FALSE;
@@ -5085,7 +5081,7 @@ static gboolean pcapng_dump_finish(wtap_dumper *wdh, int *err,
}
}
- ws_debug("%s", G_STRFUNC);
+ ws_debug("leaving function");
return TRUE;
}
@@ -5097,7 +5093,7 @@ pcapng_dump_open(wtap_dumper *wdh, int *err, gchar **err_info _U_)
{
guint i;
- ws_debug("%s", G_STRFUNC);
+ ws_debug("entering function");
/* This is a pcapng file */
wdh->subtype_add_idb = pcapng_add_idb;
wdh->subtype_write = pcapng_dump;
@@ -5107,11 +5103,11 @@ pcapng_dump_open(wtap_dumper *wdh, int *err, gchar **err_info _U_)
if (!pcapng_write_section_header_block(wdh, err)) {
return FALSE;
}
- ws_debug("%s: wrote section header block.", G_STRFUNC);
+ ws_debug("wrote section header block.");
/* Write the Interface description blocks */
- ws_debug("%s: Number of IDBs to write (number of interfaces) %u",
- G_STRFUNC, wdh->interface_data->len);
+ ws_debug("Number of IDBs to write (number of interfaces) %u",
+ wdh->interface_data->len);
for (i = 0; i < wdh->interface_data->len; i++) {
@@ -5144,8 +5140,7 @@ pcapng_dump_open(wtap_dumper *wdh, int *err, gchar **err_info _U_)
an error indication otherwise. */
static int pcapng_dump_can_write_encap(int wtap_encap)
{
- ws_debug("%s: encap = %d (%s)",
- G_STRFUNC,
+ ws_debug("encap = %d (%s)",
wtap_encap,
wtap_encap_description(wtap_encap));