Move dissect_pn_uint16_ret_item() to packet-pn.c, to be with its sibling
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 13 Jan 2014 22:36:52 +0000 (22:36 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 13 Jan 2014 22:36:52 +0000 (22:36 +0000)
dissect_pn_uint16().  Declare it in packet-pn.h.

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

plugins/profinet/packet-pn-mrp.c
plugins/profinet/packet-pn.c
plugins/profinet/packet-pn.h

index 7cdaaf2e900a6494a737c92f8f3abf41f36b244f..ed13f82dfc126372d0417c7d6dfd0b9066c01d88 100644 (file)
@@ -117,28 +117,6 @@ static const value_string pn_mrp_prio_vals[] = {
 };
 #endif
 
-/* routine disecting an uint16 and returning that item as well */
-/* dissect a 16 bit unsigned integer */
-int
-dissect_pn_uint16_ret_item(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_,
-                       proto_tree *tree, int hfindex, guint16 *pdata, proto_item ** new_item)
-{
-    guint16     data;
-    proto_item *item = NULL;
-
-    data = tvb_get_ntohs (tvb, offset);
-
-    if (tree) {
-        item = proto_tree_add_uint(tree, hfindex, tvb, offset, 2, data);
-    }
-    if (pdata)
-        *pdata = data;
-    if (new_item)
-        *new_item = item;
-    return offset + 2;
-}
-
-
 
 static int
 dissect_PNMRP_Common(tvbuff_t *tvb, int offset,
index cb8fd2434d8bc95082e610f7ae28d8c961b319ea..4457effd57be4ca15382b1345d8fd127f91ae826 100644 (file)
@@ -61,6 +61,26 @@ dissect_pn_uint8(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_,
     return offset + 1;
 }
 
+/* dissect a 16 bit unsigned integer; return the item through a pointer as well */
+int
+dissect_pn_uint16_ret_item(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_,
+                       proto_tree *tree, int hfindex, guint16 *pdata, proto_item ** new_item)
+{
+    guint16     data;
+    proto_item *item = NULL;
+
+    data = tvb_get_ntohs (tvb, offset);
+
+    if (tree) {
+        item = proto_tree_add_uint(tree, hfindex, tvb, offset, 2, data);
+    }
+    if (pdata)
+        *pdata = data;
+    if (new_item)
+        *new_item = item;
+    return offset + 2;
+}
+
 /* dissect a 16 bit unsigned integer */
 int
 dissect_pn_uint16(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_,
index 3fef27e835793c3a11875563d5b0fc375091ed27..6b980684a1a53a3c727124b2819c42da6c560861 100644 (file)
@@ -33,6 +33,8 @@ extern void init_pn(int proto);
 extern int dissect_pn_uint8(tvbuff_t *tvb, gint offset, packet_info *pinfo,
                   proto_tree *tree, int hfindex, guint8 *pdata);
 
+extern int dissect_pn_uint16_ret_item(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_,
+                       proto_tree *tree, int hfindex, guint16 *pdata, proto_item ** new_item);
 extern int dissect_pn_uint16(tvbuff_t *tvb, gint offset, packet_info *pinfo,
                        proto_tree *tree, int hfindex, guint16 *pdata);