Don't guard col_set_str (COL_INFO/COL_PROTOCOL) with col_check
[obnox/wireshark/wip.git] / epan / dissectors / packet-zbee-nwk.c
index 0ae3ceab2a6df1b63d029fcd031d8b3445464ef8..e2041fd51c03af81a99c051cc716b86987dd0e16 100644 (file)
 /*************************/
 /* Function Declarations */
 /*************************/
-/* Protocol Registration */
-void    proto_reg_handoff_zbee_nwk  (void);
-void    proto_register_zbee_nwk     (void);
-
 /* Dissector Routines */
-gboolean    dissect_zbee_nwk_heur   (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-void        dissect_zbee_nwk        (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-void        dissect_zbee_nwk_cmd    (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-void        dissect_zbee_beacon     (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
+static void        dissect_zbee_nwk        (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
+static void        dissect_zbee_nwk_cmd    (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
+static void        dissect_zbee_beacon     (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
 
 /* Command Dissector Helpers */
-guint       dissect_zbee_nwk_route_req  (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, zbee_nwk_packet * packet, guint offset);
-guint       dissect_zbee_nwk_route_rep  (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
-guint       dissect_zbee_nwk_status     (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
-guint       dissect_zbee_nwk_leave      (tvbuff_t *tvb, proto_tree *tree, guint offset);
-guint       dissect_zbee_nwk_route_rec  (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, zbee_nwk_packet * packet, guint offset);
-guint       dissect_zbee_nwk_rejoin_req (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, zbee_nwk_packet * packet, guint offset);
-guint       dissect_zbee_nwk_rejoin_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, zbee_nwk_packet * packet, guint offset);
-guint       dissect_zbee_nwk_link_status(tvbuff_t *tvb, proto_tree *tree, guint offset);
-guint       dissect_zbee_nwk_report     (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
-guint       dissect_zbee_nwk_update     (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
+static guint       dissect_zbee_nwk_route_req  (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, zbee_nwk_packet * packet, guint offset);
+static guint       dissect_zbee_nwk_route_rep  (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
+static guint       dissect_zbee_nwk_status     (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
+static guint       dissect_zbee_nwk_leave      (tvbuff_t *tvb, proto_tree *tree, guint offset);
+static guint       dissect_zbee_nwk_route_rec  (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, zbee_nwk_packet * packet, guint offset);
+static guint       dissect_zbee_nwk_rejoin_req (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, zbee_nwk_packet * packet, guint offset);
+static guint       dissect_zbee_nwk_rejoin_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, zbee_nwk_packet * packet, guint offset);
+static guint       dissect_zbee_nwk_link_status(tvbuff_t *tvb, proto_tree *tree, guint offset);
+static guint       dissect_zbee_nwk_report     (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
+static guint       dissect_zbee_nwk_update     (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
 
 
 /********************/
@@ -154,20 +149,19 @@ static gint ett_zbee_nwk_cmd_cinfo = -1;
 
 static dissector_handle_t   data_handle;
 static dissector_handle_t   aps_handle;
-static dissector_handle_t   security_handle;
 
 /********************/
 /* Field Names      */
 /********************/
 /* Frame Types */
-const value_string zbee_nwk_frame_types[] = {
+static const value_string zbee_nwk_frame_types[] = {
     { ZBEE_NWK_FCF_DATA,    "Data" },
     { ZBEE_NWK_FCF_CMD,     "Command" },
     { 0, NULL }
 };
 
 /* Route Discovery Modes */
-const value_string zbee_nwk_discovery_modes[] = {
+static const value_string zbee_nwk_discovery_modes[] = {
     { ZBEE_NWK_FCF_DISCOVERY_SUPPRESS,  "Suppress" },
     { ZBEE_NWK_FCF_DISCOVERY_ENABLE,    "Enable" },
     { ZBEE_NWK_FCF_DISCOVERY_FORCE,     "Force" },
@@ -175,7 +169,7 @@ const value_string zbee_nwk_discovery_modes[] = {
 };
 
 /* Command Names*/
-const value_string zbee_nwk_cmd_names[] = {
+static const value_string zbee_nwk_cmd_names[] = {
     { ZBEE_NWK_CMD_ROUTE_REQ,       "Route Request" },
     { ZBEE_NWK_CMD_ROUTE_REPLY,     "Route Reply" },
     { ZBEE_NWK_CMD_NWK_STATUS,      "Network Status" },
@@ -190,7 +184,7 @@ const value_string zbee_nwk_cmd_names[] = {
 };
 
 /* Many-To-One Route Discovery Modes. */
-const value_string zbee_nwk_cmd_route_many_modes[] = {
+static const value_string zbee_nwk_cmd_route_many_modes[] = {
     { ZBEE_NWK_CMD_ROUTE_OPTION_MANY_NONE,  "Not Many-to-One" },
     { ZBEE_NWK_CMD_ROUTE_OPTION_MANY_REC,   "With Source Routing" },
     { ZBEE_NWK_CMD_ROUTE_OPTION_MANY_NOREC, "Without Source Routing" },
@@ -198,7 +192,7 @@ const value_string zbee_nwk_cmd_route_many_modes[] = {
 };
 
 /* Rejoin Status Codes */
-const value_string zbee_nwk_rejoin_codes[] = {
+static const value_string zbee_nwk_rejoin_codes[] = {
     { IEEE802154_CMD_ASRSP_AS_SUCCESS,      "Success" },
     { IEEE802154_CMD_ASRSP_PAN_FULL,        "PAN Full" },
     { IEEE802154_CMD_ASRSP_PAN_DENIED,      "PAN Access Denied" },
@@ -206,19 +200,19 @@ const value_string zbee_nwk_rejoin_codes[] = {
 };
 
 /* Network Report Types */
-const value_string zbee_nwk_report_types[] = {
+static const value_string zbee_nwk_report_types[] = {
     { ZBEE_NWK_CMD_NWK_REPORT_ID_PAN_CONFLICT,  "PAN Identifier Conflict" },
     { 0, NULL }
 };
 
 /* Network Update Types */
-const value_string zbee_nwk_update_types[] = {
+static const value_string zbee_nwk_update_types[] = {
     { ZBEE_NWK_CMD_NWK_UPDATE_ID_PAN_UPDATE,  "PAN Identifier Update" },
     { 0, NULL }
 };
 
 /* Network Status Codes */
-const value_string zbee_nwk_status_codes[] = {
+static const value_string zbee_nwk_status_codes[] = {
     { ZBEE_NWK_STATUS_NO_ROUTE_AVAIL,       "No Route Available" },
     { ZBEE_NWK_STATUS_TREE_LINK_FAIL,       "Tree Link Failure" },
     { ZBEE_NWK_STATUS_NON_TREE_LINK_FAIL,   "Non-tree Link Failure" },
@@ -242,7 +236,7 @@ const value_string zbee_nwk_status_codes[] = {
 };
 
 /* Stack Profile Values. */
-const value_string zbee_nwk_stack_profiles[] = {
+static const value_string zbee_nwk_stack_profiles[] = {
     { 0x00, "Network Specific" },
     { 0x01, "ZigBee Home" },
     { 0x02, "ZigBee PRO" },
@@ -274,11 +268,11 @@ proto_tree_add_eui64(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, g
 
 /*FUNCTION:------------------------------------------------------
  *  NAME
- *      get_bit_field
+ *      zbee_get_bit_field
  *  DESCRIPTION
  *      Extracts an integer sub-field from an int with a given mask
  *      if the mask is 0, this will return 0, if the mask is non-
- *      continuos the output is undefined.
+ *      continuous the output is undefined.
  *  PARAMETERS
  *      guint       input
  *      guint       mask
@@ -287,7 +281,7 @@ proto_tree_add_eui64(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, g
  *---------------------------------------------------------------
  */
 guint
-get_bit_field(guint input, guint mask)
+zbee_get_bit_field(guint input, guint mask)
 {
     /* Sanity Check, don't want infinite loops. */
     if (mask == 0) return 0;
@@ -297,7 +291,7 @@ get_bit_field(guint input, guint mask)
         mask >>=1;
     } /* while */
     return (input & mask);
-} /* get_bit_field */
+} /* zbee_get_bit_field */
 
 /*FUNCTION:------------------------------------------------------
  *  NAME
@@ -307,12 +301,12 @@ get_bit_field(guint input, guint mask)
  *  PARAMETERS
  *      tvbuff_t *tvb       - pointer to buffer containing raw packet.
  *      packet_into *pinfo  - pointer to packet information fields
- *      proto_tree *tree    - pointer to data tree ethereal uses to display packet.
+ *      proto_tree *tree    - pointer to data tree Wireshark uses to display packet.
  *  RETURNS
- *      Boolean value, wether it handles the packet or not.
+ *      Boolean value, whether it handles the packet or not.
  *---------------------------------------------------------------
  */
-gboolean
+static gboolean
 dissect_zbee_nwk_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
     ieee802154_packet   *packet = pinfo->private_data;
@@ -344,16 +338,16 @@ dissect_zbee_nwk_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
  *  NAME
  *      dissect_zbee_nwk
  *  DESCRIPTION
- *      ZigBee packet dissection routine for ethereal.
+ *      ZigBee packet dissection routine for Wireshark.
  *  PARAMETERS
  *      tvbuff_t *tvb       - pointer to buffer containing raw packet.
  *      packet_into *pinfo  - pointer to packet information fields
- *      proto_tree *tree    - pointer to data tree ethereal uses to display packet.
+ *      proto_tree *tree    - pointer to data tree Wireshark uses to display packet.
  *  RETURNS
  *      void
  *---------------------------------------------------------------
  */
-void
+static void
 dissect_zbee_nwk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
     tvbuff_t            *payload_tvb = NULL;
@@ -373,9 +367,7 @@ dissect_zbee_nwk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     memset(&packet, 0, sizeof(packet));
 
     /* Add ourself to the protocol column, clear the info column, and create the protocol tree. */
-    if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
-        col_set_str(pinfo->cinfo, COL_PROTOCOL, "ZigBee");
-    }
+    col_set_str(pinfo->cinfo, COL_PROTOCOL, "ZigBee");
     if (check_col(pinfo->cinfo, COL_INFO)) {
         col_clear(pinfo->cinfo, COL_INFO);
     }
@@ -386,14 +378,14 @@ dissect_zbee_nwk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
     /* Get and parse the FCF */
     fcf = tvb_get_letohs(tvb, offset);
-    packet.type         = get_bit_field(fcf, ZBEE_NWK_FCF_FRAME_TYPE);
-    packet.version      = get_bit_field(fcf, ZBEE_NWK_FCF_VERSION);
-    packet.discovery    = get_bit_field(fcf, ZBEE_NWK_FCF_DISCOVER_ROUTE);
-    packet.security     = get_bit_field(fcf, ZBEE_NWK_FCF_SECURITY);
-    packet.multicast    = get_bit_field(fcf, ZBEE_NWK_FCF_MULTICAST);
-    packet.route        = get_bit_field(fcf, ZBEE_NWK_FCF_SOURCE_ROUTE);
-    packet.ext_dst      = get_bit_field(fcf, ZBEE_NWK_FCF_EXT_DEST);
-    packet.ext_src      = get_bit_field(fcf, ZBEE_NWK_FCF_EXT_SOURCE);
+    packet.type         = zbee_get_bit_field(fcf, ZBEE_NWK_FCF_FRAME_TYPE);
+    packet.version      = zbee_get_bit_field(fcf, ZBEE_NWK_FCF_VERSION);
+    packet.discovery    = zbee_get_bit_field(fcf, ZBEE_NWK_FCF_DISCOVER_ROUTE);
+    packet.security     = zbee_get_bit_field(fcf, ZBEE_NWK_FCF_SECURITY);
+    packet.multicast    = zbee_get_bit_field(fcf, ZBEE_NWK_FCF_MULTICAST);
+    packet.route        = zbee_get_bit_field(fcf, ZBEE_NWK_FCF_SOURCE_ROUTE);
+    packet.ext_dst      = zbee_get_bit_field(fcf, ZBEE_NWK_FCF_EXT_DEST);
+    packet.ext_src      = zbee_get_bit_field(fcf, ZBEE_NWK_FCF_EXT_SOURCE);
     pinfo->zbee_stack_vers = packet.version;
 
     /* Display the FCF. */
@@ -492,9 +484,9 @@ dissect_zbee_nwk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     if ((pinfo->zbee_stack_vers >= ZBEE_VERSION_2007) && packet.multicast) {
         guint8  mcast_control = tvb_get_guint8(tvb, offset);
 
-        packet.mcast_mode       = get_bit_field(mcast_control, ZBEE_NWK_MCAST_MODE);
-        packet.mcast_radius     = get_bit_field(mcast_control, ZBEE_NWK_MCAST_RADIUS);
-        packet.mcast_max_radius = get_bit_field(mcast_control, ZBEE_NWK_MCAST_MAX_RADIUS);
+        packet.mcast_mode       = zbee_get_bit_field(mcast_control, ZBEE_NWK_MCAST_MODE);
+        packet.mcast_radius     = zbee_get_bit_field(mcast_control, ZBEE_NWK_MCAST_RADIUS);
+        packet.mcast_max_radius = zbee_get_bit_field(mcast_control, ZBEE_NWK_MCAST_MAX_RADIUS);
         if (tree) {
             /* Create a subtree for the multicast control field. */
             ti = proto_tree_add_text(nwk_tree, tvb, offset, sizeof(guint8), "Multicast Control Field");
@@ -618,18 +610,18 @@ dissect_zbee_nwk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
  *  NAME
  *      dissect_zbee_nwk_cmd
  *  DESCRIPTION
- *      ZigBee Network command packet dissection routine for ethereal.
+ *      ZigBee Network command packet dissection routine for Wireshark.
  *          note: this dissector differs from others in that is shouldn't be
  *                  passed the main tree pointer, but the nwk tree instead.
  *  PARAMETERS
  *      tvbuff_t *tvb       - pointer to buffer containing raw packet.
  *      packet_into *pinfo  - pointer to packet information fields
- *      proto_tree *tree    - pointer to data tree ethereal uses to display packet.
+ *      proto_tree *tree    - pointer to data tree Wireshark uses to display packet.
  *  RETURNS
  *      void
  *---------------------------------------------------------------
  */
-void dissect_zbee_nwk_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static void dissect_zbee_nwk_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
     proto_tree  *cmd_tree = NULL;
     proto_item  *cmd_root = NULL;
@@ -744,7 +736,7 @@ void dissect_zbee_nwk_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
  *      guint               - offset after command dissection.
  *---------------------------------------------------------------
  */
-guint
+static guint
 dissect_zbee_nwk_route_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, zbee_nwk_packet * packet, guint offset)
 {
     proto_tree  *field_tree;
@@ -827,7 +819,7 @@ dissect_zbee_nwk_route_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
  *      guint               - offset after command dissection.
  *---------------------------------------------------------------
  */
-guint
+static guint
 dissect_zbee_nwk_route_rep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
 {
     proto_tree  *field_tree;
@@ -928,7 +920,7 @@ dissect_zbee_nwk_route_rep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
  *      guint               - offset after command dissection.
  *---------------------------------------------------------------
  */
-guint
+static guint
 dissect_zbee_nwk_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
 {
     guint8  status_code;
@@ -970,7 +962,7 @@ dissect_zbee_nwk_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui
  *      guint               - offset after command dissection.
  *---------------------------------------------------------------
  */
-guint
+static guint
 dissect_zbee_nwk_leave(tvbuff_t *tvb, proto_tree *tree, guint offset)
 {
     guint8  leave_options;
@@ -1003,7 +995,7 @@ dissect_zbee_nwk_leave(tvbuff_t *tvb, proto_tree *tree, guint offset)
  *      guint               - offset after command dissection.
  *---------------------------------------------------------------
  */
-guint
+static guint
 dissect_zbee_nwk_route_rec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, zbee_nwk_packet * packet, guint offset)
 {
     guint8  relay_count;
@@ -1050,7 +1042,7 @@ dissect_zbee_nwk_route_rec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
  *      guint               - offset after command dissection.
  *---------------------------------------------------------------
  */
-guint
+static guint
 dissect_zbee_nwk_rejoin_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, zbee_nwk_packet * packet, guint offset)
 {
     proto_tree  *field_tree;
@@ -1099,7 +1091,7 @@ dissect_zbee_nwk_rejoin_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
  *      guint               - offset after command dissection.
  *---------------------------------------------------------------
  */
-guint
+static guint
 dissect_zbee_nwk_rejoin_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, zbee_nwk_packet * packet, guint offset)
 {
     guint16 addr;
@@ -1146,7 +1138,7 @@ dissect_zbee_nwk_rejoin_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
  *      guint               - offset after command dissection.
  *---------------------------------------------------------------
  */
-guint
+static guint
 dissect_zbee_nwk_link_status(tvbuff_t *tvb, proto_tree *tree, guint offset)
 {
     guint8  options;
@@ -1169,7 +1161,7 @@ dissect_zbee_nwk_link_status(tvbuff_t *tvb, proto_tree *tree, guint offset)
         addr = tvb_get_letohs(tvb, offset);
         options = tvb_get_guint8(tvb, offset+sizeof(guint16));
         if (tree) {
-            proto_tree_add_text(tree, tvb, offset, sizeof(guint16)+sizeof(guint8), "0x%04x, Incomming Cost: %d Outgoing Cost: %d", addr, options & ZBEE_NWK_CMD_LINK_INCOMMING_COST_MASK, (options & ZBEE_NWK_CMD_LINK_OUTGOING_COST_MASK)>>4);
+            proto_tree_add_text(tree, tvb, offset, sizeof(guint16)+sizeof(guint8), "0x%04x, Incoming Cost: %d Outgoing Cost: %d", addr, options & ZBEE_NWK_CMD_LINK_INCOMMING_COST_MASK, (options & ZBEE_NWK_CMD_LINK_OUTGOING_COST_MASK)>>4);
         }
         offset += (sizeof(guint16)+sizeof(guint8));
     } /* for */
@@ -1192,7 +1184,7 @@ dissect_zbee_nwk_link_status(tvbuff_t *tvb, proto_tree *tree, guint offset)
  *      guint               - offset after command dissection.
  *---------------------------------------------------------------
  */
-guint
+static guint
 dissect_zbee_nwk_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
 {
     guint8  options;
@@ -1254,7 +1246,7 @@ dissect_zbee_nwk_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui
  *      guint               - offset after command dissection.
  *---------------------------------------------------------------
  */
-guint
+static guint
 dissect_zbee_nwk_update(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
 {
     guint8  options;
@@ -1318,12 +1310,12 @@ dissect_zbee_nwk_update(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui
  *  PARAMETERS
  *      tvbuff_t *tvb       - pointer to buffer containing raw packet.
  *      packet_into *pinfo  - pointer to packet information fields
- *      proto_tree *tree    - pointer to data tree ethereal uses to display packet.
+ *      proto_tree *tree    - pointer to data tree Wireshark uses to display packet.
  *  RETURNS
  *      void
  *---------------------------------------------------------------
  */
-void dissect_zbee_beacon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static void dissect_zbee_beacon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
     ieee802154_packet   *packet = pinfo->private_data;
 
@@ -1361,9 +1353,9 @@ void dissect_zbee_beacon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
     /* Get and display the stack profile and protocol version. */
     temp = tvb_get_guint8(tvb, offset);
-    pinfo->zbee_stack_vers = version = get_bit_field(temp, ZBEE_NWK_BEACON_PROTOCOL_VERSION);
+    pinfo->zbee_stack_vers = version = zbee_get_bit_field(temp, ZBEE_NWK_BEACON_PROTOCOL_VERSION);
     if (tree) {
-        proto_tree_add_uint(beacon_tree, hf_zbee_beacon_stack_profile, tvb, offset, sizeof(guint8), get_bit_field(temp, ZBEE_NWK_BEACON_STACK_PROFILE));
+        proto_tree_add_uint(beacon_tree, hf_zbee_beacon_stack_profile, tvb, offset, sizeof(guint8), zbee_get_bit_field(temp, ZBEE_NWK_BEACON_STACK_PROFILE));
         proto_tree_add_uint(beacon_tree, hf_zbee_beacon_version, tvb, offset, sizeof(guint8), version);
     }
     offset += sizeof(guint8);
@@ -1371,9 +1363,9 @@ void dissect_zbee_beacon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     /* Get and display the security level and flags. */
     temp        = tvb_get_guint8(tvb, offset);
     if (tree) {
-        proto_tree_add_boolean(beacon_tree, hf_zbee_beacon_router_capacity, tvb, offset, sizeof(guint8), get_bit_field(temp, ZBEE_NWK_BEACON_ROUTER_CAPACITY));
-        proto_tree_add_uint(beacon_tree, hf_zbee_beacon_depth, tvb, offset, sizeof(guint8), get_bit_field(temp, ZBEE_NWK_BEACON_NETWORK_DEPTH));
-        proto_tree_add_boolean(beacon_tree, hf_zbee_beacon_end_device_capacity, tvb, offset, sizeof(guint8), get_bit_field(temp, ZBEE_NWK_BEACON_END_DEVICE_CAPACITY));
+        proto_tree_add_boolean(beacon_tree, hf_zbee_beacon_router_capacity, tvb, offset, sizeof(guint8), zbee_get_bit_field(temp, ZBEE_NWK_BEACON_ROUTER_CAPACITY));
+        proto_tree_add_uint(beacon_tree, hf_zbee_beacon_depth, tvb, offset, sizeof(guint8), zbee_get_bit_field(temp, ZBEE_NWK_BEACON_NETWORK_DEPTH));
+        proto_tree_add_boolean(beacon_tree, hf_zbee_beacon_end_device_capacity, tvb, offset, sizeof(guint8), zbee_get_bit_field(temp, ZBEE_NWK_BEACON_END_DEVICE_CAPACITY));
     }
     offset += sizeof(guint8);
 
@@ -1453,11 +1445,11 @@ void proto_register_zbee_nwk(void)
 
             { &hf_zbee_nwk_frame_type,
             { "Frame Type",             "zbee.nwk.frame_type", FT_UINT16, BASE_HEX, VALS(zbee_nwk_frame_types), ZBEE_NWK_FCF_FRAME_TYPE,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_proto_version,
             { "Protocol Version",       "zbee.nwk.proto_version", FT_UINT16, BASE_DEC, NULL, ZBEE_NWK_FCF_VERSION,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_discover_route,
             { "Discover Route",         "zbee.nwk.discovery", FT_UINT16, BASE_HEX, VALS(zbee_nwk_discovery_modes), ZBEE_NWK_FCF_DISCOVER_ROUTE,
@@ -1465,7 +1457,7 @@ void proto_register_zbee_nwk(void)
 
             { &hf_zbee_nwk_multicast,
             { "Multicast",              "zbee.nwk.multicast", FT_BOOLEAN, 16, NULL, ZBEE_NWK_FCF_MULTICAST,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_security,
             { "Security",               "zbee.nwk.security", FT_BOOLEAN, 16, NULL, ZBEE_NWK_FCF_SECURITY,
@@ -1473,23 +1465,23 @@ void proto_register_zbee_nwk(void)
 
             { &hf_zbee_nwk_source_route,
             { "Source Route",           "zbee.nwk.src_route", FT_BOOLEAN, 16, NULL, ZBEE_NWK_FCF_SOURCE_ROUTE,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_ext_dst,
             { "Extended Destination",   "zbee.nwk.ext_dst", FT_BOOLEAN, 16, NULL, ZBEE_NWK_FCF_EXT_DEST,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_ext_src,
             { "Extended Source",        "zbee.nwk.ext_src", FT_BOOLEAN, 16, NULL, ZBEE_NWK_FCF_EXT_SOURCE,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_dst,
             { "Destination",            "zbee.nwk.dst", FT_UINT16, BASE_HEX, NULL, 0x0,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_src,
             { "Source",                 "zbee.nwk.src", FT_UINT16, BASE_HEX, NULL, 0x0,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_radius,
             { "Radius",                 "zbee.nwk.radius", FT_UINT8, BASE_DEC, NULL, 0x0,
@@ -1497,7 +1489,7 @@ void proto_register_zbee_nwk(void)
 
             { &hf_zbee_nwk_seqno,
             { "Sequence Number",        "zbee.nwk.seqno", FT_UINT8, BASE_DEC, NULL, 0x0,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_mcast_mode,
             { "Multicast Mode",         "zbee.nwk.multicast.mode", FT_UINT8, BASE_DEC, NULL, ZBEE_NWK_MCAST_MODE,
@@ -1509,15 +1501,15 @@ void proto_register_zbee_nwk(void)
 
             { &hf_zbee_nwk_mcast_max_radius,
             { "Max Non-Member Radius",  "zbee.nwk.multicast.max_radius", FT_UINT8, BASE_DEC, NULL, ZBEE_NWK_MCAST_MAX_RADIUS,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_dst64,
             { "Extended Destination",   "zbee.nwk.dst64", FT_UINT64, BASE_HEX, NULL, 0x0,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_src64,
             { "Extended Source",        "zbee.nwk.scr64", FT_UINT64, BASE_HEX, NULL, 0x0,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_relay_count,
             { "Relay Count",            "zbee.nwk.relay.count", FT_UINT8, BASE_DEC, NULL, 0x0,
@@ -1529,11 +1521,11 @@ void proto_register_zbee_nwk(void)
 
             { &hf_zbee_nwk_cmd_id,
             { "Command Identifier",     "zbee.nwk.cmd.id", FT_UINT8, BASE_HEX, VALS(zbee_nwk_cmd_names), 0x0,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_cmd_addr,
             { "Address",                "zbee.nwk.cmd.addr", FT_UINT16, BASE_HEX, NULL, 0x0,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_cmd_route_id,
             { "Route ID",               "zbee.nwk.cmd.route.id", FT_UINT8, BASE_DEC, NULL, 0x0,
@@ -1541,27 +1533,27 @@ void proto_register_zbee_nwk(void)
 
             { &hf_zbee_nwk_cmd_route_dest,
             { "Destination",            "zbee.nwk.cmd.route.dest", FT_UINT16, BASE_HEX, NULL, 0x0,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_cmd_route_orig,
             { "Originator",             "zbee.nwk.cmd.route.orig", FT_UINT16, BASE_HEX, NULL, 0x0,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_cmd_route_resp,
             { "Responder",              "zbee.nwk.cmd.route.resp", FT_UINT16, BASE_HEX, NULL, 0x0,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_cmd_route_dest_ext,
             { "Extended Destination",   "zbee.nwk.cmd.route.dest_ext", FT_UINT64, BASE_HEX, NULL, 0x0,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_cmd_route_orig_ext,
             { "Extended Originator",    "zbee.nwk.cmd.route.orig_ext", FT_UINT64, BASE_HEX, NULL, 0x0,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_cmd_route_resp_ext,
             { "Extended Responder",     "zbee.nwk.cmd.route.resp_ext", FT_UINT64, BASE_HEX, NULL, 0x0,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_cmd_route_cost,
             { "Path Cost",              "zbee.nwk.cmd.route.cost", FT_UINT8, BASE_DEC, NULL, 0x0,
@@ -1577,23 +1569,23 @@ void proto_register_zbee_nwk(void)
 
             { &hf_zbee_nwk_cmd_route_opt_dest_ext,
             { "Extended Destination",   "zbee.nwk.cmd.route.opts.dest_ext", FT_BOOLEAN, 8, NULL, ZBEE_NWK_CMD_ROUTE_OPTION_DEST_EXT,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_cmd_route_opt_resp_ext,
             { "Extended Responder",   "zbee.nwk.cmd.route.opts.resp_ext", FT_BOOLEAN, 8, NULL, ZBEE_NWK_CMD_ROUTE_OPTION_RESP_EXT,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_cmd_route_opt_orig_ext,
             { "Extended Originator",    "zbee.nwk.cmd.route.opts.orig_ext", FT_BOOLEAN, 8, NULL, ZBEE_NWK_CMD_ROUTE_OPTION_ORIG_EXT,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_cmd_route_opt_many_to_one,
             { "Many-to-One Discovery",  "zbee.nwk.cmd.route.opts.many2one", FT_UINT8, BASE_HEX, VALS(zbee_nwk_cmd_route_many_modes), ZBEE_NWK_CMD_ROUTE_OPTION_MANY_MASK,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_cmd_nwk_status,
             { "Status Code",            "zbee.nwk.cmd.status", FT_UINT8, BASE_HEX, VALS(zbee_nwk_status_codes), 0x0,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_cmd_leave_rejoin,
             { "Rejoin",                 "zbee.nwk.cmd.leave.rejoin", FT_BOOLEAN, 8, NULL, ZBEE_NWK_CMD_LEAVE_OPTION_REJOIN,
@@ -1617,7 +1609,7 @@ void proto_register_zbee_nwk(void)
 
             { &hf_zbee_nwk_cmd_cinfo_type,
             { "Full-Function Device",   "zbee.nwk.cmd.cinfo.ffd", FT_BOOLEAN, 8, NULL, IEEE802154_CMD_CINFO_DEVICE_TYPE,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_cmd_cinfo_power,
             { "AC Power",               "zbee.nwk.cmd.cinfo.power", FT_BOOLEAN, 8, NULL, IEEE802154_CMD_CINFO_POWER_SRC,
@@ -1637,7 +1629,7 @@ void proto_register_zbee_nwk(void)
 
             { &hf_zbee_nwk_cmd_rejoin_status,
             { "Status",                 "zbee.nwk.cmd.rejoin_status", FT_UINT8, BASE_HEX, VALS(zbee_nwk_rejoin_codes), 0x0,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_cmd_link_last,
             { "Last Frame",             "zbee.nwk.cmd.link.last", FT_BOOLEAN, 8, NULL, ZBEE_NWK_CMD_LINK_OPTION_LAST_FRAME,
@@ -1649,46 +1641,46 @@ void proto_register_zbee_nwk(void)
 
             { &hf_zbee_nwk_cmd_link_count,
             { "Link Status Count",      "zbee.nwk.cmd.link.count", FT_UINT8, BASE_DEC, NULL, ZBEE_NWK_CMD_LINK_OPTION_COUNT_MASK,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_cmd_report_type,
             { "Report Type",            "zbee.nwk.cmd.report.type", FT_UINT8, BASE_HEX, VALS(zbee_nwk_report_types), ZBEE_NWK_CMD_NWK_REPORT_ID_MASK,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_cmd_report_count,
             { "Report Information Count",   "zbee.nwk.cmd.report.count", FT_UINT8, BASE_DEC, NULL, ZBEE_NWK_CMD_NWK_REPORT_COUNT_MASK,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_cmd_update_type,
             { "Update Type",            "zbee.nwk.cmd.update.type", FT_UINT8, BASE_HEX, VALS(zbee_nwk_update_types), ZBEE_NWK_CMD_NWK_UPDATE_ID_MASK,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_cmd_update_count,
             { "Update Information Count",   "zbee.nwk.cmd.update.count", FT_UINT8, BASE_DEC, NULL, ZBEE_NWK_CMD_NWK_UPDATE_COUNT_MASK,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_cmd_update_id,
             { "Update ID",              "zbee.nwk.cmd.update.id", FT_UINT8, BASE_DEC, NULL, 0x0,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_nwk_cmd_epid,
             { "Extended PAN ID",        "zbee.nwk.cmd.epid", FT_UINT64, BASE_HEX, NULL, 0x0,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_beacon_protocol,
             { "Protocol ID",            "zbee.beacon.protocol", FT_UINT8, BASE_DEC, NULL, 0x0,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_beacon_stack_profile,
             { "Stack Profile",          "zbee.beacon.profile", FT_UINT8, BASE_HEX, VALS(zbee_nwk_stack_profiles), 0x0,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_beacon_version,
             { "Protocol Version",       "zbee.beacon.version", FT_UINT8, BASE_DEC, NULL, 0x0,
-                "", HFILL }},
+                NULL, HFILL }},
 
             { &hf_zbee_beacon_router_capacity,
-            { "Router Capacity", "zbee.beacon.router", FT_BOOLEAN, 8, NULL, 0x0,
+            { "Router Capacity", "zbee.beacon.router", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
                 "Whether the device can accept join requests from routing capable devices.", HFILL }},
 
             { &hf_zbee_beacon_depth,
@@ -1696,7 +1688,7 @@ void proto_register_zbee_nwk(void)
                 "The tree depth of the device, 0 indicates the network coordinator.", HFILL }},
 
             { &hf_zbee_beacon_end_device_capacity,
-            { "End Device Capacity",        "zbee.beacon.end_dev", FT_BOOLEAN, 8, NULL, 0x0,
+            { "End Device Capacity",        "zbee.beacon.end_dev", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
                 "Whether the device can accept join requests from ZigBee end devices.", HFILL }},
 
             { &hf_zbee_beacon_epid,
@@ -1709,7 +1701,7 @@ void proto_register_zbee_nwk(void)
 
             { &hf_zbee_beacon_update_id,
             { "Update ID",              "zbee.beacon.update_id", FT_UINT8, BASE_DEC, NULL, 0x0,
-                "", HFILL }}
+                NULL, HFILL }}
     };
 
     /*  NWK Layer subtrees */
@@ -1741,7 +1733,7 @@ void proto_register_zbee_nwk(void)
  *  NAME
  *      proto_reg_handoff_zbee_nwk
  *  DESCRIPTION
- *      Registers the zigbee dissector with Ethereal.
+ *      Registers the zigbee dissector with Wireshark.
  *  PARAMETERS
  *      none
  *  RETURNS
@@ -1752,7 +1744,6 @@ void proto_reg_handoff_zbee_nwk(void)
 {
     /* Find the other dissectors we need. */
     data_handle     = find_dissector("data");
-    security_handle = find_dissector("zbee.security");
     aps_handle      = find_dissector("zbee.aps");
 
     /* Register our dissector with IEEE 802.15.4 */