Introduce, and start using, tvb_eth_to_str().
authormorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 21 Jan 2011 02:48:55 +0000 (02:48 +0000)
committermorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 21 Jan 2011 02:48:55 +0000 (02:48 +0000)
Export tvb_*_to_str() and put them in alphabetical order.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35602 f5534014-38df-0310-8fa8-9805f1628bb7

15 files changed:
epan/address_to_str.c
epan/dissectors/packet-atm.c
epan/dissectors/packet-cdp.c
epan/dissectors/packet-ipx.c
epan/dissectors/packet-ismp.c
epan/dissectors/packet-mactelnet.c
epan/dissectors/packet-nbns.c
epan/dissectors/packet-netbios.c
epan/dissectors/packet-nlsp.c
epan/dissectors/packet-ppp.c
epan/dissectors/packet-radius.c
epan/dissectors/packet-trmac.c
epan/dissectors/packet-vines.c
epan/libwireshark.def
epan/to_str.h

index d3cf15fab3cd4a404464553a05b0a1c808be4685..0ffc6ab7b2f8c1a00c77dbfdea54dc2b46b4c54a 100644 (file)
@@ -91,6 +91,12 @@ ether_to_str(const guint8 *ad)
        return bytestring_to_str(ad, 6, ':');
 }
 
+gchar *
+tvb_ether_to_str(tvbuff_t *tvb, const gint offset)
+{
+       return bytestring_to_str(tvb_get_ptr(tvb, offset, 6), 6, ':');
+}
+
 /*
  This function is very fast and this function is called a lot.
  XXX update the ep_address_to_str stuff to use this function.
index 67ca855a759221c87d2a4dcdb125051ab15a79e3..0f670f0b251c82e5bbede1a4f4f127355854ac0b 100644 (file)
@@ -220,7 +220,7 @@ dissect_lan_destination(tvbuff_t *tvb, int offset, const char *type, proto_tree
 
   case TAG_MAC_ADDRESS:
     proto_tree_add_text(dest_tree, tvb, offset, 6, "MAC address: %s",
-                        ether_to_str(tvb_get_ptr(tvb, offset, 6)));
+                        tvb_ether_to_str(tvb, offset));
     break;
 
   case TAG_ROUTE_DESCRIPTOR:
index 7c5c6b86b43647f8212c388910211c8b25c7d770..a3200d48c43b72d19b4ea467b40365943519535f 100644 (file)
@@ -501,10 +501,10 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                                tvb_get_guint8(tvb, offset+20));
            proto_tree_add_text(tlv_tree, tvb, offset+21, 6,
                                "Cluster Commander MAC: %s",
-                               ether_to_str(tvb_get_ptr(tvb, offset+21, 6)));
+                               tvb_ether_to_str(tvb, offset+21));
            proto_tree_add_text(tlv_tree, tvb, offset+27, 6,
                                "Switch's MAC: %s",
-                               ether_to_str(tvb_get_ptr(tvb, offset+27, 6)));
+                               tvb_ether_to_str(tvb, offset+27));
            proto_tree_add_text(tlv_tree, tvb, offset+33, 1,
                                "UNKNOWN: 0x%02X",
                                tvb_get_guint8(tvb, offset+33));
@@ -893,7 +893,7 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
       case TYPE_SPARE_POE:
        if (tree) {
-         tlvi = proto_tree_add_text(cdp_tree, tvb, offset, length, 
+         tlvi = proto_tree_add_text(cdp_tree, tvb, offset, length,
                                     "Spare Pair PoE");
          tlv_tree = proto_item_add_subtree(tlvi, ett_cdp_tlv);
 
@@ -1176,8 +1176,8 @@ dissect_nrgyz_tlv(tvbuff_t *tvb, int offset, guint16 length, guint16 num,
 }
 
 static void
-dissect_spare_poe_tlv(tvbuff_t *tvb, int offset, int length, 
-                     proto_tree *tree) 
+dissect_spare_poe_tlv(tvbuff_t *tvb, int offset, int length,
+                     proto_tree *tree)
 {
     proto_item *ti;
     proto_tree *tlv_tree;
@@ -1188,7 +1188,7 @@ dissect_spare_poe_tlv(tvbuff_t *tvb, int offset, int length,
     }
 
     tlv_data = tvb_get_guint8(tvb, offset);
-    ti = proto_tree_add_text(tree, tvb, offset, length, 
+    ti = proto_tree_add_text(tree, tvb, offset, length,
                             "Spare Pair PoE: 0x%02x", tlv_data);
     tlv_tree = proto_item_add_subtree(ti, ett_cdp_spare_poe_tlv);
 
index 4eb1cb35cf38117396a96a31a7a6b1b35d03be4b..ee73bca51a13ddb220093f151f4794bde33d615d 100644 (file)
@@ -1266,7 +1266,7 @@ dissect_ipxsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                                proto_tree_add_text(s_tree, tvb, cursor+50, 4, "Network: %s",
                                                ipxnet_to_string(tvb_get_ptr(tvb, cursor+50, 4)));
                                proto_tree_add_text(s_tree, tvb, cursor+54, 6, "Node: %s",
-                                               ether_to_str(tvb_get_ptr(tvb, cursor+54, 6)));
+                                               tvb_ether_to_str(tvb, cursor+54));
                                server_port = tvb_get_ntohs(tvb, cursor+60);
                                proto_tree_add_text(s_tree, tvb, cursor+60, 2, "Socket: %s (0x%04x)",
                                                socket_text(server_port),
index 4fbe4b50906db9999d602407f84225b5dc62fab4..da82c80f37d3d1e1e5757d98aad9d715e06a029f 100644 (file)
@@ -260,7 +260,7 @@ dissect_ismp_edp(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *ismp
 
                col_add_fstr(pinfo->cinfo, COL_INFO, "MIP %s, MMAC %s, ifIdx %d",
                        tvb_ip_to_str(tvb, offset+2),
-                       ether_to_str(tvb_get_ptr(tvb, offset+6, 6)),
+                       tvb_ether_to_str(tvb, offset+6),
                        tvb_get_ntohl(tvb, offset+12));
 
                proto_tree_add_item(edp_tree, hf_ismp_edp_version, tvb, offset, 2, FALSE);
index 91f4a123024487444897787f43f73a2e9d36fb04..7a9e58f79c568ba17f377a523e88012f2d43083f 100644 (file)
@@ -125,8 +125,8 @@ dissect_mactelnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        type = tvb_get_guint8(tvb, 1);
 
        col_add_fstr(pinfo->cinfo, COL_INFO, "%s > %s Type: %s",
-                    ether_to_str(tvb_get_ptr(tvb, 2, 6)),
-                    ether_to_str(tvb_get_ptr(tvb, 8, 6)),
+                    tvb_ether_to_str(tvb, 2),
+                    tvb_ether_to_str(tvb, 8),
                     val_to_str(type, packettypenames, "Unknown Type:0x%02x"));
 
        if (tree) {
index 0c7993f8432074db3cfb038c3220f0ab84e9af42..e99839cad31d829c722a877161eb522cacf1fac6 100644 (file)
@@ -775,7 +775,7 @@ dissect_nbns_answer(tvbuff_t *tvb, int offset, int nbns_data_offset,
                }
                proto_tree_add_text(rr_tree, tvb, cur_offset, 6,
                    "Unit ID: %s",
-                   ether_to_str(tvb_get_ptr(tvb, cur_offset, 6)));
+                   tvb_ether_to_str(tvb, cur_offset));
                cur_offset += 6;
                data_len -= 6;
 
index 600f082da663c1abe5b72f36d57fa4447f44babf..e63bb0124646291b45e158c2057fd2de24b86232 100644 (file)
@@ -686,7 +686,7 @@ dissect_netb_datagram( tvbuff_t *tvb, int offset, proto_tree *tree)
        if (tvb_memeql(tvb, offset + NB_SENDER_NAME, zeroes, 10) == 0) {
                proto_tree_add_text( tree, tvb, offset + NB_SENDER_NAME + 10, 6,
                    "Sender's MAC Address: %s",
-                   ether_to_str( tvb_get_ptr( tvb,offset + NB_SENDER_NAME + 10, 6)));
+                   tvb_ether_to_str(tvb, offset + NB_SENDER_NAME + 10));
        } else {
                netbios_add_name("Sender's Name", tvb, offset + NB_SENDER_NAME,
                    tree);
@@ -705,7 +705,7 @@ dissect_netb_datagram_bcast( tvbuff_t *tvb, int offset, proto_tree *tree)
        if (tvb_memeql(tvb, offset + NB_SENDER_NAME, zeroes, 10) == 0) {
                proto_tree_add_text( tree, tvb, offset + NB_SENDER_NAME + 10, 6,
                    "Sender's Node Address: %s",
-                   ether_to_str( tvb_get_ptr( tvb,offset + NB_SENDER_NAME + 10, 6)));
+                   tvb_ether_to_str(tvb, offset + NB_SENDER_NAME + 10));
        } else {
                netbios_add_name("Sender's Name", tvb, offset + NB_SENDER_NAME,
                    tree);
index 3147a8021c05dd794b5679e4d04bfdf407ec7faf..6697eba73e35dd3278d982875c9206eaa7d02d41 100644 (file)
@@ -307,7 +307,7 @@ dissect_neighbor_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
                if (tree) {
                        proto_tree_add_text(tree, tvb, offset, 6,
                            "Neighbor: %s",
-                           ether_to_str(tvb_get_ptr(tvb, offset, 6)));
+                           tvb_ether_to_str(tvb, offset));
                }
                offset += 6;
                length -= 6;
@@ -441,11 +441,11 @@ nlsp_dissect_nlsp_hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
        if (tree) {
                proto_tree_add_text(tree, tvb, offset, 6,
                    "Sending Router System ID: %s",
-                   ether_to_str(tvb_get_ptr(tvb, offset, 6)));
+                   tvb_ether_to_str(tvb, offset));
        }
        if (check_col(pinfo->cinfo, COL_INFO)) {
                col_append_fstr(pinfo->cinfo, COL_INFO, ", System ID: %s",
-                   ether_to_str(tvb_get_ptr(tvb, offset, 6)));
+                   tvb_ether_to_str(tvb, offset));
        }
        offset += 6;
 
@@ -481,7 +481,7 @@ nlsp_dissect_nlsp_hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
                if (tree) {
                        proto_tree_add_text(tree, tvb, offset, 6,
                            "Designated Router System ID: %s",
-                           ether_to_str(tvb_get_ptr(tvb, offset, 6)));
+                           tvb_ether_to_str(tvb, offset));
                        proto_tree_add_text(tree, tvb, offset+6, 1,
                            "Designated Router Pseudonode ID: %u",
                            tvb_get_guint8(tvb, offset+6));
@@ -547,7 +547,7 @@ dissect_lsp_mgt_info_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
        if (tree) {
                proto_tree_add_text(tree, tvb, offset, 6,
                    "Node number: %s",
-                   ether_to_str(tvb_get_ptr(tvb, offset, 6)));
+                   tvb_ether_to_str(tvb, offset));
        }
        offset += 6;
        length -= 6;
@@ -696,7 +696,7 @@ dissect_lsp_link_info_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
        if (tree) {
                proto_tree_add_text(tree, tvb, offset, 6,
                    "Router System ID: %s",
-                   ether_to_str(tvb_get_ptr(tvb, offset, 6)));
+                   tvb_ether_to_str(tvb, offset));
                proto_tree_add_text(tree, tvb, offset+6, 1,
                    "Router Pseudonode ID: %u",
                    tvb_get_guint8(tvb, offset+6));
@@ -811,7 +811,7 @@ dissect_lsp_svcs_info_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
        if (tree) {
                proto_tree_add_text(tree, tvb, offset, 6,
                    "Node number: %s",
-                   ether_to_str(tvb_get_ptr(tvb, offset, 6)));
+                   tvb_ether_to_str(tvb, offset));
        }
        offset += 6;
        length -= 6;
@@ -1013,12 +1013,12 @@ nlsp_dissect_nlsp_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
 
        if (check_col(pinfo->cinfo, COL_INFO)) {
                col_append_fstr(pinfo->cinfo, COL_INFO, ", LSP ID: %s",
-                   ether_to_str(tvb_get_ptr(tvb, offset, 6)));
+                   tvb_ether_to_str(tvb, offset));
        }
        if (tree) {
                proto_tree_add_text(tree, tvb, offset, 6,
                    "LSP ID system ID: %s",
-                   ether_to_str(tvb_get_ptr(tvb, offset, 6)));
+                   tvb_ether_to_str(tvb, offset));
        }
        offset += 6;
        /* XXX - append the pseudonode ID */
@@ -1117,7 +1117,7 @@ dissect_csnp_lsp_entries(tvbuff_t *tvb, proto_tree *tree, int offset,
 
                ti = proto_tree_add_text(tree, tvb, offset, 16,
                    "LSP-ID: %s, Sequence: 0x%08x, Lifetime: %5us, Checksum: 0x%04x",
-                   ether_to_str(tvb_get_ptr(tvb, offset+2, 6)), /* XXX - rest of system ID */
+                   tvb_ether_to_str(tvb, offset+2), /* XXX - rest of system ID */
                    tvb_get_ntohl(tvb, offset+10),
                    tvb_get_ntohs(tvb, offset),
                    tvb_get_ntohs(tvb, offset+14));
@@ -1126,7 +1126,7 @@ dissect_csnp_lsp_entries(tvbuff_t *tvb, proto_tree *tree, int offset,
 
                proto_tree_add_text(subtree, tvb, offset+2, 6,
                    "LSP ID source ID: %s",
-                   ether_to_str(tvb_get_ptr(tvb, offset+2, 6)));
+                   tvb_ether_to_str(tvb, offset+2));
                proto_tree_add_text(subtree, tvb, offset+8, 1,
                    "LSP ID pseudonode ID: %u",
                    tvb_get_guint8(tvb, offset+8));
@@ -1166,7 +1166,7 @@ dissect_psnp_lsp_entries(tvbuff_t *tvb, proto_tree *tree, int offset,
 
                ti = proto_tree_add_text(tree, tvb, offset, 16,
                    "LSP-ID: %s, Sequence: 0x%08x, Lifetime: %5us, Checksum: 0x%04x",
-                   ether_to_str(tvb_get_ptr(tvb, offset+2, 6)), /* XXX - rest of system ID */
+                   tvb_ether_to_str(tvb, offset+2), /* XXX - rest of system ID */
                    tvb_get_ntohl(tvb, offset+10),
                    tvb_get_ntohs(tvb, offset),
                    tvb_get_ntohs(tvb, offset+14));
@@ -1175,7 +1175,7 @@ dissect_psnp_lsp_entries(tvbuff_t *tvb, proto_tree *tree, int offset,
 
                proto_tree_add_text(subtree, tvb, offset+2, 6,
                    "LSP ID source ID: %s",
-                   ether_to_str(tvb_get_ptr(tvb, offset+2, 6)));
+                   tvb_ether_to_str(tvb, offset+2));
                proto_tree_add_text(subtree, tvb, offset+8, 1,
                    "LSP ID pseudonode ID: %u",
                    tvb_get_guint8(tvb, offset+8));
@@ -1248,12 +1248,12 @@ nlsp_dissect_nlsp_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
 
        if (check_col(pinfo->cinfo, COL_INFO)) {
                col_append_fstr(pinfo->cinfo, COL_INFO, ", Source ID: %s",
-                   ether_to_str(tvb_get_ptr(tvb, offset, 6)));
+                   tvb_ether_to_str(tvb, offset));
        }
        if (tree) {
                proto_tree_add_text(tree, tvb, offset, 6,
                    "Source ID system ID: %s",
-                   ether_to_str(tvb_get_ptr(tvb, offset, 6)));
+                   tvb_ether_to_str(tvb, offset));
        }
        offset += 6;
        /* XXX - add the pseudonode ID */
@@ -1266,12 +1266,12 @@ nlsp_dissect_nlsp_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
 
        if (check_col(pinfo->cinfo, COL_INFO)) {
                col_append_fstr(pinfo->cinfo, COL_INFO, ", Start LSP ID: %s",
-                   ether_to_str(tvb_get_ptr(tvb, offset, 6)));
+                   tvb_ether_to_str(tvb, offset));
        }
        if (tree) {
                proto_tree_add_text(tree, tvb, offset, 6,
                    "Start LSP ID source ID: %s",
-                   ether_to_str(tvb_get_ptr(tvb, offset, 6)));
+                   tvb_ether_to_str(tvb, offset));
        }
        offset += 6;
        /* XXX - append the pseudonode ID */
@@ -1290,12 +1290,12 @@ nlsp_dissect_nlsp_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
 
        if (check_col(pinfo->cinfo, COL_INFO)) {
                col_append_fstr(pinfo->cinfo, COL_INFO, ", End LSP ID: %s",
-                   ether_to_str(tvb_get_ptr(tvb, offset, 6)));
+                   tvb_ether_to_str(tvb, offset));
        }
        if (tree) {
                proto_tree_add_text(tree, tvb, offset, 6,
                    "End LSP ID source ID: %s",
-                   ether_to_str(tvb_get_ptr(tvb, offset, 6)));
+                   tvb_ether_to_str(tvb, offset));
        }
        offset += 6;
        /* XXX - append the pseudonode ID */
@@ -1369,12 +1369,12 @@ nlsp_dissect_nlsp_psnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
 
        if (check_col(pinfo->cinfo, COL_INFO)) {
                col_append_fstr(pinfo->cinfo, COL_INFO, ", Source ID: %s",
-                   ether_to_str(tvb_get_ptr(tvb, offset, 6)));
+                   tvb_ether_to_str(tvb, offset));
        }
        if (tree) {
                proto_tree_add_text(tree, tvb, offset, 6,
                    "Source ID system ID: %s",
-                   ether_to_str(tvb_get_ptr(tvb, offset, 6)));
+                   tvb_ether_to_str(tvb, offset));
        }
        offset += 6;
        /* XXX - add the pseudonode ID */
index 71172e9e22b2c7917dda58defbde93b042ae30d1..b01505e3598860728ae4f3dd9be8ca40e9be175b 100644 (file)
@@ -2121,7 +2121,7 @@ dissect_lcp_multilink_ep_disc_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
                             length, plurality(length, "", "s"));
       } else {
         proto_tree_add_text(field_tree, tvb, offset, length,
-                            "Address: %s", ether_to_str(tvb_get_ptr(tvb, offset, 6)));
+                            "Address: %s", tvb_ether_to_str(tvb, offset));
       }
       break;
 
index 6a84d7d6012c64ec2017e07ff5c8e030b134f3b3..96520869b66b26a21cd3fa3d3cd88b1eaeaa275e 100644 (file)
@@ -724,7 +724,7 @@ void radius_ether(radius_attr_info_t* a, proto_tree* tree, packet_info *pinfo _U
        }
 
        proto_tree_add_item(tree, a->hf, tvb, offset, len, FALSE);
-       proto_item_append_text(avp_item, "%s", ether_to_str(tvb_get_ptr(tvb, offset, len)));
+       proto_item_append_text(avp_item, "%s", tvb_ether_to_str(tvb, offset));
 }
 
 void radius_ifid(radius_attr_info_t* a, proto_tree* tree, packet_info *pinfo _U_, tvbuff_t* tvb, int offset, int len, proto_item* avp_item) {
index a2ccd2cfc32d41552c3bbd893c580cbfd68dd60c..698b20f63731bdc44ef0509e305cc1bfd9e81686 100644 (file)
@@ -181,7 +181,7 @@ sv_text(tvbuff_t *tvb, int svoff, proto_tree *tree)
                case 0x0A: /* Address of last neighbor notification */
                        proto_tree_add_text(tree, tvb, svoff+1, sv_length-1,
                                "Address of Last Neighbor Notification: %s",
-                               ether_to_str(tvb_get_ptr(tvb, svoff+2, 6)));
+                               tvb_ether_to_str(tvb, svoff+2));
                        break;
 
                case 0x0B: /* Physical Location */
index f798db39c1b6d4ddb711939fa9a8479d2b9940c9..43658d21fcf524fa1c7e8d798f817806eb85bab4 100644 (file)
@@ -1478,7 +1478,7 @@ rtp_show_gateway_info(proto_tree *tree, tvbuff_t *tvb, int offset,
                proto_tree_add_text(tree, tvb, offset, link_addr_length,
                    "Preferred Gateway Data Link Address: %s",
                    link_addr_length == 6 ?
-                   ether_to_str(tvb_get_ptr(tvb, offset, link_addr_length)) :
+                   tvb_ether_to_str(tvb, offset) :
                    tvb_bytes_to_str(tvb, offset, link_addr_length));
                offset += link_addr_length;
        }
index 612f733cbb2ad343dda2ee417e9885069f8e042a..05f27ff49a78f39ae8567e81ed57ac4d6d9f9778 100644 (file)
@@ -614,10 +614,8 @@ InfoRequestNakReason_vals       DATA
 init_dissection
 init_progfile_dir
 ip6_to_str
-tvb_ip6_to_str
 in_cksum
 ip_to_str
-tvb_ip_to_str
 ipprotostr
 ipv4_get_net_order_addr
 is_big_endian
@@ -1033,7 +1031,10 @@ tvb_bytes_to_str
 tvb_bytes_to_str_punct
 tvb_ensure_bytes_exist
 tvb_ensure_length_remaining
+tvb_eth_to_str
 tvb_fake_unicode
+tvb_fc_to_str
+tvb_fcwwm_to_str
 tvb_find_guint8
 tvb_find_line_end
 tvb_find_line_end_unquoted
@@ -1077,6 +1078,8 @@ tvb_get_ntohs
 tvb_get_ptr
 tvb_get_string
 tvb_get_stringz
+tvb_ip6_to_str
+tvb_ip_to_str
 tvb_length
 tvb_length_remaining
 tvb_memcpy
index 1b1c2b4ed9cb732c2237b9f54c6a75df7b40576f..3fc560cf1f17b3065d931076790082bf68f2dd69 100644 (file)
@@ -49,6 +49,7 @@ extern gchar* se_address_to_str(const address *);
 extern void     address_to_str_buf(const address *addr, gchar *buf, int buf_len);
 extern gchar*   bytestring_to_str(const guint8 *, const guint32, const char);
 extern gchar*  ether_to_str(const guint8 *);
+extern gchar*  tvb_ether_to_str(tvbuff_t *tvb, const gint offset);
 extern const gchar*    ip_to_str(const guint8 *);
 extern const gchar*    tvb_ip_to_str(tvbuff_t *tvb, const gint offset);
 extern void    ip_to_str_buf(const guint8 *ad, gchar *buf, const int buf_len);