summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--asn1/nbap/nbap.cnf48
-rw-r--r--asn1/nbap/packet-nbap-template.c12
-rw-r--r--configure.ac1
-rw-r--r--doc/README.developer17
-rw-r--r--epan/dissectors/packet-icep.c66
-rw-r--r--epan/dissectors/packet-nbap.c74
-rw-r--r--epan/dissectors/packet-netflow.c18
-rw-r--r--tshark.c68
-rw-r--r--wiretap/ipfix.c34
-rw-r--r--wiretap/merge.c62
-rw-r--r--wiretap/pcapng.c328
12 files changed, 333 insertions, 396 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9450f67bf5..7b4f89a712 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -381,6 +381,7 @@ else()
set(WIRESHARK_EXTRA_COMPILER_COMMON_FLAGS
# The following are for C and C++
-Wpedantic
+ -Wno-variadic-macros
#
# Various code blocks this one.
#
diff --git a/asn1/nbap/nbap.cnf b/asn1/nbap/nbap.cnf
index 0edba8646d..f7b62c22c9 100644
--- a/asn1/nbap/nbap.cnf
+++ b/asn1/nbap/nbap.cnf
@@ -867,14 +867,14 @@ num_items = 1;
/* Set data for First or single channel */
umts_fp_conversation_info->fp_dch_channel_info[0].num_ul_chans = num_tf = nbap_dch_chnl_info[commontransportchannelid].num_ul_chans;
- nbap_debug2("Frame %%u PCH-ParametersItem-CTCH-SetupRqstFDD Start: num_tf %%u",
+ nbap_debug("Frame %%u PCH-ParametersItem-CTCH-SetupRqstFDD Start: num_tf %%u",
actx->pinfo->fd->num,
num_tf);
for (j = 0; j < num_tf; j++) {
umts_fp_conversation_info->fp_dch_channel_info[0].ul_chan_tf_size[j] = nbap_dch_chnl_info[commontransportchannelid].ul_chan_tf_size[j];
umts_fp_conversation_info->fp_dch_channel_info[0].ul_chan_num_tbs[j] = nbap_dch_chnl_info[commontransportchannelid].ul_chan_num_tbs[j];
- nbap_debug2(" UL tf %%u ul_chan_tf_size %%u",j, nbap_dch_chnl_info[commontransportchannelid].ul_chan_tf_size[j]);
+ nbap_debug(" UL tf %%u ul_chan_tf_size %%u",j, nbap_dch_chnl_info[commontransportchannelid].ul_chan_tf_size[j]);
}
/* Traffic flows per DCH(DL) */
@@ -882,13 +882,13 @@ num_items = 1;
for (j = 0; j < num_tf; j++) {
umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_tf_size[j] = nbap_dch_chnl_info[commontransportchannelid].dl_chan_tf_size[j];
umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_num_tbs[j] = nbap_dch_chnl_info[commontransportchannelid].dl_chan_num_tbs[j];
- nbap_debug2(" DL tf %%u ul_chan_tf_size %%u",j, nbap_dch_chnl_info[commontransportchannelid].dl_chan_tf_size[j]);
+ nbap_debug(" DL tf %%u ul_chan_tf_size %%u",j, nbap_dch_chnl_info[commontransportchannelid].dl_chan_tf_size[j]);
}
/* Set data for associated DCH's if we have any */
i = commontransportchannelid;
- nbap_debug2(" commontransportchannelid %%u next ch %%u",commontransportchannelid, nbap_dch_chnl_info[i].next_dch);
+ nbap_debug(" commontransportchannelid %%u next ch %%u",commontransportchannelid, nbap_dch_chnl_info[i].next_dch);
umts_fp_conversation_info->dchs_in_flow_list[0] = commontransportchannelid;
while(nbap_dch_chnl_info[i].next_dch != 0){
@@ -911,12 +911,12 @@ num_items = 1;
}
umts_fp_conversation_info->num_dch_in_flow++;
- nbap_debug1(" num_dch_in_flow %%u", umts_fp_conversation_info->num_dch_in_flow);
+ nbap_debug(" num_dch_in_flow %%u", umts_fp_conversation_info->num_dch_in_flow);
umts_fp_conversation_info->dchs_in_flow_list[umts_fp_conversation_info->num_dch_in_flow] = i;
set_umts_fp_conv_data(conversation, umts_fp_conversation_info);
- nbap_debug1("Frame %%u PCH-ParametersItem-CTCH-SetupRqstFDD End",
+ nbap_debug("Frame %%u PCH-ParametersItem-CTCH-SetupRqstFDD End",
actx->pinfo->fd->num);
}
@@ -1229,9 +1229,9 @@ dch_id = 0xFFFFFFFF;
set_umts_fp_conv_data(conversation, umts_fp_conversation_info);
}
- nbap_debug1("Frame %%u RL-Specific-DCH-Info-Item Start", actx->pinfo->fd->num);
- nbap_debug1(" Total no of ch in flow will be: %%d", umts_fp_conversation_info->num_dch_in_flow);
- nbap_debug1("Frame %%u RL-Specific-DCH-Info-Item End", actx->pinfo->fd->num);
+ nbap_debug("Frame %%u RL-Specific-DCH-Info-Item Start", actx->pinfo->fd->num);
+ nbap_debug(" Total no of ch in flow will be: %%d", umts_fp_conversation_info->num_dch_in_flow);
+ nbap_debug("Frame %%u RL-Specific-DCH-Info-Item End", actx->pinfo->fd->num);
}
@@ -1316,10 +1316,10 @@ BindingID_port = 0;
/*Ip address might be useful as well*/
nbap_edch_port_info->crnc_address = transportLayerAddress_ipv4;
- nbap_debug1("Frame %%u RL-Specific-E-DCH-Information-Item Start",
+ nbap_debug("Frame %%u RL-Specific-E-DCH-Information-Item Start",
actx->pinfo->fd->num);
- nbap_debug4(" g_tree_insert(edch_flow_port_map) com_context_id %%u e_dch_macdflow_id %%u IP %%s Port %%u",
+ nbap_debug(" g_tree_insert(edch_flow_port_map) com_context_id %%u e_dch_macdflow_id %%u IP %%s Port %%u",
umts_fp_conversation_info->com_context_id,
e_dch_macdflow_id,
address_to_str(wmem_packet_scope(), &dst_addr),
@@ -1328,7 +1328,7 @@ BindingID_port = 0;
g_tree_insert(edch_flow_port_map, GINT_TO_POINTER((gint)umts_fp_conversation_info->com_context_id), nbap_edch_port_info);
}else{
- nbap_debug4(" Insert in existing edch_flow_port_map com_context_id %%u e_dch_macdflow_id %%u IP %%s Port %%u",
+ nbap_debug(" Insert in existing edch_flow_port_map com_context_id %%u e_dch_macdflow_id %%u IP %%s Port %%u",
umts_fp_conversation_info->com_context_id,
e_dch_macdflow_id,
address_to_str(wmem_packet_scope(), &dst_addr),
@@ -1344,7 +1344,7 @@ BindingID_port = 0;
set_umts_fp_conv_data(conversation, umts_fp_conversation_info);
- nbap_debug1("Frame %%u RL-Specific-E-DCH-Information-Item End", actx->pinfo->fd->num);
+ nbap_debug("Frame %%u RL-Specific-E-DCH-Information-Item End", actx->pinfo->fd->num);
}
}
@@ -1430,12 +1430,12 @@ BindingID_port = 0;
0, NO_ADDR_B|NO_PORT_B);
if(old_conversation){
- nbap_debug3("Frame %%u E-DCH-FDD-Information-to-Modify: found old conv on IP %%s Port %%u",
+ nbap_debug("Frame %%u E-DCH-FDD-Information-to-Modify: found old conv on IP %%s Port %%u",
actx->pinfo->fd->num,
address_to_str(wmem_packet_scope(), &dst_addr),
BindingID_port);
}else{
- nbap_debug3("Frame %%u E-DCH-FDD-Information-to-Modify: Did not find old conv on IP %%s Port %%u",
+ nbap_debug("Frame %%u E-DCH-FDD-Information-to-Modify: Did not find old conv on IP %%s Port %%u",
actx->pinfo->fd->num,
address_to_str(wmem_packet_scope(), &dst_addr),
BindingID_port);
@@ -1505,7 +1505,7 @@ num_items = 1;
return offset;
}
- nbap_debug1("Frame %%u E-DCH-MACdFlow-Specific-InfoItem-to-Modify",
+ nbap_debug("Frame %%u E-DCH-MACdFlow-Specific-InfoItem-to-Modify",
actx->pinfo->fd->num);
/****** Look up old port and ip information since this is not included in this message ******/
@@ -1526,12 +1526,12 @@ num_items = 1;
expert_add_info(actx->pinfo, NULL, &ei_nbap_no_find_port_info);
return offset;
}
- nbap_debug1(" Found com_context_id %%u", com_context_id);
+ nbap_debug(" Found com_context_id %%u", com_context_id);
/*Set the appropriate port, cheat and use same variable.*/
BindingID_port = old_info->crnc_port[e_dch_macdflow_id];
- nbap_debug2(" Port %%u loaded from old_info->crnc_port[e_dch_macdflow_id %%u]",
+ nbap_debug(" Port %%u loaded from old_info->crnc_port[e_dch_macdflow_id %%u]",
BindingID_port,
e_dch_macdflow_id);
@@ -1778,7 +1778,7 @@ nbap_edch_channel_info[e_dch_macdflow_id].no_ddi_entries = num_items;
SET_ADDRESS(&null_addr, AT_NONE, 0, NULL);
for (i = 0; i < maxNrOfMACdFlows; i++) {
if (nbap_hsdsch_channel_info[i].crnc_port != 0){
- nbap_debug4("Frame %%u HSDSCH-MACdFlows-Information:hsdsch_macdflow_id %%u Look for conv on IP %%s Port %%u",
+ nbap_debug("Frame %%u HSDSCH-MACdFlows-Information:hsdsch_macdflow_id %%u Look for conv on IP %%s Port %%u",
actx->pinfo->fd->num,
i,
address_to_str (wmem_packet_scope(), &(nbap_hsdsch_channel_info[i].crnc_address)),
@@ -1790,7 +1790,7 @@ nbap_edch_channel_info[e_dch_macdflow_id].no_ddi_entries = num_items;
if (conversation == NULL) {
/* It's not part of any conversation - create a new one. */
- nbap_debug2("Frame %%u HSDSCH-MACdFlows-Information: Set up conv on Port %%u", actx->pinfo->fd->num, nbap_hsdsch_channel_info[i].crnc_port);
+ nbap_debug("Frame %%u HSDSCH-MACdFlows-Information: Set up conv on Port %%u", actx->pinfo->fd->num, nbap_hsdsch_channel_info[i].crnc_port);
conversation = conversation_new(actx->pinfo->fd->num, &(nbap_hsdsch_channel_info[i].crnc_address),
&null_addr, PT_UDP, nbap_hsdsch_channel_info[i].crnc_port,
0, NO_ADDR2|NO_PORT2);
@@ -1890,12 +1890,12 @@ nbap_edch_channel_info[e_dch_macdflow_id].no_ddi_entries = num_items;
/* Set port to zero use that as an indication of whether we have data or not */
SET_ADDRESS(&null_addr, AT_NONE, 0, NULL);
- nbap_debug1("Frame %%u HSDSCH-MACdFlows-Information Start",
+ nbap_debug("Frame %%u HSDSCH-MACdFlows-Information Start",
actx->pinfo->fd->num);
for (i = 0; i < maxNrOfMACdFlows; i++) {
if (nbap_hsdsch_channel_info[i].crnc_port != 0){
- nbap_debug3(" hsdsch_macdflow_id %%u Look for conv on IP %%s Port %%u",
+ nbap_debug(" hsdsch_macdflow_id %%u Look for conv on IP %%s Port %%u",
i,
address_to_str (wmem_packet_scope(), &(nbap_hsdsch_channel_info[i].crnc_address)),
nbap_hsdsch_channel_info[i].crnc_port);
@@ -1906,7 +1906,7 @@ nbap_edch_channel_info[e_dch_macdflow_id].no_ddi_entries = num_items;
if (conversation == NULL) {
/* It's not part of any conversation - create a new one. */
- nbap_debug1(" Set up conv on Port %%u", nbap_hsdsch_channel_info[i].crnc_port);
+ nbap_debug(" Set up conv on Port %%u", nbap_hsdsch_channel_info[i].crnc_port);
conversation = conversation_new(actx->pinfo->fd->num, &(nbap_hsdsch_channel_info[i].crnc_address),
&null_addr, PT_UDP, nbap_hsdsch_channel_info[i].crnc_port,
@@ -1958,7 +1958,7 @@ nbap_edch_channel_info[e_dch_macdflow_id].no_ddi_entries = num_items;
}
}
}
- nbap_debug1("Frame %%u HSDSCH-MACdFlows-Information End",
+ nbap_debug("Frame %%u HSDSCH-MACdFlows-Information End",
actx->pinfo->fd->num);
}
diff --git a/asn1/nbap/packet-nbap-template.c b/asn1/nbap/packet-nbap-template.c
index 8c34e80269..29ae5e718c 100644
--- a/asn1/nbap/packet-nbap-template.c
+++ b/asn1/nbap/packet-nbap-template.c
@@ -55,17 +55,9 @@
/* Debug */
#if 0
-#define nbap_debug0(str) g_warning(str)
-#define nbap_debug1(str,p1) g_warning(str,p1)
-#define nbap_debug2(str,p1,p2) g_warning(str,p1,p2)
-#define nbap_debug3(str,p1,p2,p3) g_warning(str,p1,p2,p3)
-#define nbap_debug4(str,p1,p2,p3,p4) g_warning(str,p1,p2,p3,p4)
+#define nbap_debug(...) g_warning(__VA_ARGS__)
#else
-#define nbap_debug0(str)
-#define nbap_debug1(str,p1)
-#define nbap_debug2(str,p1,p2)
-#define nbap_debug3(str,p1,p2,p3)
-#define nbap_debug4(str,p1,p2,p3,p4)
+#define nbap_debug(...)
#endif
void proto_register_nbap(void);
diff --git a/configure.ac b/configure.ac
index 81394ee505..92dc1329d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -871,6 +871,7 @@ AC_ARG_ENABLE(extra-compiler-warnings,
# The following are for C and C++
#
AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpedantic)
+ AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-variadic-macros)
#
# Various code blocks this one.
#
diff --git a/doc/README.developer b/doc/README.developer
index 4e9f33cdf6..30dc613b31 100644
--- a/doc/README.developer
+++ b/doc/README.developer
@@ -385,23 +385,6 @@ to implement it. Use something like
instead.
-Don't use "variadic macros", such as
-
- #define DBG(format, args...) fprintf(stderr, format, ## args)
-
-as not all C compilers support them. Use macros that take a fixed
-number of arguments, such as
-
- #define DBG0(format) fprintf(stderr, format)
- #define DBG1(format, arg1) fprintf(stderr, format, arg1)
- #define DBG2(format, arg1, arg2) fprintf(stderr, format, arg1, arg2)
-
- ...
-
-or something such as
-
- #define DBG(args) printf args
-
Don't use
case N ... M:
diff --git a/epan/dissectors/packet-icep.c b/epan/dissectors/packet-icep.c
index e89353bdc2..22c35b5141 100644
--- a/epan/dissectors/packet-icep.c
+++ b/epan/dissectors/packet-icep.c
@@ -47,19 +47,17 @@ void proto_register_icep(void);
void proto_reg_handoff_icep(void);
#if 0
-#define DBG(str, args...) do {\
+#define DBG(...) do {\
fprintf(stdout, \
"[%s][%s][%d]: ",\
__FILE__, \
__FUNCTION__, \
__LINE__); \
fflush(stdout); \
- fprintf(stdout, str, ## args); \
+ fprintf(stdout, __VA_ARGS__); \
} while (0)
#else
-#define DBG0(format)
-#define DBG1(format, arg1)
-#define DBG2(format, arg1, arg2)
+#define DBG(...)
#endif /* 0/1 */
/* fixed values taken from the standard */
@@ -219,7 +217,7 @@ static void dissect_ice_string(packet_info *pinfo, proto_tree *tree, proto_item
(*consumed) += 4;
}
- DBG1("string.Size --> %d\n", Size);
+ DBG("string.Size --> %d\n", Size);
/* check if the string exists */
if ( !tvb_bytes_exist(tvb, offset, Size) ) {
@@ -390,7 +388,7 @@ static void dissect_ice_context(packet_info *pinfo, proto_tree *tree, proto_item
(*consumed) += 4;
}
- DBG1("context.Size --> %d\n", Size);
+ DBG("context.Size --> %d\n", Size);
if ( Size > icep_max_ice_context_pairs ) {
@@ -421,7 +419,7 @@ static void dissect_ice_context(packet_info *pinfo, proto_tree *tree, proto_item
proto_item *ti;
proto_tree *context_tree;
- DBG1("looping through context dictionary, loop #%d\n", i);
+ DBG("looping through context dictionary, loop #%d\n", i);
context_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_icep_invocation_context, &ti, "Invocation Context");
dissect_ice_string(pinfo, context_tree, ti, hf_icep_invocation_key, tvb, offset, &consumed_key, &str_key);
@@ -485,7 +483,7 @@ static void dissect_ice_params(packet_info *pinfo, proto_tree *tree, proto_item
/* get the size */
size = tvb_get_letohl(tvb, offset);
- DBG1("params.size --> %d\n", size);
+ DBG("params.size --> %d\n", size);
if ( size < ICEP_MIN_PARAMS_SIZE ) {
@@ -585,7 +583,7 @@ static void dissect_icep_request_common(tvbuff_t *tvb, guint32 offset,
if ( consumed == -1 )
goto error;
- offset += consumed; DBG1("consumed --> %d\n", consumed);
+ offset += consumed; DBG("consumed --> %d\n", consumed);
(*total_consumed) += consumed;
@@ -594,7 +592,7 @@ static void dissect_icep_request_common(tvbuff_t *tvb, guint32 offset,
if ( consumed == -1 )
goto error;
- offset += consumed; DBG1("consumed --> %d\n", consumed);
+ offset += consumed; DBG("consumed --> %d\n", consumed);
(*total_consumed) += consumed;
@@ -608,7 +606,7 @@ static void dissect_icep_request_common(tvbuff_t *tvb, guint32 offset,
if ( consumed == -1 )
goto error;
- offset += consumed; DBG1("consumed --> %d\n", consumed);
+ offset += consumed; DBG("consumed --> %d\n", consumed);
(*total_consumed) += consumed;
/* "operation" is an ice_string
@@ -620,11 +618,11 @@ static void dissect_icep_request_common(tvbuff_t *tvb, guint32 offset,
if ( consumed == -1 )
goto error;
else {
- offset += consumed; DBG1("consumed --> %d\n", consumed);
+ offset += consumed; DBG("consumed --> %d\n", consumed);
(*total_consumed) += consumed;
if ( opstr && namestr ) {
- DBG2("operation --> %s.%s()\n", namestr, opstr);
+ DBG("operation --> %s.%s()\n", namestr, opstr);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s.%s()",
namestr, opstr);
opstr = NULL;
@@ -643,7 +641,7 @@ static void dissect_icep_request_common(tvbuff_t *tvb, guint32 offset,
proto_tree_add_item(icep_sub_tree, hf_icep_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
- offset++; DBG0("consumed --> 1\n");
+ offset++; DBG("consumed --> 1\n");
(*total_consumed)++;
@@ -656,7 +654,7 @@ static void dissect_icep_request_common(tvbuff_t *tvb, guint32 offset,
if ( consumed == -1 )
goto error;
- offset += consumed; DBG1("consumed --> %d\n", consumed);
+ offset += consumed; DBG("consumed --> %d\n", consumed);
(*total_consumed) += consumed;
/* "params" is a Encapsulation
@@ -669,7 +667,7 @@ static void dissect_icep_request_common(tvbuff_t *tvb, guint32 offset,
goto error;
/*offset += consumed;*/
- DBG1("consumed --> %d\n", consumed);
+ DBG("consumed --> %d\n", consumed);
(*total_consumed) += consumed;
return;
@@ -700,7 +698,7 @@ static void dissect_icep_request(tvbuff_t *tvb, guint32 offset,
gint32 consumed = 0;
guint32 reqid = 0;
- DBG0("dissect request\n");
+ DBG("dissect request\n");
/* check for req id */
if ( !tvb_bytes_exist(tvb, offset, 4) ) {
@@ -727,7 +725,7 @@ static void dissect_icep_request(tvbuff_t *tvb, guint32 offset,
offset += 4;
- DBG0("consumed --> 4\n");
+ DBG("consumed --> 4\n");
dissect_icep_request_common(tvb, offset, pinfo, icep_sub_tree, ti, &consumed);
@@ -735,7 +733,7 @@ static void dissect_icep_request(tvbuff_t *tvb, guint32 offset,
return;
/*offset += consumed;*/
- DBG1("consumed --> %d\n", consumed);
+ DBG("consumed --> %d\n", consumed);
}
@@ -768,7 +766,7 @@ static void dissect_icep_batch_request(tvbuff_t *tvb, guint32 offset,
guint32 i = 0;
gint32 consumed = 0;
- DBG0("dissect batch request\n");
+ DBG("dissect batch request\n");
/* check for first 4 byte */
if ( !tvb_bytes_exist(tvb, offset, 4) ) {
@@ -781,7 +779,7 @@ static void dissect_icep_batch_request(tvbuff_t *tvb, guint32 offset,
num_reqs = tvb_get_letohl(tvb, offset);
offset += 4;
- DBG1("batch_requests.count --> %d\n", num_reqs);
+ DBG("batch_requests.count --> %d\n", num_reqs);
if ( num_reqs > icep_max_batch_requests ) {
@@ -808,7 +806,7 @@ static void dissect_icep_batch_request(tvbuff_t *tvb, guint32 offset,
for ( i = 0; i < num_reqs; i++ ) {
- DBG1("looping through sequence of batch requests, loop #%d\n", i);
+ DBG("looping through sequence of batch requests, loop #%d\n", i);
/* create display subtree for this message type */
@@ -828,7 +826,7 @@ static void dissect_icep_batch_request(tvbuff_t *tvb, guint32 offset,
proto_item_set_len(ti, consumed);
offset += consumed;
- DBG1("consumed --> %d\n", consumed);
+ DBG("consumed --> %d\n", consumed);
}
}
@@ -850,7 +848,7 @@ static void dissect_icep_reply(tvbuff_t *tvb, guint32 offset,
proto_item *ti = NULL;
proto_tree *icep_sub_tree = NULL;
- DBG0("dissect reply\n");
+ DBG("dissect reply\n");
/* get at least a full reply message header */
@@ -884,7 +882,7 @@ static void dissect_icep_reply(tvbuff_t *tvb, guint32 offset,
offset++;
- DBG1("consumed --> %d\n", 5);
+ DBG("consumed --> %d\n", 5);
/* check if I got all reply data */
tvb_data_remained = tvb_reported_length_remaining(tvb, offset);
@@ -901,7 +899,7 @@ static void dissect_icep_reply(tvbuff_t *tvb, guint32 offset,
reported_reply_data - tvb_data_remained);
/*offset += tvb_data_remained;*/
- DBG1("consumed --> %d\n", tvb_data_remained);
+ DBG("consumed --> %d\n", tvb_data_remained);
return;
}
@@ -910,7 +908,7 @@ static void dissect_icep_reply(tvbuff_t *tvb, guint32 offset,
proto_tree_add_item(icep_sub_tree, hf_icep_reply_data, tvb, offset, reported_reply_data, ENC_NA);
/*offset += reported_reply_data;*/
- DBG1("consumed --> %d\n", reported_reply_data);
+ DBG("consumed --> %d\n", reported_reply_data);
}
static guint get_icep_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
@@ -948,7 +946,7 @@ static int dissect_icep_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
icep_msgtype_vals,
"Unknown Message Type: 0x%02x"));
- DBG0("got an icep msg, start analysis\n");
+ DBG("got an icep msg, start analysis\n");
/* create display subtree for the protocol */
@@ -996,17 +994,17 @@ static int dissect_icep_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
switch(tvb_get_guint8(tvb, 8)) {
case 0x0:
- DBG1("request message body: parsing %d bytes\n",
+ DBG("request message body: parsing %d bytes\n",
tvb_captured_length_remaining(tvb, offset));
dissect_icep_request(tvb, offset, pinfo, icep_tree, ti);
break;
case 0x1:
- DBG1("batch request message body: parsing %d bytes\n",
+ DBG("batch request message body: parsing %d bytes\n",
tvb_captured_length_remaining(tvb, offset));
dissect_icep_batch_request(tvb, offset, pinfo, icep_tree, ti);
break;
case 0x2:
- DBG1("reply message body: parsing %d bytes\n",
+ DBG("reply message body: parsing %d bytes\n",
tvb_captured_length_remaining(tvb, offset));
dissect_icep_reply(tvb, offset, pinfo, icep_tree, ti);
break;
@@ -1024,7 +1022,7 @@ static int dissect_icep_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* entry point */
static gboolean dissect_icep_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- DBG0("triggered\n");
+ DBG("triggered\n");
if ( tvb_memeql(tvb, 0, icep_magic, 4) == -1 ) {
/* Not a ICEP packet. */
@@ -1041,7 +1039,7 @@ static gboolean dissect_icep_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
static gboolean dissect_icep_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- DBG0("triggered\n");
+ DBG("triggered\n");
if ( tvb_memeql(tvb, 0, icep_magic, 4) == -1 ) {
/* Not a ICEP packet. */
diff --git a/epan/dissectors/packet-nbap.c b/epan/dissectors/packet-nbap.c
index 0b9e78039d..5055a53b5d 100644
--- a/epan/dissectors/packet-nbap.c
+++ b/epan/dissectors/packet-nbap.c
@@ -63,17 +63,9 @@
/* Debug */
#if 0
-#define nbap_debug0(str) g_warning(str)
-#define nbap_debug1(str,p1) g_warning(str,p1)
-#define nbap_debug2(str,p1,p2) g_warning(str,p1,p2)
-#define nbap_debug3(str,p1,p2,p3) g_warning(str,p1,p2,p3)
-#define nbap_debug4(str,p1,p2,p3,p4) g_warning(str,p1,p2,p3,p4)
+#define nbap_debug(...) g_warning(__VA_ARGS__)
#else
-#define nbap_debug0(str)
-#define nbap_debug1(str,p1)
-#define nbap_debug2(str,p1,p2)
-#define nbap_debug3(str,p1,p2,p3)
-#define nbap_debug4(str,p1,p2,p3,p4)
+#define nbap_debug(...)
#endif
void proto_register_nbap(void);
@@ -1544,7 +1536,7 @@ typedef enum _ProtocolIE_ID_enum {
} ProtocolIE_ID_enum;
/*--- End of included file: packet-nbap-val.h ---*/
-#line 82 "../../asn1/nbap/packet-nbap-template.c"
+#line 74 "../../asn1/nbap/packet-nbap-template.c"
/* Initialize the protocol and registered fields */
static int proto_nbap = -1;
@@ -4848,7 +4840,7 @@ static int hf_nbap_RACH_SubChannelNumbers_subCh1 = -1;
static int hf_nbap_RACH_SubChannelNumbers_subCh0 = -1;
/*--- End of included file: packet-nbap-hf.c ---*/
-#line 90 "../../asn1/nbap/packet-nbap-template.c"
+#line 82 "../../asn1/nbap/packet-nbap-template.c"
/* Initialize the subtree pointers */
static int ett_nbap = -1;
@@ -6487,7 +6479,7 @@ static gint ett_nbap_UnsuccessfulOutcome = -1;
static gint ett_nbap_Outcome = -1;
/*--- End of included file: packet-nbap-ett.c ---*/
-#line 98 "../../asn1/nbap/packet-nbap-template.c"
+#line 90 "../../asn1/nbap/packet-nbap-template.c"
static expert_field ei_nbap_no_find_comm_context_id = EI_INIT;
static expert_field ei_nbap_no_find_port_info = EI_INIT;
@@ -18494,7 +18486,7 @@ num_items = 1;
return offset;
}
- nbap_debug1("Frame %u E-DCH-MACdFlow-Specific-InfoItem-to-Modify",
+ nbap_debug("Frame %u E-DCH-MACdFlow-Specific-InfoItem-to-Modify",
actx->pinfo->fd->num);
/****** Look up old port and ip information since this is not included in this message ******/
@@ -18515,12 +18507,12 @@ num_items = 1;
expert_add_info(actx->pinfo, NULL, &ei_nbap_no_find_port_info);
return offset;
}
- nbap_debug1(" Found com_context_id %u", com_context_id);
+ nbap_debug(" Found com_context_id %u", com_context_id);
/*Set the appropriate port, cheat and use same variable.*/
BindingID_port = old_info->crnc_port[e_dch_macdflow_id];
- nbap_debug2(" Port %u loaded from old_info->crnc_port[e_dch_macdflow_id %u]",
+ nbap_debug(" Port %u loaded from old_info->crnc_port[e_dch_macdflow_id %u]",
BindingID_port,
e_dch_macdflow_id);
@@ -18649,12 +18641,12 @@ BindingID_port = 0;
0, NO_ADDR_B|NO_PORT_B);
if(old_conversation){
- nbap_debug3("Frame %u E-DCH-FDD-Information-to-Modify: found old conv on IP %s Port %u",
+ nbap_debug("Frame %u E-DCH-FDD-Information-to-Modify: found old conv on IP %s Port %u",
actx->pinfo->fd->num,
address_to_str(wmem_packet_scope(), &dst_addr),
BindingID_port);
}else{
- nbap_debug3("Frame %u E-DCH-FDD-Information-to-Modify: Did not find old conv on IP %s Port %u",
+ nbap_debug("Frame %u E-DCH-FDD-Information-to-Modify: Did not find old conv on IP %s Port %u",
actx->pinfo->fd->num,
address_to_str(wmem_packet_scope(), &dst_addr),
BindingID_port);
@@ -23793,7 +23785,7 @@ dissect_nbap_HSDSCH_FDD_Information(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_
SET_ADDRESS(&null_addr, AT_NONE, 0, NULL);
for (i = 0; i < maxNrOfMACdFlows; i++) {
if (nbap_hsdsch_channel_info[i].crnc_port != 0){
- nbap_debug4("Frame %u HSDSCH-MACdFlows-Information:hsdsch_macdflow_id %u Look for conv on IP %s Port %u",
+ nbap_debug("Frame %u HSDSCH-MACdFlows-Information:hsdsch_macdflow_id %u Look for conv on IP %s Port %u",
actx->pinfo->fd->num,
i,
address_to_str (wmem_packet_scope(), &(nbap_hsdsch_channel_info[i].crnc_address)),
@@ -23805,7 +23797,7 @@ dissect_nbap_HSDSCH_FDD_Information(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_
if (conversation == NULL) {
/* It's not part of any conversation - create a new one. */
- nbap_debug2("Frame %u HSDSCH-MACdFlows-Information: Set up conv on Port %u", actx->pinfo->fd->num, nbap_hsdsch_channel_info[i].crnc_port);
+ nbap_debug("Frame %u HSDSCH-MACdFlows-Information: Set up conv on Port %u", actx->pinfo->fd->num, nbap_hsdsch_channel_info[i].crnc_port);
conversation = conversation_new(actx->pinfo->fd->num, &(nbap_hsdsch_channel_info[i].crnc_address),
&null_addr, PT_UDP, nbap_hsdsch_channel_info[i].crnc_port,
0, NO_ADDR2|NO_PORT2);
@@ -24126,12 +24118,12 @@ dissect_nbap_HSDSCH_Information_to_Modify(tvbuff_t *tvb _U_, int offset _U_, asn
/* Set port to zero use that as an indication of whether we have data or not */
SET_ADDRESS(&null_addr, AT_NONE, 0, NULL);
- nbap_debug1("Frame %u HSDSCH-MACdFlows-Information Start",
+ nbap_debug("Frame %u HSDSCH-MACdFlows-Information Start",
actx->pinfo->fd->num);
for (i = 0; i < maxNrOfMACdFlows; i++) {
if (nbap_hsdsch_channel_info[i].crnc_port != 0){
- nbap_debug3(" hsdsch_macdflow_id %u Look for conv on IP %s Port %u",
+ nbap_debug(" hsdsch_macdflow_id %u Look for conv on IP %s Port %u",
i,
address_to_str (wmem_packet_scope(), &(nbap_hsdsch_channel_info[i].crnc_address)),
nbap_hsdsch_channel_info[i].crnc_port);
@@ -24142,7 +24134,7 @@ dissect_nbap_HSDSCH_Information_to_Modify(tvbuff_t *tvb _U_, int offset _U_, asn
if (conversation == NULL) {
/* It's not part of any conversation - create a new one. */
- nbap_debug1(" Set up conv on Port %u", nbap_hsdsch_channel_info[i].crnc_port);
+ nbap_debug(" Set up conv on Port %u", nbap_hsdsch_channel_info[i].crnc_port);
conversation = conversation_new(actx->pinfo->fd->num, &(nbap_hsdsch_channel_info[i].crnc_address),
&null_addr, PT_UDP, nbap_hsdsch_channel_info[i].crnc_port,
@@ -24194,7 +24186,7 @@ dissect_nbap_HSDSCH_Information_to_Modify(tvbuff_t *tvb _U_, int offset _U_, asn
}
}
}
- nbap_debug1("Frame %u HSDSCH-MACdFlows-Information End",
+ nbap_debug("Frame %u HSDSCH-MACdFlows-Information End",
actx->pinfo->fd->num);
}
@@ -28746,9 +28738,9 @@ dch_id = 0xFFFFFFFF;
set_umts_fp_conv_data(conversation, umts_fp_conversation_info);
}
- nbap_debug1("Frame %u RL-Specific-DCH-Info-Item Start", actx->pinfo->fd->num);
- nbap_debug1(" Total no of ch in flow will be: %d", umts_fp_conversation_info->num_dch_in_flow);
- nbap_debug1("Frame %u RL-Specific-DCH-Info-Item End", actx->pinfo->fd->num);
+ nbap_debug("Frame %u RL-Specific-DCH-Info-Item Start", actx->pinfo->fd->num);
+ nbap_debug(" Total no of ch in flow will be: %d", umts_fp_conversation_info->num_dch_in_flow);
+ nbap_debug("Frame %u RL-Specific-DCH-Info-Item End", actx->pinfo->fd->num);
}
@@ -28863,10 +28855,10 @@ BindingID_port = 0;
/*Ip address might be useful as well*/
nbap_edch_port_info->crnc_address = transportLayerAddress_ipv4;
- nbap_debug1("Frame %u RL-Specific-E-DCH-Information-Item Start",
+ nbap_debug("Frame %u RL-Specific-E-DCH-Information-Item Start",
actx->pinfo->fd->num);
- nbap_debug4(" g_tree_insert(edch_flow_port_map) com_context_id %u e_dch_macdflow_id %u IP %s Port %u",
+ nbap_debug(" g_tree_insert(edch_flow_port_map) com_context_id %u e_dch_macdflow_id %u IP %s Port %u",
umts_fp_conversation_info->com_context_id,
e_dch_macdflow_id,
address_to_str(wmem_packet_scope(), &dst_addr),
@@ -28875,7 +28867,7 @@ BindingID_port = 0;
g_tree_insert(edch_flow_port_map, GINT_TO_POINTER((gint)umts_fp_conversation_info->com_context_id), nbap_edch_port_info);
}else{
- nbap_debug4(" Insert in existing edch_flow_port_map com_context_id %u e_dch_macdflow_id %u IP %s Port %u",
+ nbap_debug(" Insert in existing edch_flow_port_map com_context_id %u e_dch_macdflow_id %u IP %s Port %u",
umts_fp_conversation_info->com_context_id,
e_dch_macdflow_id,
address_to_str(wmem_packet_scope(), &dst_addr),
@@ -28891,7 +28883,7 @@ BindingID_port = 0;
set_umts_fp_conv_data(conversation, umts_fp_conversation_info);
- nbap_debug1("Frame %u RL-Specific-E-DCH-Information-Item End", actx->pinfo->fd->num);
+ nbap_debug("Frame %u RL-Specific-E-DCH-Information-Item End", actx->pinfo->fd->num);
}
}
@@ -32568,14 +32560,14 @@ num_items = 1;
/* Set data for First or single channel */
umts_fp_conversation_info->fp_dch_channel_info[0].num_ul_chans = num_tf = nbap_dch_chnl_info[commontransportchannelid].num_ul_chans;
- nbap_debug2("Frame %u PCH-ParametersItem-CTCH-SetupRqstFDD Start: num_tf %u",
+ nbap_debug("Frame %u PCH-ParametersItem-CTCH-SetupRqstFDD Start: num_tf %u",
actx->pinfo->fd->num,
num_tf);
for (j = 0; j < num_tf; j++) {
umts_fp_conversation_info->fp_dch_channel_info[0].ul_chan_tf_size[j] = nbap_dch_chnl_info[commontransportchannelid].ul_chan_tf_size[j];
umts_fp_conversation_info->fp_dch_channel_info[0].ul_chan_num_tbs[j] = nbap_dch_chnl_info[commontransportchannelid].ul_chan_num_tbs[j];
- nbap_debug2(" UL tf %u ul_chan_tf_size %u",j, nbap_dch_chnl_info[commontransportchannelid].ul_chan_tf_size[j]);
+ nbap_debug(" UL tf %u ul_chan_tf_size %u",j, nbap_dch_chnl_info[commontransportchannelid].ul_chan_tf_size[j]);
}
/* Traffic flows per DCH(DL) */
@@ -32583,13 +32575,13 @@ num_items = 1;
for (j = 0; j < num_tf; j++) {
umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_tf_size[j] = nbap_dch_chnl_info[commontransportchannelid].dl_chan_tf_size[j];
umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_num_tbs[j] = nbap_dch_chnl_info[commontransportchannelid].dl_chan_num_tbs[j];
- nbap_debug2(" DL tf %u ul_chan_tf_size %u",j, nbap_dch_chnl_info[commontransportchannelid].dl_chan_tf_size[j]);
+ nbap_debug(" DL tf %u ul_chan_tf_size %u",j, nbap_dch_chnl_info[commontransportchannelid].dl_chan_tf_size[j]);
}
/* Set data for associated DCH's if we have any */
i = commontransportchannelid;
- nbap_debug2(" commontransportchannelid %u next ch %u",commontransportchannelid, nbap_dch_chnl_info[i].next_dch);
+ nbap_debug(" commontransportchannelid %u next ch %u",commontransportchannelid, nbap_dch_chnl_info[i].next_dch);
umts_fp_conversation_info->dchs_in_flow_list[0] = commontransportchannelid;
while(nbap_dch_chnl_info[i].next_dch != 0){
@@ -32612,12 +32604,12 @@ num_items = 1;
}
umts_fp_conversation_info->num_dch_in_flow++;
- nbap_debug1(" num_dch_in_flow %u", umts_fp_conversation_info->num_dch_in_flow);
+ nbap_debug(" num_dch_in_flow %u", umts_fp_conversation_info->num_dch_in_flow);
umts_fp_conversation_info->dchs_in_flow_list[umts_fp_conversation_info->num_dch_in_flow] = i;
set_umts_fp_conv_data(conversation, umts_fp_conversation_info);
- nbap_debug1("Frame %u PCH-ParametersItem-CTCH-SetupRqstFDD End",
+ nbap_debug("Frame %u PCH-ParametersItem-CTCH-SetupRqstFDD End",
actx->pinfo->fd->num);
}
@@ -55167,7 +55159,7 @@ static int dissect_NULL_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tre
/*--- End of included file: packet-nbap-fn.c ---*/
-#line 320 "../../asn1/nbap/packet-nbap-template.c"
+#line 312 "../../asn1/nbap/packet-nbap-template.c"
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
@@ -68501,7 +68493,7 @@ void proto_register_nbap(void)
NULL, HFILL }},
/*--- End of included file: packet-nbap-hfarr.c ---*/
-#line 489 "../../asn1/nbap/packet-nbap-template.c"
+#line 481 "../../asn1/nbap/packet-nbap-template.c"
};
/* List of subtrees */
@@ -70141,7 +70133,7 @@ void proto_register_nbap(void)
&ett_nbap_Outcome,
/*--- End of included file: packet-nbap-ettarr.c ---*/
-#line 498 "../../asn1/nbap/packet-nbap-template.c"
+#line 490 "../../asn1/nbap/packet-nbap-template.c"
};
static ei_register_info ei[] = {
@@ -71296,7 +71288,7 @@ proto_reg_handoff_nbap(void)
/*--- End of included file: packet-nbap-dis-tab.c ---*/
-#line 556 "../../asn1/nbap/packet-nbap-template.c"
+#line 548 "../../asn1/nbap/packet-nbap-template.c"
}
diff --git a/epan/dissectors/packet-netflow.c b/epan/dissectors/packet-netflow.c
index 89bb7d925e..1797951f04 100644
--- a/epan/dissectors/packet-netflow.c
+++ b/epan/dissectors/packet-netflow.c
@@ -141,15 +141,9 @@ void proto_register_netflow(void);
void proto_reg_handoff_netflow(void);
#if 0
-#define ipfix_debug0(str) g_warning(str)
-#define ipfix_debug1(str,p1) g_warning(str,p1)
-#define ipfix_debug2(str,p1,p2) g_warning(str,p1,p2)
-#define ipfix_debug3(str,p1,p2,p3) g_warning(str,p1,p2,p3)
+#define ipfix_debug(...) g_warning(__VA_ARGS__)
#else
-#define ipfix_debug0(str)
-#define ipfix_debug1(str,p1)
-#define ipfix_debug2(str,p1,p2)
-#define ipfix_debug3(str,p1,p2,p3)
+#define ipfix_debug(...)
#endif
@@ -2313,11 +2307,11 @@ dissect_netflow(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
dissect_pdu_t *pduptr;
guint32 flows_seen = 0;
- ipfix_debug0("dissect_netflow: start");
+ ipfix_debug("dissect_netflow: start");
ver = tvb_get_ntohs(tvb, offset);
- ipfix_debug1("dissect_netflow: found version %d", ver);
+ ipfix_debug("dissect_netflow: found version %d", ver);
switch (ver) {
case 1:
@@ -2351,13 +2345,13 @@ dissect_netflow(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
col_set_str(pinfo->cinfo, COL_PROTOCOL, "CFLOW");
col_clear(pinfo->cinfo, COL_INFO);
- ipfix_debug0("dissect_netflow: column cleared");
+ ipfix_debug("dissect_netflow: column cleared");
if (tree) {
ti = proto_tree_add_item(tree, proto_netflow, tvb, offset, -1, ENC_NA);
netflow_tree = proto_item_add_subtree(ti, ett_netflow);
}
- ipfix_debug0("dissect_netflow: tree added");
+ ipfix_debug("dissect_netflow: tree added");
hdrinfo.vspec = ver;
hdrinfo.src_id = 0;
diff --git a/tshark.c b/tshark.c
index 4c4c800fd5..bdab5811ca 100644
--- a/tshark.c
+++ b/tshark.c
@@ -136,15 +136,9 @@
#if 0
-#define tshark_debug0(str) g_warning(str)
-#define tshark_debug1(str,p1) g_warning(str,p1)
-#define tshark_debug2(str,p1,p2) g_warning(str,p1,p2)
-#define tshark_debug3(str,p1,p2,p3) g_warning(str,p1,p2,p3)
+#define tshark_debug(...) g_warning(__VA_ARGS__)
#else
-#define tshark_debug0(str)
-#define tshark_debug1(str,p1)
-#define tshark_debug2(str,p1,p2)
-#define tshark_debug3(str,p1,p2,p3)
+#define tshark_debug(...)
#endif
@@ -1051,7 +1045,7 @@ DIAG_ON(cast-qual)
static const char optstring[] = OPTSTRING;
- tshark_debug1("tshark started with %d args", argc);
+ tshark_debug("tshark started with %d args", argc);
/* Set the C-language locale to the native environment. */
setlocale(LC_ALL, "");
@@ -1309,7 +1303,7 @@ DIAG_ON(cast-qual)
return 0;
}
- tshark_debug0("tshark reading preferences");
+ tshark_debug("tshark reading preferences");
prefs_p = read_prefs(&gpf_open_errno, &gpf_read_errno, &gpf_path,
&pf_open_errno, &pf_read_errno, &pf_path);
@@ -2112,7 +2106,7 @@ DIAG_ON(cast-qual)
#endif
if (rfilter != NULL) {
- tshark_debug1("Compiling read filter: '%s'", rfilter);
+ tshark_debug("Compiling read filter: '%s'", rfilter);
if (!dfilter_compile(rfilter, &rfcode, &err_msg)) {
cmdarg_err("%s", err_msg);
g_free(err_msg);
@@ -2138,7 +2132,7 @@ DIAG_ON(cast-qual)
cfile.rfcode = rfcode;
if (dfilter != NULL) {
- tshark_debug1("Compiling display filter: '%s'", dfilter);
+ tshark_debug("Compiling display filter: '%s'", dfilter);
if (!dfilter_compile(dfilter, &dfcode, &err_msg)) {
cmdarg_err("%s", err_msg);
g_free(err_msg);
@@ -2193,10 +2187,10 @@ DIAG_ON(cast-qual)
we're using any taps that need dissection. */
do_dissection = print_packet_info || rfcode || dfcode || tap_listeners_require_dissection();
- tshark_debug1("tshark: do_dissection = %s", do_dissection ? "TRUE" : "FALSE");
+ tshark_debug("tshark: do_dissection = %s", do_dissection ? "TRUE" : "FALSE");
if (cf_name) {
- tshark_debug1("tshark: Opening capture file: %s", cf_name);
+ tshark_debug("tshark: Opening capture file: %s", cf_name);
/*
* We're reading a capture file.
*/
@@ -2206,7 +2200,7 @@ DIAG_ON(cast-qual)
}
/* Process the packets in the file */
- tshark_debug0("tshark: invoking load_cap_file() to process the packets");
+ tshark_debug("tshark: invoking load_cap_file() to process the packets");
TRY {
#ifdef HAVE_LIBPCAP
err = load_cap_file(&cfile, global_capture_opts.save_file, out_file_type, out_file_name_res,
@@ -2233,7 +2227,7 @@ DIAG_ON(cast-qual)
exit_status = 2;
}
} else {
- tshark_debug0("tshark: no capture file specified");
+ tshark_debug("tshark: no capture file specified");
/* No capture file specified, so we're supposed to do a live capture
or get a list of link-layer types for a live capture device;
do we have support for live captures? */
@@ -2316,7 +2310,7 @@ DIAG_ON(cast-qual)
}
}
- tshark_debug0("tshark: performing live capture");
+ tshark_debug("tshark: performing live capture");
/*
* XXX - this returns FALSE if an error occurred, but it also
* returns FALSE if the capture stops because a time limit
@@ -3200,7 +3194,7 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
/* Snapshot length of input file not known. */
snapshot_length = WTAP_MAX_PACKET_SIZE;
}
- tshark_debug1("tshark: snapshot_length = %d", snapshot_length);
+ tshark_debug("tshark: snapshot_length = %d", snapshot_length);
shb_hdr = wtap_file_get_shb_for_new_file(cf->wth);
nrb_hdr = wtap_file_get_nrb_for_new_file(cf->wth);
@@ -3213,12 +3207,12 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
if (linktype != WTAP_ENCAP_PER_PACKET &&
out_file_type == WTAP_FILE_TYPE_SUBTYPE_PCAP) {
- tshark_debug1("tshark: writing PCAP format to %s", save_file);
+ tshark_debug("tshark: writing PCAP format to %s", save_file);
pdh = wtap_dump_open(save_file, out_file_type, linktype,
snapshot_length, FALSE /* compressed */, &err);
}
else {
- tshark_debug2("tshark: writing format type %d, to %s", out_file_type, save_file);
+ tshark_debug("tshark: writing format type %d, to %s", out_file_type, save_file);
pdh = wtap_dump_open_ng(save_file, out_file_type, linktype,
snapshot_length, FALSE /* compressed */, shb_hdr, idb_inf, nrb_hdr, &err);
}
@@ -3279,7 +3273,7 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
if (perform_two_pass_analysis) {
frame_data *fdata;
- tshark_debug1("tshark: perform_two_pass_analysis, do_dissection=%s", do_dissection ? "TRUE" : "FALSE");
+ tshark_debug("tshark: perform_two_pass_analysis, do_dissection=%s", do_dissection ? "TRUE" : "FALSE");
/* Allocate a frame_data_sequence for all the frames. */
cf->frames = new_frame_data_sequence();
@@ -3292,14 +3286,14 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
if (cf->rfcode || cf->dfcode)
create_proto_tree = TRUE;
- tshark_debug1("tshark: create_proto_tree = %s", create_proto_tree ? "TRUE" : "FALSE");
+ tshark_debug("tshark: create_proto_tree = %s", create_proto_tree ? "TRUE" : "FALSE");
/* We're not going to display the protocol tree on this pass,
so it's not going to be "visible". */
edt = epan_dissect_new(cf->epan, create_proto_tree, FALSE);
}
- tshark_debug0("tshark: reading records for first pass");
+ tshark_debug("tshark: reading records for first pass");
while (wtap_read(cf->wth, &err, &err_info, &data_offset)) {
if (process_packet_first_pass(cf, edt, data_offset, wtap_phdr(cf->wth),
wtap_buf_ptr(cf->wth))) {
@@ -3309,7 +3303,7 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
* (unless we roll over max_packet_count ?)
*/
if ( (--max_packet_count == 0) || (max_byte_count != 0 && data_offset >= max_byte_count)) {
- tshark_debug3("tshark: max_packet_count (%d) or max_byte_count (%" G_GINT64_MODIFIER "d/%" G_GINT64_MODIFIER "d) reached",
+ tshark_debug("tshark: max_packet_count (%d) or max_byte_count (%" G_GINT64_MODIFIER "d/%" G_GINT64_MODIFIER "d) reached",
max_packet_count, data_offset, max_byte_count);
err = 0; /* This is not an error */
break;
@@ -3333,7 +3327,7 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
prev_cap = NULL;
ws_buffer_init(&buf, 1500);
- tshark_debug0("tshark: done with first pass");
+ tshark_debug("tshark: done with first pass");
if (do_dissection) {
gboolean create_proto_tree;
@@ -3344,7 +3338,7 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
else
create_proto_tree = FALSE;
- tshark_debug1("tshark: create_proto_tree = %s", create_proto_tree ? "TRUE" : "FALSE");
+ tshark_debug("tshark: create_proto_tree = %s", create_proto_tree ? "TRUE" : "FALSE");
/* The protocol tree will be "visible", i.e., printed, only if we're
printing packet details, which is true if we're printing stuff
@@ -3357,17 +3351,17 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
fdata = frame_data_sequence_find(cf->frames, framenum);
if (wtap_seek_read(cf->wth, fdata->file_off, &phdr, &buf, &err,
&err_info)) {
- tshark_debug1("tshark: invoking process_packet_second_pass() for frame #%d", framenum);
+ tshark_debug("tshark: invoking process_packet_second_pass() for frame #%d", framenum);
if (process_packet_second_pass(cf, edt, fdata, &phdr, &buf,
tap_flags)) {
/* Either there's no read filtering or this packet passed the
filter, so, if we're writing to a capture file, write
this packet out. */
if (pdh != NULL) {
- tshark_debug1("tshark: writing packet #%d to outfile", framenum);
+ tshark_debug("tshark: writing packet #%d to outfile", framenum);
if (!wtap_dump(pdh, &phdr, ws_buffer_start_ptr(&buf), &err, &err_info)) {
/* Error writing to a capture file */
- tshark_debug1("tshark: error writing to a capture file (%d)", err);
+ tshark_debug("tshark: error writing to a capture file (%d)", err);
switch (err) {
case WTAP_ERR_UNWRITABLE_ENCAP:
@@ -3453,13 +3447,13 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
ws_buffer_free(&buf);
- tshark_debug0("tshark: done with second pass");
+ tshark_debug("tshark: done with second pass");
}
else {
/* !perform_two_pass_analysis */
framenum = 0;
- tshark_debug1("tshark: perform one pass analysis, do_dissection=%s", do_dissection ? "TRUE" : "FALSE");
+ tshark_debug("tshark: perform one pass analysis, do_dissection=%s", do_dissection ? "TRUE" : "FALSE");
if (do_dissection) {
gboolean create_proto_tree;
@@ -3470,7 +3464,7 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
else
create_proto_tree = FALSE;
- tshark_debug1("tshark: create_proto_tree = %s", create_proto_tree ? "TRUE" : "FALSE");
+ tshark_debug("tshark: create_proto_tree = %s", create_proto_tree ? "TRUE" : "FALSE");
/* The protocol tree will be "visible", i.e., printed, only if we're
printing packet details, which is true if we're printing stuff
@@ -3482,7 +3476,7 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
while (wtap_read(cf->wth, &err, &err_info, &data_offset)) {
framenum++;
- tshark_debug1("tshark: processing packet #%d", framenum);
+ tshark_debug("tshark: processing packet #%d", framenum);
if (process_packet(cf, edt, data_offset, wtap_phdr(cf->wth),
wtap_buf_ptr(cf->wth),
@@ -3491,10 +3485,10 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
filter, so, if we're writing to a capture file, write
this packet out. */
if (pdh != NULL) {
- tshark_debug1("tshark: writing packet #%d to outfile", framenum);
+ tshark_debug("tshark: writing packet #%d to outfile", framenum);
if (!wtap_dump(pdh, wtap_phdr(cf->wth), wtap_buf_ptr(cf->wth), &err, &err_info)) {
/* Error writing to a capture file */
- tshark_debug1("tshark: error writing to a capture file (%d)", err);
+ tshark_debug("tshark: error writing to a capture file (%d)", err);
switch (err) {
case WTAP_ERR_UNWRITABLE_ENCAP:
@@ -3564,7 +3558,7 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
* (unless we roll over max_packet_count ?)
*/
if ( (--max_packet_count == 0) || (max_byte_count != 0 && data_offset >= max_byte_count)) {
- tshark_debug3("tshark: max_packet_count (%d) or max_byte_count (%" G_GINT64_MODIFIER "d/%" G_GINT64_MODIFIER "d) reached",
+ tshark_debug("tshark: max_packet_count (%d) or max_byte_count (%" G_GINT64_MODIFIER "d/%" G_GINT64_MODIFIER "d) reached",
max_packet_count, data_offset, max_byte_count);
err = 0; /* This is not an error */
break;
@@ -3580,7 +3574,7 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
wtap_phdr_cleanup(&phdr);
if (err != 0) {
- tshark_debug1("tshark: something failed along the line (%d)", err);
+ tshark_debug("tshark: something failed along the line (%d)", err);
/*
* Print a message noting that the read failed somewhere along the line.
*
diff --git a/wiretap/ipfix.c b/wiretap/ipfix.c
index c6abef19a1..092918df1e 100644
--- a/wiretap/ipfix.c
+++ b/wiretap/ipfix.c
@@ -68,15 +68,9 @@
#include "ipfix.h"
#if 0
-#define ipfix_debug0(str) g_warning(str)
-#define ipfix_debug1(str,p1) g_warning(str,p1)
-#define ipfix_debug2(str,p1,p2) g_warning(str,p1,p2)
-#define ipfix_debug3(str,p1,p2,p3) g_warning(str,p1,p2,p3)
+#define ipfix_debug(...) g_warning(__VA_ARGS__)
#else
-#define ipfix_debug0(str)
-#define ipfix_debug1(str,p1)
-#define ipfix_debug2(str,p1,p2)
-#define ipfix_debug3(str,p1,p2,p3)
+#define ipfix_debug(...)
#endif
#define RECORDS_FOR_IPFIX_CHECK 20
@@ -143,7 +137,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) {
- ipfix_debug0("ipfix_read: couldn't go back in file before header");
+ ipfix_debug("ipfix_read: couldn't go back in file before header");
return FALSE;
}
@@ -189,7 +183,7 @@ ipfix_open(wtap *wth, int *err, gchar **err_info)
ipfix_message_header_t msg_hdr;
ipfix_set_header_t set_hdr;
- ipfix_debug0("ipfix_open: opening file");
+ ipfix_debug("ipfix_open: opening file");
/* number of records to scan before deciding if this really is IPFIX */
if ((s = getenv("IPFIX_RECORDS_TO_CHECK")) != NULL) {
@@ -206,7 +200,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)) {
- ipfix_debug3("ipfix_open: couldn't read message header #%d with err code #%d (%s)",
+ ipfix_debug("ipfix_open: 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 */
@@ -230,7 +224,7 @@ ipfix_open(wtap *wth, int *err, gchar **err_info)
break;
}
if (file_seek(wth->fh, IPFIX_MSG_HDR_SIZE, SEEK_CUR, err) == -1) {
- ipfix_debug1("ipfix_open: failed seek to next message in file, %d bytes away",
+ ipfix_debug("ipfix_open: failed seek to next message in file, %d bytes away",
msg_hdr.message_length);
return WTAP_OPEN_NOT_MINE;
}
@@ -242,7 +236,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. */
- ipfix_debug1("ipfix_open: error %d reading set", *err);
+ ipfix_debug("ipfix_open: error %d reading set", *err);
return WTAP_OPEN_NOT_MINE;
}
@@ -252,7 +246,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)) {
- ipfix_debug1("ipfix_open: found invalid set_length of %d",
+ ipfix_debug("ipfix_open: found invalid set_length of %d",
set_hdr.set_length);
return WTAP_OPEN_NOT_MINE;
}
@@ -260,7 +254,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)
{
- ipfix_debug1("ipfix_open: failed seek to next set in file, %d bytes away",
+ ipfix_debug("ipfix_open: failed seek to next set in file, %d bytes away",
set_hdr.set_length - IPFIX_SET_HDR_SIZE);
return WTAP_OPEN_ERROR;
}
@@ -291,10 +285,10 @@ static gboolean
ipfix_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset)
{
*data_offset = file_tell(wth->fh);
- ipfix_debug1("ipfix_read: data_offset is initially %" G_GINT64_MODIFIER "d", *data_offset);
+ ipfix_debug("ipfix_read: data_offset is initially %" G_GINT64_MODIFIER "d", *data_offset);
if (!ipfix_read_message(wth->fh, &wth->phdr, wth->frame_buffer, err, err_info)) {
- ipfix_debug2("ipfix_read: couldn't read message header with code: %d\n, and error '%s'",
+ ipfix_debug("ipfix_read: couldn't read message header with code: %d\n, and error '%s'",
*err, *err_info);
return FALSE;
}
@@ -310,15 +304,15 @@ ipfix_seek_read(wtap *wth, gint64 seek_off, struct wtap_pkthdr *phdr,
{
/* seek to the right file position */
if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1) {
- ipfix_debug2("ipfix_seek_read: couldn't read message header with code: %d\n, and error '%s'",
+ ipfix_debug("ipfix_seek_read: couldn't read message header with code: %d\n, and error '%s'",
*err, *err_info);
return FALSE; /* Seek error */
}
- ipfix_debug1("ipfix_seek_read: reading at offset %" G_GINT64_MODIFIER "u", seek_off);
+ ipfix_debug("ipfix_seek_read: reading at offset %" G_GINT64_MODIFIER "u", seek_off);
if (!ipfix_read_message(wth->random_fh, phdr, buf, err, err_info)) {
- ipfix_debug0("ipfix_seek_read: couldn't read message header");
+ ipfix_debug("ipfix_seek_read: 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 46eae0bce2..9a0ce7cc4e 100644
--- a/wiretap/merge.c
+++ b/wiretap/merge.c
@@ -41,15 +41,9 @@
#if 0
-#define merge_debug0(str) g_warning(str)
-#define merge_debug1(str,p1) g_warning(str,p1)
-#define merge_debug2(str,p1,p2) g_warning(str,p1,p2)
-#define merge_debug3(str,p1,p2,p3) g_warning(str,p1,p2,p3)
+#define merge_debug(...) g_warning(__VA_ARGS__)
#else
-#define merge_debug0(str)
-#define merge_debug1(str,p1)
-#define merge_debug2(str,p1,p2)
-#define merge_debug3(str,p1,p2,p3)
+#define merge_debug(...)
#endif
@@ -410,32 +404,32 @@ is_duplicate_idb(const wtapng_if_descr_t *idb1, const wtapng_if_descr_t *idb2)
{
g_assert(idb1 && idb2);
- merge_debug0("merge::is_duplicate_idb() called");
- merge_debug1("idb1->wtap_encap == idb2->wtap_encap: %s",
+ merge_debug("merge::is_duplicate_idb() called");
+ merge_debug("idb1->wtap_encap == idb2->wtap_encap: %s",
(idb1->wtap_encap == idb2->wtap_encap) ? "TRUE":"FALSE");
- merge_debug1("idb1->time_units_per_second == idb2->time_units_per_second: %s",
+ merge_debug("idb1->time_units_per_second == idb2->time_units_per_second: %s",
(idb1->time_units_per_second == idb2->time_units_per_second) ? "TRUE":"FALSE");
- merge_debug1("idb1->tsprecision == idb2->tsprecision: %s",
+ merge_debug("idb1->tsprecision == idb2->tsprecision: %s",
(idb1->tsprecision == idb2->tsprecision) ? "TRUE":"FALSE");
- merge_debug1("idb1->link_type == idb2->link_type: %s",
+ merge_debug("idb1->link_type == idb2->link_type: %s",
(idb1->link_type == idb2->link_type) ? "TRUE":"FALSE");
- merge_debug1("idb1->snap_len == idb2->snap_len: %s",
+ merge_debug("idb1->snap_len == idb2->snap_len: %s",
(idb1->snap_len == idb2->snap_len) ? "TRUE":"FALSE");
- merge_debug1("idb1->if_speed == idb2->if_speed: %s",
+ merge_debug("idb1->if_speed == idb2->if_speed: %s",
(idb1->if_speed == idb2->if_speed) ? "TRUE":"FALSE");
- merge_debug1("idb1->if_tsresol == idb2->if_tsresol: %s",
+ merge_debug("idb1->if_tsresol == idb2->if_tsresol: %s",
(idb1->if_tsresol == idb2->if_tsresol) ? "TRUE":"FALSE");
- merge_debug1("idb1->if_fcslen == idb2->if_fcslen: %s",
+ merge_debug("idb1->if_fcslen == idb2->if_fcslen: %s",
(idb1->if_fcslen == idb2->if_fcslen) ? "TRUE":"FALSE");
- merge_debug1("g_strcmp0(idb1->opt_comment, idb2->opt_comment) == 0: %s",
+ merge_debug("g_strcmp0(idb1->opt_comment, idb2->opt_comment) == 0: %s",
(g_strcmp0(idb1->opt_comment, idb2->opt_comment) == 0) ? "TRUE":"FALSE");
- merge_debug1("g_strcmp0(idb1->if_name, idb2->if_name) == 0: %s",
+ merge_debug("g_strcmp0(idb1->if_name, idb2->if_name) == 0: %s",
(g_strcmp0(idb1->if_name, idb2->if_name) == 0) ? "TRUE":"FALSE");
- merge_debug1("g_strcmp0(idb1->if_description, idb2->if_description) == 0: %s",
+ merge_debug("g_strcmp0(idb1->if_description, idb2->if_description) == 0: %s",
(g_strcmp0(idb1->if_description, idb2->if_description) == 0) ? "TRUE":"FALSE");
- merge_debug1("g_strcmp0(idb1->if_os, idb2->if_os) == 0: %s",
+ merge_debug("g_strcmp0(idb1->if_os, idb2->if_os) == 0: %s",
(g_strcmp0(idb1->if_os, idb2->if_os) == 0) ? "TRUE":"FALSE");
- merge_debug0("merge::is_duplicate_idb() returning");
+ merge_debug("merge::is_duplicate_idb() returning");
/* does not compare filters nor interface statistics */
return (idb1->wtap_encap == idb2->wtap_encap &&
@@ -480,7 +474,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) {
- merge_debug2("merge::all_idbs_are_duplicates: sizes of IDB lists don't match: first=%u, other=%u",
+ merge_debug("merge::all_idbs_are_duplicates: 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);
@@ -492,7 +486,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, wtapng_if_descr_t, j);
if (!is_duplicate_idb(first_file_idb, other_file_idb)) {
- merge_debug1("merge::all_idbs_are_duplicates: IDBs at index %d do not match, returning FALSE", j);
+ merge_debug("merge::all_idbs_are_duplicates: IDBs at index %d do not match, returning FALSE", j);
g_free(other_idb_list);
g_free(first_idb_list);
return FALSE;
@@ -501,7 +495,7 @@ all_idbs_are_duplicates(const merge_in_file_t *in_files, const guint in_file_cou
g_free(other_idb_list);
}
- merge_debug0("merge::all_idbs_are_duplicates: returning TRUE");
+ merge_debug("merge::all_idbs_are_duplicates: returning TRUE");
g_free(first_idb_list);
@@ -595,7 +589,7 @@ generate_merged_idb(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;
- merge_debug0("merge::generate_merged_idb: mode ALL set and all IDBs are duplicates");
+ merge_debug("merge::generate_merged_idb: 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);
@@ -630,7 +624,7 @@ generate_merged_idb(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))
{
- merge_debug0("merge::generate_merged_idb: mode ANY set and found a duplicate");
+ merge_debug("merge::generate_merged_idb: 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
@@ -639,7 +633,7 @@ generate_merged_idb(merge_in_file_t *in_files, const guint in_file_count, const
add_idb_index_map(&in_files[i], itf_count, merged_index);
}
else {
- merge_debug0("merge::generate_merged_idb: mode NONE set or did not find a duplicate");
+ merge_debug("merge::generate_merged_idb: 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 indeces.
@@ -670,7 +664,7 @@ map_phdr_interface_id(struct wtap_pkthdr *phdr, 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 */
- merge_debug0("merge::map_phdr_interface_id: current_interface_id >= in_file->idb_index_map->len (ERROR?)");
+ merge_debug("merge::map_phdr_interface_id: current_interface_id >= in_file->idb_index_map->len (ERROR?)");
return FALSE;
}
@@ -867,12 +861,12 @@ merge_files(int out_fd, const gchar* out_filename, const int file_type,
/* if a callback was given, it has to have a callback function ptr */
g_assert((cb != NULL) ? (cb->callback_func != NULL) : TRUE);
- merge_debug0("merge_files: begin");
+ merge_debug("merge_files: begin");
/* open the input files */
if (!merge_open_in_files(in_file_count, in_filenames, &in_files,
err, err_info, err_fileno)) {
- merge_debug1("merge_files: merge_open_in_files() failed with err=%d", *err);
+ merge_debug("merge_files: merge_open_in_files() failed with err=%d", *err);
return MERGE_ERR_CANT_OPEN_INFILE;
}
@@ -892,7 +886,7 @@ merge_files(int out_fd, const gchar* out_filename, const int file_type,
* whether we can merge IDBs into one or not.
*/
frame_type = merge_select_frame_type(in_file_count, in_files);
- merge_debug1("merge_files: got frame_type=%d", frame_type);
+ merge_debug("merge_files: 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);
@@ -900,10 +894,10 @@ merge_files(int out_fd, const gchar* out_filename, const int file_type,
/* prepare the outfile */
if (file_type == WTAP_FILE_TYPE_SUBTYPE_PCAPNG) {
shb_hdr = create_shb_header(in_files, in_file_count, app_name);
- merge_debug0("merge_files: SHB created");
+ merge_debug("merge_files: SHB created");
idb_inf = generate_merged_idb(in_files, in_file_count, mode);
- merge_debug1("merge_files: IDB merge operation complete, got %u IDBs", idb_inf ? idb_inf->interface_data->len : 0);
+ merge_debug("merge_files: IDB merge operation complete, got %u IDBs", idb_inf ? idb_inf->interface_data->len : 0);
pdh = wtap_dump_fdopen_ng(out_fd, file_type, frame_type, snaplen,
FALSE /* compressed */, shb_hdr, idb_inf,
diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c
index 647086170b..ddb4526167 100644
--- a/wiretap/pcapng.c
+++ b/wiretap/pcapng.c
@@ -43,15 +43,9 @@
#include "pcapng_module.h"
#if 0
-#define pcapng_debug0(str) g_warning(str)
-#define pcapng_debug1(str,p1) g_warning(str,p1)
-#define pcapng_debug2(str,p1,p2) g_warning(str,p1,p2)
-#define pcapng_debug3(str,p1,p2,p3) g_warning(str,p1,p2,p3)
+#define pcapng_debug(...) g_warning(__VA_ARGS__)
#else
-#define pcapng_debug0(str)
-#define pcapng_debug1(str,p1)
-#define pcapng_debug2(str,p1,p2)
-#define pcapng_debug3(str,p1,p2,p3)
+#define pcapng_debug(...)
#endif
static gboolean
@@ -475,7 +469,7 @@ pcapng_read_option(FILE_T fh, pcapng_t *pn, pcapng_option_header_t *oh,
/* read option header */
if (!wtap_read_bytes(fh, oh, sizeof (*oh), err, err_info)) {
- pcapng_debug0("pcapng_read_option: failed to read option");
+ pcapng_debug("pcapng_read_option: failed to read option");
return -1;
}
block_read = sizeof (*oh);
@@ -500,7 +494,7 @@ pcapng_read_option(FILE_T fh, pcapng_t *pn, pcapng_option_header_t *oh,
/* read option content */
if (!wtap_read_bytes(fh, content, oh->option_length, err, err_info)) {
- pcapng_debug1("pcapng_read_option: failed to read content of option %u", oh->option_code);
+ pcapng_debug("pcapng_read_option: failed to read content of option %u", oh->option_code);
return -1;
}
block_read += oh->option_length;
@@ -572,7 +566,7 @@ pcapng_read_section_header_block(FILE_T fh, pcapng_block_header_t *bh,
pn->version_major = shb.version_major;
pn->version_minor = shb.version_minor;
- pcapng_debug3("pcapng_read_section_header_block: SHB (little endian) V%u.%u, len %u",
+ pcapng_debug("pcapng_read_section_header_block: SHB (little endian) V%u.%u, len %u",
pn->version_major, pn->version_minor, bh->block_total_length);
break;
case(0x4D3C2B1A):
@@ -584,7 +578,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);
- pcapng_debug3("pcapng_read_section_header_block: SHB (big endian) V%u.%u, len %u",
+ pcapng_debug("pcapng_read_section_header_block: SHB (big endian) V%u.%u, len %u",
pn->version_major, pn->version_minor, bh->block_total_length);
break;
default:
@@ -661,13 +655,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;
}
- pcapng_debug1("pcapng_read_section_header_block: Options %u bytes", to_read);
+ pcapng_debug("pcapng_read_section_header_block: Options %u bytes", to_read);
while (to_read != 0) {
/* read option */
- pcapng_debug1("pcapng_read_section_header_block: Options %u bytes remaining", to_read);
+ pcapng_debug("pcapng_read_section_header_block: Options %u bytes remaining", to_read);
bytes_read = pcapng_read_option(fh, pn, &oh, option_content, opt_cont_buf_len, to_read, err, err_info);
if (bytes_read <= 0) {
- pcapng_debug0("pcapng_read_section_header_block: failed to read option");
+ pcapng_debug("pcapng_read_section_header_block: failed to read option");
return PCAPNG_BLOCK_ERROR;
}
to_read -= bytes_read;
@@ -676,7 +670,7 @@ pcapng_read_section_header_block(FILE_T fh, pcapng_block_header_t *bh,
switch (oh.option_code) {
case(OPT_EOFOPT):
if (to_read != 0) {
- pcapng_debug1("pcapng_read_section_header_block: %u bytes after opt_endofopt", to_read);
+ pcapng_debug("pcapng_read_section_header_block: %u bytes after opt_endofopt", to_read);
}
/* padding should be ok here, just get out of this */
to_read = 0;
@@ -685,40 +679,40 @@ pcapng_read_section_header_block(FILE_T fh, pcapng_block_header_t *bh,
if (oh.option_length > 0 && oh.option_length < opt_cont_buf_len) {
g_free(wblock->data.section.opt_comment);
wblock->data.section.opt_comment = g_strndup((char *)option_content, oh.option_length);
- pcapng_debug1("pcapng_read_section_header_block: opt_comment %s", wblock->data.section.opt_comment);
+ pcapng_debug("pcapng_read_section_header_block: opt_comment %s", wblock->data.section.opt_comment);
} else {
- pcapng_debug1("pcapng_read_section_header_block: opt_comment length %u seems strange", oh.option_length);
+ pcapng_debug("pcapng_read_section_header_block: opt_comment length %u seems strange", oh.option_length);
}
break;
case(OPT_SHB_HARDWARE):
if (oh.option_length > 0 && oh.option_length < opt_cont_buf_len) {
g_free(wblock->data.section.shb_hardware);
wblock->data.section.shb_hardware = g_strndup((char *)option_content, oh.option_length);
- pcapng_debug1("pcapng_read_section_header_block: shb_hardware %s", wblock->data.section.shb_hardware);
+ pcapng_debug("pcapng_read_section_header_block: shb_hardware %s", wblock->data.section.shb_hardware);
} else {
- pcapng_debug1("pcapng_read_section_header_block: shb_hardware length %u seems strange", oh.option_length);
+ pcapng_debug("pcapng_read_section_header_block: shb_hardware length %u seems strange", oh.option_length);
}
break;
case(OPT_SHB_OS):
if (oh.option_length > 0 && oh.option_length < opt_cont_buf_len) {
g_free(wblock->data.section.shb_os);
wblock->data.section.shb_os = g_strndup((char *)option_content, oh.option_length);
- pcapng_debug1("pcapng_read_section_header_block: shb_os %s", wblock->data.section.shb_os);
+ pcapng_debug("pcapng_read_section_header_block: shb_os %s", wblock->data.section.shb_os);
} else {
- pcapng_debug2("pcapng_read_section_header_block: shb_os length %u seems strange, opt buffsize %u", oh.option_length,to_read);
+ pcapng_debug("pcapng_read_section_header_block: shb_os length %u seems strange, opt buffsize %u", oh.option_length,to_read);
}
break;
case(OPT_SHB_USERAPPL):
if (oh.option_length > 0 && oh.option_length < opt_cont_buf_len) {
g_free(wblock->data.section.shb_user_appl);
wblock->data.section.shb_user_appl = g_strndup((char *)option_content, oh.option_length);
- pcapng_debug1("pcapng_read_section_header_block: shb_user_appl %s", wblock->data.section.shb_user_appl);
+ pcapng_debug("pcapng_read_section_header_block: shb_user_appl %s", wblock->data.section.shb_user_appl);
} else {
- pcapng_debug1("pcapng_read_section_header_block: shb_user_appl length %u seems strange", oh.option_length);
+ pcapng_debug("pcapng_read_section_header_block: shb_user_appl length %u seems strange", oh.option_length);
}
break;
default:
- pcapng_debug2("pcapng_read_section_header_block: unknown option %u - ignoring %u bytes",
+ pcapng_debug("pcapng_read_section_header_block: unknown option %u - ignoring %u bytes",
oh.option_code, oh.option_length);
}
}
@@ -772,7 +766,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)) {
- pcapng_debug0("pcapng_read_if_descr_block: failed to read IDB");
+ pcapng_debug("pcapng_read_if_descr_block: failed to read IDB");
return FALSE;
}
@@ -789,7 +783,7 @@ pcapng_read_if_descr_block(wtap *wth, FILE_T fh, pcapng_block_header_t *bh,
wblock->data.if_descr.time_units_per_second = time_units_per_second;
wblock->data.if_descr.tsprecision = tsprecision;
- pcapng_debug3("pcapng_read_if_descr_block: IDB link_type %u (%s), snap %u",
+ pcapng_debug("pcapng_read_if_descr_block: IDB link_type %u (%s), snap %u",
wblock->data.if_descr.link_type,
wtap_encap_string(wblock->data.if_descr.wtap_encap),
wblock->data.if_descr.snap_len);
@@ -799,7 +793,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.
*/
- pcapng_debug1("pcapng_read_if_descr_block: snapshot length %u unrealistic.",
+ pcapng_debug("pcapng_read_if_descr_block: snapshot length %u unrealistic.",
wblock->data.if_descr.snap_len);
/*wblock->data.if_descr.snap_len = WTAP_MAX_PACKET_SIZE;*/
}
@@ -837,7 +831,7 @@ pcapng_read_if_descr_block(wtap *wth, FILE_T fh, pcapng_block_header_t *bh,
/* read option */
bytes_read = pcapng_read_option(fh, pn, &oh, option_content, opt_cont_buf_len, to_read, err, err_info);
if (bytes_read <= 0) {
- pcapng_debug0("pcapng_read_if_descr_block: failed to read option");
+ pcapng_debug("pcapng_read_if_descr_block: failed to read option");
return FALSE;
}
to_read -= bytes_read;
@@ -846,7 +840,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) {
- pcapng_debug1("pcapng_read_if_descr_block: %u bytes after opt_endofopt", to_read);
+ pcapng_debug("pcapng_read_if_descr_block: %u bytes after opt_endofopt", to_read);
}
/* padding should be ok here, just get out of this */
to_read = 0;
@@ -854,25 +848,25 @@ pcapng_read_if_descr_block(wtap *wth, FILE_T fh, pcapng_block_header_t *bh,
case(OPT_COMMENT): /* opt_comment */
if (oh.option_length > 0 && oh.option_length < opt_cont_buf_len) {
wblock->data.if_descr.opt_comment = g_strndup((char *)option_content, oh.option_length);
- pcapng_debug1("pcapng_read_if_descr_block: opt_comment %s", wblock->data.if_descr.opt_comment);
+ pcapng_debug("pcapng_read_if_descr_block: opt_comment %s", wblock->data.if_descr.opt_comment);
} else {
- pcapng_debug1("pcapng_read_if_descr_block: opt_comment length %u seems strange", oh.option_length);
+ pcapng_debug("pcapng_read_if_descr_block: opt_comment length %u seems strange", oh.option_length);
}
break;
case(OPT_IDB_NAME): /* if_name */
if (oh.option_length > 0 && oh.option_length < opt_cont_buf_len) {
wblock->data.if_descr.if_name = g_strndup((char *)option_content, oh.option_length);
- pcapng_debug1("pcapng_read_if_descr_block: if_name %s", wblock->data.if_descr.if_name);
+ pcapng_debug("pcapng_read_if_descr_block: if_name %s", wblock->data.if_descr.if_name);
} else {
- pcapng_debug1("pcapng_read_if_descr_block: if_name length %u seems strange", oh.option_length);
+ pcapng_debug("pcapng_read_if_descr_block: if_name length %u seems strange", oh.option_length);
}
break;
case(OPT_IDB_DESCR): /* if_description */
if (oh.option_length > 0 && oh.option_length < opt_cont_buf_len) {
wblock->data.if_descr.if_description = g_strndup((char *)option_content, oh.option_length);
- pcapng_debug1("pcapng_read_if_descr_block: if_description %s", wblock->data.if_descr.if_description);
+ pcapng_debug("pcapng_read_if_descr_block: if_description %s", wblock->data.if_descr.if_description);
} else {
- pcapng_debug1("pcapng_read_if_descr_block: if_description length %u seems strange", oh.option_length);
+ pcapng_debug("pcapng_read_if_descr_block: if_description length %u seems strange", oh.option_length);
}
break;
case(OPT_IDB_SPEED): /* if_speed */
@@ -884,9 +878,9 @@ pcapng_read_if_descr_block(wtap *wth, FILE_T fh, pcapng_block_header_t *bh,
memcpy(&wblock->data.if_descr.if_speed, option_content, sizeof(guint64));
if (pn->byte_swapped)
wblock->data.if_descr.if_speed = GUINT64_SWAP_LE_BE(wblock->data.if_descr.if_speed);
- pcapng_debug1("pcapng_read_if_descr_block: if_speed %" G_GINT64_MODIFIER "u (bps)", wblock->data.if_descr.if_speed);
+ pcapng_debug("pcapng_read_if_descr_block: if_speed %" G_GINT64_MODIFIER "u (bps)", wblock->data.if_descr.if_speed);
} else {
- pcapng_debug1("pcapng_read_if_descr_block: if_speed length %u not 8 as expected", oh.option_length);
+ pcapng_debug("pcapng_read_if_descr_block: if_speed length %u not 8 as expected", oh.option_length);
}
break;
case(OPT_IDB_TSRESOL): /* if_tsresol */
@@ -912,7 +906,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)) {
- pcapng_debug0("pcapng_open: time conversion might be inaccurate");
+ pcapng_debug("pcapng_open: time conversion might be inaccurate");
}
wblock->data.if_descr.time_units_per_second = time_units_per_second;
wblock->data.if_descr.if_tsresol = if_tsresol;
@@ -929,9 +923,9 @@ pcapng_read_if_descr_block(wtap *wth, FILE_T fh, pcapng_block_header_t *bh,
else
tsprecision = WTAP_TSPREC_SEC;
wblock->data.if_descr.tsprecision = tsprecision;
- pcapng_debug3("pcapng_read_if_descr_block: if_tsresol %u, units/s %" G_GINT64_MODIFIER "u, tsprecision %d", wblock->data.if_descr.if_tsresol, wblock->data.if_descr.time_units_per_second, tsprecision);
+ pcapng_debug("pcapng_read_if_descr_block: if_tsresol %u, units/s %" G_GINT64_MODIFIER "u, tsprecision %d", wblock->data.if_descr.if_tsresol, wblock->data.if_descr.time_units_per_second, tsprecision);
} else {
- pcapng_debug1("pcapng_read_if_descr_block: if_tsresol length %u not 1 as expected", oh.option_length);
+ pcapng_debug("pcapng_read_if_descr_block: if_tsresol length %u not 1 as expected", oh.option_length);
}
break;
/*
@@ -944,14 +938,14 @@ pcapng_read_if_descr_block(wtap *wth, FILE_T fh, pcapng_block_header_t *bh,
*/
if (option_content[0] == 0) {
wblock->data.if_descr.if_filter_str = g_strndup((char *)option_content+1, oh.option_length-1);
- pcapng_debug2("pcapng_read_if_descr_block: if_filter_str %s oh.option_length %u", wblock->data.if_descr.if_filter_str, oh.option_length);
+ pcapng_debug("pcapng_read_if_descr_block: if_filter_str %s oh.option_length %u", wblock->data.if_descr.if_filter_str, oh.option_length);
} else if (option_content[0] == 1) {
wblock->data.if_descr.bpf_filter_len = oh.option_length-1;
wblock->data.if_descr.if_filter_bpf_bytes = (gchar *)g_malloc(oh.option_length-1);
memcpy(wblock->data.if_descr.if_filter_bpf_bytes, (char *)option_content+1, oh.option_length-1);
}
} else {
- pcapng_debug1("pcapng_read_if_descr_block: if_filter length %u seems strange", oh.option_length);
+ pcapng_debug("pcapng_read_if_descr_block: if_filter length %u seems strange", oh.option_length);
}
break;
case(OPT_IDB_OS): /* if_os */
@@ -962,19 +956,19 @@ pcapng_read_if_descr_block(wtap *wth, FILE_T fh, pcapng_block_header_t *bh,
*/
if (oh.option_length > 0 && oh.option_length < opt_cont_buf_len) {
wblock->data.if_descr.if_os = g_strndup((char *)option_content, oh.option_length);
- pcapng_debug1("pcapng_read_if_descr_block: if_os %s", wblock->data.if_descr.if_os);
+ pcapng_debug("pcapng_read_if_descr_block: if_os %s", wblock->data.if_descr.if_os);
} else {
- pcapng_debug1("pcapng_read_if_descr_block: if_os length %u seems strange", oh.option_length);
+ pcapng_debug("pcapng_read_if_descr_block: if_os length %u seems strange", oh.option_length);
}
break;
case(OPT_IDB_FCSLEN): /* if_fcslen */
if (oh.option_length == 1) {
wblock->data.if_descr.if_fcslen = option_content[0];
pn->if_fcslen = wblock->data.if_descr.if_fcslen;
- pcapng_debug1("pcapng_read_if_descr_block: if_fcslen %u", wblock->data.if_descr.if_fcslen);
+ pcapng_debug("pcapng_read_if_descr_block: if_fcslen %u", wblock->data.if_descr.if_fcslen);
/* XXX - add sanity check */
} else {
- pcapng_debug1("pcapng_read_if_descr_block: if_fcslen length %u not 1 as expected", oh.option_length);
+ pcapng_debug("pcapng_read_if_descr_block: if_fcslen length %u not 1 as expected", oh.option_length);
}
break;
@@ -1023,7 +1017,7 @@ pcapng_read_if_descr_block(wtap *wth, FILE_T fh, pcapng_block_header_t *bh,
* be useful for highly synchronized capture systems? 1234
*/
default:
- pcapng_debug2("pcapng_read_if_descr_block: unknown option %u - ignoring %u bytes",
+ pcapng_debug("pcapng_read_if_descr_block: unknown option %u - ignoring %u bytes",
oh.option_code, oh.option_length);
}
}
@@ -1115,7 +1109,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *pn, wta
return FALSE;
}
if (!wtap_read_bytes(fh, &epb, sizeof epb, err, err_info)) {
- pcapng_debug0("pcapng_read_packet_block: failed to read packet data");
+ pcapng_debug("pcapng_read_packet_block: failed to read packet data");
return FALSE;
}
block_read = (guint)sizeof epb;
@@ -1135,7 +1129,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *pn, wta
packet.cap_len = epb.captured_len;
packet.packet_len = epb.packet_len;
}
- pcapng_debug3("pcapng_read_packet_block: EPB on interface_id %d, cap_len %d, packet_len %d",
+ pcapng_debug("pcapng_read_packet_block: EPB on interface_id %d, cap_len %d, packet_len %d",
packet.interface_id, packet.cap_len, packet.packet_len);
} else {
/*
@@ -1151,7 +1145,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *pn, wta
return FALSE;
}
if (!wtap_read_bytes(fh, &pb, sizeof pb, err, err_info)) {
- pcapng_debug0("pcapng_read_packet_block: failed to read packet data");
+ pcapng_debug("pcapng_read_packet_block: failed to read packet data");
return FALSE;
}
block_read = (guint)sizeof pb;
@@ -1171,7 +1165,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *pn, wta
packet.cap_len = pb.captured_len;
packet.packet_len = pb.packet_len;
}
- pcapng_debug3("pcapng_read_packet_block: PB on interface_id %d, cap_len %d, packet_len %d",
+ pcapng_debug("pcapng_read_packet_block: PB on interface_id %d, cap_len %d, packet_len %d",
packet.interface_id, packet.cap_len, packet.packet_len);
}
@@ -1190,7 +1184,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *pn, wta
} else {
block_total_length = bh->block_total_length;
}
- pcapng_debug1("pcapng_read_packet_block: block_total_length %d", block_total_length);
+ pcapng_debug("pcapng_read_packet_block: block_total_length %d", block_total_length);
/*
* Is this block long enough to hold the packet data?
@@ -1225,7 +1219,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *pn, wta
packet.cap_len, WTAP_MAX_PACKET_SIZE);
return FALSE;
}
- pcapng_debug3("pcapng_read_packet_block: packet data: packet_len %u captured_len %u interface_id %u",
+ pcapng_debug("pcapng_read_packet_block: packet data: packet_len %u captured_len %u interface_id %u",
packet.packet_len,
packet.cap_len,
packet.interface_id);
@@ -1242,7 +1236,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *pn, wta
wblock->packet_header->rec_type = REC_TYPE_PACKET;
wblock->packet_header->presence_flags = WTAP_HAS_TS|WTAP_HAS_CAP_LEN|WTAP_HAS_INTERFACE_ID;
- pcapng_debug3("pcapng_read_packet_block: encapsulation = %d (%s), pseudo header size = %d.",
+ pcapng_debug("pcapng_read_packet_block: encapsulation = %d (%s), pseudo header size = %d.",
iface_info.wtap_encap,
wtap_encap_string(iface_info.wtap_encap),
pcap_get_phdr_size(iface_info.wtap_encap, &wblock->packet_header->pseudo_header));
@@ -1264,7 +1258,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *pn, wta
}
block_read += pseudo_header_len;
if (pseudo_header_len != pcap_get_phdr_size(iface_info.wtap_encap, &wblock->packet_header->pseudo_header)) {
- pcapng_debug1("pcapng_read_packet_block: Could only read %d bytes for pseudo header.",
+ pcapng_debug("pcapng_read_packet_block: Could only read %d bytes for pseudo header.",
pseudo_header_len);
}
wblock->packet_header->caplen = packet.cap_len - pseudo_header_len;
@@ -1318,7 +1312,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *pn, wta
option_content = opt_ptr + sizeof (pcapng_option_header_t);
bytes_read = pcapng_read_option(fh, pn, oh, option_content, opt_cont_buf_len, to_read, err, err_info);
if (bytes_read <= 0) {
- pcapng_debug0("pcapng_read_packet_block: failed to read option");
+ pcapng_debug("pcapng_read_packet_block: failed to read option");
/* XXX - free anything? */
return FALSE;
}
@@ -1329,7 +1323,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *pn, wta
switch (oh->option_code) {
case(OPT_EOFOPT):
if (to_read != 0) {
- pcapng_debug1("pcapng_read_packet_block: %u bytes after opt_endofopt", to_read);
+ pcapng_debug("pcapng_read_packet_block: %u bytes after opt_endofopt", to_read);
}
/* padding should be ok here, just get out of this */
to_read = 0;
@@ -1338,9 +1332,9 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *pn, wta
if (oh->option_length > 0 && oh->option_length < opt_cont_buf_len) {
wblock->packet_header->presence_flags |= WTAP_HAS_COMMENTS;
wblock->packet_header->opt_comment = g_strndup((char *)option_content, oh->option_length);
- pcapng_debug2("pcapng_read_packet_block: length %u opt_comment '%s'", oh->option_length, wblock->packet_header->opt_comment);
+ pcapng_debug("pcapng_read_packet_block: length %u opt_comment '%s'", oh->option_length, wblock->packet_header->opt_comment);
} else {
- pcapng_debug1("pcapng_read_packet_block: opt_comment length %u seems strange", oh->option_length);
+ pcapng_debug("pcapng_read_packet_block: opt_comment length %u seems strange", oh->option_length);
}
break;
case(OPT_EPB_FLAGS):
@@ -1365,10 +1359,10 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *pn, wta
/* The FCS length is present */
fcslen = (wblock->packet_header->pack_flags & 0x000001E0) >> 5;
}
- pcapng_debug1("pcapng_read_packet_block: pack_flags %u (ignored)", wblock->packet_header->pack_flags);
+ pcapng_debug("pcapng_read_packet_block: pack_flags %u (ignored)", wblock->packet_header->pack_flags);
break;
case(OPT_EPB_HASH):
- pcapng_debug2("pcapng_read_packet_block: epb_hash %u currently not handled - ignoring %u bytes",
+ pcapng_debug("pcapng_read_packet_block: epb_hash %u currently not handled - ignoring %u bytes",
oh->option_code, oh->option_length);
break;
case(OPT_EPB_DROPCOUNT):
@@ -1390,7 +1384,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *pn, wta
memcpy(option_content, &wblock->packet_header->drop_count, sizeof(guint64));
}
- pcapng_debug1("pcapng_read_packet_block: drop_count %" G_GINT64_MODIFIER "u", wblock->packet_header->drop_count);
+ pcapng_debug("pcapng_read_packet_block: drop_count %" G_GINT64_MODIFIER "u", wblock->packet_header->drop_count);
break;
default:
#ifdef HAVE_PLUGINS
@@ -1408,7 +1402,7 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *pn, wta
} else
#endif
{
- pcapng_debug2("pcapng_read_packet_block: unknown option %u - ignoring %u bytes",
+ pcapng_debug("pcapng_read_packet_block: unknown option %u - ignoring %u bytes",
oh->option_code, oh->option_length);
}
}
@@ -1461,7 +1455,7 @@ pcapng_read_simple_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *
/* "Simple Packet Block" read fixed part */
if (!wtap_read_bytes(fh, &spb, sizeof spb, err, err_info)) {
- pcapng_debug0("pcapng_read_simple_packet_block: failed to read packet data");
+ pcapng_debug("pcapng_read_simple_packet_block: failed to read packet data");
return FALSE;
}
@@ -1503,7 +1497,7 @@ pcapng_read_simple_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *
} else {
block_total_length = bh->block_total_length;
}
- pcapng_debug1("pcapng_read_simple_packet_block: block_total_length %d", block_total_length);
+ pcapng_debug("pcapng_read_simple_packet_block: block_total_length %d", block_total_length);
/*
* Is this block long enough to hold the packet data?
@@ -1527,10 +1521,10 @@ pcapng_read_simple_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *
simple_packet.cap_len, WTAP_MAX_PACKET_SIZE);
return FALSE;
}
- pcapng_debug1("pcapng_read_simple_packet_block: packet data: packet_len %u",
+ pcapng_debug("pcapng_read_simple_packet_block: packet data: packet_len %u",
simple_packet.packet_len);
- pcapng_debug1("pcapng_read_simple_packet_block: Need to read pseudo header of size %d",
+ pcapng_debug("pcapng_read_simple_packet_block: Need to read pseudo header of size %d",
pcap_get_phdr_size(iface_info.wtap_encap, &wblock->packet_header->pseudo_header));
/* No time stamp in a simple packet block; no options, either */
@@ -1561,7 +1555,7 @@ pcapng_read_simple_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *
wblock->packet_header->caplen = simple_packet.cap_len - pseudo_header_len;
wblock->packet_header->len = simple_packet.packet_len - pseudo_header_len;
if (pseudo_header_len != pcap_get_phdr_size(iface_info.wtap_encap, &wblock->packet_header->pseudo_header)) {
- pcapng_debug1("pcapng_read_simple_packet_block: Could only read %d bytes for pseudo header.",
+ pcapng_debug("pcapng_read_simple_packet_block: Could only read %d bytes for pseudo header.",
pseudo_header_len);
}
@@ -1676,7 +1670,7 @@ pcapng_read_name_resolution_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t
to_read = bh->block_total_length - 8 - 4; /* We have read the header and should not read the final block_total_length */
- pcapng_debug1("pcapng_read_name_resolution_block, total %d bytes", bh->block_total_length);
+ pcapng_debug("pcapng_read_name_resolution_block, total %d bytes", bh->block_total_length);
/*
* Start out with a buffer big enough for an IPv6 address and one
@@ -1699,7 +1693,7 @@ pcapng_read_name_resolution_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t
}
if (!wtap_read_bytes(fh, &nrb, sizeof nrb, err, err_info)) {
ws_buffer_free(&nrb_rec);
- pcapng_debug0("pcapng_read_name_resolution_block: failed to read record header");
+ pcapng_debug("pcapng_read_name_resolution_block: failed to read record header");
return FALSE;
}
block_read += (int)sizeof nrb;
@@ -1748,7 +1742,7 @@ pcapng_read_name_resolution_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t
if (!wtap_read_bytes(fh, ws_buffer_start_ptr(&nrb_rec),
nrb.record_len, err, err_info)) {
ws_buffer_free(&nrb_rec);
- pcapng_debug0("pcapng_read_name_resolution_block: failed to read IPv4 record data");
+ pcapng_debug("pcapng_read_name_resolution_block: failed to read IPv4 record data");
return FALSE;
}
block_read += nrb.record_len;
@@ -1846,7 +1840,7 @@ pcapng_read_name_resolution_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t
block_read += PADDING4(nrb.record_len);
break;
default:
- pcapng_debug1("pcapng_read_name_resolution_block: unknown record type 0x%x", nrb.record_type);
+ pcapng_debug("pcapng_read_name_resolution_block: unknown record type 0x%x", nrb.record_type);
if (!file_skip(fh, nrb.record_len + PADDING4(nrb.record_len), err)) {
ws_buffer_free(&nrb_rec);
return FALSE;
@@ -1882,7 +1876,7 @@ read_options:
/* read option */
bytes_read = pcapng_read_option(fh, pn, &oh, option_content, opt_cont_buf_len, to_read, err, err_info);
if (bytes_read <= 0) {
- pcapng_debug0("pcapng_read_name_resolution_block: failed to read option");
+ pcapng_debug("pcapng_read_name_resolution_block: failed to read option");
g_free(option_content);
ws_buffer_free(&nrb_rec);
return FALSE;
@@ -1893,7 +1887,7 @@ read_options:
switch (oh.option_code) {
case(OPT_EOFOPT):
if (to_read != 0) {
- pcapng_debug1("pcapng_read_name_resolution_block: %u bytes after opt_endofopt", to_read);
+ pcapng_debug("pcapng_read_name_resolution_block: %u bytes after opt_endofopt", to_read);
}
/* padding should be ok here, just get out of this */
to_read = 0;
@@ -1901,9 +1895,9 @@ read_options:
case(OPT_COMMENT):
if (oh.option_length > 0 && oh.option_length < opt_cont_buf_len) {
wblock->data.name_res.opt_comment = g_strndup((char *)option_content, oh.option_length);
- pcapng_debug2("pcapng_read_name_resolution_block: length %u opt_comment '%s'", oh.option_length, wblock->data.name_res.opt_comment);
+ pcapng_debug("pcapng_read_name_resolution_block: length %u opt_comment '%s'", oh.option_length, wblock->data.name_res.opt_comment);
} else {
- pcapng_debug1("pcapng_read_name_resolution_block: opt_comment length %u seems strange", oh.option_length);
+ pcapng_debug("pcapng_read_name_resolution_block: opt_comment length %u seems strange", oh.option_length);
}
break;
break;
@@ -1926,7 +1920,7 @@ read_options:
} else
#endif
{
- pcapng_debug2("pcapng_read_name_resolution_block: unknown option %u - ignoring %u bytes",
+ pcapng_debug("pcapng_read_name_resolution_block: unknown option %u - ignoring %u bytes",
oh.option_code, oh.option_length);
}
}
@@ -1976,7 +1970,7 @@ pcapng_read_interface_statistics_block(FILE_T fh, pcapng_block_header_t *bh, pca
/* "Interface Statistics Block" read fixed part */
if (!wtap_read_bytes(fh, &isb, sizeof isb, err, err_info)) {
- pcapng_debug0("pcapng_read_interface_statistics_block: failed to read packet data");
+ pcapng_debug("pcapng_read_interface_statistics_block: failed to read packet data");
return FALSE;
}
@@ -1989,7 +1983,7 @@ pcapng_read_interface_statistics_block(FILE_T fh, pcapng_block_header_t *bh, pca
wblock->data.if_stats.ts_high = isb.timestamp_high;
wblock->data.if_stats.ts_low = isb.timestamp_low;
}
- pcapng_debug1("pcapng_read_interface_statistics_block: interface_id %u", wblock->data.if_stats.interface_id);
+ pcapng_debug("pcapng_read_interface_statistics_block: interface_id %u", wblock->data.if_stats.interface_id);
/* Option defaults */
wblock->data.if_stats.opt_comment = NULL;
@@ -2015,7 +2009,7 @@ pcapng_read_interface_statistics_block(FILE_T fh, pcapng_block_header_t *bh, pca
/* read option */
bytes_read = pcapng_read_option(fh, pn, &oh, option_content, opt_cont_buf_len, to_read, err, err_info);
if (bytes_read <= 0) {
- pcapng_debug0("pcapng_read_interface_statistics_block: failed to read option");
+ pcapng_debug("pcapng_read_interface_statistics_block: failed to read option");
return FALSE;
}
to_read -= bytes_read;
@@ -2024,7 +2018,7 @@ pcapng_read_interface_statistics_block(FILE_T fh, pcapng_block_header_t *bh, pca
switch (oh.option_code) {
case(OPT_EOFOPT): /* opt_endofopt */
if (to_read != 0) {
- pcapng_debug1("pcapng_read_interface_statistics_block: %u bytes after opt_endofopt", to_read);
+ pcapng_debug("pcapng_read_interface_statistics_block: %u bytes after opt_endofopt", to_read);
}
/* padding should be ok here, just get out of this */
to_read = 0;
@@ -2032,9 +2026,9 @@ pcapng_read_interface_statistics_block(FILE_T fh, pcapng_block_header_t *bh, pca
case(OPT_COMMENT): /* opt_comment */
if (oh.option_length > 0 && oh.option_length < opt_cont_buf_len) {
wblock->data.if_stats.opt_comment = g_strndup((char *)option_content, oh.option_length);
- pcapng_debug1("pcapng_read_interface_statistics_block: opt_comment %s", wblock->data.if_stats.opt_comment);
+ pcapng_debug("pcapng_read_interface_statistics_block: opt_comment %s", wblock->data.if_stats.opt_comment);
} else {
- pcapng_debug1("pcapng_read_interface_statistics_block: opt_comment length %u seems strange", oh.option_length);
+ pcapng_debug("pcapng_read_interface_statistics_block: opt_comment length %u seems strange", oh.option_length);
}
break;
case(OPT_ISB_STARTTIME): /* isb_starttime */
@@ -2054,9 +2048,9 @@ pcapng_read_interface_statistics_block(FILE_T fh, pcapng_block_header_t *bh, pca
wblock->data.if_stats.isb_starttime = (guint64)high;
wblock->data.if_stats.isb_starttime <<= 32;
wblock->data.if_stats.isb_starttime += (guint64)low;
- pcapng_debug1("pcapng_read_interface_statistics_block: isb_starttime %" G_GINT64_MODIFIER "u", wblock->data.if_stats.isb_starttime);
+ pcapng_debug("pcapng_read_interface_statistics_block: isb_starttime %" G_GINT64_MODIFIER "u", wblock->data.if_stats.isb_starttime);
} else {
- pcapng_debug1("pcapng_read_interface_statistics_block: isb_starttime length %u not 8 as expected", oh.option_length);
+ pcapng_debug("pcapng_read_interface_statistics_block: isb_starttime length %u not 8 as expected", oh.option_length);
}
break;
case(OPT_ISB_ENDTIME): /* isb_endtime */
@@ -2076,9 +2070,9 @@ pcapng_read_interface_statistics_block(FILE_T fh, pcapng_block_header_t *bh, pca
wblock->data.if_stats.isb_endtime = (guint64)high;
wblock->data.if_stats.isb_endtime <<= 32;
wblock->data.if_stats.isb_endtime += (guint64)low;
- pcapng_debug1("pcapng_read_interface_statistics_block: isb_endtime %" G_GINT64_MODIFIER "u", wblock->data.if_stats.isb_endtime);
+ pcapng_debug("pcapng_read_interface_statistics_block: isb_endtime %" G_GINT64_MODIFIER "u", wblock->data.if_stats.isb_endtime);
} else {
- pcapng_debug1("pcapng_read_interface_statistics_block: isb_starttime length %u not 8 as expected", oh.option_length);
+ pcapng_debug("pcapng_read_interface_statistics_block: isb_starttime length %u not 8 as expected", oh.option_length);
}
break;
case(OPT_ISB_IFRECV): /* isb_ifrecv */
@@ -2090,9 +2084,9 @@ pcapng_read_interface_statistics_block(FILE_T fh, pcapng_block_header_t *bh, pca
memcpy(&wblock->data.if_stats.isb_ifrecv, option_content, sizeof(guint64));
if (pn->byte_swapped)
wblock->data.if_stats.isb_ifrecv = GUINT64_SWAP_LE_BE(wblock->data.if_stats.isb_ifrecv);
- pcapng_debug1("pcapng_read_interface_statistics_block: isb_ifrecv %" G_GINT64_MODIFIER "u", wblock->data.if_stats.isb_ifrecv);
+ pcapng_debug("pcapng_read_interface_statistics_block: isb_ifrecv %" G_GINT64_MODIFIER "u", wblock->data.if_stats.isb_ifrecv);
} else {
- pcapng_debug1("pcapng_read_interface_statistics_block: isb_ifrecv length %u not 8 as expected", oh.option_length);
+ pcapng_debug("pcapng_read_interface_statistics_block: isb_ifrecv length %u not 8 as expected", oh.option_length);
}
break;
case(OPT_ISB_IFDROP): /* isb_ifdrop */
@@ -2104,9 +2098,9 @@ pcapng_read_interface_statistics_block(FILE_T fh, pcapng_block_header_t *bh, pca
memcpy(&wblock->data.if_stats.isb_ifdrop, option_content, sizeof(guint64));
if (pn->byte_swapped)
wblock->data.if_stats.isb_ifdrop = GUINT64_SWAP_LE_BE(wblock->data.if_stats.isb_ifdrop);
- pcapng_debug1("pcapng_read_interface_statistics_block: isb_ifdrop %" G_GINT64_MODIFIER "u", wblock->data.if_stats.isb_ifdrop);
+ pcapng_debug("pcapng_read_interface_statistics_block: isb_ifdrop %" G_GINT64_MODIFIER "u", wblock->data.if_stats.isb_ifdrop);
} else {
- pcapng_debug1("pcapng_read_interface_statistics_block: isb_ifdrop length %u not 8 as expected", oh.option_length);
+ pcapng_debug("pcapng_read_interface_statistics_block: isb_ifdrop length %u not 8 as expected", oh.option_length);
}
break;
case(OPT_ISB_FILTERACCEPT): /* isb_filteraccept 6 */
@@ -2118,9 +2112,9 @@ pcapng_read_interface_statistics_block(FILE_T fh, pcapng_block_header_t *bh, pca
memcpy(&wblock->data.if_stats.isb_filteraccept, option_content, sizeof(guint64));
if (pn->byte_swapped)
wblock->data.if_stats.isb_filteraccept = GUINT64_SWAP_LE_BE(wblock->data.if_stats.isb_filteraccept);
- pcapng_debug1("pcapng_read_interface_statistics_block: isb_filteraccept %" G_GINT64_MODIFIER "u", wblock->data.if_stats.isb_filteraccept);
+ pcapng_debug("pcapng_read_interface_statistics_block: isb_filteraccept %" G_GINT64_MODIFIER "u", wblock->data.if_stats.isb_filteraccept);
} else {
- pcapng_debug1("pcapng_read_interface_statistics_block: isb_filteraccept length %u not 8 as expected", oh.option_length);
+ pcapng_debug("pcapng_read_interface_statistics_block: isb_filteraccept length %u not 8 as expected", oh.option_length);
}
break;
case(OPT_ISB_OSDROP): /* isb_osdrop 7 */
@@ -2132,9 +2126,9 @@ pcapng_read_interface_statistics_block(FILE_T fh, pcapng_block_header_t *bh, pca
memcpy(&wblock->data.if_stats.isb_osdrop, option_content, sizeof(guint64));
if (pn->byte_swapped)
wblock->data.if_stats.isb_osdrop = GUINT64_SWAP_LE_BE(wblock->data.if_stats.isb_osdrop);
- pcapng_debug1("pcapng_read_interface_statistics_block: isb_osdrop %" G_GINT64_MODIFIER "u", wblock->data.if_stats.isb_osdrop);
+ pcapng_debug("pcapng_read_interface_statistics_block: isb_osdrop %" G_GINT64_MODIFIER "u", wblock->data.if_stats.isb_osdrop);
} else {
- pcapng_debug1("pcapng_read_interface_statistics_block: isb_osdrop length %u not 8 as expected", oh.option_length);
+ pcapng_debug("pcapng_read_interface_statistics_block: isb_osdrop length %u not 8 as expected", oh.option_length);
}
break;
case(OPT_ISB_USRDELIV): /* isb_usrdeliv 8 */
@@ -2146,13 +2140,13 @@ pcapng_read_interface_statistics_block(FILE_T fh, pcapng_block_header_t *bh, pca
memcpy(&wblock->data.if_stats.isb_usrdeliv, option_content, sizeof(guint64));
if (pn->byte_swapped)
wblock->data.if_stats.isb_usrdeliv = GUINT64_SWAP_LE_BE(wblock->data.if_stats.isb_usrdeliv);
- pcapng_debug1("pcapng_read_interface_statistics_block: isb_usrdeliv %" G_GINT64_MODIFIER "u", wblock->data.if_stats.isb_usrdeliv);
+ pcapng_debug("pcapng_read_interface_statistics_block: isb_usrdeliv %" G_GINT64_MODIFIER "u", wblock->data.if_stats.isb_usrdeliv);
} else {
- pcapng_debug1("pcapng_read_interface_statistics_block: isb_usrdeliv length %u not 8 as expected", oh.option_length);
+ pcapng_debug("pcapng_read_interface_statistics_block: isb_usrdeliv length %u not 8 as expected", oh.option_length);
}
break;
default:
- pcapng_debug2("pcapng_read_interface_statistics_block: unknown option %u - ignoring %u bytes",
+ pcapng_debug("pcapng_read_interface_statistics_block: unknown option %u - ignoring %u bytes",
oh.option_code, oh.option_length);
}
}
@@ -2225,7 +2219,7 @@ pcapng_read_block(wtap *wth, FILE_T fh, pcapng_t *pn, wtapng_block_t *wblock, in
/* Try to read the (next) block header */
if (!wtap_read_bytes_or_eof(fh, &bh, sizeof bh, err, err_info)) {
- pcapng_debug1("pcapng_read_block: wtap_read_bytes_or_eof() failed, err = %d.", *err);
+ pcapng_debug("pcapng_read_block: wtap_read_bytes_or_eof() failed, err = %d.", *err);
if (*err == 0 || *err == WTAP_ERR_SHORT_READ) {
/*
* Short read or EOF.
@@ -2249,7 +2243,7 @@ pcapng_read_block(wtap *wth, FILE_T fh, pcapng_t *pn, wtapng_block_t *wblock, in
wblock->type = bh.block_type;
- pcapng_debug1("pcapng_read_block: block_type 0x%x", bh.block_type);
+ pcapng_debug("pcapng_read_block: block_type 0x%x", bh.block_type);
/*
* SHBs have to be treated differently from other blocks, as we
@@ -2298,7 +2292,7 @@ pcapng_read_block(wtap *wth, FILE_T fh, pcapng_t *pn, wtapng_block_t *wblock, in
return PCAPNG_BLOCK_ERROR;
break;
default:
- pcapng_debug2("pcapng_read_block: Unknown block_type: 0x%x (block ignored), block total length %d", bh.block_type, bh.block_total_length);
+ pcapng_debug("pcapng_read_block: Unknown block_type: 0x%x (block ignored), block total length %d", bh.block_type, bh.block_total_length);
if (!pcapng_read_unknown_block(fh, &bh, pn, wblock, err, err_info))
return PCAPNG_BLOCK_ERROR;
break;
@@ -2308,7 +2302,7 @@ pcapng_read_block(wtap *wth, FILE_T fh, pcapng_t *pn, wtapng_block_t *wblock, in
/* sanity check: first and second block lengths must match */
if (!wtap_read_bytes(fh, &block_total_length, sizeof block_total_length,
err, err_info)) {
- pcapng_debug0("pcapng_check_block_trailer: couldn't read second block length");
+ pcapng_debug("pcapng_check_block_trailer: couldn't read second block length");
return PCAPNG_BLOCK_ERROR;
}
@@ -2389,7 +2383,7 @@ pcapng_open(wtap *wth, int *err, gchar **err_info)
wblock.frame_buffer = NULL;
wblock.packet_header = NULL;
- pcapng_debug0("pcapng_open: opening file");
+ pcapng_debug("pcapng_open: opening file");
/* read first block */
switch (pcapng_read_block(wth, wth->fh, &pn, &wblock, err, err_info)) {
@@ -2417,7 +2411,7 @@ pcapng_open(wtap *wth, int *err, gchar **err_info)
* between Windows and UN*X as text rather than
* binary data?
*/
- pcapng_debug1("pcapng_open: first block type %u not SHB", wblock.type);
+ pcapng_debug("pcapng_open: first block type %u not SHB", wblock.type);
pcapng_free_wtapng_block_data(&wblock);
return WTAP_OPEN_NOT_MINE;
}
@@ -2454,10 +2448,10 @@ 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 */
- pcapng_debug0("No more IDBs available...");
+ pcapng_debug("No more IDBs available...");
break;
}
- pcapng_debug1("pcapng_open: Check for more IDB:s, wtap_read_bytes_or_eof() failed, err = %d.", *err);
+ pcapng_debug("pcapng_open: Check for more IDB:s, wtap_read_bytes_or_eof() failed, err = %d.", *err);
return WTAP_OPEN_ERROR;
}
@@ -2468,24 +2462,24 @@ pcapng_open(wtap *wth, int *err, gchar **err_info)
bh.block_type = GUINT32_SWAP_LE_BE(bh.block_type);
}
- pcapng_debug1("pcapng_open: Check for more IDB:s block_type 0x%x", bh.block_type);
+ pcapng_debug("pcapng_open: Check for more IDB:s block_type 0x%x", bh.block_type);
if (bh.block_type != BLOCK_TYPE_IDB) {
break; /* No more IDB:s */
}
if (pcapng_read_block(wth, wth->fh, &pn, &wblock, err, err_info) != PCAPNG_BLOCK_OK) {
if (*err == 0) {
- pcapng_debug0("No more IDBs available...");
+ pcapng_debug("No more IDBs available...");
pcapng_free_wtapng_block_data(&wblock);
break;
} else {
- pcapng_debug0("pcapng_open: couldn't read IDB");
+ pcapng_debug("pcapng_open: couldn't read IDB");
pcapng_free_wtapng_block_data(&wblock);
return WTAP_OPEN_ERROR;
}
}
pcapng_process_idb(wth, pcapng, &wblock);
- pcapng_debug2("pcapng_open: Read IDB number_of_interfaces %u, wtap_encap %i",
+ pcapng_debug("pcapng_open: Read IDB number_of_interfaces %u, wtap_encap %i",
wth->interface_data->len, wth->file_encap);
}
return WTAP_OPEN_MINE;
@@ -2510,10 +2504,10 @@ pcapng_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset)
/* read next block */
while (1) {
*data_offset = file_tell(wth->fh);
- pcapng_debug1("pcapng_read: data_offset is %" G_GINT64_MODIFIER "d", *data_offset);
+ pcapng_debug("pcapng_read: data_offset is %" G_GINT64_MODIFIER "d", *data_offset);
if (pcapng_read_block(wth, wth->fh, pcapng, &wblock, err, err_info) != PCAPNG_BLOCK_OK) {
- pcapng_debug1("pcapng_read: data_offset is finally %" G_GINT64_MODIFIER "d", *data_offset);
- pcapng_debug0("pcapng_read: couldn't read packet block");
+ pcapng_debug("pcapng_read: data_offset is finally %" G_GINT64_MODIFIER "d", *data_offset);
+ pcapng_debug("pcapng_read: couldn't read packet block");
return FALSE;
}
@@ -2535,26 +2529,26 @@ pcapng_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset)
case(BLOCK_TYPE_IDB):
/* A new interface */
- pcapng_debug0("pcapng_read: block type BLOCK_TYPE_IDB");
+ pcapng_debug("pcapng_read: block type BLOCK_TYPE_IDB");
pcapng_process_idb(wth, pcapng, &wblock);
break;
case(BLOCK_TYPE_NRB):
/* More name resolution entries */
- pcapng_debug0("pcapng_read: block type BLOCK_TYPE_NRB");
+ pcapng_debug("pcapng_read: block type BLOCK_TYPE_NRB");
break;
case(BLOCK_TYPE_ISB):
/* Another interface statistics report */
- pcapng_debug0("pcapng_read: block type BLOCK_TYPE_ISB");
+ pcapng_debug("pcapng_read: block type BLOCK_TYPE_ISB");
if (wth->interface_data->len <= wblock.data.if_stats.interface_id) {
- pcapng_debug1("pcapng_read: BLOCK_TYPE_ISB wblock.if_stats.interface_id %u >= number_of_interfaces", wblock.data.if_stats.interface_id);
+ pcapng_debug("pcapng_read: BLOCK_TYPE_ISB wblock.if_stats.interface_id %u >= number_of_interfaces", wblock.data.if_stats.interface_id);
} else {
/* Get the interface description */
wtapng_if_descr = &g_array_index(wth->interface_data, wtapng_if_descr_t, wblock.data.if_stats.interface_id);
if (wtapng_if_descr->num_stat_entries == 0) {
/* First ISB found, no previous entry */
- pcapng_debug0("pcapng_read: block type BLOCK_TYPE_ISB. First ISB found, no previous entry");
+ pcapng_debug("pcapng_read: block type BLOCK_TYPE_ISB. First ISB found, no previous entry");
wtapng_if_descr->interface_statistics = g_array_new(FALSE, FALSE, sizeof(wtapng_if_stats_t));
}
@@ -2578,15 +2572,15 @@ pcapng_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset)
default:
/* XXX - improve handling of "unknown" blocks */
- pcapng_debug1("pcapng_read: Unknown block type 0x%08x", wblock.type);
+ pcapng_debug("pcapng_read: Unknown block type 0x%08x", wblock.type);
break;
}
}
got_packet:
- /*pcapng_debug2("Read length: %u Packet length: %u", bytes_read, wth->phdr.caplen);*/
- pcapng_debug1("pcapng_read: data_offset is finally %" G_GINT64_MODIFIER "d", *data_offset);
+ /*pcapng_debug("Read length: %u Packet length: %u", bytes_read, wth->phdr.caplen);*/
+ pcapng_debug("pcapng_read: data_offset is finally %" G_GINT64_MODIFIER "d", *data_offset);
return TRUE;
}
@@ -2607,7 +2601,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 */
}
- pcapng_debug1("pcapng_seek_read: reading at offset %" G_GINT64_MODIFIER "u", seek_off);
+ pcapng_debug("pcapng_seek_read: reading at offset %" G_GINT64_MODIFIER "u", seek_off);
wblock.frame_buffer = buf;
wblock.packet_header = phdr;
@@ -2616,7 +2610,7 @@ pcapng_seek_read(wtap *wth, gint64 seek_off,
ret = pcapng_read_block(wth, wth->random_fh, pcapng, &wblock, err, err_info);
pcapng_free_wtapng_block_data(&wblock);
if (ret != PCAPNG_BLOCK_OK) {
- pcapng_debug1("pcapng_seek_read: couldn't read packet block (err=%d).",
+ pcapng_debug("pcapng_seek_read: couldn't read packet block (err=%d).",
*err);
return FALSE;
}
@@ -2625,7 +2619,7 @@ pcapng_seek_read(wtap *wth, gint64 seek_off,
or a "Simple Packet Block" */
if (wblock.type != BLOCK_TYPE_PB && wblock.type != BLOCK_TYPE_EPB &&
wblock.type != BLOCK_TYPE_SPB) {
- pcapng_debug1("pcapng_seek_read: block type %u not PB/EPB/SPB", wblock.type);
+ pcapng_debug("pcapng_seek_read: block type %u not PB/EPB/SPB", wblock.type);
return FALSE;
}
@@ -2639,7 +2633,7 @@ pcapng_close(wtap *wth)
{
pcapng_t *pcapng = (pcapng_t *)wth->priv;
- pcapng_debug0("pcapng_close: closing file");
+ pcapng_debug("pcapng_close: closing file");
g_array_free(pcapng->interfaces, TRUE);
}
@@ -2657,7 +2651,7 @@ pcapng_write_section_header_block(wtap_dumper *wdh, int *err)
guint32 comment_pad_len = 0, shb_hardware_pad_len = 0, shb_os_pad_len = 0, shb_user_appl_pad_len = 0;
if (wdh->shb_hdr) {
- pcapng_debug0("pcapng_write_section_header_block: Have shb_hdr");
+ pcapng_debug("pcapng_write_section_header_block: Have shb_hdr");
/* Check if we should write comment option */
if (wdh->shb_hdr->opt_comment) {
have_options = TRUE;
@@ -2715,7 +2709,7 @@ pcapng_write_section_header_block(wtap_dumper *wdh, int *err)
/* write block header */
bh.block_type = BLOCK_TYPE_SHB;
bh.block_total_length = (guint32)(sizeof(bh) + sizeof(shb) + options_total_length + 4);
- pcapng_debug2("pcapng_write_section_header_block: Total len %u, Options total len %u",bh.block_total_length, options_total_length);
+ pcapng_debug("pcapng_write_section_header_block: Total len %u, Options total len %u",bh.block_total_length, options_total_length);
if (!wtap_dump_file_write(wdh, &bh, sizeof bh, err))
return FALSE;
@@ -2747,7 +2741,7 @@ pcapng_write_section_header_block(wtap_dumper *wdh, int *err)
wdh->bytes_dumped += 4;
/* Write the comments string */
- pcapng_debug3("pcapng_write_section_header_block, comment:'%s' comment_len %u comment_pad_len %u" , wdh->shb_hdr->opt_comment, comment_len, comment_pad_len);
+ pcapng_debug("pcapng_write_section_header_block, comment:'%s' comment_len %u comment_pad_len %u" , wdh->shb_hdr->opt_comment, comment_len, comment_pad_len);
if (!wtap_dump_file_write(wdh, wdh->shb_hdr->opt_comment, comment_len, err))
return FALSE;
wdh->bytes_dumped += comment_len;
@@ -2768,7 +2762,7 @@ pcapng_write_section_header_block(wtap_dumper *wdh, int *err)
wdh->bytes_dumped += 4;
/* Write the string */
- pcapng_debug3("pcapng_write_section_header_block, shb_hardware:'%s' shb_hardware_len %u shb_hardware_pad_len %u" , wdh->shb_hdr->shb_hardware, shb_hardware_len, shb_hardware_pad_len);
+ pcapng_debug("pcapng_write_section_header_block, shb_hardware:'%s' shb_hardware_len %u shb_hardware_pad_len %u" , wdh->shb_hdr->shb_hardware, shb_hardware_len, shb_hardware_pad_len);
if (!wtap_dump_file_write(wdh, wdh->shb_hdr->shb_hardware, shb_hardware_len, err))
return FALSE;
wdh->bytes_dumped += shb_hardware_len;
@@ -2789,7 +2783,7 @@ pcapng_write_section_header_block(wtap_dumper *wdh, int *err)
wdh->bytes_dumped += 4;
/* Write the string */
- pcapng_debug3("pcapng_write_section_header_block, shb_os:'%s' shb_os_len %u shb_os_pad_len %u" , wdh->shb_hdr->shb_os, shb_os_len, shb_os_pad_len);
+ pcapng_debug("pcapng_write_section_header_block, shb_os:'%s' shb_os_len %u shb_os_pad_len %u" , wdh->shb_hdr->shb_os, shb_os_len, shb_os_pad_len);
if (!wtap_dump_file_write(wdh, wdh->shb_hdr->shb_os, shb_os_len, err))
return FALSE;
wdh->bytes_dumped += shb_os_len;
@@ -2810,7 +2804,7 @@ pcapng_write_section_header_block(wtap_dumper *wdh, int *err)
wdh->bytes_dumped += 4;
/* Write the comments string */
- pcapng_debug3("pcapng_write_section_header_block, shb_user_appl:'%s' shb_user_appl_len %u shb_user_appl_pad_len %u" , wdh->shb_hdr->shb_user_appl, shb_user_appl_len, shb_user_appl_pad_len);
+ pcapng_debug("pcapng_write_section_header_block, shb_user_appl:'%s' shb_user_appl_len %u shb_user_appl_pad_len %u" , wdh->shb_hdr->shb_user_appl, shb_user_appl_len, shb_user_appl_pad_len);
if (!wtap_dump_file_write(wdh, wdh->shb_hdr->shb_user_appl, shb_user_appl_len, err))
return FALSE;
wdh->bytes_dumped += shb_user_appl_len;
@@ -2855,7 +2849,7 @@ pcapng_write_if_descr_block(wtap_dumper *wdh, wtapng_if_descr_t *int_data, int *
guint32 comment_pad_len = 0, if_name_pad_len = 0, if_description_pad_len = 0, if_os_pad_len = 0, if_filter_str_pad_len = 0;
- pcapng_debug3("pcapng_write_if_descr_block: encap = %d (%s), snaplen = %d",
+ pcapng_debug("pcapng_write_if_descr_block: encap = %d (%s), snaplen = %d",
int_data->link_type,
wtap_encap_string(wtap_pcap_encap_to_wtap_encap(int_data->link_type)),
int_data->snap_len);
@@ -2996,7 +2990,7 @@ pcapng_write_if_descr_block(wtap_dumper *wdh, wtapng_if_descr_t *int_data, int *
wdh->bytes_dumped += 4;
/* Write the comments string */
- pcapng_debug3("pcapng_write_if_descr_block, comment:'%s' comment_len %u comment_pad_len %u" , int_data->opt_comment, comment_len, comment_pad_len);
+ pcapng_debug("pcapng_write_if_descr_block, comment:'%s' comment_len %u comment_pad_len %u" , int_data->opt_comment, comment_len, comment_pad_len);
if (!wtap_dump_file_write(wdh, int_data->opt_comment, comment_len, err))
return FALSE;
wdh->bytes_dumped += comment_len;
@@ -3019,7 +3013,7 @@ pcapng_write_if_descr_block(wtap_dumper *wdh, wtapng_if_descr_t *int_data, int *
wdh->bytes_dumped += 4;
/* Write the comments string */
- pcapng_debug3("pcapng_write_if_descr_block, if_name:'%s' if_name_len %u if_name_pad_len %u" , int_data->if_name, if_name_len, if_name_pad_len);
+ pcapng_debug("pcapng_write_if_descr_block, if_name:'%s' if_name_len %u if_name_pad_len %u" , int_data->if_name, if_name_len, if_name_pad_len);
if (!wtap_dump_file_write(wdh, int_data->if_name, if_name_len, err))
return FALSE;
wdh->bytes_dumped += if_name_len;
@@ -3042,7 +3036,7 @@ pcapng_write_if_descr_block(wtap_dumper *wdh, wtapng_if_descr_t *int_data, int *
wdh->bytes_dumped += 4;
/* Write the comments string */
- pcapng_debug3("pcapng_write_if_descr_block, if_description:'%s' if_description_len %u if_description_pad_len %u" , int_data->if_description, if_description_len, if_description_pad_len);
+ pcapng_debug("pcapng_write_if_descr_block, if_description:'%s' if_description_len %u if_description_pad_len %u" , int_data->if_description, if_description_len, if_description_pad_len);
if (!wtap_dump_file_write(wdh, int_data->if_description, if_description_len, err))
return FALSE;
wdh->bytes_dumped += if_description_len;
@@ -3071,7 +3065,7 @@ pcapng_write_if_descr_block(wtap_dumper *wdh, wtapng_if_descr_t *int_data, int *
wdh->bytes_dumped += 4;
/* Write the comments string */
- pcapng_debug1("pcapng_write_if_descr_block: if_speed %" G_GINT64_MODIFIER "u (bps)", int_data->if_speed);
+ pcapng_debug("pcapng_write_if_descr_block: if_speed %" G_GINT64_MODIFIER "u (bps)", int_data->if_speed);
if (!wtap_dump_file_write(wdh, &int_data->if_speed, sizeof(guint64), err))
return FALSE;
wdh->bytes_dumped += 8;
@@ -3090,7 +3084,7 @@ pcapng_write_if_descr_block(wtap_dumper *wdh, wtapng_if_descr_t *int_data, int *
wdh->bytes_dumped += 4;
/* Write the time stamp resolution */
- pcapng_debug1("pcapng_write_if_descr_block: if_tsresol %u", int_data->if_tsresol);
+ pcapng_debug("pcapng_write_if_descr_block: if_tsresol %u", int_data->if_tsresol);
if (!wtap_dump_file_write(wdh, &int_data->if_tsresol, 1, err))
return FALSE;
wdh->bytes_dumped += 1;
@@ -3119,7 +3113,7 @@ pcapng_write_if_descr_block(wtap_dumper *wdh, wtapng_if_descr_t *int_data, int *
wdh->bytes_dumped += 1;
/* Write the comments string */
- pcapng_debug3("pcapng_write_if_descr_block, if_filter_str:'%s' if_filter_str_len %u if_filter_str_pad_len %u" , int_data->if_filter_str, if_filter_str_len, if_filter_str_pad_len);
+ pcapng_debug("pcapng_write_if_descr_block, if_filter_str:'%s' if_filter_str_len %u if_filter_str_pad_len %u" , int_data->if_filter_str, if_filter_str_len, if_filter_str_pad_len);
/* if_filter_str_len includes the leading byte indicating filter type (libpcap str or BPF code) */
if (!wtap_dump_file_write(wdh, int_data->if_filter_str, if_filter_str_len-1, err))
return FALSE;
@@ -3143,7 +3137,7 @@ pcapng_write_if_descr_block(wtap_dumper *wdh, wtapng_if_descr_t *int_data, int *
wdh->bytes_dumped += 4;
/* Write the comments string */
- pcapng_debug3("pcapng_write_if_descr_block, if_os:'%s' if_os_len %u if_os_pad_len %u" , int_data->if_os, if_os_len, if_os_pad_len);
+ pcapng_debug("pcapng_write_if_descr_block, if_os:'%s' if_os_len %u if_os_pad_len %u" , int_data->if_os, if_os_len, if_os_pad_len);
if (!wtap_dump_file_write(wdh, int_data->if_os, if_os_len, err))
return FALSE;
wdh->bytes_dumped += if_os_len;
@@ -3194,7 +3188,7 @@ pcapng_write_interface_statistics_block(wtap_dumper *wdh, wtapng_if_stats_t *if_
guint32 comment_len = 0;
guint32 comment_pad_len = 0;
- pcapng_debug0("pcapng_write_interface_statistics_block");
+ pcapng_debug("pcapng_write_interface_statistics_block");
/* Calculate options length */
@@ -3277,7 +3271,7 @@ pcapng_write_interface_statistics_block(wtap_dumper *wdh, wtapng_if_stats_t *if_
wdh->bytes_dumped += 4;
/* Write the comments string */
- pcapng_debug3("pcapng_write_interface_statistics_block, comment:'%s' comment_len %u comment_pad_len %u" , if_stats->opt_comment, comment_len, comment_pad_len);
+ pcapng_debug("pcapng_write_interface_statistics_block, comment:'%s' comment_len %u comment_pad_len %u" , if_stats->opt_comment, comment_len, comment_pad_len);
if (!wtap_dump_file_write(wdh, if_stats->opt_comment, comment_len, err))
return FALSE;
wdh->bytes_dumped += comment_len;
@@ -3302,7 +3296,7 @@ pcapng_write_interface_statistics_block(wtap_dumper *wdh, wtapng_if_stats_t *if_
wdh->bytes_dumped += 4;
/* Write isb_starttime */
- pcapng_debug1("pcapng_write_interface_statistics_block, isb_starttime: %" G_GINT64_MODIFIER "u" , if_stats->isb_starttime);
+ pcapng_debug("pcapng_write_interface_statistics_block, isb_starttime: %" G_GINT64_MODIFIER "u" , if_stats->isb_starttime);
if (!wtap_dump_file_write(wdh, &high, 4, err))
return FALSE;
wdh->bytes_dumped += 4;
@@ -3323,7 +3317,7 @@ pcapng_write_interface_statistics_block(wtap_dumper *wdh, wtapng_if_stats_t *if_
wdh->bytes_dumped += 4;
/* Write isb_endtime */
- pcapng_debug1("pcapng_write_interface_statistics_block, isb_starttime: %" G_GINT64_MODIFIER "u" , if_stats->isb_endtime);
+ pcapng_debug("pcapng_write_interface_statistics_block, isb_starttime: %" G_GINT64_MODIFIER "u" , if_stats->isb_endtime);
if (!wtap_dump_file_write(wdh, &high, 4, err))
return FALSE;
wdh->bytes_dumped += 4;
@@ -3340,7 +3334,7 @@ pcapng_write_interface_statistics_block(wtap_dumper *wdh, wtapng_if_stats_t *if_
wdh->bytes_dumped += 4;
/* Write isb_ifrecv */
- pcapng_debug1("pcapng_write_interface_statistics_block, isb_ifrecv: %" G_GINT64_MODIFIER "u" , if_stats->isb_ifrecv);
+ pcapng_debug("pcapng_write_interface_statistics_block, isb_ifrecv: %" G_GINT64_MODIFIER "u" , if_stats->isb_ifrecv);
if (!wtap_dump_file_write(wdh, &if_stats->isb_ifrecv, 8, err))
return FALSE;
wdh->bytes_dumped += 8;
@@ -3354,7 +3348,7 @@ pcapng_write_interface_statistics_block(wtap_dumper *wdh, wtapng_if_stats_t *if_
wdh->bytes_dumped += 4;
/* Write isb_ifdrop */
- pcapng_debug1("pcapng_write_interface_statistics_block, isb_ifdrop: %" G_GINT64_MODIFIER "u" , if_stats->isb_ifdrop);
+ pcapng_debug("pcapng_write_interface_statistics_block, isb_ifdrop: %" G_GINT64_MODIFIER "u" , if_stats->isb_ifdrop);
if (!wtap_dump_file_write(wdh, &if_stats->isb_ifdrop, 8, err))
return FALSE;
wdh->bytes_dumped += 8;
@@ -3368,7 +3362,7 @@ pcapng_write_interface_statistics_block(wtap_dumper *wdh, wtapng_if_stats_t *if_
wdh->bytes_dumped += 4;
/* Write isb_filteraccept */
- pcapng_debug1("pcapng_write_interface_statistics_block, isb_filteraccept: %" G_GINT64_MODIFIER "u" , if_stats->isb_filteraccept);
+ pcapng_debug("pcapng_write_interface_statistics_block, isb_filteraccept: %" G_GINT64_MODIFIER "u" , if_stats->isb_filteraccept);
if (!wtap_dump_file_write(wdh, &if_stats->isb_filteraccept, 8, err))
return FALSE;
wdh->bytes_dumped += 8;
@@ -3382,7 +3376,7 @@ pcapng_write_interface_statistics_block(wtap_dumper *wdh, wtapng_if_stats_t *if_
wdh->bytes_dumped += 4;
/* Write isb_osdrop */
- pcapng_debug1("pcapng_write_interface_statistics_block, isb_osdrop: %" G_GINT64_MODIFIER "u" , if_stats->isb_osdrop);
+ pcapng_debug("pcapng_write_interface_statistics_block, isb_osdrop: %" G_GINT64_MODIFIER "u" , if_stats->isb_osdrop);
if (!wtap_dump_file_write(wdh, &if_stats->isb_osdrop, 8, err))
return FALSE;
wdh->bytes_dumped += 8;
@@ -3396,7 +3390,7 @@ pcapng_write_interface_statistics_block(wtap_dumper *wdh, wtapng_if_stats_t *if_
wdh->bytes_dumped += 4;
/* Write isb_usrdeliv */
- pcapng_debug1("pcapng_write_interface_statistics_block, isb_usrdeliv: %" G_GINT64_MODIFIER "u" , if_stats->isb_usrdeliv);
+ pcapng_debug("pcapng_write_interface_statistics_block, isb_usrdeliv: %" G_GINT64_MODIFIER "u" , if_stats->isb_usrdeliv);
if (!wtap_dump_file_write(wdh, &if_stats->isb_usrdeliv, 8, err))
return FALSE;
wdh->bytes_dumped += 8;
@@ -3561,7 +3555,7 @@ pcapng_write_enhanced_packet_block(wtap_dumper *wdh,
wdh->bytes_dumped += 4;
/* Write the comments string */
- pcapng_debug3("pcapng_write_enhanced_packet_block, comment:'%s' comment_len %u comment_pad_len %u" , phdr->opt_comment, comment_len, comment_pad_len);
+ pcapng_debug("pcapng_write_enhanced_packet_block, comment:'%s' comment_len %u comment_pad_len %u" , phdr->opt_comment, comment_len, comment_pad_len);
if (!wtap_dump_file_write(wdh, phdr->opt_comment, comment_len, err))
return FALSE;
wdh->bytes_dumped += comment_len;
@@ -3573,7 +3567,7 @@ pcapng_write_enhanced_packet_block(wtap_dumper *wdh,
wdh->bytes_dumped += comment_pad_len;
}
- pcapng_debug2("pcapng_write_enhanced_packet_block: Wrote Options comments: comment_len %u, comment_pad_len %u",
+ pcapng_debug("pcapng_write_enhanced_packet_block: Wrote Options comments: comment_len %u, comment_pad_len %u",
comment_len,
comment_pad_len);
}
@@ -3586,7 +3580,7 @@ pcapng_write_enhanced_packet_block(wtap_dumper *wdh,
if (!wtap_dump_file_write(wdh, &phdr->pack_flags, 4, err))
return FALSE;
wdh->bytes_dumped += 4;
- pcapng_debug1("pcapng_write_enhanced_packet_block: Wrote Options packet flags: %x", phdr->pack_flags);
+ pcapng_debug("pcapng_write_enhanced_packet_block: Wrote Options packet flags: %x", phdr->pack_flags);
}
/* Write end of options if we have options */
if (have_options) {
@@ -3658,7 +3652,7 @@ pcapng_write_name_resolution_block(wtap_dumper *wdh, int *err)
memcpy(rec_data + rec_off, &bh.block_total_length, sizeof(bh.block_total_length));
- pcapng_debug2("pcapng_write_name_resolution_block: Write bh.block_total_length bytes %d, rec_off %u", bh.block_total_length, rec_off);
+ pcapng_debug("pcapng_write_name_resolution_block: Write bh.block_total_length bytes %d, rec_off %u", bh.block_total_length, rec_off);
if (!wtap_dump_file_write(wdh, rec_data, bh.block_total_length, err)) {
g_free(rec_data);
@@ -3682,7 +3676,7 @@ pcapng_write_name_resolution_block(wtap_dumper *wdh, int *err)
rec_off += namelen;
memset(rec_data + rec_off, 0, PADDING4(namelen));
rec_off += PADDING4(namelen);
- pcapng_debug1("NRB: added IPv4 record for %s", ipv4_hash_list_entry->name);
+ pcapng_debug("NRB: 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);
@@ -3727,7 +3721,7 @@ pcapng_write_name_resolution_block(wtap_dumper *wdh, int *err)
memcpy(rec_data + rec_off, &bh.block_total_length, sizeof(bh.block_total_length));
- pcapng_debug2("pcapng_write_name_resolution_block: Write bh.block_total_length bytes %d, rec_off %u", bh.block_total_length, rec_off);
+ pcapng_debug("pcapng_write_name_resolution_block: Write bh.block_total_length bytes %d, rec_off %u", bh.block_total_length, rec_off);
if (!wtap_dump_file_write(wdh, rec_data, bh.block_total_length, err)) {
g_free(rec_data);
@@ -3751,7 +3745,7 @@ pcapng_write_name_resolution_block(wtap_dumper *wdh, int *err)
rec_off += namelen;
memset(rec_data + rec_off, 0, PADDING4(namelen));
rec_off += PADDING4(namelen);
- pcapng_debug1("NRB: added IPv6 record for %s", ipv6_hash_list_entry->name);
+ pcapng_debug("NRB: 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);
@@ -3801,7 +3795,7 @@ pcapng_write_name_resolution_block(wtap_dumper *wdh, int *err)
memcpy(rec_data + rec_off, &bh.block_total_length, sizeof(bh.block_total_length));
- pcapng_debug2("pcapng_write_name_resolution_block: Write bh.block_total_length bytes %d, rec_off %u", bh.block_total_length, rec_off);
+ pcapng_debug("pcapng_write_name_resolution_block: Write bh.block_total_length bytes %d, rec_off %u", bh.block_total_length, rec_off);
if (!wtap_dump_file_write(wdh, rec_data, bh.block_total_length, err)) {
g_free(rec_data);
@@ -3830,7 +3824,7 @@ pcapng_write_name_resolution_block(wtap_dumper *wdh, int *err)
memset(rec_data + rec_off, 0, comment_pad_len);
rec_off += comment_pad_len;
- pcapng_debug2("pcapng_write_name_resolution_block: Wrote Options comments: comment_len %u, comment_pad_len %u",
+ pcapng_debug("pcapng_write_name_resolution_block: Wrote Options comments: comment_len %u, comment_pad_len %u",
comment_len,
comment_pad_len);
}
@@ -3853,7 +3847,7 @@ pcapng_write_name_resolution_block(wtap_dumper *wdh, int *err)
memcpy(rec_data + rec_off, &bh.block_total_length, sizeof(bh.block_total_length));
- pcapng_debug2("pcapng_write_name_resolution_block: Write bh.block_total_length bytes %d, rec_off %u", bh.block_total_length, rec_off);
+ pcapng_debug("pcapng_write_name_resolution_block: Write bh.block_total_length bytes %d, rec_off %u", bh.block_total_length, rec_off);
if (!wtap_dump_file_write(wdh, rec_data, bh.block_total_length, err)) {
g_free(rec_data);
@@ -3874,7 +3868,7 @@ static gboolean pcapng_dump(wtap_dumper *wdh,
block_handler *handler;
#endif
- pcapng_debug2("pcapng_dump: encap = %d (%s)",
+ pcapng_debug("pcapng_dump: encap = %d (%s)",
phdr->pkt_encap,
wtap_encap_string(phdr->pkt_encap));
@@ -3936,14 +3930,14 @@ static gboolean pcapng_dump_close(wtap_dumper *wdh, int *err)
wtapng_if_stats_t if_stats;
if_stats = g_array_index(int_data.interface_statistics, wtapng_if_stats_t, j);
- pcapng_debug1("pcapng_dump_close: write ISB for interface %u",if_stats.interface_id);
+ pcapng_debug("pcapng_dump_close: write ISB for interface %u",if_stats.interface_id);
if (!pcapng_write_interface_statistics_block(wdh, &if_stats, err)) {
return FALSE;
}
}
}
- pcapng_debug0("pcapng_dump_close");
+ pcapng_debug("pcapng_dump_close");
return TRUE;
}
@@ -3955,13 +3949,13 @@ pcapng_dump_open(wtap_dumper *wdh, int *err)
{
guint i;
- pcapng_debug0("pcapng_dump_open");
+ pcapng_debug("pcapng_dump_open");
/* This is a pcapng file */
wdh->subtype_write = pcapng_dump;
wdh->subtype_close = pcapng_dump_close;
if (wdh->interface_data->len == 0) {
- pcapng_debug0("There are no interfaces. Can't handle that...");
+ pcapng_debug("There are no interfaces. Can't handle that...");
*err = WTAP_ERR_INTERNAL;
return FALSE;
}
@@ -3970,10 +3964,10 @@ pcapng_dump_open(wtap_dumper *wdh, int *err)
if (!pcapng_write_section_header_block(wdh, err)) {
return FALSE;
}
- pcapng_debug0("pcapng_dump_open: wrote section header block.");
+ pcapng_debug("pcapng_dump_open: wrote section header block.");
/* Write the Interface description blocks */
- pcapng_debug1("pcapng_dump_open: Number of IDB:s to write (number of interfaces) %u",
+ pcapng_debug("pcapng_dump_open: Number of IDB:s to write (number of interfaces) %u",
wdh->interface_data->len);
for (i = 0; i < wdh->interface_data->len; i++) {
@@ -3997,7 +3991,7 @@ pcapng_dump_open(wtap_dumper *wdh, int *err)
an error indication otherwise. */
int pcapng_dump_can_write_encap(int wtap_encap)
{
- pcapng_debug2("pcapng_dump_can_write_encap: encap = %d (%s)",
+ pcapng_debug("pcapng_dump_can_write_encap: encap = %d (%s)",
wtap_encap,
wtap_encap_string(wtap_encap));