diff options
-rw-r--r-- | epan/dissectors/packet-clnp.c | 7 | ||||
-rw-r--r-- | epan/dissectors/packet-esis.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-isis-lsp.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-osi-options.c | 5 | ||||
-rw-r--r-- | epan/dissectors/packet-rsvp.c | 8 | ||||
-rw-r--r-- | epan/osi-utils.c | 8 | ||||
-rw-r--r-- | epan/osi-utils.h | 4 |
7 files changed, 19 insertions, 23 deletions
diff --git a/epan/dissectors/packet-clnp.c b/epan/dissectors/packet-clnp.c index 736b512b05..ecab1b505c 100644 --- a/epan/dissectors/packet-clnp.c +++ b/epan/dissectors/packet-clnp.c @@ -225,7 +225,6 @@ dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) cksum_status_t cksum_status; int offset; guchar src_len, dst_len, nsel, opt_len = 0; - const guint8 *dst_addr, *src_addr; guint next_length; proto_tree *discpdu_tree; gboolean save_in_error_pkt; @@ -389,14 +388,13 @@ dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) FIXED_PART_LEN + 1 + dst_len); return; } - dst_addr = tvb_get_ptr(tvb, offset, dst_len); nsel = tvb_get_guint8(tvb, offset + dst_len - 1); TVB_SET_ADDRESS(&pinfo->net_dst, get_osi_address_type(), tvb, offset, dst_len); TVB_SET_ADDRESS(&pinfo->dst, get_osi_address_type(), tvb, offset, dst_len); proto_tree_add_bytes_format_value(clnp_tree, hf_clnp_dest, tvb, offset, dst_len, NULL, "%s", - print_nsap_net(dst_addr, dst_len)); + print_nsap_net(tvb, offset, dst_len)); offset += dst_len; opt_len -= dst_len; @@ -427,14 +425,13 @@ dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) FIXED_PART_LEN + 1 + dst_len + 1 + src_len); return; } - src_addr = tvb_get_ptr(tvb, offset, src_len); TVB_SET_ADDRESS(&pinfo->net_src, get_osi_address_type(), tvb, offset, src_len); TVB_SET_ADDRESS(&pinfo->src, get_osi_address_type(), tvb, offset, src_len); proto_tree_add_bytes_format_value(clnp_tree, hf_clnp_src, tvb, offset, src_len, NULL, "%s", - print_nsap_net(src_addr, src_len)); + print_nsap_net(tvb, offset, src_len)); offset += src_len; opt_len -= src_len; diff --git a/epan/dissectors/packet-esis.c b/epan/dissectors/packet-esis.c index e02f806c2d..c6733e94eb 100644 --- a/epan/dissectors/packet-esis.c +++ b/epan/dissectors/packet-esis.c @@ -152,7 +152,7 @@ esis_dissect_esh_pdu( guint8 len, tvbuff_t *tvb, proto_tree *tree) { offset++; proto_tree_add_text(esis_area_tree, tvb, offset, sal, " SA: %s", - print_nsap_net( tvb_get_ptr(tvb, offset, sal), sal ) ); + print_nsap_net(tvb, offset, sal ) ); offset += sal; len -= ( sal + 1 ); } @@ -173,7 +173,7 @@ esis_dissect_ish_pdu( guint8 len, tvbuff_t *tvb, proto_tree *tree) { proto_tree_add_text( tree, tvb, offset, netl + 1, "### Network Entity Title Section ###"); proto_tree_add_uint_format_value(tree, hf_esis_netl, tvb, offset++, 1, netl, "%2u Octets", netl); - proto_tree_add_string( tree, hf_esis_net, tvb, offset, netl, print_nsap_net( tvb_get_ptr(tvb, offset, netl), netl ) ); + proto_tree_add_string( tree, hf_esis_net, tvb, offset, netl, print_nsap_net( tvb, offset, netl ) ); offset += netl; len -= ( netl + 1 ); @@ -195,7 +195,7 @@ esis_dissect_redirect_pdu( guint8 len, tvbuff_t *tvb, proto_tree *tree) { "### Destination Address Section ###" ); proto_tree_add_uint_format_value(tree, hf_esis_dal, tvb, offset++, 1, tmpl, "%2u Octets", tmpl); proto_tree_add_string( tree, hf_esis_da, tvb, offset, tmpl, - print_nsap_net( tvb_get_ptr(tvb, offset, tmpl), tmpl ) ); + print_nsap_net( tvb, offset, tmpl ) ); offset += tmpl; len -= ( tmpl + 1 ); tmpl = (int) tvb_get_guint8(tvb, offset); @@ -219,7 +219,7 @@ esis_dissect_redirect_pdu( guint8 len, tvbuff_t *tvb, proto_tree *tree) { "### Network Entity Title Section ###" ); proto_tree_add_uint_format_value(tree, hf_esis_netl, tvb, offset++, 1, tmpl, "%2u Octets", tmpl ); proto_tree_add_string( tree, hf_esis_net, tvb, offset, tmpl, - print_nsap_net( tvb_get_ptr(tvb, offset, tmpl), tmpl ) ); + print_nsap_net( tvb, offset, tmpl ) ); offset += tmpl; len -= ( tmpl + 1 ); } diff --git a/epan/dissectors/packet-isis-lsp.c b/epan/dissectors/packet-isis-lsp.c index eeb9e300c8..48ccb0de06 100644 --- a/epan/dissectors/packet-isis-lsp.c +++ b/epan/dissectors/packet-isis-lsp.c @@ -2774,7 +2774,7 @@ dissect_lsp_prefix_neighbors_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree * * Lets turn the area address into "standard" 0000.0000.etc * format string. */ - sbuf = print_area( tvb_get_ptr(tvb, offset+1, mylen), mylen ); + sbuf = print_area( tvb, offset+1, mylen ); /* and spit it out */ if ( tree ) { proto_tree_add_text ( tree, tvb, offset, mylen + 1, diff --git a/epan/dissectors/packet-osi-options.c b/epan/dissectors/packet-osi-options.c index 9c1491697d..6ae31cbca2 100644 --- a/epan/dissectors/packet-osi-options.c +++ b/epan/dissectors/packet-osi-options.c @@ -351,7 +351,7 @@ dissect_option_route(guchar parm_type, int offset, guchar parm_len, netl = tvb_get_guint8(tvb, this_hop); proto_tree_add_text(osi_route_tree, tvb, this_hop, netl + 1, "Hop #%3u NETL: %2u, NET: %s", cnt_hops++, netl, - print_nsap_net(tvb_get_ptr(tvb, this_hop + 1, netl), netl)); + print_nsap_net(tvb, this_hop + 1, netl)); this_hop += 1 + netl; } } @@ -549,8 +549,7 @@ dissect_osi_options(guchar opt_len, tvbuff_t *tvb, int offset, proto_tree *tree) case OSI_OPT_ADDRESS_MASK: proto_tree_add_bytes_format_value(osi_option_tree, hf_osi_options_address_mask, tvb, offset, parm_len, tvb_get_ptr(tvb, offset, parm_len), "%s", - print_area(tvb_get_ptr(tvb, offset, parm_len), - parm_len)); + print_area(tvb, offset, parm_len)); break; case OSI_OPT_SNPA_MASK: diff --git a/epan/dissectors/packet-rsvp.c b/epan/dissectors/packet-rsvp.c index e81a5015fc..cc389ee08c 100644 --- a/epan/dissectors/packet-rsvp.c +++ b/epan/dissectors/packet-rsvp.c @@ -2770,7 +2770,7 @@ dissect_rsvp_ifid_tlv(proto_tree *ti, packet_info* pinfo, proto_tree *rsvp_objec "%sISIS-Area TLV - Invalid Length field", tlv_name); break; } - ip_str = print_nsap_net(tvb_get_ptr(tvb, offset+tlv_off+5, isis_len), isis_len); + ip_str = print_nsap_net(tvb, offset+tlv_off+5, isis_len); rsvp_ifid_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+tlv_off, tlv_len, subtree_type, NULL, "%sISIS-Area TLV - %s", tlv_name, @@ -5844,10 +5844,10 @@ dissect_rsvp_gen_uni(proto_tree *ti, packet_info* pinfo, proto_tree *rsvp_object proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+5, sobj_len-4, "NSAP address: %s", - print_nsap_net(tvb_get_ptr(tvb, offset2+l+5, nsap_len), nsap_len)); + print_nsap_net(tvb, offset2+l+5, nsap_len)); if (i < 4) { proto_item_append_text(ti, "%s NSAP TNA: %s", c, - print_nsap_net(tvb_get_ptr(tvb, offset2+l+5, nsap_len), nsap_len)); + print_nsap_net(tvb, offset2+l+5, nsap_len)); } break; @@ -6099,7 +6099,7 @@ dissect_rsvp_call_id(proto_tree *ti, proto_tree *rsvp_object_tree, case 3: offset4 = offset3 + 20; - str = print_nsap_net(tvb_get_ptr(tvb, offset3, 20), 20); + str = print_nsap_net(tvb, offset3, 20); proto_tree_add_text(rsvp_object_tree, tvb, offset3, 20, "Source Transport Network addr: %s", str); break; diff --git a/epan/osi-utils.c b/epan/osi-utils.c index 48fe369f68..22be209b66 100644 --- a/epan/osi-utils.c +++ b/epan/osi-utils.c @@ -41,12 +41,12 @@ * "dissect_nsap()" in epan/dissectors/packet-isup.c. */ gchar * -print_nsap_net( const guint8 *ad, int length ) +print_nsap_net( tvbuff_t *tvb, const gint offset, int length ) { gchar *cur; cur = (gchar *)wmem_alloc(wmem_packet_scope(), MAX_NSAP_LEN * 3 + 50); - print_nsap_net_buf( ad, length, cur, MAX_NSAP_LEN * 3 + 50); + print_nsap_net_buf( tvb_get_ptr(tvb, offset, length), length, cur, MAX_NSAP_LEN * 3 + 50); return( cur ); } @@ -141,12 +141,12 @@ print_system_id_buf( const guint8 *ad, int length, gchar *buf, int buf_len) } gchar * -print_area(const guint8 *ad, int length) +print_area(tvbuff_t *tvb, const gint offset, int length) { gchar *cur; cur = (gchar *)wmem_alloc(wmem_packet_scope(), MAX_AREA_LEN * 3 + 20); - print_area_buf(ad, length, cur, MAX_AREA_LEN * 3 + 20); + print_area_buf(tvb_get_ptr(tvb, offset, length), length, cur, MAX_AREA_LEN * 3 + 20); return cur; } diff --git a/epan/osi-utils.h b/epan/osi-utils.h index 2bcf7daaf5..a0b74e71a9 100644 --- a/epan/osi-utils.h +++ b/epan/osi-utils.h @@ -45,9 +45,9 @@ #define NSAP_IDI_ISODCC 0x39 #define NSAP_IDI_GOSIP2 0x47 -gchar* print_nsap_net ( const guint8 *, int ); +gchar* print_nsap_net ( tvbuff_t *, const gint, int ); void print_nsap_net_buf( const guint8 *, int, gchar *, int); -gchar* print_area ( const guint8 *, int ); +gchar* print_area ( tvbuff_t *, const gint, int ); void print_area_buf ( const guint8 *, int, gchar *, int); gchar* print_system_id(wmem_allocator_t *, const guint8 *, int ); gchar* tvb_print_system_id( tvbuff_t *, const gint, int ); |