* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "config.h"
{
- proto_item *item = NULL;
- proto_tree *tree = NULL;
+ proto_item *item;
+ proto_tree *tree;
int old_offset = offset;
+ const guint8 *principal;
#define sec_rgy_pname_t_size 257
/*
dissect sec_rgy_pname const signed32 sec_rgy_pname_t_size = 257; * Include final '\0' *
}
- if (parent_tree)
- {
- tree =
- proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_sec_rgy_pname_t, &item, "sec_rgy_pname_t");
- }
+ tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_sec_rgy_pname_t, &item, "sec_rgy_pname_t");
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, di, drep,
hf_sec_rgy_pname_t_size, &string_size);
{
/* proto_tree_add_string(tree, id, tvb, start, length, value_ptr); */
- proto_tree_add_item (tree, hf_sec_rgy_pname_t_principalName_string,
- tvb, offset, string_size, ENC_ASCII|ENC_NA);
+ proto_tree_add_item_ret_string(tree, hf_sec_rgy_pname_t_principalName_string,
+ tvb, offset, string_size, ENC_ASCII|ENC_NA, wmem_packet_scope(), &principal);
if (string_size > 1)
{
- col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s",
- tvb_get_string_enc(wmem_packet_scope(), tvb, offset, string_size, ENC_ASCII));
+ col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s", principal);
}
offset += string_size;
}
{
- proto_item *item = NULL;
- proto_tree *tree = NULL;
+ proto_item *item;
+ proto_tree *tree;
int old_offset = offset;
+ const guint8 *principal;
#define sec_rgy_name_t_size 1025
/* typedef [string] char sec_rgy_name_t[sec_rgy_name_t_size]; */
guint32 string_size;
}
- if (parent_tree)
- {
- tree =
- proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_sec_rgy_name_t, &item, "sec_rgy_name_t");
- }
+ tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_sec_rgy_name_t, &item, "sec_rgy_name_t");
offset =
dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep,
{
/* proto_tree_add_string(tree, id, tvb, start, length, value_ptr); */
- proto_tree_add_item (tree, hf_sec_rgy_name_t_principalName_string,
- tvb, offset, string_size, ENC_ASCII|ENC_NA);
+ proto_tree_add_item_ret_string(tree, hf_sec_rgy_name_t_principalName_string,
+ tvb, offset, string_size, ENC_ASCII|ENC_NA, wmem_packet_scope(), &principal);
if (string_size > 1)
{
- col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s",
- tvb_get_string_enc(wmem_packet_scope(), tvb, offset, string_size, ENC_ASCII));
+ col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s", principal);
}
offset += string_size;
}
[out] error_status_t *status
*/
- buff_remain = tvb_length_remaining(tvb, offset);
+ buff_remain = tvb_captured_length_remaining(tvb, offset);
/* found several add_member responses that had 8 bytes of data. first was 4 0's and last was 3 zeros and a 1 */
if (buff_remain > 8) {
[out] rs_cache_data_t *cache_info,
[out] error_status_t *status
*/
- buff_remain = tvb_length_remaining(tvb, offset);
+ buff_remain = tvb_captured_length_remaining(tvb, offset);
/* found several add_member responses that had 8 bytes of data. first was 4 0's and last was 3 zeros and a 1 */
[out] error_status_t *status
*/
- buff_remain = tvb_length_remaining(tvb, offset);
+ buff_remain = tvb_captured_length_remaining(tvb, offset);
/* found several add responses that had 8 bytes of data. first was 4 0's and last was 3 zeros and a 1 */
if (buff_remain > 8) {