Put the system ID in the top-level items for neighbors.

Add a tvb_print_system_id() routine, and use that in various ISIS
dissectors, while we're at it.

Change-Id: I31b6b9ea8faf2b4849f974ec7ed27fbdd14b91ef
Reviewed-on: https://code.wireshark.org/review/1145
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2014-04-14 15:43:03 -07:00
parent d3ad27390c
commit 16b26b8e5f
5 changed files with 16 additions and 6 deletions

View File

@ -963,7 +963,7 @@ dissect_isis_hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offs
offset += 1;
proto_tree_add_item(hello_tree, hf_isis_hello_source_id, tvb, offset, id_length, ENC_NA);
col_append_fstr(pinfo->cinfo, COL_INFO, ", System-ID: %s", print_system_id( tvb_get_ptr(tvb, offset, id_length), id_length ));
col_append_fstr(pinfo->cinfo, COL_INFO, ", System-ID: %s", tvb_print_system_id( tvb, offset, id_length ));
offset += id_length;

View File

@ -1691,6 +1691,7 @@ dissect_lsp_eis_neighbors_clv_inner(tvbuff_t *tvb, packet_info *pinfo, proto_tre
proto_tree_add_item(ntree, hf_isis_lsp_eis_neighbors_error_metric_ie, tvb, offset+3, 1, ENC_NA);
proto_tree_add_item(ntree, is_eis ? hf_isis_lsp_eis_neighbors_es_neighbor_id : hf_isis_lsp_eis_neighbors_is_neighbor_id,
tvb, offset+4, id_length, ENC_NA);
proto_item_append_text(ti, ": %s", tvb_print_system_id(tvb, offset+4, id_length));
}
offset += tlen;
length -= tlen;
@ -1981,6 +1982,7 @@ dissect_lsp_ext_is_reachability_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tre
ntree = proto_item_add_subtree (ti, ett_isis_lsp_part_of_clv_ext_is_reachability );
proto_tree_add_item(ntree, hf_isis_lsp_ext_is_reachability_is_neighbor_id, tvb, offset, 7, ENC_NA);
proto_item_append_text(ti, ": %s", tvb_print_system_id(tvb, offset, 7));
proto_tree_add_item(ntree, hf_isis_lsp_ext_is_reachability_metric, tvb, offset+7, 3, ENC_BIG_ENDIAN);
@ -2601,7 +2603,7 @@ dissect_isis_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset
offset_checksum = offset;
proto_tree_add_item(lsp_tree, hf_isis_lsp_lsp_id, tvb, offset, id_length + 2, ENC_NA);
system_id = print_system_id( tvb_get_ptr(tvb, offset, id_length+2), id_length+2);
system_id = tvb_print_system_id( tvb, offset, id_length+2 );
col_append_fstr(pinfo->cinfo, COL_INFO, ", LSP-ID: %s", system_id);
offset += (id_length + 2);

View File

@ -322,17 +322,17 @@ dissect_isis_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offse
offset += 2;
proto_tree_add_item(csnp_tree, hf_isis_csnp_source_id, tvb, offset, id_length, ENC_NA);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Source-ID: %s", print_system_id( tvb_get_ptr(tvb, offset, id_length), id_length ));
col_append_fstr(pinfo->cinfo, COL_INFO, ", Source-ID: %s", tvb_print_system_id( tvb, offset, id_length ));
offset += id_length + 1;
proto_tree_add_item(csnp_tree, hf_isis_csnp_start_lsp_id, tvb, offset, id_length + 2, ENC_NA);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Start LSP-ID: %s",
print_system_id( tvb_get_ptr(tvb, offset, id_length+2), id_length+2 ));
tvb_print_system_id( tvb, offset, id_length+2 ));
offset += id_length + 2;
proto_tree_add_item(csnp_tree, hf_isis_csnp_end_lsp_id, tvb, offset, id_length + 2, ENC_NA);
col_append_fstr(pinfo->cinfo, COL_INFO, ", End LSP-ID: %s",
print_system_id( tvb_get_ptr(tvb, offset, id_length+2), id_length+2 ));
tvb_print_system_id( tvb, offset, id_length+2 ));
offset += id_length + 2;
len = pdu_length - header_length;
@ -385,7 +385,7 @@ dissect_isis_psnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offse
offset += 2;
proto_tree_add_item(psnp_tree, hf_isis_psnp_source_id, tvb, offset, id_length, ENC_NA);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Source-ID: %s", print_system_id( tvb_get_ptr(tvb, offset, id_length), id_length ));
col_append_fstr(pinfo->cinfo, COL_INFO, ", Source-ID: %s", tvb_print_system_id( tvb, offset, id_length ));
offset += id_length + 1;

View File

@ -30,6 +30,7 @@
#include <string.h>
#include <glib.h>
#include "tvbuff.h"
#include "osi-utils.h"
#include "emem.h"
@ -87,6 +88,12 @@ print_system_id( const guint8 *ad, int length )
return( cur );
}
gchar *
tvb_print_system_id( tvbuff_t *tvb, const gint offset, int length )
{
return( print_system_id(tvb_get_ptr(tvb, offset, length), length) );
}
void
print_system_id_buf( const guint8 *ad, int length, gchar *buf, int buf_len)
{

View File

@ -50,6 +50,7 @@ void print_nsap_net_buf( const guint8 *, int, gchar *, int);
gchar* print_area ( const guint8 *, int );
void print_area_buf ( const guint8 *, int, gchar *, int);
gchar* print_system_id( const guint8 *, int );
gchar* tvb_print_system_id( tvbuff_t *, const gint, int );
void print_system_id_buf( const guint8 *, int, gchar *, int);
#endif /* __OSI_UTILS_H__ */