Remove check_col()

svn path=/trunk/; revision=34426
This commit is contained in:
Jeff Morriss 2010-10-08 01:50:50 +00:00
parent d4c3cbea6d
commit fae45ea6a1
3 changed files with 69 additions and 99 deletions

View File

@ -1972,11 +1972,9 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
"Program: %s (%u)", progname, prog);
}
if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
/* Set the protocol name to the underlying
program name. */
col_set_str(pinfo->cinfo, COL_PROTOCOL, progname);
}
/* Set the protocol name to the underlying
program name. */
col_set_str(pinfo->cinfo, COL_PROTOCOL, progname);
vers = tvb_get_ntohl(tvb, offset+8);
if (rpc_tree) {
@ -2063,22 +2061,17 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* Print the program version, procedure name, and message type (call or reply). */
if (check_col(pinfo->cinfo, COL_INFO)) {
if (first_pdu)
col_clear(pinfo->cinfo, COL_INFO);
else
col_append_str(pinfo->cinfo, COL_INFO, " ; ");
/* Special case for NFSv4 - if the type is COMPOUND, do not print the procedure name */
if (vers==4 && prog==NFS_PROGRAM && !strcmp(procname, "COMPOUND"))
col_append_fstr(pinfo->cinfo, COL_INFO,"V%u %s",
vers,
if (first_pdu)
col_clear(pinfo->cinfo, COL_INFO);
else
col_append_str(pinfo->cinfo, COL_INFO, " ; ");
/* Special case for NFSv4 - if the type is COMPOUND, do not print the procedure name */
if (vers==4 && prog==NFS_PROGRAM && !strcmp(procname, "COMPOUND"))
col_append_fstr(pinfo->cinfo, COL_INFO,"V%u %s", vers,
msg_type_name);
else
col_append_fstr(pinfo->cinfo, COL_INFO,"V%u %s %s",
vers,
procname,
msg_type_name);
}
else
col_append_fstr(pinfo->cinfo, COL_INFO,"V%u %s %s",
vers, procname, msg_type_name);
/* Keep track of the address whence the call came, and the
port to which the call is being sent, so that we can
@ -2157,19 +2150,16 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (pinfo->fd->num != rpc_call->req_num) {
/* No, so it's a duplicate request.
Mark it as such. */
if (check_col(pinfo->cinfo, COL_INFO)) {
col_prepend_fstr(pinfo->cinfo, COL_INFO,
"[RPC retransmission of #%d]", rpc_call->req_num);
}
proto_tree_add_item(rpc_tree,
hf_rpc_dup, tvb, 0,0, TRUE);
proto_tree_add_uint(rpc_tree,
hf_rpc_call_dup, tvb, 0,0, rpc_call->req_num);
col_prepend_fstr(pinfo->cinfo, COL_INFO,
"[RPC retransmission of #%d]",
rpc_call->req_num);
proto_tree_add_item(rpc_tree, hf_rpc_dup, tvb,
0, 0, TRUE);
proto_tree_add_uint(rpc_tree, hf_rpc_call_dup,
tvb, 0,0, rpc_call->req_num);
}
if(rpc_call->rep_num){
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO," (Reply In %d)", rpc_call->rep_num);
}
col_append_fstr(pinfo->cinfo, COL_INFO," (Reply In %d)", rpc_call->rep_num);
}
} else {
/* Prepare the value data.
@ -2268,30 +2258,23 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
ett = rpc_prog->ett;
progname = rpc_prog->progname;
if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
/* Set the protocol name to the underlying
program name. */
col_set_str(pinfo->cinfo, COL_PROTOCOL, progname);
}
/* Set the protocol name to the underlying
program name. */
col_set_str(pinfo->cinfo, COL_PROTOCOL, progname);
}
/* Print the program version, procedure name, and message type (call or reply). */
if (check_col(pinfo->cinfo, COL_INFO)) {
if (first_pdu)
col_clear(pinfo->cinfo, COL_INFO);
else
col_append_str(pinfo->cinfo, COL_INFO, " ; ");
/* Special case for NFSv4 - if the type is COMPOUND, do not print the procedure name */
if (vers==4 && prog==NFS_PROGRAM && !strcmp(procname, "COMPOUND"))
col_append_fstr(pinfo->cinfo, COL_INFO,"V%u %s",
vers,
msg_type_name);
else
col_append_fstr(pinfo->cinfo, COL_INFO,"V%u %s %s",
vers,
procname,
msg_type_name);
}
if (first_pdu)
col_clear(pinfo->cinfo, COL_INFO);
else
col_append_str(pinfo->cinfo, COL_INFO, " ; ");
/* Special case for NFSv4 - if the type is COMPOUND, do not print the procedure name */
if (vers==4 && prog==NFS_PROGRAM && !strcmp(procname, "COMPOUND"))
col_append_fstr(pinfo->cinfo, COL_INFO,"V%u %s",
vers, msg_type_name);
else
col_append_fstr(pinfo->cinfo, COL_INFO,"V%u %s %s",
vers, procname, msg_type_name);
if (rpc_tree) {
proto_item *tmp_item;
@ -2330,9 +2313,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
&ns);
PROTO_ITEM_SET_GENERATED(tmp_item);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO," (Call In %d)", rpc_call->req_num);
}
col_append_fstr(pinfo->cinfo, COL_INFO," (Call In %d)", rpc_call->req_num);
}
@ -2349,10 +2330,8 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* No, so it's a duplicate reply.
Mark it as such. */
if (check_col(pinfo->cinfo, COL_INFO)) {
col_prepend_fstr(pinfo->cinfo, COL_INFO,
col_prepend_fstr(pinfo->cinfo, COL_INFO,
"[RPC duplicate of #%d]", rpc_call->rep_num);
}
tmp_item=proto_tree_add_item(rpc_tree,
hf_rpc_dup, tvb, 0,0, TRUE);
PROTO_ITEM_SET_GENERATED(tmp_item);
@ -2624,13 +2603,11 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* an RPC auth level message, then process the args.
*/
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RPC");
if (check_col(pinfo->cinfo, COL_INFO)) {
col_clear(pinfo->cinfo, COL_INFO);
col_append_fstr(pinfo->cinfo, COL_INFO,
"%s %s XID 0x%x",
val_to_str(gss_proc, rpc_authgssapi_proc, "Unknown (%d)"),
msg_type_name, xid);
}
col_clear(pinfo->cinfo, COL_INFO);
col_append_fstr(pinfo->cinfo, COL_INFO,
"%s %s XID 0x%x",
val_to_str(gss_proc, rpc_authgssapi_proc, "Unknown (%d)"),
msg_type_name, xid);
switch (gss_proc) {

View File

@ -128,7 +128,7 @@ static const value_string token_setting_vals[] = {
{ 0x03, "reserved" },
{ 0, NULL }
};
static int hf_release_token_setting = -1;
static int hf_major_activity_token_setting = -1;
static int hf_synchronize_minor_token_setting = -1;
@ -490,9 +490,9 @@ dissect_parameter(tvbuff_t *tvb, int offset, proto_tree *tree,
tf = proto_tree_add_uint(param_tree,
hf_connect_protocol_options_flags, tvb, offset, 1,
flags);
flags_tree = proto_item_add_subtree(tf,
flags_tree = proto_item_add_subtree(tf,
ett_connect_protocol_options_flags);
proto_tree_add_boolean(flags_tree,
proto_tree_add_boolean(flags_tree,
hf_able_to_receive_extended_concatenated_SPDU,
tvb, offset, 1, flags);
}
@ -520,7 +520,7 @@ dissect_parameter(tvbuff_t *tvb, int offset, proto_tree *tree,
hf_data_separation_function_unit, tvb, offset, 2,
flags);
proto_tree_add_boolean(flags_tree,
hf_symmetric_synchronize_function_unit,
hf_symmetric_synchronize_function_unit,
tvb, offset, 2, flags);
proto_tree_add_boolean(flags_tree,
hf_typed_data_function_unit, tvb, offset, 2, flags);
@ -529,21 +529,21 @@ dissect_parameter(tvbuff_t *tvb, int offset, proto_tree *tree,
proto_tree_add_boolean(flags_tree,
hf_capability_function_unit, tvb, offset, 2, flags);
proto_tree_add_boolean(flags_tree,
hf_negotiated_release_function_unit,
hf_negotiated_release_function_unit,
tvb, offset, 2, flags);
proto_tree_add_boolean(flags_tree,
hf_activity_management_function_unit,
hf_activity_management_function_unit,
tvb, offset, 2, flags);
proto_tree_add_boolean(flags_tree,
hf_resynchronize_function_unit, tvb, offset, 2,
flags);
proto_tree_add_boolean(flags_tree,
hf_major_resynchronize_function_unit,
hf_major_resynchronize_function_unit,
tvb, offset, 2, flags);
proto_tree_add_boolean(flags_tree,
hf_minor_resynchronize_function_unit,
hf_minor_resynchronize_function_unit,
tvb, offset, 2, flags);
proto_tree_add_boolean(flags_tree,
proto_tree_add_boolean(flags_tree,
hf_expedited_data_resynchronize_function_unit,
tvb, offset, 2, flags);
proto_tree_add_boolean(flags_tree,
@ -641,7 +641,7 @@ dissect_parameter(tvbuff_t *tvb, int offset, proto_tree *tree,
if(!(flags & BEGINNING_SPDU)) {
/* X.225 7.11.2 also states:
* "All DATA TRANSFER SPDUs, except the last DATA TRANSFER SPDU in a sequence greater than one, must have user information"
* So if BEGINNING_SPDU and END_SPDU are set in the enclosure item, then this is presumably a sequence of one and
* So if BEGINNING_SPDU and END_SPDU are set in the enclosure item, then this is presumably a sequence of one and
* consequently there must be user information.
*
* So, there is only no user information if *only* END_SPDU is set.
@ -702,16 +702,16 @@ dissect_parameter(tvbuff_t *tvb, int offset, proto_tree *tree,
/*
0: Rejection by called SS-user; reason not specified.
1: Rejection by called SS-user due to temporary congestion.
2: Rejection by called SS-user. Subsequent octets may be used for user data
up to a length of 512 octets if Protocol Version 1 has been selected, and up
to a length such that the total length (including SI and LI) of the SPDU
2: Rejection by called SS-user. Subsequent octets may be used for user data
up to a length of 512 octets if Protocol Version 1 has been selected, and up
to a length such that the total length (including SI and LI) of the SPDU
does not exceed 65 539 octets if Protocol Version 2 has been selected.
128 + 1: Session Selector unknown.
128 + 2: SS-user not attached to SSAP.
128 + 3: SPM congestion at connect time.
128 + 4: Proposed protocol versions not supported.
128 + 5: Rejection by the SPM; reason not specified.
128 + 6: Rejection by the SPM; implementation restriction stated in the
128 + 6: Rejection by the SPM; implementation restriction stated in the
PICS. */
if (param_len < 1)
{
@ -855,7 +855,7 @@ dissect_parameter_group(tvbuff_t *tvb, int offset, proto_tree *tree,
proto_tree_add_text(param_tree, tvb, offset, len_len,
"Parameter length: %u", param_len);
offset += len_len;
if (param_str != NULL)
{
switch(param_type)
@ -934,7 +934,7 @@ dissect_parameters(tvbuff_t *tvb, int offset, guint16 len, proto_tree *tree,
proto_tree_add_text(param_tree, tvb, offset, len_len,
"Parameter length: %u", param_len);
offset += len_len;
if (param_str != NULL)
{
switch(param_type)
@ -1002,8 +1002,7 @@ dissect_spdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
session.rtse_reassemble = FALSE;
if(connectionless) {
if (check_col(pinfo->cinfo, COL_INFO))
col_add_str(pinfo->cinfo, COL_INFO,
col_add_str(pinfo->cinfo, COL_INFO,
val_to_str(type, ses_vals, "Unknown SPDU type (0x%02x)"));
if (tree) {
ti = proto_tree_add_item(tree, proto_clses, tvb, offset,
@ -1015,8 +1014,7 @@ dissect_spdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
has_user_information = TRUE;
}
else if (tokens) {
if (check_col(pinfo->cinfo, COL_INFO))
col_add_str(pinfo->cinfo, COL_INFO,
col_add_str(pinfo->cinfo, COL_INFO,
val_to_str(type, ses_category0_vals, "Unknown SPDU type (0x%02x)"));
if (tree) {
ti = proto_tree_add_item(tree, proto_ses, tvb, offset,
@ -1026,8 +1024,7 @@ dissect_spdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
offset, 1, type);
}
} else {
if (check_col(pinfo->cinfo, COL_INFO))
col_add_str(pinfo->cinfo, COL_INFO,
col_add_str(pinfo->cinfo, COL_INFO,
val_to_str(type, ses_vals, "Unknown SPDU type (0x%02x)"));
if (tree) {
ti = proto_tree_add_item(tree, proto_ses, tvb, offset,
@ -1077,7 +1074,7 @@ dissect_spdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
pinfo, &session))
has_user_information = FALSE;
offset += parameters_len;
proto_item_set_end(ti, tvb, offset);
/* Dissect user information, if present */
@ -1861,9 +1858,9 @@ dissect_ses_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
}
}
/* some Siemens SIMATIC protocols also use COTP, and shouldn't be
/* some Siemens SIMATIC protocols also use COTP, and shouldn't be
* misinterpreted as SES.
* the starter in this case is fixed to 0x32 (SES_MINOR_SYNC_ACK for SES),
* the starter in this case is fixed to 0x32 (SES_MINOR_SYNC_ACK for SES),
* so if the parameter type is unknown, it's probably SIMATIC */
if(type == 0x32 && tvb_length(tvb) >= 3) {
type = tvb_get_guint8(tvb, offset+2);
@ -1895,7 +1892,7 @@ proto_reg_handoff_ses(void)
/* define sub dissector */
pres_handle = find_dissector("pres");
/* add our session dissector to cotp dissector list
/* add our session dissector to cotp dissector list
* and cotp_is dissector list*/
heur_dissector_add("cotp", dissect_ses_heur, proto_ses);
heur_dissector_add("cotp_is", dissect_ses_heur, proto_ses);

View File

@ -104,13 +104,9 @@ dissect_vlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tci = tvb_get_ntohs( tvb, 0 );
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "PRI: %u CFI: %u ID: %u",
(tci >> 13), ((tci >> 12) & 1), (tci & 0xFFF));
}
if ( check_col(pinfo->cinfo, COL_8021Q_VLAN_ID)) {
col_add_fstr(pinfo->cinfo, COL_8021Q_VLAN_ID, "%u", (tci & 0xFFF));
}
col_add_fstr(pinfo->cinfo, COL_INFO, "PRI: %u CFI: %u ID: %u",
(tci >> 13), ((tci >> 12) & 1), (tci & 0xFFF));
col_add_fstr(pinfo->cinfo, COL_8021Q_VLAN_ID, "%u", (tci & 0xFFF));
vlan_tree = NULL;
@ -118,7 +114,7 @@ dissect_vlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_vlan, tvb, 0, 4, FALSE);
if (vlan_summary_in_tree) {
proto_item_append_text(ti, ", PRI: %u, CFI: %u, ID: %u",
proto_item_append_text(ti, ", PRI: %u, CFI: %u, ID: %u",
(tci >> 13), ((tci >> 12) & 1), (tci & 0xFFF));
}