* proto_tree * : protocol display tree to fill out. May be NULL
* int : offset into packet data where we are.
* int : length of clv we are decoding
+ * int : tree id to use for proto tree.
*
* Output:
* void, but we will add to proto tree if !NULL.
void
isis_dissect_hostname_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
- int length)
+ int length, int tree_id)
{
if ( !tree ) return; /* nothing to do! */
proto_tree_add_text ( tree, tvb, offset, length,
"Hostname: --none--" );
} else {
- proto_tree_add_text ( tree, tvb, offset, length,
- "Hostname: %.*s", length,
- tvb_get_ptr(tvb, offset, length) );
+ const char* value = tvb_get_ptr(tvb, offset, length);
+ proto_tree_add_string_format ( tree, tree_id,
+ tvb, offset, length,
+ value, "Hostname: %.*s", length, value);
}
}
extern void isis_dissect_mt_clv(tvbuff_t *tvb, proto_tree *tree,
int offset, int length, int tree_id);
extern void isis_dissect_hostname_clv(tvbuff_t *tvb, proto_tree *tree,
- int offset, int length);
+ int offset, int length, int tree_id);
extern void isis_dissect_authentication_clv(tvbuff_t *tvb, proto_tree *tree,
int offset, int length);
extern void isis_dissect_ip_authentication_clv(tvbuff_t *tvb, proto_tree *tree,
static int hf_isis_lsp_pdu_length = -1;
static int hf_isis_lsp_remaining_life = -1;
static int hf_isis_lsp_sequence_number = -1;
+static int hf_isis_lsp_lsp_id = -1;
+static int hf_isis_lsp_hostname = -1;
static int hf_isis_lsp_checksum = -1;
static int hf_isis_lsp_checksum_bad = -1;
static int hf_isis_lsp_checksum_good = -1;
dissect_lsp_hostname_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
int id_length _U_, int length)
{
- isis_dissect_hostname_clv(tvb, tree, offset, length);
+ isis_dissect_hostname_clv(tvb, tree, offset, length,
+ hf_isis_lsp_hostname);
}
offset_checksum = offset;
if (tree) {
- proto_tree_add_text(lsp_tree, tvb, offset, id_length + 2,
- "LSP-ID: %s",
- print_system_id( tvb_get_ptr(tvb, offset, id_length+2), id_length+2 ) );
+ char* value = print_system_id( tvb_get_ptr(tvb, offset, id_length+2),
+ id_length+2);
+ proto_tree_add_string_format(lsp_tree, hf_isis_lsp_lsp_id,
+ tvb, offset, id_length + 2,
+ value, "LSP-ID: %s", value);
}
if (check_col(pinfo->cinfo, COL_INFO)) {
{ "Remaining lifetime", "isis.lsp.remaining_life", FT_UINT16,
BASE_DEC, NULL, 0x0, "", HFILL }},
+ { &hf_isis_lsp_lsp_id,
+ { "LSP-ID", "isis.lsp.lsp_id", FT_STRING,
+ BASE_NONE, NULL, 0x0, "", HFILL }},
+
+ { &hf_isis_lsp_hostname,
+ { "Hostname", "isis.lsp.hostname", FT_STRING,
+ BASE_NONE, NULL, 0x0, "", HFILL }},
+
{ &hf_isis_lsp_sequence_number,
{ "Sequence number", "isis.lsp.sequence_number",
FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }},