From 55371ca87db45d0e7463cfba3e57c3ef3a742d50 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Tue, 1 Oct 2013 13:02:12 +0000 Subject: [PATCH] Remove check_col for all non-generated DCE/RPC dissectors. svn path=/trunk/; revision=52310 --- epan/dissectors/packet-dcerpc-atsvc.c | 8 +- epan/dissectors/packet-dcerpc-conv.c | 14 +-- epan/dissectors/packet-dcerpc-epm.c | 4 +- epan/dissectors/packet-dcerpc-fileexp.c | 95 +++++----------- epan/dissectors/packet-dcerpc-fldb.c | 107 +++++------------- epan/dissectors/packet-dcerpc-ndr.c | 16 +-- epan/dissectors/packet-dcerpc-netlogon.c | 2 +- epan/dissectors/packet-dcerpc-nt.c | 16 +-- epan/dissectors/packet-dcerpc-rpriv.c | 4 +- epan/dissectors/packet-dcerpc-rs_acct.c | 8 +- epan/dissectors/packet-dcerpc-rs_misc.c | 4 +- epan/dissectors/packet-dcerpc-rs_pgo.c | 70 ++++-------- epan/dissectors/packet-dcerpc-spoolss.c | 135 +++++++++-------------- epan/dissectors/packet-dcerpc-svcctl.c | 3 +- 14 files changed, 149 insertions(+), 337 deletions(-) diff --git a/epan/dissectors/packet-dcerpc-atsvc.c b/epan/dissectors/packet-dcerpc-atsvc.c index 3fb1d09263..2c1eebda33 100644 --- a/epan/dissectors/packet-dcerpc-atsvc.c +++ b/epan/dissectors/packet-dcerpc-atsvc.c @@ -1137,7 +1137,7 @@ atsvc_dissect_JobAdd_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pi offset = dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_atsvc_status, &status); - if (status != 0 && check_col(pinfo->cinfo, COL_INFO)) + if (status != 0) col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str(status, NT_errors, "Unknown NT status 0x%08x")); return offset; @@ -1203,7 +1203,7 @@ atsvc_dissect_JobDel_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pi pinfo->dcerpc_procedure_name="JobDel"; offset = dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_atsvc_status, &status); - if (status != 0 && check_col(pinfo->cinfo, COL_INFO)) + if (status != 0) col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str(status, NT_errors, "Unknown NT status 0x%08x")); return offset; @@ -1322,7 +1322,7 @@ atsvc_dissect_JobEnum_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *p offset = dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_atsvc_status, &status); - if (status != 0 && check_col(pinfo->cinfo, COL_INFO)) + if (status != 0) col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str(status, NT_errors, "Unknown NT status 0x%08x")); return offset; @@ -1411,7 +1411,7 @@ atsvc_dissect_JobGetInfo_response(tvbuff_t *tvb _U_, int offset _U_, packet_info offset = dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_atsvc_status, &status); - if (status != 0 && check_col(pinfo->cinfo, COL_INFO)) + if (status != 0) col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str(status, NT_errors, "Unknown NT status 0x%08x")); return offset; diff --git a/epan/dissectors/packet-dcerpc-conv.c b/epan/dissectors/packet-dcerpc-conv.c index 2ea3f59c2b..f53518016d 100644 --- a/epan/dissectors/packet-dcerpc-conv.c +++ b/epan/dissectors/packet-dcerpc-conv.c @@ -64,13 +64,11 @@ conv_dissect_who_are_you_rqst (tvbuff_t *tvb, int offset, offset = dissect_ndr_uuid_t (tvb, offset, pinfo, tree, drep, hf_conv_who_are_you_rqst_actuid, &actuid); offset = dissect_ndr_time_t (tvb, offset, pinfo, tree, drep, hf_conv_who_are_you_rqst_boot_time, NULL); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_add_fstr(pinfo->cinfo, COL_INFO, + col_add_fstr(pinfo->cinfo, COL_INFO, "conv_who_are_you request actuid: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", actuid.Data1, actuid.Data2, actuid.Data3, actuid.Data4[0], actuid.Data4[1], actuid.Data4[2], actuid.Data4[3], actuid.Data4[4], actuid.Data4[5], actuid.Data4[6], actuid.Data4[7]); - } return offset; } @@ -90,10 +88,8 @@ conv_dissect_who_are_you_resp (tvbuff_t *tvb, int offset, offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_conv_rc, &st); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_add_fstr(pinfo->cinfo, COL_INFO, "conv_who_are_you response seq:%u st:%s", + col_add_fstr(pinfo->cinfo, COL_INFO, "conv_who_are_you response seq:%u st:%s", seq, val_to_str_ext(st, &dce_error_vals_ext, "%u")); - } return offset; } @@ -114,13 +110,11 @@ conv_dissect_who_are_you2_rqst (tvbuff_t *tvb, int offset, offset = dissect_ndr_uuid_t (tvb, offset, pinfo, tree, drep, hf_conv_who_are_you2_rqst_actuid, &actuid); offset = dissect_ndr_time_t (tvb, offset, pinfo, tree, drep, hf_conv_who_are_you2_rqst_boot_time, NULL); - if (check_col(pinfo->cinfo, COL_INFO)) { col_add_fstr(pinfo->cinfo, COL_INFO, "conv_who_are_you2 request actuid: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", actuid.Data1, actuid.Data2, actuid.Data3, actuid.Data4[0], actuid.Data4[1], actuid.Data4[2], actuid.Data4[3], actuid.Data4[4], actuid.Data4[5], actuid.Data4[6], actuid.Data4[7]); - } return offset; } @@ -142,14 +136,12 @@ conv_dissect_who_are_you2_resp (tvbuff_t *tvb, int offset, offset = dissect_ndr_uuid_t (tvb, offset, pinfo, tree, drep, hf_conv_who_are_you2_resp_casuuid, &cas_uuid); offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_conv_rc, &st); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_add_fstr(pinfo->cinfo, COL_INFO, + col_add_fstr(pinfo->cinfo, COL_INFO, "conv_who_are_you2 response seq:%u st:%s cas:%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", seq, val_to_str_ext(st, &dce_error_vals_ext, "%u"), cas_uuid.Data1, cas_uuid.Data2, cas_uuid.Data3, cas_uuid.Data4[0], cas_uuid.Data4[1], cas_uuid.Data4[2], cas_uuid.Data4[3], cas_uuid.Data4[4], cas_uuid.Data4[5], cas_uuid.Data4[6], cas_uuid.Data4[7]); - } return offset; } diff --git a/epan/dissectors/packet-dcerpc-epm.c b/epan/dissectors/packet-dcerpc-epm.c index e5b5a7642b..6b36277a15 100644 --- a/epan/dissectors/packet-dcerpc-epm.c +++ b/epan/dissectors/packet-dcerpc-epm.c @@ -196,9 +196,7 @@ epm_dissect_ept_entry_t(tvbuff_t *tvb, int offset, proto_item_append_text(item, " Service:%s ", str); proto_item_append_text(tree->parent, " Service:%s ", str); } - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ", Service:%s", str); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ", Service:%s", str); } proto_item_set_len(item, offset-old_offset); diff --git a/epan/dissectors/packet-dcerpc-fileexp.c b/epan/dissectors/packet-dcerpc-fileexp.c index 756e6c2584..84b9b56b77 100644 --- a/epan/dissectors/packet-dcerpc-fileexp.c +++ b/epan/dissectors/packet-dcerpc-fileexp.c @@ -311,11 +311,9 @@ inode, volume, etc all will be garbage. offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_error_st, &st); \ st_str = val_to_str_ext (st, &dce_error_vals_ext, "%u"); \ if (st){ \ - if (check_col (pinfo->cinfo, COL_INFO)) \ - col_add_fstr (pinfo->cinfo, COL_INFO, "%s st:%s ", name, st_str); \ + col_add_fstr (pinfo->cinfo, COL_INFO, "%s st:%s ", name, st_str); \ }else{ \ - if (check_col (pinfo->cinfo, COL_INFO)) \ - col_append_fstr (pinfo->cinfo, COL_INFO, " st:%s ", st_str); \ + col_append_fstr (pinfo->cinfo, COL_INFO, " st:%s ", st_str); \ } \ } @@ -371,8 +369,7 @@ dissect_afsFid (tvbuff_t * tvb, int offset, offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fileexp_afsFid_Unique, &unique); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " :FSID:%u ", volume_low); + col_append_fstr (pinfo->cinfo, COL_INFO, " :FSID:%u ", volume_low); if ((vnode == 1) || (vnode == 2)) { @@ -381,8 +378,7 @@ dissect_afsFid (tvbuff_t * tvb, int offset, else { inode = ((volume_low << 16) + vnode) & 0x7fffffff; - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " inode:%u ", inode); + col_append_fstr (pinfo->cinfo, COL_INFO, " inode:%u ", inode); } proto_item_set_len (item, offset - old_offset); @@ -534,8 +530,7 @@ dissect_afsConnParams (tvbuff_t * tvb, int offset, { col_append_str (pinfo->cinfo, COL_INFO, ":512BYTE_BLOCKS"); } - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, + col_append_fstr (pinfo->cinfo, COL_INFO, " Values:%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u", Values[0], Values[1], Values[2], Values[3], Values[4], Values[5], Values[6], Values[7], Values[8], @@ -584,19 +579,16 @@ typedef [string] byte NameString_t[AFS_NAMEMAX]; dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fileexp_afsNameString_t_principalName_size, &string_size); - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " String_size:%u", string_size); if (string_size < AFS_NAMEMAX) { proto_tree_add_item (tree, hf_fileexp_afsNameString_t_principalName_string, tvb, offset, string_size, ENC_ASCII|ENC_NA); namestring = tvb_get_string (wmem_packet_scope(), tvb, offset, string_size); offset += string_size; - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s", namestring); } else { - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " :FIXME!: Invalid string length of %u", string_size); @@ -644,7 +636,6 @@ dissect_afsNetAddr (tvbuff_t * tvb, int offset, if (type) { - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " Type:%u ", type); @@ -661,25 +652,20 @@ dissect_afsNetAddr (tvbuff_t * tvb, int offset, case 1: if (data) { - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " Port:%u", data); } break; case 2: - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " IP:%u.", data); break; case 3: - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, "%u.", data); break; case 4: - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, "%u.", data); break; case 5: - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, "%u", data); break; } @@ -780,8 +766,7 @@ dissect_afsTaggedPath (tvbuff_t * tvb, int offset, tp_length, ENC_ASCII|ENC_NA); tp_chars = tvb_get_string (wmem_packet_scope(), tvb, offset, 1025); offset += 1025; - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " :tp_chars %s", tp_chars); + col_append_fstr (pinfo->cinfo, COL_INFO, " :tp_chars %s", tp_chars); proto_item_set_len (item, offset - old_offset); @@ -828,8 +813,7 @@ dissect_afsAcl (tvbuff_t * tvb, int offset, offset = dissect_ndr_uuid_t (tvb, offset, pinfo, tree, drep, hf_fileexp_afsacl_uuid1, &uuid1); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, + col_append_fstr (pinfo->cinfo, COL_INFO, " - %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", uuid1.Data1, uuid1.Data2, uuid1.Data3, uuid1.Data4[0], uuid1.Data4[1], uuid1.Data4[2], uuid1.Data4[3], @@ -839,8 +823,7 @@ dissect_afsAcl (tvbuff_t * tvb, int offset, offset = dissect_ndr_uuid_t (tvb, offset, pinfo, tree, drep, hf_fileexp_afsacl_defaultcell_uuid, &defaultcell); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, + col_append_fstr (pinfo->cinfo, COL_INFO, " %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", defaultcell.Data1, defaultcell.Data2, defaultcell.Data3, defaultcell.Data4[0], defaultcell.Data4[1], @@ -888,8 +871,7 @@ dissect_afsErrorStatus (tvbuff_t * tvb, int offset, &st); st_str = val_to_str_ext (st, &dce_error_vals_ext, "%u"); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " st:%s ", st_str); + col_append_fstr (pinfo->cinfo, COL_INFO, " st:%s ", st_str); proto_item_set_len (item, offset - old_offset); return offset; @@ -1107,34 +1089,28 @@ dissect_afsstorestatus (tvbuff_t * tvb, int offset, col_append_str (pinfo->cinfo, COL_INFO, " Mask="); if ((mask & AFS_SETMODTIME) == AFS_SETMODTIME) { - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, ":SETMODTIME-%u.%u", modtime_sec, modtime_usec); } if ((mask & AFS_SETOWNER) == AFS_SETOWNER) { - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, ":SETOWNER-%u", owner); } if ((mask & AFS_SETGROUP) == AFS_SETGROUP) { - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, ":SETGROUP-%u", group); } if ((mask & AFS_SETMODE) == AFS_SETMODE) { - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, ":SETMODE-%o", mode); } if ((mask & AFS_SETACCESSTIME) == AFS_SETACCESSTIME) { - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, ":SETACCESSTIME-%u.%u", accesstime_sec, accesstime_usec); } if ((mask & AFS_SETCHANGETIME) == AFS_SETCHANGETIME) { - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, ":SETCHANGETIME-%u.%u", changetime_sec, changetime_usec); } @@ -1228,7 +1204,6 @@ dissect_afstoken (tvbuff_t * tvb, int offset, offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fileexp_endrangeext, &endrangeext); - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " :Tokenid:%u/%u ExpirationTime:%u beginrange:%u endrange:%u beginrangeext:%u endrangeext:%u", tokenid_hi, tokenid_low, expirationtime, beginrange, @@ -1360,12 +1335,10 @@ dissect_afstaggedname (tvbuff_t * tvb, int offset, tn_length, ENC_ASCII|ENC_NA); tn_string = tvb_get_string (wmem_packet_scope(), tvb, offset, 257); offset += 257; - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " :tn_tag: %s", tn_string); } else { - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " :FIXME!: Invalid string length of %u", tn_length); } @@ -1444,7 +1417,6 @@ dissect_minvvp (tvbuff_t * tvb, int offset, dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fileexp_minvvp_low, &minvvp_low); - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " minVVp:%u/%u", minvvp_high, minvvp_low); @@ -1486,7 +1458,7 @@ dissect_afsuuid (tvbuff_t * tvb, int offset, offset = dissect_ndr_uuid_t (tvb, offset, pinfo, tree, drep, hf_fileexp_afsuuid_uuid, &uuid1); -if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, ":%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", uuid1.Data1, uuid1.Data2, uuid1.Data3, uuid1.Data4[0], uuid1.Data4[1], uuid1.Data4[2], uuid1.Data4[3], uuid1.Data4[4], uuid1.Data4[5], uuid1.Data4[6], uuid1.Data4[7]); + col_append_fstr (pinfo->cinfo, COL_INFO, ":%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", uuid1.Data1, uuid1.Data2, uuid1.Data3, uuid1.Data4[0], uuid1.Data4[1], uuid1.Data4[2], uuid1.Data4[3], uuid1.Data4[4], uuid1.Data4[5], uuid1.Data4[6], uuid1.Data4[7]); proto_item_set_len (item, offset - old_offset); return offset; @@ -1527,7 +1499,6 @@ dissect_offsetp (tvbuff_t * tvb, int offset, dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fileexp_offsetp_low, &offsetp_low); - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " offsetp:%u/%u", offsetp_high, offsetp_low); @@ -1571,8 +1542,7 @@ dissect_returntokenidp (tvbuff_t * tvb, int offset, dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fileexp_returntokenidp_low, &returntokenidp_low); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " returnTokenIDp:%u/%u", returntokenidp_high, + col_append_fstr (pinfo->cinfo, COL_INFO, " returnTokenIDp:%u/%u", returntokenidp_high, returntokenidp_low); @@ -1642,8 +1612,7 @@ dissect_volsync (tvbuff_t * tvb, int offset, dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fileexp_vvspare2, &vvspare2); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, + col_append_fstr (pinfo->cinfo, COL_INFO, " volid_hi:%u volid_low:%u vv_hi:%u vv_low:%u vvage:%u vvpingage:%u vvpspare1:%u vvspare2:%u", volid_hi, volid_low, vv_hi, vv_low, vvage, vvpingage, vvspare1, vvspare2); @@ -1957,8 +1926,7 @@ dissect_fetchstatus (tvbuff_t * tvb, int offset, &spare6); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, + col_append_fstr (pinfo->cinfo, COL_INFO, " :interfacever:%u filetype:%u linkcount:%u length:%u dataver:%u author:%u owner:%u group:%u calleraccess:%u anonaccess:%u aclexpire:%u mode:%u parentvnode:%u parentunique:%u modtimesec:%u changetime_sec:%u accesstime_sec:%u servermodtimesec:%u devicenumber:%u blocksused:%u clientspare:%u devicehighbits:%u agtypeunique:%u", interfaceversion, filetype, linkcount, length_low, dataversion_low, author, owner, group, calleraccess, @@ -2019,8 +1987,7 @@ dissect_afsReturnDesc (tvbuff_t * tvb, int offset, offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fileexp_afsreturndesc_type_low, &type_low); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " TokenId:%u/%u Type:%u/%u", + col_append_fstr (pinfo->cinfo, COL_INFO, " TokenId:%u/%u Type:%u/%u", tokenid_high, tokenid_low, type_high, type_low); offset = @@ -2227,8 +2194,7 @@ fileexp_dissect_storedata_rqst (tvbuff_t * tvb, int offset, dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fileexp_length, &length); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " Position:%u/%u Length:%u", + col_append_fstr (pinfo->cinfo, COL_INFO, " Position:%u/%u Length:%u", position_high, position_low, length); offset = @@ -2398,8 +2364,7 @@ fileexp_dissect_fetchdata_rqst (tvbuff_t * tvb, int offset, offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fileexp_length, &length); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " Position:%u/%u Length:%u", + col_append_fstr (pinfo->cinfo, COL_INFO, " Position:%u/%u Length:%u", position_high, position_low, length); offset = @@ -2532,8 +2497,7 @@ fileexp_dissect_storeacl_rqst (tvbuff_t * tvb, int offset, dissect_ndr_pointer (tvb, offset, pinfo, tree, drep, dissect_afsFlags, NDR_POINTER_REF, "afsFlags:", -1); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " aclType:%u",acltype); + col_append_fstr (pinfo->cinfo, COL_INFO, " aclType:%u",acltype); return offset; } @@ -2757,8 +2721,7 @@ fileexp_dissect_readdir_rqst (tvbuff_t * tvb, int offset, dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fileexp_readdir_size, &size); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " Size:%u", size); + col_append_fstr (pinfo->cinfo, COL_INFO, " Size:%u", size); offset = dissect_ndr_pointer (tvb, offset, pinfo, tree, drep, dissect_minvvp, @@ -2845,8 +2808,7 @@ fileexp_dissect_removedir_rqst (tvbuff_t * tvb, int offset, dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fileexp_returntokenidp_low, &returntokenidp_low); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " returnTokenIDp:%u/%u", + col_append_fstr (pinfo->cinfo, COL_INFO, " returnTokenIDp:%u/%u", returntokenidp_high, returntokenidp_low); offset = dissect_ndr_pointer (tvb, offset, pinfo, tree, drep, dissect_minvvp, @@ -2991,8 +2953,7 @@ fileexp_dissect_makemountpoint_rqst (tvbuff_t * tvb, int offset, offset = dissect_afsFlags (tvb, offset, pinfo, tree, drep); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " Type:%u", type); + col_append_fstr (pinfo->cinfo, COL_INFO, " Type:%u", type); return offset; @@ -3044,7 +3005,7 @@ col_append_str (pinfo->cinfo, COL_INFO, " setObjectID"); dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fileexp_setcontext_rqst_parm7, &parm7); -if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " epochTime:%u clientSizesAttrs:%u parm7:%u", epochtime, clientsizesattrs, parm7); + col_append_fstr (pinfo->cinfo, COL_INFO, " epochTime:%u clientSizesAttrs:%u parm7:%u", epochtime, clientsizesattrs, parm7); return offset; } @@ -3647,8 +3608,7 @@ static int dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fileexp_nextoffsetp_low, &nextoffsetp_low); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " NextOffsetp:%u/%u", + col_append_fstr (pinfo->cinfo, COL_INFO, " NextOffsetp:%u/%u", nextoffsetp_high, nextoffsetp_low); /* all packets seem to have SKIPTOKEN/SKIPSTATUS sent, and thus these structures are missing on calls holding tokens. */ @@ -3741,7 +3701,7 @@ static int dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fileexp_gettime_syncdispersion, &syncdispersion); - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " Secondsp:%u Usecondsp:%u SyncDistance:/%u SyncDispersion:%u", secondsp, usecondsp, syncdistance, syncdispersion); + col_append_fstr (pinfo->cinfo, COL_INFO, " Secondsp:%u Usecondsp:%u SyncDistance:/%u SyncDispersion:%u", secondsp, usecondsp, syncdistance, syncdispersion); MACRO_ST_CLEAR ("GetTime reply"); @@ -4028,8 +3988,7 @@ static int dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fileexp_cellidp_low, &cellidp_low); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " CellIDp:%u/%u", cellidp_high, + col_append_fstr (pinfo->cinfo, COL_INFO, " CellIDp:%u/%u", cellidp_high, cellidp_low); /* XXX figure out the afsBulkVolIDS */ @@ -4163,8 +4122,7 @@ static int dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fileexp_offsetp_low, &offsetp_low); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " Offsetp:%u/%u", offsetp_high, + col_append_fstr (pinfo->cinfo, COL_INFO, " Offsetp:%u/%u", offsetp_high, offsetp_low); offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, @@ -4213,8 +4171,7 @@ static int dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fileexp_nextoffsetp_low, &nextoffsetp_low); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " NextOffsetp:%u/%u", + col_append_fstr (pinfo->cinfo, COL_INFO, " NextOffsetp:%u/%u", nextoffsetp_high, nextoffsetp_low); offset = dissect_ndr_pointer (tvb, offset, pinfo, tree, drep, dissect_fetchstatus, diff --git a/epan/dissectors/packet-dcerpc-fldb.c b/epan/dissectors/packet-dcerpc-fldb.c index 20ab95a119..2f9abee238 100644 --- a/epan/dissectors/packet-dcerpc-fldb.c +++ b/epan/dissectors/packet-dcerpc-fldb.c @@ -231,10 +231,8 @@ static const guint8 *st_str; offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_error_st, &st); \ st_str = val_to_str_ext (st, &dce_error_vals_ext, "%u"); \ if (st){ \ - if (check_col (pinfo->cinfo, COL_INFO)) \ col_add_fstr (pinfo->cinfo, COL_INFO, "%s st:%s ", name, st_str); \ } else{ \ - if (check_col (pinfo->cinfo, COL_INFO)) \ col_append_fstr (pinfo->cinfo, COL_INFO, " st:%s ", st_str); \ } @@ -267,7 +265,6 @@ dissect_afsnetaddr (tvbuff_t * tvb, int offset, if (type) { - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " Type:%u ", type); @@ -284,25 +281,20 @@ dissect_afsnetaddr (tvbuff_t * tvb, int offset, case 1: if (data) { - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " Port:%u", + col_append_fstr (pinfo->cinfo, COL_INFO, " Port:%u", data); } break; case 2: - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " IP:%u.", data); break; case 3: - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, "%u.", data); break; case 4: - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, "%u.", data); break; case 5: - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, "%u", data); break; } @@ -351,8 +343,7 @@ dissect_vlconf_cell (tvbuff_t * tvb, int offset, proto_tree_add_item (tree, hf_fldb_vlconf_cell_name, tvb, offset, 114, ENC_ASCII|ENC_NA); name = tvb_get_string (wmem_packet_scope(), tvb, offset, MAXVLCELLCHARS); /* XXX why 114 above and 128 here?? */ offset += MAXVLCELLCHARS; /* some reason this 114 seems to be incorrect... cutting 4 short to compensate.... */ - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " Name: %s", name); + col_append_fstr (pinfo->cinfo, COL_INFO, " Name: %s", name); /* afsHyper CellID; identifier for that cell */ @@ -363,8 +354,7 @@ dissect_vlconf_cell (tvbuff_t * tvb, int offset, offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_vlconf_cell_cellid_low, &cellid_low); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " CellID:%u-%u", cellid_high, + col_append_fstr (pinfo->cinfo, COL_INFO, " CellID:%u-%u", cellid_high, cellid_low); @@ -372,8 +362,7 @@ dissect_vlconf_cell (tvbuff_t * tvb, int offset, offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_vlconf_cell_numservers, &numservers); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " numServers:%u", numservers); + col_append_fstr (pinfo->cinfo, COL_INFO, " numServers:%u", numservers); /* afsNetAddr hostAddr[MAXVLHOSTSPERCELL]; *addresses for cell's servers */ for (i = 0; i < MAXVLHOSTSPERCELL; i++) @@ -390,46 +379,40 @@ dissect_vlconf_cell (tvbuff_t * tvb, int offset, 64, ENC_ASCII|ENC_NA); hostname = tvb_get_string (wmem_packet_scope(), tvb, offset, 64); offset += 64; /* some reason this 114 seems to be incorrect... cutting 4 short to compensate.... */ - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " hostName: %s", hostname); + col_append_fstr (pinfo->cinfo, COL_INFO, " hostName: %s", hostname); } /* unsigned32 spare1; */ offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_vlconf_cell_spare1, &spare1); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " spare1:%u", spare1); + col_append_fstr (pinfo->cinfo, COL_INFO, " spare1:%u", spare1); /* unsigned32 spare2; */ offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_vlconf_cell_spare2, &spare2); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " spare2:%u", spare2); + col_append_fstr (pinfo->cinfo, COL_INFO, " spare2:%u", spare2); /* unsigned32 spare3; */ offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_vlconf_cell_spare3, &spare3); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " spare3:%u", spare3); + col_append_fstr (pinfo->cinfo, COL_INFO, " spare3:%u", spare3); /* unsigned32 spare4; */ offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_vlconf_cell_spare4, &spare4); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " spare4:%u", spare4); + col_append_fstr (pinfo->cinfo, COL_INFO, " spare4:%u", spare4); /* unsigned32 spare5; */ offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_vlconf_cell_spare5, &spare5); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " spare5:%u", spare5); + col_append_fstr (pinfo->cinfo, COL_INFO, " spare5:%u", spare5); proto_item_set_len (item, offset - old_offset); @@ -472,8 +455,7 @@ typedef [string] byte NameString_t[AFS_NAMEMAX]; offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_afsNameString_t_principalName_size, &string_size); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " String_size:%u", string_size); + col_append_fstr (pinfo->cinfo, COL_INFO, " String_size:%u", string_size); if (string_size < AFS_NAMEMAX) { /* proto_tree_add_string(tree, id, tvb, start, length, value_ptr); */ @@ -482,12 +464,10 @@ typedef [string] byte NameString_t[AFS_NAMEMAX]; tvb, offset, string_size, ENC_ASCII|ENC_NA); namestring = tvb_get_string (wmem_packet_scope(), tvb, offset, string_size); offset += string_size; - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s", namestring); } else { - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " :FIXME!: Invalid string length of %u", string_size); @@ -708,28 +688,24 @@ dissect_vldbentry (tvbuff_t * tvb, int offset, ENC_ASCII|ENC_NA); volumename = tvb_get_string (wmem_packet_scope(), tvb, offset, 114); offset += 110; /* some reason this 114 seems to be incorrect... cutting 4 short to compensate.... */ - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " Name: %s", volumename); /* unsigned32 volumeType; */ offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_vldbentry_volumetype, &volumetype); - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " Type:%u", volumetype); /*unsigned32 nServers; */ offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_vldbentry_nservers, &nservers); - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " nServers:%u", nservers); /* afsNetAddr siteAddr[MAXNSERVERS]; 16 */ for (i = 0; i < MAXNSERVERS; i++) { - /* if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " Site:%u", i); */ + /* col_append_fstr (pinfo->cinfo, COL_INFO, " Site:%u", i); */ offset = dissect_afsnetaddr (tvb, offset, pinfo, tree, drep); } @@ -742,7 +718,6 @@ dissect_vldbentry (tvbuff_t * tvb, int offset, hf_fldb_vldbentry_sitepartition, &sitepartition); if (sitepartition) { - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " LFS:%u", sitepartition); } @@ -764,7 +739,6 @@ dissect_vldbentry (tvbuff_t * tvb, int offset, &sitemaxreplicalatency); if (sitemaxreplicalatency) { - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " MaxRepLat%d:%u", i, sitemaxreplicalatency); } @@ -776,7 +750,6 @@ dissect_vldbentry (tvbuff_t * tvb, int offset, offset, 64, ENC_ASCII|ENC_NA); siteprincipal = tvb_get_string (wmem_packet_scope(), tvb, offset, 64); offset += 64; - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " Princ: %s", siteprincipal); } @@ -787,7 +760,6 @@ dissect_vldbentry (tvbuff_t * tvb, int offset, offset = dissect_ndr_uuid_t (tvb, offset, pinfo, tree, drep, hf_fldb_vldbentry_siteowner, &siteowner); - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " SiteOwner - %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", siteowner.Data1, siteowner.Data2, siteowner.Data3, @@ -804,7 +776,6 @@ dissect_vldbentry (tvbuff_t * tvb, int offset, offset = dissect_ndr_uuid_t (tvb, offset, pinfo, tree, drep, hf_fldb_vldbentry_siteobjid, &siteobjid); - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " SiteObjID - %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", siteobjid.Data1, siteobjid.Data2, siteobjid.Data3, @@ -826,7 +797,6 @@ dissect_vldbentry (tvbuff_t * tvb, int offset, offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_vldbentry_volids_low, &volids_low); - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " VolIDs%d:%u", i, volids_low); } @@ -840,7 +810,6 @@ dissect_vldbentry (tvbuff_t * tvb, int offset, hf_fldb_vldbentry_voltypes, &voltypes); if (voltypes) { - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " VolTypes:%d:%u", i, voltypes); } @@ -855,7 +824,6 @@ dissect_vldbentry (tvbuff_t * tvb, int offset, hf_fldb_vldbentry_cloneid_low, &cloneid_low); if (cloneid_low) { - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " CloneId:%u", cloneid_low); } @@ -868,7 +836,6 @@ dissect_vldbentry (tvbuff_t * tvb, int offset, offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_vldbentry_maxtotallatency, &maxtotallatency); - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " MaxTotLat:%u", maxtotallatency); @@ -878,7 +845,6 @@ dissect_vldbentry (tvbuff_t * tvb, int offset, dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_vldbentry_hardmaxtotallatency, &hardmaxtotallatency); - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " HardMaxTotLat:%u", hardmaxtotallatency); @@ -888,7 +854,6 @@ dissect_vldbentry (tvbuff_t * tvb, int offset, dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_vldbentry_minimumpouncedally, &minimumpouncedally); - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " minPounceDally:%u", minimumpouncedally); @@ -898,7 +863,6 @@ dissect_vldbentry (tvbuff_t * tvb, int offset, dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_vldbentry_defaultmaxreplicalatency, &defaultmaxreplicalatency); - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " defaultMaxReplicaLatency:%u", defaultmaxreplicalatency); @@ -906,7 +870,6 @@ dissect_vldbentry (tvbuff_t * tvb, int offset, offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_vldbentry_reclaimdally, &reclaimdally); - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " reclaimDally:%u", reclaimdally); @@ -915,7 +878,6 @@ dissect_vldbentry (tvbuff_t * tvb, int offset, offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_vldbentry_whenlocked, &whenlocked); - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " WhenLocked:%u", whenlocked); @@ -923,14 +885,12 @@ dissect_vldbentry (tvbuff_t * tvb, int offset, offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_vldbentry_spare1, &spare1); - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " spare1:%u", spare1); /* unsigned32 spare2; */ offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_vldbentry_spare2, &spare2); - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " spare2:%u", spare2); @@ -938,14 +898,12 @@ dissect_vldbentry (tvbuff_t * tvb, int offset, offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_vldbentry_spare3, &spare3); - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " spare3:%u", spare3); /* unsigned32 spare4; */ offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_vldbentry_spare4, &spare4); - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " spare4:%u", spare4); @@ -954,7 +912,6 @@ dissect_vldbentry (tvbuff_t * tvb, int offset, MAXLOCKNAMELEN, ENC_ASCII|ENC_NA); lockername = tvb_get_string (wmem_packet_scope(), tvb, offset, MAXLOCKNAMELEN); offset += MAXLOCKNAMELEN; /* some reason this 114 seems to be incorrect... cutting 4 short to compensate.... */ - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " LockerName: %s", lockername); /* byte charSpares[50]; */ @@ -962,7 +919,6 @@ dissect_vldbentry (tvbuff_t * tvb, int offset, ENC_ASCII|ENC_NA); charspares = tvb_get_string (wmem_packet_scope(), tvb, offset, 50); offset += 50; /* some reason this 114 seems to be incorrect... cutting 4 short to compensate.... */ - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " charSpares:%s", charspares); @@ -1120,12 +1076,10 @@ fldb_dissect_getsiteinfo_resp (tvbuff_t * tvb, int offset, proto_tree_add_item (tree, hf_fldb_namestring, tvb, offset, 64, ENC_ASCII|ENC_NA); namestring = tvb_get_string (wmem_packet_scope(), tvb, offset, 64); offset += 64; - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " %s", namestring); + col_append_fstr (pinfo->cinfo, COL_INFO, " %s", namestring); offset = dissect_ndr_uuid_t (tvb, offset, pinfo, tree, drep, hf_fldb_uuid_owner, &owner); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, + col_append_fstr (pinfo->cinfo, COL_INFO, " Owner - %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", owner.Data1, owner.Data2, owner.Data3, owner.Data4[0], owner.Data4[1], owner.Data4[2], owner.Data4[3], @@ -1135,8 +1089,7 @@ fldb_dissect_getsiteinfo_resp (tvbuff_t * tvb, int offset, offset = dissect_ndr_uuid_t (tvb, offset, pinfo, tree, drep, hf_fldb_uuid_objid, &objid); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, + col_append_fstr (pinfo->cinfo, COL_INFO, " ObjID - %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", objid.Data1, objid.Data2, objid.Data3, objid.Data4[0], objid.Data4[1], objid.Data4[2], objid.Data4[3], @@ -1165,8 +1118,7 @@ fldb_dissect_getsiteinfo_resp (tvbuff_t * tvb, int offset, dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_spare5, &spare5); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, + col_append_fstr (pinfo->cinfo, COL_INFO, " CreationQuota:%u CreationUses:%u DeletedFlag:%u Spare2:%u Spare3:%u Spare4:%u Spare5:%u", creationquota, creationuses, deletedflag, spare2, spare3, spare4, spare5); @@ -1209,8 +1161,7 @@ fldb_dissect_listentry_rqst (tvbuff_t * tvb, int offset, hf_fldb_listentry_rqst_var1, &var1); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " :PrevIndex: %u", + col_append_fstr (pinfo->cinfo, COL_INFO, " :PrevIndex: %u", previous_index); @@ -1278,8 +1229,7 @@ fldb_dissect_setlock_rqst (tvbuff_t * tvb, int offset, dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_setlock_rqst_voloper, &voloper); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, + col_append_fstr (pinfo->cinfo, COL_INFO, " :FSID:%u/%u VolType:0x%x VolOper:%u", fsid_high, fsid_low, voltype, voloper); @@ -1359,8 +1309,7 @@ fldb_dissect_deleteentry_rqst (tvbuff_t * tvb, int offset, dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_deleteentry_rqst_voloper, &voloper); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " :FSID:%u/%u", fsid_high, + col_append_fstr (pinfo->cinfo, COL_INFO, " :FSID:%u/%u", fsid_high, fsid_low); @@ -1438,8 +1387,7 @@ fldb_dissect_getentrybyid_rqst (tvbuff_t * tvb, int offset, dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_voltype, &voltype); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " VolID:%u/%u VolType:0x%x", + col_append_fstr (pinfo->cinfo, COL_INFO, " VolID:%u/%u VolType:0x%x", volid_high, volid_low, voltype); return offset; @@ -1466,8 +1414,7 @@ fldb_dissect_getnewvolumeids_rqst (tvbuff_t * tvb, int offset, offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_numwanted, &numwanted); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " numWanted:%u", numwanted); + col_append_fstr (pinfo->cinfo, COL_INFO, " numWanted:%u", numwanted); offset = dissect_afsnetaddr (tvb, offset, pinfo, tree, drep); @@ -1543,8 +1490,7 @@ fldb_dissect_releaselock_rqst (tvbuff_t * tvb, int offset, dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_releaselock_rqst_voloper, &voloper); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " :FSID:%u/%u", fsid_high, + col_append_fstr (pinfo->cinfo, COL_INFO, " :FSID:%u/%u", fsid_high, fsid_low); return offset; @@ -1593,8 +1539,7 @@ fldb_dissect_getnextserversbyid_resp (tvbuff_t * tvb, int offset, offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_nextstartp, &nextstartp); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " nextStartP:%u", nextstartp); + col_append_fstr (pinfo->cinfo, COL_INFO, " nextStartP:%u", nextstartp); /* [out] vldbentry *entry, */ @@ -1607,8 +1552,7 @@ fldb_dissect_getnextserversbyid_resp (tvbuff_t * tvb, int offset, dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_fldb_flagsp, &flagsp); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " flagsp:%u", flagsp); + col_append_fstr (pinfo->cinfo, COL_INFO, " flagsp:%u", flagsp); return offset; } @@ -1645,8 +1589,7 @@ fldb_dissect_replaceentry_rqst (tvbuff_t * tvb, int offset, hf_fldb_replaceentry_rqst_voltype, &voltype); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " FSID:%u/%u Name:", fsid_high, + col_append_fstr (pinfo->cinfo, COL_INFO, " FSID:%u/%u Name:", fsid_high, fsid_low); offset = dissect_vldbentry (tvb, offset, pinfo, tree, drep); diff --git a/epan/dissectors/packet-dcerpc-ndr.c b/epan/dissectors/packet-dcerpc-ndr.c index 0c5b91e5d0..943aa8f6d5 100644 --- a/epan/dissectors/packet-dcerpc-ndr.c +++ b/epan/dissectors/packet-dcerpc-ndr.c @@ -107,9 +107,7 @@ PIDL_dissect_uint8(tvbuff_t *tvb, gint offset, packet_info *pinfo, REPORT_DISSECTOR_BUG("Invalid hf->display value"); } - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO," %s:%s", hf_info->name, valstr); - } + col_append_fstr(pinfo->cinfo, COL_INFO," %s:%s", hf_info->name, valstr); } return offset; @@ -191,9 +189,7 @@ PIDL_dissect_uint16(tvbuff_t *tvb, gint offset, packet_info *pinfo, REPORT_DISSECTOR_BUG("Invalid hf->display value"); } - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO," %s:%s", hf_info->name, valstr); - } + col_append_fstr(pinfo->cinfo, COL_INFO," %s:%s", hf_info->name, valstr); } return offset; @@ -322,9 +318,7 @@ PIDL_dissect_uint32(tvbuff_t *tvb, gint offset, packet_info *pinfo, REPORT_DISSECTOR_BUG("Invalid hf->display value"); } - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO," %s:%s", hf_info->name, valstr); - } + col_append_fstr(pinfo->cinfo, COL_INFO," %s:%s", hf_info->name, valstr); } return offset; @@ -439,9 +433,7 @@ PIDL_dissect_uint64(tvbuff_t *tvb, gint offset, packet_info *pinfo, REPORT_DISSECTOR_BUG("Invalid hf->display value"); } - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO," %s:%s", hf_info->name, valstr); - } + col_append_fstr(pinfo->cinfo, COL_INFO," %s:%s", hf_info->name, valstr); } return offset; diff --git a/epan/dissectors/packet-dcerpc-netlogon.c b/epan/dissectors/packet-dcerpc-netlogon.c index 35a527488e..32a2345771 100644 --- a/epan/dissectors/packet-dcerpc-netlogon.c +++ b/epan/dissectors/packet-dcerpc-netlogon.c @@ -4969,7 +4969,7 @@ netlogon_dissect_netrlogoncontrol2_reply(tvbuff_t *tvb, int offset, offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_netlogon_werr_rc, &status); - if (status != 0 && check_col(pinfo->cinfo, COL_INFO)) + if (status != 0) col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str(status, WERR_errors, "Unknown WERR error 0x%08x")); diff --git a/epan/dissectors/packet-dcerpc-nt.c b/epan/dissectors/packet-dcerpc-nt.c index 65b9ba6b7f..49a15fd12d 100644 --- a/epan/dissectors/packet-dcerpc-nt.c +++ b/epan/dissectors/packet-dcerpc-nt.c @@ -357,8 +357,7 @@ static void cb_byte_array_postprocess(packet_info *pinfo, proto_tree *tree _U_, /* Append string to COL_INFO */ if (options & CB_STR_COL_INFO) { - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", s); + col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", s); } /* Append string to upper-level proto_items */ @@ -940,7 +939,7 @@ dissect_ntstatus(tvbuff_t *tvb, gint offset, packet_info *pinfo, offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hfindex, &status); - if (status != 0 && check_col(pinfo->cinfo, COL_INFO)) + if (status != 0) col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str(status, NT_errors, "Unknown error 0x%08x")); @@ -962,7 +961,7 @@ dissect_doserror(tvbuff_t *tvb, gint offset, packet_info *pinfo, offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hfindex, &status); - if (status != 0 && check_col(pinfo->cinfo, COL_INFO)) + if (status != 0) col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str(status, DOS_errors, "Unknown error 0x%08x")); @@ -1292,8 +1291,7 @@ void cb_wstr_postprocess(packet_info *pinfo, proto_tree *tree _U_, /* Append string to COL_INFO */ if (options & CB_STR_COL_INFO) { - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", s); + col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", s); } /* Append string to upper-level proto_items */ @@ -1354,8 +1352,7 @@ void cb_str_postprocess(packet_info *pinfo, proto_tree *tree _U_, /* Append string to COL_INFO */ if (options & CB_STR_COL_INFO) { - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", s); + col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", s); } /* Append string to upper-level proto_items */ @@ -1473,8 +1470,7 @@ dissect_ndr_nt_SID_with_options(tvbuff_t *tvb, int offset, packet_info *pinfo, p while we just do a conformance run, this might have sideeffects so it needs some more thoughts first. */ - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", s); + col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", s); } /* Append string to upper-level proto_items */ diff --git a/epan/dissectors/packet-dcerpc-rpriv.c b/epan/dissectors/packet-dcerpc-rpriv.c index dbfd17f45a..0d6f95915a 100644 --- a/epan/dissectors/packet-dcerpc-rpriv.c +++ b/epan/dissectors/packet-dcerpc-rpriv.c @@ -87,10 +87,8 @@ rpriv_dissect_get_eptgt_rqst (tvbuff_t *tvb, int offset, offset += key_size2; - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, + col_append_fstr(pinfo->cinfo, COL_INFO, " Request for: %s in %s ", key_t2, key_t1); - } return offset; diff --git a/epan/dissectors/packet-dcerpc-rs_acct.c b/epan/dissectors/packet-dcerpc-rs_acct.c index c74e5fc43f..bc3805b866 100644 --- a/epan/dissectors/packet-dcerpc-rs_acct.c +++ b/epan/dissectors/packet-dcerpc-rs_acct.c @@ -69,10 +69,8 @@ rs_acct_dissect_lookup_rqst (tvbuff_t *tvb, int offset, keyx_t = tvb_get_string(wmem_packet_scope(), tvb, offset, key_size); offset += key_size; - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, + col_append_fstr(pinfo->cinfo, COL_INFO, " Request for: %s ", keyx_t); - } } else { col_append_str(pinfo->cinfo, COL_INFO, " Request (other)"); @@ -100,10 +98,8 @@ rs_acct_dissect_get_projlist_rqst (tvbuff_t *tvb, int offset, keyx_t = tvb_get_string(wmem_packet_scope(), tvb, offset, key_size); offset += key_size; - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, + col_append_fstr(pinfo->cinfo, COL_INFO, " Request for: %s", keyx_t); - } return offset; } diff --git a/epan/dissectors/packet-dcerpc-rs_misc.c b/epan/dissectors/packet-dcerpc-rs_misc.c index a0f39cce38..1e99e1f8c7 100644 --- a/epan/dissectors/packet-dcerpc-rs_misc.c +++ b/epan/dissectors/packet-dcerpc-rs_misc.c @@ -67,10 +67,8 @@ rs_misc_dissect_login_get_info_rqst (tvbuff_t *tvb, int offset, key_t1 = tvb_get_string(wmem_packet_scope(), tvb, offset, key_size); offset += key_size; - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, + col_append_fstr(pinfo->cinfo, COL_INFO, "rs_login_get_info Request for: %s ", key_t1); - } } else { col_append_str(pinfo->cinfo, COL_INFO, "rs_login_get_info Request (other)"); diff --git a/epan/dissectors/packet-dcerpc-rs_pgo.c b/epan/dissectors/packet-dcerpc-rs_pgo.c index ee1bce178b..0bcd6d3bbe 100644 --- a/epan/dissectors/packet-dcerpc-rs_pgo.c +++ b/epan/dissectors/packet-dcerpc-rs_pgo.c @@ -128,8 +128,8 @@ dissect_error_status_t (tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * parent_tree, guint8 * drep) { - proto_item *item = NULL; - proto_tree *tree = NULL; + proto_item *item; + proto_tree *tree; int old_offset = offset; guint32 st; dcerpc_info *di; @@ -137,24 +137,19 @@ dissect_error_status_t (tvbuff_t * tvb, int offset, di = (dcerpc_info *)pinfo->private_data; if (di->conformant_run) - { - return offset; - } + { + return offset; + } - if (parent_tree) - { - item = proto_tree_add_text (parent_tree, tvb, offset, -1, - "error_status_t"); - tree = proto_item_add_subtree (item, ett_error_status_t); - } + item = proto_tree_add_text (parent_tree, tvb, offset, -1, "error_status_t"); + tree = proto_item_add_subtree (item, ett_error_status_t); offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_error_status_t, &st); st_str = val_to_str_ext (st, &dce_error_vals_ext, "%u"); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " st:%s ", st_str); + col_append_fstr (pinfo->cinfo, COL_INFO, " st:%s ", st_str); proto_item_set_len (item, offset - old_offset); return offset; @@ -195,8 +190,7 @@ dissect sec_rgy_pname const signed32 sec_rgy_pname_t_size = 257; * In offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_sec_rgy_pname_t_size, &string_size); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " String_size:%u", string_size); + col_append_fstr (pinfo->cinfo, COL_INFO, " String_size:%u", string_size); if (string_size < sec_rgy_pname_t_size) { /* proto_tree_add_string(tree, id, tvb, start, length, value_ptr); */ @@ -205,15 +199,13 @@ dissect sec_rgy_pname const signed32 sec_rgy_pname_t_size = 257; * In tvb, offset, string_size, ENC_ASCII|ENC_NA); if (string_size > 1) { - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s", + col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s", tvb_get_string(wmem_packet_scope(), tvb, offset, string_size)); } offset += string_size; } else { - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " :FIXME!: Invalid string length of %u", string_size); @@ -371,8 +363,7 @@ dissect_rs_cache_data_t (tvbuff_t * tvb, int offset, dissect_dcerpc_time_t (tvb, offset, pinfo, tree, drep, hf_rs_timeval, &org_dtm); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, + col_append_fstr (pinfo->cinfo, COL_INFO, " siteid %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x person_dtm:%u group_dtm:%u org_dtm:%u", uuid1.Data1, uuid1.Data2, uuid1.Data3, uuid1.Data4[0], uuid1.Data4[1], uuid1.Data4[2], uuid1.Data4[3], @@ -417,8 +408,7 @@ dissect_sec_rgy_name_t (tvbuff_t * tvb, int offset, offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_sec_rgy_name_t_size, &string_size); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " String_size:%u", string_size); + col_append_fstr (pinfo->cinfo, COL_INFO, " String_size:%u", string_size); if (string_size < sec_rgy_name_t_size) { /* proto_tree_add_string(tree, id, tvb, start, length, value_ptr); */ @@ -427,15 +417,13 @@ dissect_sec_rgy_name_t (tvbuff_t * tvb, int offset, tvb, offset, string_size, ENC_ASCII|ENC_NA); if (string_size > 1) { - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s", + col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s", tvb_get_string (wmem_packet_scope(), tvb, offset, string_size)); } offset += string_size; } else { - if (check_col (pinfo->cinfo, COL_INFO)) col_append_fstr (pinfo->cinfo, COL_INFO, " :FIXME!: Invalid string length of %u", string_size); @@ -481,8 +469,7 @@ dissect_sec_rgy_domain_t (tvbuff_t * tvb, int offset, dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_sec_rgy_domain_t, &domain_t); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " sec_rgy_domain_t:%u", + col_append_fstr (pinfo->cinfo, COL_INFO, " sec_rgy_domain_t:%u", domain_t); @@ -541,8 +528,7 @@ dissect_sec_rgy_pgo_item_t (tvbuff_t * tvb, int offset, offset += 4; /* XXX */ offset = dissect_sec_rgy_pname_t (tvb, offset, pinfo, tree, drep); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, + col_append_fstr (pinfo->cinfo, COL_INFO, " sec_rgy_pgo_item_t - id %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x unix_num:%u quota:%u", id.Data1, id.Data2, id.Data3, id.Data4[0], id.Data4[1], id.Data4[2], id.Data4[3], @@ -603,8 +589,7 @@ dissect_sec_rgy_cursor_t (tvbuff_t * tvb, int offset, dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_rs_sec_rgy_pgo_item_t_quota, &valid); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, + col_append_fstr (pinfo->cinfo, COL_INFO, " sec_rgy_cursor_t - source %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x handle:%u valid:%u", source.Data1, source.Data2, source.Data3, source.Data4[0], source.Data4[1], source.Data4[2], @@ -673,8 +658,7 @@ dissect_rs_pgo_query_t (tvbuff_t * tvb, int offset, col_append_str (pinfo->cinfo, COL_INFO, "NONE"); break; default: - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " unknown:%u", query_t); + col_append_fstr (pinfo->cinfo, COL_INFO, " unknown:%u", query_t); break; ; } @@ -722,8 +706,7 @@ dissect_rs_pgo_id_key_t (tvbuff_t * tvb, int offset, dissect_ndr_uuid_t (tvb, offset, pinfo, tree, drep, hf_rs_uuid1, &id); offset = dissect_sec_rgy_name_t (tvb, offset, pinfo, tree, drep); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, + col_append_fstr (pinfo->cinfo, COL_INFO, " rs_pgo_id_key_t - id %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", id.Data1, id.Data2, id.Data3, id.Data4[0], id.Data4[1], id.Data4[2], id.Data4[3], @@ -820,8 +803,7 @@ r hf_rs_pgo_unix_num_key_t, &rs_pgo_unix_num_key_t); offset = dissect_sec_rgy_name_t (tvb, offset, pinfo, tree, drep); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, + col_append_fstr (pinfo->cinfo, COL_INFO, " rs_pgo_unix_num_key_t:%u", rs_pgo_unix_num_key_t); proto_item_set_len (item, offset - old_offset); @@ -912,9 +894,8 @@ dissect_rs_pgo_query_key_t (tvbuff_t * tvb, int offset, break; default: - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " unknown:%u", query_t); - ; + col_append_fstr (pinfo->cinfo, COL_INFO, " unknown:%u", query_t); + break; } proto_item_set_len (item, offset - old_offset); @@ -964,8 +945,7 @@ dissect_rs_pgo_query_result_t (tvbuff_t * tvb, int offset, hf_rs_pgo_query_result_t, &st); status = val_to_str_ext (st, &dce_error_vals_ext, "%u"); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " status:%s ", status); + col_append_fstr (pinfo->cinfo, COL_INFO, " status:%s ", status); offset += 4; /* XXX */ @@ -1356,8 +1336,7 @@ rs_pgo_dissect_get_members_rqst (tvbuff_t * tvb, int offset, dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_rs_var1, &max_members); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " :max_members:%u", max_members); + col_append_fstr (pinfo->cinfo, COL_INFO, " :max_members:%u", max_members); return offset; } @@ -1518,8 +1497,7 @@ rs_pgo_dissect_get_rqst (tvbuff_t * tvb, int offset, dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_rs_var1, &allow_aliases); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, " :allow_aliases:%u", + col_append_fstr (pinfo->cinfo, COL_INFO, " :allow_aliases:%u", allow_aliases); diff --git a/epan/dissectors/packet-dcerpc-spoolss.c b/epan/dissectors/packet-dcerpc-spoolss.c index e967df36e5..2c4aa3c255 100644 --- a/epan/dissectors/packet-dcerpc-spoolss.c +++ b/epan/dissectors/packet-dcerpc-spoolss.c @@ -512,8 +512,7 @@ dissect_spoolss_string_parm_data(tvbuff_t *tvb, int offset, packet_info *pinfo, } offset += buffer_len; - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", s); + col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", s); /* Append string to upper level item */ if (tree && item) { @@ -643,7 +642,7 @@ SpoolssClosePrinter_q(tvbuff_t *tvb, int offset, dcerpc_fetch_polhnd_data(&policy_hnd, &pol_name, NULL, NULL, NULL, pinfo->fd->num); - if (check_col(pinfo->cinfo, COL_INFO) && pol_name) + if (pol_name) col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", pol_name); @@ -704,8 +703,7 @@ dissect_printerdata_data(tvbuff_t *tvb, int offset, proto_item_append_text(item, ": %s", data); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr( + col_append_fstr( pinfo->cinfo, COL_INFO, " = %s", data); hidden_item = proto_tree_add_string( @@ -722,8 +720,7 @@ dissect_printerdata_data(tvbuff_t *tvb, int offset, proto_item_append_text(item, ": 0x%08x", data); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr( + col_append_fstr( pinfo->cinfo, COL_INFO, " = 0x%08x", data); @@ -788,8 +785,7 @@ SpoolssGetPrinterData_q(tvbuff_t *tvb, int offset, } } - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", value_name); + col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", value_name); offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_offered, NULL); @@ -806,6 +802,7 @@ SpoolssGetPrinterData_r(tvbuff_t *tvb, int offset, dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data; guint32 type; proto_item *hidden_item; + const char *data; hidden_item = proto_tree_add_uint( tree, hf_printerdata, tvb, offset, 0, 1); @@ -816,11 +813,9 @@ SpoolssGetPrinterData_r(tvbuff_t *tvb, int offset, offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_printerdata_type, &type); - if (check_col(pinfo->cinfo, COL_INFO)) { - const char *data = (const char *)(dcv->se_data ? dcv->se_data : "????"); + data = (const char *)(dcv->se_data ? dcv->se_data : "????"); - col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", data); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", data); offset = dissect_printerdata_data( tvb, offset, pinfo, tree, drep, type); @@ -878,7 +873,7 @@ SpoolssGetPrinterDataEx_q(tvbuff_t *tvb, int offset, } } - if (check_col(pinfo->cinfo, COL_INFO) && dcv->se_data) + if (dcv->se_data) col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", (char *)dcv->se_data); @@ -910,7 +905,7 @@ SpoolssGetPrinterDataEx_r(tvbuff_t *tvb, int offset, offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_returned, &size); - if (check_col(pinfo->cinfo, COL_INFO) && dcv->se_data) { + if (dcv->se_data) { col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", (char *)dcv->se_data); } @@ -967,7 +962,7 @@ SpoolssSetPrinterData_q(tvbuff_t *tvb, int offset, } - if (check_col(pinfo->cinfo, COL_INFO) && dcv->se_data){ + if (dcv->se_data){ col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", (char *)dcv->se_data); } @@ -1037,8 +1032,7 @@ SpoolssSetPrinterDataEx_q(tvbuff_t *tvb, int offset, tvb, offset, pinfo, tree, drep, sizeof(guint16), hf_printerdata_value, TRUE, &value_name); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", %s/%s", + col_append_fstr(pinfo->cinfo, COL_INFO, ", %s/%s", key_name, value_name); offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, @@ -3281,7 +3275,7 @@ SpoolssReplyOpenPrinter_q(tvbuff_t *tvb, int offset, } } - if (check_col(pinfo->cinfo, COL_INFO) && name) + if (name) col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", name); offset = dissect_ndr_uint32( @@ -3370,8 +3364,7 @@ SpoolssGetPrinter_q(tvbuff_t *tvb, int offset, packet_info *pinfo, } - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); + col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); offset = dissect_spoolss_buffer( tvb, offset, pinfo, tree, drep, NULL); @@ -3395,8 +3388,7 @@ SpoolssGetPrinter_r(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_item *item; proto_tree *subtree = NULL; - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); + col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); /* Parse packet */ @@ -3603,8 +3595,7 @@ SpoolssSetPrinter_q(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_level, &level); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); + col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); offset = dissect_SPOOL_PRINTER_INFO( tvb, offset, pinfo, tree, drep); @@ -3728,8 +3719,7 @@ SpoolssEnumForms_q(tvbuff_t *tvb, int offset, packet_info *pinfo, dcv->se_data = GINT_TO_POINTER((int)level); } - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); + col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); offset = dissect_spoolss_buffer( tvb, offset, pinfo, tree, drep, NULL); @@ -3763,8 +3753,7 @@ SpoolssEnumForms_r(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_needed, NULL); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); + col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_enumforms_num, &count); @@ -3897,8 +3886,7 @@ SpoolssEnumPrinterData_q(tvbuff_t *tvb, int offset, tvb, offset, pinfo, tree, drep, hf_enumprinterdata_enumindex, &ndx); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", index %d", ndx); + col_append_fstr(pinfo->cinfo, COL_INFO, ", index %d", ndx); offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, @@ -3944,7 +3932,7 @@ SpoolssEnumPrinterData_r(tvbuff_t *tvb, int offset, offset += value_len * 2; - if (check_col(pinfo->cinfo, COL_INFO) && value && value[0]) + if (value && value[0]) col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", value); proto_item_append_text(value_item, ": %s", value); @@ -4055,8 +4043,7 @@ SpoolssEnumPrinters_q(tvbuff_t *tvb, int offset, packet_info *pinfo, dcv->se_data = GINT_TO_POINTER((int)level); } - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); + col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); offset = dissect_spoolss_buffer( tvb, offset, pinfo, tree, drep, NULL); @@ -4079,8 +4066,7 @@ SpoolssEnumPrinters_r(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_item *item; proto_tree *subtree = NULL; - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); + col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); /* Parse packet */ @@ -4285,8 +4271,7 @@ SpoolssAddForm_q(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_form_level, &level); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); + col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); /* AddForm() stores the level in se_data */ if(!pinfo->fd->flags.visited){ @@ -4341,7 +4326,7 @@ SpoolssDeleteForm_q(tvbuff_t *tvb, int offset, packet_info *pinfo, tvb, offset, pinfo, tree, drep, sizeof(guint16), hf_form_name, TRUE, &name); - if (check_col(pinfo->cinfo, COL_INFO) && name) + if (name) col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", name); return offset; @@ -4391,14 +4376,13 @@ SpoolssSetForm_q(tvbuff_t *tvb, int offset, packet_info *pinfo, tvb, offset, pinfo, tree, drep, sizeof(guint16), hf_form_name, TRUE, &name); - if (check_col(pinfo->cinfo, COL_INFO) && name) + if (name) col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", name); offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_form_level, &level); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); + col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); offset = dissect_FORM_CTR(tvb, offset, pinfo, tree, drep); @@ -4451,8 +4435,7 @@ SpoolssGetForm_q(tvbuff_t *tvb, int offset, packet_info *pinfo, tvb, offset, pinfo, tree, drep, sizeof(guint16), hf_form_name, TRUE, &name); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", name); + col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", name); offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_form_level, &level); @@ -4462,8 +4445,7 @@ SpoolssGetForm_q(tvbuff_t *tvb, int offset, packet_info *pinfo, dcv->se_data = GUINT_TO_POINTER((int)level); } - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", + col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); offset = dissect_spoolss_buffer(tvb, offset, pinfo, tree, drep, NULL); @@ -4496,8 +4478,7 @@ SpoolssGetForm_r(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_needed, NULL); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); + col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); if (buffer.tvb) { int buffer_offset = 0; @@ -4770,8 +4751,7 @@ SpoolssEnumJobs_q(tvbuff_t *tvb, int offset, packet_info *pinfo, dcv->se_data = GUINT_TO_POINTER((int)level); } - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); + col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); offset = dissect_spoolss_buffer(tvb, offset, pinfo, tree, drep, NULL); @@ -4869,8 +4849,7 @@ SpoolssSetJob_q(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_setjob_cmd, &cmd); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr( + col_append_fstr( pinfo->cinfo, COL_INFO, ", %s jobid %d", val_to_str(cmd, setjob_commands, "Unknown (%d)"), jobid); @@ -4919,8 +4898,7 @@ SpoolssGetJob_q(tvbuff_t *tvb, int offset, packet_info *pinfo, dcv->se_data = GUINT_TO_POINTER((int)level); } - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d, jobid %d", + col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d, jobid %d", level, jobid); offset = dissect_spoolss_buffer(tvb, offset, pinfo, tree, drep, NULL); @@ -4993,7 +4971,7 @@ SpoolssStartPagePrinter_q(tvbuff_t *tvb, int offset, dcerpc_fetch_polhnd_data(&policy_hnd, &pol_name, NULL, NULL, NULL, pinfo->fd->num); - if (check_col(pinfo->cinfo, COL_INFO) && pol_name) + if (pol_name) col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", pol_name); @@ -5034,7 +5012,7 @@ SpoolssEndPagePrinter_q(tvbuff_t *tvb, int offset, dcerpc_fetch_polhnd_data(&policy_hnd, &pol_name, NULL, NULL, NULL, pinfo->fd->num); - if (check_col(pinfo->cinfo, COL_INFO) && pol_name) + if (pol_name) col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", pol_name); @@ -5177,7 +5155,7 @@ SpoolssStartDocPrinter_q(tvbuff_t *tvb, int offset, dcerpc_fetch_polhnd_data(&policy_hnd, &pol_name, NULL, NULL, NULL, pinfo->fd->num); - if (check_col(pinfo->cinfo, COL_INFO) && pol_name) + if (pol_name) col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", pol_name); @@ -5223,7 +5201,7 @@ SpoolssEndDocPrinter_q(tvbuff_t *tvb, int offset, dcerpc_fetch_polhnd_data(&policy_hnd, &pol_name, NULL, NULL, NULL, pinfo->fd->num); - if (check_col(pinfo->cinfo, COL_INFO) && pol_name) + if (pol_name) col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", pol_name); @@ -5271,15 +5249,14 @@ SpoolssWritePrinter_q(tvbuff_t *tvb, int offset, packet_info *pinfo, dcerpc_fetch_polhnd_data(&policy_hnd, &pol_name, NULL, NULL, NULL, pinfo->fd->num); - if (check_col(pinfo->cinfo, COL_INFO) && pol_name) + if (pol_name) col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", pol_name); offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_buffer_size, &size); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", %d bytes", size); + col_append_fstr(pinfo->cinfo, COL_INFO, ", %d bytes", size); item = proto_tree_add_text(tree, tvb, offset, 0, "Buffer"); @@ -5308,8 +5285,7 @@ SpoolssWritePrinter_r(tvbuff_t *tvb, int offset, packet_info *pinfo, tvb, offset, pinfo, tree, drep, hf_writeprinter_numwritten, &size); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr( + col_append_fstr( pinfo->cinfo, COL_INFO, ", %d bytes written", size); offset = dissect_doserror( @@ -5344,8 +5320,7 @@ SpoolssDeletePrinterData_q(tvbuff_t *tvb, int offset, tvb, offset, pinfo, tree, drep, sizeof(guint16), hf_printerdata_value, TRUE, &value_name); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", value_name); + col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", value_name); return offset; } @@ -5674,8 +5649,7 @@ SpoolssEnumPrinterDrivers_q(tvbuff_t *tvb, int offset, dcv->se_data = GUINT_TO_POINTER((int)level); } - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); + col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); offset = dissect_spoolss_buffer(tvb, offset, pinfo, tree, drep, NULL); @@ -5777,8 +5751,7 @@ SpoolssGetPrinterDriver2_q(tvbuff_t *tvb, int offset, dcerpc_fetch_polhnd_data(&policy_hnd, &pol_name, NULL, NULL, NULL, pinfo->fd->num); - if (check_col(pinfo->cinfo, COL_INFO) && pol_name) - col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", + col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", pol_name); offset = dissect_ndr_str_pointer_item( @@ -5793,8 +5766,7 @@ SpoolssGetPrinterDriver2_q(tvbuff_t *tvb, int offset, dcv->se_data = GUINT_TO_POINTER((int)level); } - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); + col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); offset = dissect_spoolss_buffer(tvb, offset, pinfo, tree, drep, NULL); @@ -6377,7 +6349,7 @@ dissect_NOTIFY_INFO(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_notify_info_count, &count); - if (!di->conformant_run && check_col(pinfo->cinfo, COL_INFO)) + if (!di->conformant_run) col_append_fstr( pinfo->cinfo, COL_INFO, ", %d %s", count, notify_plural(count)); @@ -6407,8 +6379,7 @@ SpoolssRFNPCNEX_q(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_rrpcn_changelow, &changeid); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr( + col_append_fstr( pinfo->cinfo, COL_INFO, ", changeid %d", changeid); offset = dissect_ndr_pointer( @@ -6455,8 +6426,7 @@ SpoolssRRPCN_q(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_rrpcn_changelow, &changeid); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr( + col_append_fstr( pinfo->cinfo, COL_INFO, ", changeid %d", changeid); offset = dissect_ndr_uint32( @@ -6655,14 +6625,10 @@ SpoolssEnumPrinterKey_q(tvbuff_t *tvb, int offset, tvb, offset, pinfo, tree, drep, sizeof(guint16), hf_printerdata_key, TRUE, &key_name); - if (check_col(pinfo->cinfo, COL_INFO)) { - const char *kn = key_name; + if (!key_name[0]) + key_name = "\"\""; - if (!key_name[0]) - kn = "\"\""; - - col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", kn); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", key_name); offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_needed, NULL); @@ -6717,8 +6683,7 @@ SpoolssEnumPrinterDataEx_q(tvbuff_t *tvb, int offset, tvb, offset, pinfo, tree, drep, sizeof(guint16), hf_printerdata_key, TRUE, &key_name); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", key_name); + col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", key_name); offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_offered, NULL); diff --git a/epan/dissectors/packet-dcerpc-svcctl.c b/epan/dissectors/packet-dcerpc-svcctl.c index 0f5d83db06..1d92fd78d8 100644 --- a/epan/dissectors/packet-dcerpc-svcctl.c +++ b/epan/dissectors/packet-dcerpc-svcctl.c @@ -540,8 +540,7 @@ svcctl_dissect_CloseServiceHandle_rqst(tvbuff_t *tvb, int offset, dcerpc_fetch_polhnd_data(&policy_hnd, &pol_name, NULL, NULL, NULL, pinfo->fd->num); - if (check_col(pinfo->cinfo, COL_INFO) && pol_name) - col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", + col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", pol_name); return offset;