Allow use of variadic macros

Remove variadic macros restriction (c99, c++11 feature) from
README.developer. GCC, Clang, MSVC 2005 all support it.

Enable -Wno-variadic-macros in configure.ac and CMakeLists.txt when
-Wpedantic is enabled (which would enable -Wvariadic-macros).

For all files matching 'define\s*\w+[0-9]\(', replace "FOO[0-9]" by
"FOO" and adjust the macro definition accordingly. The nbap dissector
was regenerated after adjusting its template and .cnf file. The
generated code is the same since all files disabled the debug macros.

Discussed at:
https://www.wireshark.org/lists/wireshark-dev/201209/msg00142.html
https://www.wireshark.org/lists/wireshark-dev/201510/msg00012.html

Change-Id: I3b2e22487db817cbbaac774a592669a4f44314b2
Reviewed-on: https://code.wireshark.org/review/10781
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Peter Wu 2015-10-04 16:27:02 +02:00 committed by Guy Harris
parent 5b1d142f52
commit 6d7b29592a
12 changed files with 333 additions and 396 deletions

View File

@ -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.
#

View File

@ -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);
}

View File

@ -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);

View File

@ -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.
#

View File

@ -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:

View File

@ -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. */

View File

@ -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"
}

View File

@ -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;

View File

@ -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.
*

View File

@ -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;

View File

@ -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,

File diff suppressed because it is too large Load Diff