aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2010-10-11 19:00:55 +0000
committerBill Meier <wmeier@newsguy.com>2010-10-11 19:00:55 +0000
commite7568712efd25f076e38f8911e5793975db03735 (patch)
treeec1f18668b7116e4c2bd0f70bb4ff559d123d718
parentb2a92a4c35f9310ac8215f4e59b10af6bf7eb4c1 (diff)
Define some fcns & vars as static;
Minor whitespace and comments cleanup. svn path=/trunk/; revision=34477
-rw-r--r--epan/dissectors/packet-ansi_a.c2
-rw-r--r--epan/dissectors/packet-assa_r3.c2
-rw-r--r--epan/dissectors/packet-banana.c2
-rw-r--r--epan/dissectors/packet-bssgp.c2
-rw-r--r--epan/dissectors/packet-btl2cap.c115
-rw-r--r--epan/dissectors/packet-cip.c8
-rw-r--r--epan/dissectors/packet-cisco-sm.c89
-rw-r--r--epan/dissectors/packet-ctdb.c4
-rw-r--r--epan/dissectors/packet-e212.c28
-rw-r--r--epan/dissectors/packet-fc.c348
-rw-r--r--epan/dissectors/packet-fcdns.c443
-rw-r--r--epan/dissectors/packet-fcels.c1426
-rw-r--r--epan/dissectors/packet-fcfcs.c64
-rw-r--r--epan/dissectors/packet-fcfzs.c172
-rw-r--r--epan/dissectors/packet-fcswils.c268
-rw-r--r--epan/dissectors/packet-gopher.c224
16 files changed, 1570 insertions, 1627 deletions
diff --git a/epan/dissectors/packet-ansi_a.c b/epan/dissectors/packet-ansi_a.c
index 2dea2d0244..608e882346 100644
--- a/epan/dissectors/packet-ansi_a.c
+++ b/epan/dissectors/packet-ansi_a.c
@@ -55,7 +55,7 @@
/*
* IOS 4, probably most common
*/
-gint global_a_variant = A_VARIANT_IOS401;
+static gint global_a_variant = A_VARIANT_IOS401;
/* PROTOTYPES/FORWARDS */
diff --git a/epan/dissectors/packet-assa_r3.c b/epan/dissectors/packet-assa_r3.c
index 3bd2441cf8..75f20d053a 100644
--- a/epan/dissectors/packet-assa_r3.c
+++ b/epan/dissectors/packet-assa_r3.c
@@ -1994,7 +1994,7 @@ typedef struct
}
configMap_t;
-configMap_t configMap [] =
+static configMap_t configMap [] =
{
{ CONFIGITEM_SERIAL_NUMBER, CONFIGTYPE_STRING },
{ CONFIGITEM_CRYPT_KEY, CONFIGTYPE_STRING },
diff --git a/epan/dissectors/packet-banana.c b/epan/dissectors/packet-banana.c
index 1c6442587e..4250b5dd1b 100644
--- a/epan/dissectors/packet-banana.c
+++ b/epan/dissectors/packet-banana.c
@@ -55,7 +55,7 @@ static int hf_banana_pb = -1;
static gint ett_banana = -1;
static gint ett_list = -1;
-dissector_handle_t banana_handle;
+static dissector_handle_t banana_handle;
#define BE_LIST 0x80
#define BE_INT 0x81
diff --git a/epan/dissectors/packet-bssgp.c b/epan/dissectors/packet-bssgp.c
index c2bc269af7..77b46f64d5 100644
--- a/epan/dissectors/packet-bssgp.c
+++ b/epan/dissectors/packet-bssgp.c
@@ -79,7 +79,7 @@ static dissector_handle_t llc_handle;
static dissector_handle_t rrlp_handle;
static dissector_handle_t data_handle;
-module_t *bssgp_module;
+static module_t *bssgp_module;
/* Initialize the protocol and registered fields */
static int hf_bssgp_iei_nacc_cause = -1;
diff --git a/epan/dissectors/packet-btl2cap.c b/epan/dissectors/packet-btl2cap.c
index 52d1a0bd46..eedf2e21f7 100644
--- a/epan/dissectors/packet-btl2cap.c
+++ b/epan/dissectors/packet-btl2cap.c
@@ -16,12 +16,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -131,8 +131,8 @@ static gint ett_btl2cap_control = -1;
/* Initialize dissector table */
-dissector_table_t l2cap_psm_dissector_table;
-dissector_table_t l2cap_cid_dissector_table;
+static dissector_table_t l2cap_psm_dissector_table;
+static dissector_table_t l2cap_cid_dissector_table;
/* This table maps cid values to psm values.
* The same table is used both for SCID and DCID.
@@ -307,7 +307,7 @@ static const value_string option_fcs_vals[] = {
{ 0, NULL }
};
-static int
+static int
dissect_comrej(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
{
guint16 reason;
@@ -426,7 +426,7 @@ dissect_options(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *t
option_type = tvb_get_guint8(tvb, offset);
option_length = tvb_get_guint8(tvb, offset+1);
- ti_option = proto_tree_add_none_format(tree,
+ ti_option = proto_tree_add_none_format(tree,
hf_btl2cap_option, tvb,
offset, option_length + 2,
"Option: ");
@@ -477,7 +477,7 @@ dissect_options(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *t
break;
case 0x04: /* Retransmission and Flow Control*/
- if(config_data)
+ if(config_data)
{
config_data->mode = tvb_get_guint8(tvb, offset);
config_data->txwindow = tvb_get_guint8(tvb, offset+1);
@@ -614,7 +614,7 @@ dissect_inforesponse(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tr
break;
case 0x0002: /* Extended Features */
- ti_features = proto_tree_add_none_format(tree,
+ ti_features = proto_tree_add_none_format(tree,
hf_btl2cap_info_extfeatures, tvb,
offset, 4,
"Features: ");
@@ -713,7 +713,7 @@ dissect_configresponse(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_
return offset;
}
-static int
+static int
dissect_connresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
{
guint16 scid, dcid;
@@ -793,7 +793,8 @@ dissect_disconnrequestresponse(tvbuff_t *tvb, int offset, packet_info *pinfo _U_
return offset;
}
-static void dissect_b_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *btl2cap_tree, guint16 psm, guint16 length, int offset)
+static void
+dissect_b_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *btl2cap_tree, guint16 psm, guint16 length, int offset)
{
tvbuff_t *next_tvb;
next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), length);
@@ -829,7 +830,8 @@ typedef struct _sdu_reassembly_t
int cur_off; /* counter used by reassembly */
} sdu_reassembly_t;
-static void dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *btl2cap_tree, psm_data_t *psm_data, guint16 length, int offset, config_data_t *config_data)
+static void
+dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *btl2cap_tree, psm_data_t *psm_data, guint16 length, int offset, config_data_t *config_data)
{
tvbuff_t *next_tvb = NULL;
guint16 control, segment;
@@ -881,7 +883,7 @@ static void dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Detect malformed data */
if (sdulen < length) {
sdulen = length;
- expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_WARN,
+ expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_WARN,
"SDU length less than length of first packet");
}
@@ -954,7 +956,8 @@ static void dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 2;
}
-static void dissect_s_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, proto_tree *btl2cap_tree, guint16 psm _U_, guint16 length _U_, int offset, config_data_t *config_data _U_)
+static void
+dissect_s_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, proto_tree *btl2cap_tree, guint16 psm _U_, guint16 length _U_, int offset, config_data_t *config_data _U_)
{
proto_item* ti_control;
proto_tree* ti_control_subtree;
@@ -990,10 +993,11 @@ static void dissect_s_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
/* Code to actually dissect the packets
* This dissector will only be called ontop of BTHCI ACL
- * and this dissector _REQUIRES_ that
+ * and this dissector _REQUIRES_ that
* pinfo->private_data points to a valid bthci_acl_data_t structure
*/
-static void dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static void
+dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
int offset=0;
proto_item *ti=NULL;
@@ -1038,10 +1042,10 @@ static void dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 cmd_code;
guint16 cmd_length;
- ti_command=proto_tree_add_none_format(btl2cap_tree,
+ ti_command=proto_tree_add_none_format(btl2cap_tree,
hf_btl2cap_command, tvb,
offset, length,
- "Command: ");
+ "Command: ");
btl2cap_cmd_tree=proto_item_add_subtree(ti_command, ett_btl2cap_cmd);
cmd_code=tvb_get_guint8(tvb, offset);
@@ -1094,10 +1098,10 @@ static void dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
case 0x07: /* Disconnect Response */
- offset=dissect_disconnrequestresponse(tvb, offset, pinfo, btl2cap_cmd_tree);
+ offset=dissect_disconnrequestresponse(tvb, offset, pinfo, btl2cap_cmd_tree);
proto_item_append_text(ti_command, "Disconnect Response");
col_append_str(pinfo->cinfo, COL_INFO, "Disconnect Response");
- break;
+ break;
case 0x08: /* Echo Request */
proto_item_append_text(ti_command, "Echo Request");
@@ -1177,7 +1181,7 @@ static void dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), length);
/* call next dissector */
- if(!dissector_try_port(l2cap_psm_dissector_table, (guint32) psm,
+ if(!dissector_try_port(l2cap_psm_dissector_table, (guint32) psm,
next_tvb, pinfo, tree)){
/* unknown protocol. declare as data */
proto_tree_add_item(btl2cap_tree, hf_btl2cap_payload, tvb, offset, length, TRUE);
@@ -1250,63 +1254,63 @@ static void dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Register the protocol with Wireshark */
void
proto_register_btl2cap(void)
-{
+{
/* Setup list of header fields See Section 1.6.1 for details*/
static hf_register_info hf[] = {
{ &hf_btl2cap_length,
{ "Length", "btl2cap.length",
- FT_UINT16, BASE_DEC, NULL, 0x0,
+ FT_UINT16, BASE_DEC, NULL, 0x0,
"L2CAP Payload Length", HFILL }
},
{ &hf_btl2cap_cid,
{ "CID", "btl2cap.cid",
- FT_UINT16, BASE_HEX, NULL, 0x0,
+ FT_UINT16, BASE_HEX, NULL, 0x0,
"L2CAP Channel Identifier", HFILL }
},
{ &hf_btl2cap_payload,
{ "Payload", "btl2cap.payload",
- FT_BYTES, BASE_NONE, NULL, 0x0,
+ FT_BYTES, BASE_NONE, NULL, 0x0,
"L2CAP Payload", HFILL }
},
{ &hf_btl2cap_command,
{ "Command", "btl2cap.command",
- FT_NONE, BASE_NONE, NULL, 0x0,
+ FT_NONE, BASE_NONE, NULL, 0x0,
"L2CAP Command", HFILL }
},
{ &hf_btl2cap_cmd_code,
{ "Command Code", "btl2cap.cmd_code",
- FT_UINT8, BASE_HEX, VALS(command_code_vals), 0x0,
+ FT_UINT8, BASE_HEX, VALS(command_code_vals), 0x0,
"L2CAP Command Code", HFILL }
},
{ &hf_btl2cap_cmd_ident,
{ "Command Identifier", "btl2cap.cmd_ident",
- FT_UINT8, BASE_HEX, NULL, 0x0,
+ FT_UINT8, BASE_HEX, NULL, 0x0,
"L2CAP Command Identifier", HFILL }
},
{ &hf_btl2cap_cmd_length,
{ "Command Length", "btl2cap.cmd_length",
- FT_UINT8, BASE_DEC, NULL, 0x0,
+ FT_UINT8, BASE_DEC, NULL, 0x0,
"L2CAP Command Length", HFILL }
},
{ &hf_btl2cap_cmd_data,
{ "Command Data", "btl2cap.cmd_data",
- FT_NONE, BASE_NONE, NULL, 0x0,
+ FT_NONE, BASE_NONE, NULL, 0x0,
"L2CAP Command Data", HFILL }
},
{ &hf_btl2cap_psm,
{ "PSM", "btl2cap.psm",
- FT_UINT16, BASE_HEX, VALS(psm_vals), 0x0,
+ FT_UINT16, BASE_HEX, VALS(psm_vals), 0x0,
"Protocol/Service Multiplexer", HFILL }
},
{ &hf_btl2cap_scid,
{ "Source CID", "btl2cap.scid",
- FT_UINT16, BASE_HEX, NULL, 0x0,
+ FT_UINT16, BASE_HEX, NULL, 0x0,
"Source Channel Identifier", HFILL }
},
{ &hf_btl2cap_dcid,
{ "Destination CID", "btl2cap.dcid",
- FT_UINT16, BASE_HEX, NULL, 0x0,
+ FT_UINT16, BASE_HEX, NULL, 0x0,
"Destination Channel Identifier", HFILL }
},
{ &hf_btl2cap_icid,
@@ -1326,7 +1330,7 @@ proto_register_btl2cap(void)
},
{ &hf_btl2cap_result,
{ "Result", "btl2cap.result",
- FT_UINT16, BASE_HEX, VALS(result_vals), 0x0,
+ FT_UINT16, BASE_HEX, VALS(result_vals), 0x0,
NULL, HFILL }
},
{ &hf_btl2cap_move_result,
@@ -1341,22 +1345,22 @@ proto_register_btl2cap(void)
},
{ &hf_btl2cap_status,
{ "Status", "btl2cap.status",
- FT_UINT16, BASE_HEX, VALS(status_vals), 0x0,
+ FT_UINT16, BASE_HEX, VALS(status_vals), 0x0,
NULL, HFILL }
},
{ &hf_btl2cap_rej_reason,
{ "Reason", "btl2cap.rej_reason",
- FT_UINT16, BASE_HEX, VALS(reason_vals), 0x0,
+ FT_UINT16, BASE_HEX, VALS(reason_vals), 0x0,
NULL, HFILL }
},
{ &hf_btl2cap_sig_mtu,
{ "Maximum Signalling MTU", "btl2cap.sig_mtu",
- FT_UINT16, BASE_DEC, NULL, 0x0,
+ FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_btl2cap_info_mtu,
{ "Remote Entity MTU", "btl2cap.info_mtu",
- FT_UINT16, BASE_DEC, NULL, 0x0,
+ FT_UINT16, BASE_DEC, NULL, 0x0,
"Remote entity acceptable connectionless MTU", HFILL }
},
{ &hf_btl2cap_info_flowcontrol,
@@ -1441,12 +1445,12 @@ proto_register_btl2cap(void)
},
{ &hf_btl2cap_info_type,
{ "Information Type", "btl2cap.info_type",
- FT_UINT16, BASE_HEX, VALS(info_type_vals), 0x0,
+ FT_UINT16, BASE_HEX, VALS(info_type_vals), 0x0,
"Type of implementation-specific information", HFILL }
},
{ &hf_btl2cap_info_result,
{ "Result", "btl2cap.info_result",
- FT_UINT16, BASE_HEX, VALS(info_result_vals), 0x0,
+ FT_UINT16, BASE_HEX, VALS(info_result_vals), 0x0,
"Information about the success of the request", HFILL }
},
{ &hf_btl2cap_info_extfeatures,
@@ -1456,7 +1460,7 @@ proto_register_btl2cap(void)
},
{ &hf_btl2cap_continuation_flag,
{ "Continuation Flag", "btl2cap.continuation",
- FT_BOOLEAN, 16, NULL, 0x0001,
+ FT_BOOLEAN, 16, NULL, 0x0001,
NULL, HFILL }
},
{ &hf_btl2cap_configuration_result,
@@ -1466,22 +1470,22 @@ proto_register_btl2cap(void)
},
{ &hf_btl2cap_option_type,
{ "Type", "btl2cap.option_type",
- FT_UINT8, BASE_HEX, VALS(option_type_vals), 0x0,
+ FT_UINT8, BASE_HEX, VALS(option_type_vals), 0x0,
"Type of option", HFILL }
},
{ &hf_btl2cap_option_length,
{ "Length", "btl2cap.option_length",
- FT_UINT8, BASE_DEC, NULL, 0x0,
+ FT_UINT8, BASE_DEC, NULL, 0x0,
"Number of octets in option payload", HFILL }
},
{ &hf_btl2cap_option_mtu,
{ "MTU", "btl2cap.option_mtu",
- FT_UINT16, BASE_DEC, NULL, 0x0,
+ FT_UINT16, BASE_DEC, NULL, 0x0,
"Maximum Transmission Unit", HFILL }
},
{ &hf_btl2cap_option_flushTO,
{ "Flush Timeout (ms)", "btl2cap.option_flushto",
- FT_UINT16, BASE_DEC, NULL, 0x0,
+ FT_UINT16, BASE_DEC, NULL, 0x0,
"Flush Timeout in milliseconds", HFILL }
},
{ &hf_btl2cap_option_flush_to_us,
@@ -1511,37 +1515,37 @@ proto_register_btl2cap(void)
},
{ &hf_btl2cap_option_flags,
{ "Flags", "btl2cap.option_flags",
- FT_UINT8, BASE_HEX, NULL, 0x0,
+ FT_UINT8, BASE_HEX, NULL, 0x0,
"Flags - must be set to 0 (Reserved for future use)", HFILL }
},
{ &hf_btl2cap_option_service_type,
{ "Service Type", "btl2cap.option_servicetype",
- FT_UINT8, BASE_HEX, VALS(option_servicetype_vals), 0x0,
+ FT_UINT8, BASE_HEX, VALS(option_servicetype_vals), 0x0,
"Level of service required", HFILL }
},
{ &hf_btl2cap_option_tokenrate,
{ "Token Rate (bytes/s)", "btl2cap.option_tokenrate",
- FT_UINT32, BASE_DEC, NULL, 0x0,
+ FT_UINT32, BASE_DEC, NULL, 0x0,
"Rate at which traffic credits are granted (bytes/s)", HFILL }
},
{ &hf_btl2cap_option_tokenbucketsize,
{ "Token Bucket Size (bytes)", "btl2cap.option_tokenbsize",
- FT_UINT32, BASE_DEC, NULL, 0x0,
+ FT_UINT32, BASE_DEC, NULL, 0x0,
"Size of the token bucket (bytes)", HFILL }
},
{ &hf_btl2cap_option_peakbandwidth,
{ "Peak Bandwidth (bytes/s)", "btl2cap.option_peakbandwidth",
- FT_UINT32, BASE_DEC, NULL, 0x0,
+ FT_UINT32, BASE_DEC, NULL, 0x0,
"Limit how fast packets may be sent (bytes/s)", HFILL }
},
{ &hf_btl2cap_option_latency,
{ "Latency (microseconds)", "btl2cap.option_latency",
- FT_UINT32, BASE_DEC, NULL, 0x0,
+ FT_UINT32, BASE_DEC, NULL, 0x0,
"Maximal acceptable delay (microseconds)", HFILL }
},
{ &hf_btl2cap_option_delayvariation,
{ "Delay Variation (microseconds)", "btl2cap.option_delayvar",
- FT_UINT32, BASE_DEC, NULL, 0x0,
+ FT_UINT32, BASE_DEC, NULL, 0x0,
"Difference between maximum and minimum delay (microseconds)", HFILL }
},
{ &hf_btl2cap_option_retransmissionmode,
@@ -1586,7 +1590,7 @@ proto_register_btl2cap(void)
},
{ &hf_btl2cap_option,
{ "Configuration Parameter Option", "btl2cap.conf_param_option",
- FT_NONE, BASE_NONE, NULL, 0x0,
+ FT_NONE, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_btl2cap_control_sar,
@@ -1674,10 +1678,3 @@ proto_register_btl2cap(void)
}
-void
-proto_reg_handoff_btl2cap(void)
-{
-
-}
-
-
diff --git a/epan/dissectors/packet-cip.c b/epan/dissectors/packet-cip.c
index 0262e0c8e2..e625038a8a 100644
--- a/epan/dissectors/packet-cip.c
+++ b/epan/dissectors/packet-cip.c
@@ -73,9 +73,11 @@ typedef struct cip_req_info {
void *pData;
} cip_req_info_t;
-dissector_handle_t cip_handle;
-dissector_handle_t cip_class_generic_handle,cip_class_cm_handle,cip_class_mr_handle;
-dissector_handle_t cip_class_cco_handle;
+static dissector_handle_t cip_handle;
+static dissector_handle_t cip_class_generic_handle;
+static dissector_handle_t cip_class_cm_handle;
+static dissector_handle_t cip_class_mr_handle;
+static dissector_handle_t cip_class_cco_handle;
/* Initialize the protocol and registered fields */
static int proto_cip = -1;
diff --git a/epan/dissectors/packet-cisco-sm.c b/epan/dissectors/packet-cisco-sm.c
index 50cc2d12f7..44db4e2511 100644
--- a/epan/dissectors/packet-cisco-sm.c
+++ b/epan/dissectors/packet-cisco-sm.c
@@ -12,12 +12,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -27,7 +27,7 @@
* This is basically a glue dissector for the Cisco SM protocol. It sits
* between the RUDP and MTP3 layers in conversations on port 7000 between
* SLTs and MGCs. A link to an overview of the technology :
- *
+ *
* http://www.cisco.com/en/US/products/sw/netmgtsw/ps4883/products_installation_and_configuration_guide_chapter09186a008010950a.html
*
* Link showing debugs of the protocol:
@@ -59,14 +59,14 @@
#define MESSAGE_TYPE_Q_RESET_RESPONSE 9
#define MESSAGE_TYPE_PDU 0x8000
-const value_string sm_message_type_value[] = {
- { MESSAGE_TYPE_START, "Start Message" },
- { MESSAGE_TYPE_STOP, "Stop Message" },
- { MESSAGE_TYPE_ACTIVE, "Active Message" },
- { MESSAGE_TYPE_STANDBY, "Standby Message" },
- { MESSAGE_TYPE_Q_HOLD_INVOKE, "Q_HOLD Invoke Message" },
- { MESSAGE_TYPE_Q_HOLD_RESPONSE, "Q_HOLD Response Message" },
- { MESSAGE_TYPE_Q_RESUME_INVOKE, "Q_RESUME Invoke Message" },
+static const value_string sm_message_type_value[] = {
+ { MESSAGE_TYPE_START, "Start Message" },
+ { MESSAGE_TYPE_STOP, "Stop Message" },
+ { MESSAGE_TYPE_ACTIVE, "Active Message" },
+ { MESSAGE_TYPE_STANDBY, "Standby Message" },
+ { MESSAGE_TYPE_Q_HOLD_INVOKE, "Q_HOLD Invoke Message" },
+ { MESSAGE_TYPE_Q_HOLD_RESPONSE, "Q_HOLD Response Message" },
+ { MESSAGE_TYPE_Q_RESUME_INVOKE, "Q_RESUME Invoke Message" },
{ MESSAGE_TYPE_Q_RESUME_RESPONSE, "Q_RESUME Response Message" },
{ MESSAGE_TYPE_Q_RESET_INVOKE, "Q_RESET Invoke Message" },
{ MESSAGE_TYPE_Q_RESET_RESPONSE, "Q_RESET Response Message" },
@@ -74,7 +74,7 @@ const value_string sm_message_type_value[] = {
{ 0, NULL }
};
-const value_string sm_message_type_value_info[] = {
+static const value_string sm_message_type_value_info[] = {
{ MESSAGE_TYPE_START, "Start" },
{ MESSAGE_TYPE_STOP, "Stop" },
{ MESSAGE_TYPE_ACTIVE, "Active" },
@@ -93,14 +93,14 @@ const value_string sm_message_type_value_info[] = {
#define PDU_MTP3_TO_SLT 0x10
#define PDU_MTP3_FROM_SLT 0x11
-#define PDU_SET_STATE 0x44
-#define PDU_RETURN_STATE 0x45
+#define PDU_SET_STATE 0x44
+#define PDU_RETURN_STATE 0x45
-const value_string sm_pdu_type_value[] = {
- { PDU_MTP3_TO_SLT, "mtp3 to SLT"},
+static const value_string sm_pdu_type_value[] = {
+ { PDU_MTP3_TO_SLT, "mtp3 to SLT"},
{ PDU_MTP3_FROM_SLT, "mtp3 from SLT"},
- { PDU_SET_STATE, "set session state"},
- { PDU_RETURN_STATE, "return session state"},
+ { PDU_SET_STATE, "set session state"},
+ { PDU_RETURN_STATE, "return session state"},
{ 0, NULL }
};
@@ -151,7 +151,7 @@ dissect_sm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SM");
- if (check_col(pinfo->cinfo, COL_INFO))
+ if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "Cisco SM Packet (%s)",
val_to_str(sm_message_type, sm_message_type_value_info,"reserved"));
@@ -186,11 +186,11 @@ dissect_sm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case SM_PROTOCOL_X101:
if (!tree)
return;
- /* XXX Reveres enginered so this may not be correct!!!
- * EISUP - used between Cisco HSI and Cisco PGW devices,
- * uses RUDP with default port number 8003.
- * Protocol stack is RUDP->Cisco SM->SDP.
- * This implementation is PROPRIETARY
+ /* XXX Reveres enginered so this may not be correct!!!
+ * EISUP - used between Cisco HSI and Cisco PGW devices,
+ * uses RUDP with default port number 8003.
+ * Protocol stack is RUDP->Cisco SM->SDP.
+ * This implementation is PROPRIETARY
*/
proto_tree_add_item(sm_tree, hf_sm_len, tvb, offset, 2, FALSE);
length = tvb_get_ntohs(tvb,offset);
@@ -285,70 +285,62 @@ dissect_sm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
void
-proto_reg_handoff_sm(void)
-{
- sdp_handle = find_dissector("sdp");
- mtp3_handle = find_dissector("mtp3");
- data_handle = find_dissector("data");
-}
-
-void
proto_register_sm(void)
-{
+{
static hf_register_info hf[] = {
{ &hf_sm_sm_msg_type,
{ "SM Message Type", "sm.sm_msg_type",
- FT_UINT32, BASE_HEX, NULL, 0x0,
+ FT_UINT32, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_sm_protocol,
{ "Protocol Type", "sm.protocol",
- FT_UINT16, BASE_HEX, NULL, 0x0,
+ FT_UINT16, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_sm_msg_id,
{ "Message ID", "sm.msgid",
- FT_UINT16, BASE_HEX, NULL, 0x0,
+ FT_UINT16, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_sm_msg_type,
{ "Message Type", "sm.msg_type",
- FT_UINT16, BASE_HEX, NULL, 0x0,
+ FT_UINT16, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_sm_channel,
{ "Channel ID", "sm.channel",
- FT_UINT16, BASE_HEX, NULL, 0x0,
+ FT_UINT16, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_sm_bearer,
{ "Bearer ID", "sm.bearer",
- FT_UINT16, BASE_HEX, NULL, 0x0,
+ FT_UINT16, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_sm_len,
{ "Length", "sm.len",
- FT_UINT16, BASE_DEC, NULL, 0x0,
+ FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_sm_ip_addr,
{ "IPv4 address","sm.ip_addr",
- FT_IPv4,BASE_NONE, NULL, 0x0,
+ FT_IPv4,BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_sm_context,
{ "Context","sm.context",
- FT_UINT32, BASE_DEC, NULL, 0x0,
+ FT_UINT32, BASE_DEC, NULL, 0x0,
"Context(guesswork!)", HFILL }
},
{ &hf_sm_eisup_msg_id,
{ "Message id","sm.eisup_message_id",
- FT_UINT8, BASE_DEC, NULL, 0x0,
+ FT_UINT8, BASE_DEC, NULL, 0x0,
"Message id(guesswork!)", HFILL }
},
{ &hf_sm_tag,
{ "Tag","sm.tag",
- FT_UINT16, BASE_DEC, NULL, 0x0,
+ FT_UINT16, BASE_DEC, NULL, 0x0,
"Tag(guesswork!)", HFILL }
},
};
@@ -368,3 +360,12 @@ proto_register_sm(void)
proto_register_field_array(proto_sm, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
+
+void
+proto_reg_handoff_sm(void)
+{
+ sdp_handle = find_dissector("sdp");
+ mtp3_handle = find_dissector("mtp3");
+ data_handle = find_dissector("data");
+}
+
diff --git a/epan/dissectors/packet-ctdb.c b/epan/dissectors/packet-ctdb.c
index 15bd0425e1..f905286574 100644
--- a/epan/dissectors/packet-ctdb.c
+++ b/epan/dissectors/packet-ctdb.c
@@ -80,7 +80,7 @@ static gint ett_ctdb = -1;
static gint ett_ctdb_key = -1;
/* this tree keeps track of caller/reqid for ctdb transactions */
-emem_tree_t *ctdb_transactions=NULL;
+static emem_tree_t *ctdb_transactions=NULL;
typedef struct _ctdb_trans_t {
guint32 key_hash;
guint32 request_in;
@@ -89,7 +89,7 @@ typedef struct _ctdb_trans_t {
} ctdb_trans_t;
/* this tree keeps track of CONTROL request/responses */
-emem_tree_t *ctdb_controls=NULL;
+static emem_tree_t *ctdb_controls=NULL;
typedef struct _ctdb_control_t {
guint32 opcode;
guint32 request_in;
diff --git a/epan/dissectors/packet-e212.c b/epan/dissectors/packet-e212.c
index d853aeebad..5ebc385ffa 100644
--- a/epan/dissectors/packet-e212.c
+++ b/epan/dissectors/packet-e212.c
@@ -283,7 +283,7 @@ const value_string E212_codes[] = {
/*
* Annex to ITU Operational Bulletin No. 958 - 15.VI.2010
* including amendments up to ITU Operational Bulletin No. 960 - 15.VII.2010
- *
+ *
* According to Recommendation ITU-T E.212 (05/2008)
*
* The value parts of the list below are equal to:
@@ -291,11 +291,11 @@ const value_string E212_codes[] = {
* 1000 * MCC + MNC, in case of 3 digits long MNCs
* with this encoding, we are sure that even in cases of mixed length
* MNCs under the same MCC, it is impossible for 2 MNCs to get mapped to
- * the same entry. Aliasing to the same entry in the list below occurs
+ * the same entry. Aliasing to the same entry in the list below occurs
* only in case of an invalid combination of MNCs, i.e. in the same MCC a
* 2 digits long MNC is a prefix of a 3 digits long MNC
*/
-const value_string mcc_mnc_codes[] = {
+static const value_string mcc_mnc_codes[] = {
{ 202010, "Cosmote" },
{ 202050, "Vodafone - Panafon" },
{ 202090, "Info Quest S.A." },
@@ -1698,7 +1698,7 @@ static int hf_E212_msin = -1;
* MCC/MNC dissection - little endian MNC encoding
*
* MNC of length 2:
- *
+ *
* 8 7 6 5 4 3 2 1
* +---+---+---+---+---+---+---+---+
* | MCC digit 2 | MCC digit 1 | octet x
@@ -1723,7 +1723,7 @@ static int hf_E212_msin = -1;
* MCC/MNC dissection - big endian MNC encoding
*
* MNC of length 2:
- *
+ *
* 8 7 6 5 4 3 2 1
* +---+---+---+---+---+---+---+---+
* | MCC digit 2 | MCC digit 1 | octet x
@@ -1747,7 +1747,7 @@ static int hf_E212_msin = -1;
int
dissect_e212_mcc_mnc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, gboolean little_endian){
- int start_offset;
+ int start_offset;
guint8 octet;
guint16 mcc, mnc;
guint8 mcc1, mcc2, mcc3, mnc1, mnc2, mnc3;
@@ -1801,17 +1801,17 @@ dissect_e212_mcc_mnc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
/*
* When we want to decode the MCC/MNC pair in an address that is encoded according to E.212
- * the main problem is that we do not know whether we are dealing with a length 2 or length 3
- * MNC. Initially, it was possible to find the length of the MNC by checking the MCC code.
+ * the main problem is that we do not know whether we are dealing with a length 2 or length 3
+ * MNC. Initially, it was possible to find the length of the MNC by checking the MCC code.
* Originally each country employed a pure 2 digit or 3 digit MNC scheme. However, it is possible
* to find countries now that employ both lengths for the MNC (e.g. Canada, India).
* Since in these cases we can be sure that an MNC cannot possible be a prefix for another MNC, we
- * initially assume that the MNC is 2 digits long. If the MCC/MNC combination gives a match in our
+ * initially assume that the MNC is 2 digits long. If the MCC/MNC combination gives a match in our
* mcc_mnc_codes list then we can be sure that we deal with an MNC that is 2 digits long. Otherwise,
* assume that the MNC is 3 digits long.
- *
+ *
* MNC of length 2:
- *
+ *
* 8 7 6 5 4 3 2 1
* +---+---+---+---+---+---+---+---+
* | MCC digit 2 | MCC digit 1 | octet x
@@ -1822,7 +1822,7 @@ dissect_e212_mcc_mnc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
* +---------------+---------------+
*
* MNC of length 3:
- *
+ *
* 8 7 6 5 4 3 2 1
* +---+---+---+---+---+---+---+---+
* | MCC digit 2 | MCC digit 1 | octet x
@@ -1914,12 +1914,12 @@ proto_register_e212(void)
static hf_register_info hf[] = {
{ &hf_E212_mcc,
{ "Mobile Country Code (MCC)","e212.mcc",
- FT_UINT16, BASE_DEC, VALS(E212_codes), 0x0,
+ FT_UINT16, BASE_DEC, VALS(E212_codes), 0x0,
"Mobile Country Code MCC", HFILL }
},
{ &hf_E212_mnc,
{ "Mobile network code (MNC)","e212.mnc",
- FT_UINT16, BASE_DEC, NULL, 0x0,
+ FT_UINT16, BASE_DEC, NULL, 0x0,
"Mobile network code", HFILL }
},
{ &hf_E212_msin,
diff --git a/epan/dissectors/packet-fc.c b/epan/dissectors/packet-fc.c
index 84ddf3565f..82ed4c1c88 100644
--- a/epan/dissectors/packet-fc.c
+++ b/epan/dissectors/packet-fc.c
@@ -174,7 +174,7 @@ typedef struct _fcseq_conv_data {
guint32 seq_cnt;
} fcseq_conv_data_t;
-GHashTable *fcseq_req_hash = NULL;
+static GHashTable *fcseq_req_hash = NULL;
/*
* Hash Functions
@@ -182,10 +182,10 @@ GHashTable *fcseq_req_hash = NULL;
static gint
fcseq_equal(gconstpointer v, gconstpointer w)
{
- const fcseq_conv_key_t *v1 = v;
- const fcseq_conv_key_t *v2 = w;
+ const fcseq_conv_key_t *v1 = v;
+ const fcseq_conv_key_t *v2 = w;
- return (v1->conv_idx == v2->conv_idx);
+ return (v1->conv_idx == v2->conv_idx);
}
static guint
@@ -457,68 +457,68 @@ fc_get_ftype (guint8 r_ctl, guint8 type)
}
static const value_string abts_ack_vals[] = {
- {0x000000, "ABTS - Cont"},
- {0x000010, "ABTS - Abort"},
- {0x000020, "ABTS - Stop"},
- {0x000030, "ABTS - Imm Seq Retx"},
- {0,NULL}
+ {0x000000, "ABTS - Cont"},
+ {0x000010, "ABTS - Abort"},
+ {0x000020, "ABTS - Stop"},
+ {0x000030, "ABTS - Imm Seq Retx"},
+ {0,NULL}
};
static const value_string abts_not_ack_vals[] = {
- {0x000000, "ABTS - Abort/MS"},
- {0x000010, "ABTS - Abort/SS"},
- {0x000020, "ABTS - Process/IB"},
- {0x000030, "ABTS - Discard/MS/Imm Retx"},
- {0,NULL}
+ {0x000000, "ABTS - Abort/MS"},
+ {0x000010, "ABTS - Abort/SS"},
+ {0x000020, "ABTS - Process/IB"},
+ {0x000030, "ABTS - Discard/MS/Imm Retx"},
+ {0,NULL}
};
static const value_string last_data_frame_vals[] = {
- {0x000000, "Last Data Frame - No Info"},
- {0x004000, "Last Data Frame - Seq Imm"},
- {0x008000, "Last Data Frame - Seq Soon"},
- {0x00c000, "Last Data Frame - Seq Delyd"},
- {0,NULL}
+ {0x000000, "Last Data Frame - No Info"},
+ {0x004000, "Last Data Frame - Seq Imm"},
+ {0x008000, "Last Data Frame - Seq Soon"},
+ {0x00c000, "Last Data Frame - Seq Delyd"},
+ {0,NULL}
};
static const value_string ack_0_1_vals[] = {
- {0x003000, "ACK_0 Required"},
- {0x002000, "ACK_0 Required"},
- {0x001000, "ACK_1 Required"},
- {0x000000, "no ack required"},
- {0,NULL}
+ {0x003000, "ACK_0 Required"},
+ {0x002000, "ACK_0 Required"},
+ {0x001000, "ACK_1 Required"},
+ {0x000000, "no ack required"},
+ {0,NULL}
};
static const true_false_string tfs_fc_fctl_exchange_responder = {
- "Exchange Responder",
- "Exchange Originator"
+ "Exchange Responder",
+ "Exchange Originator"
};
static const true_false_string tfs_fc_fctl_seq_recipient = {
- "Seq Recipient",
- "Seq Initiator"
+ "Seq Recipient",
+ "Seq Initiator"
};
static const true_false_string tfs_fc_fctl_exchange_first = {
- "Exchg First",
- "NOT exchg first"
+ "Exchg First",
+ "NOT exchg first"
};
static const true_false_string tfs_fc_fctl_exchange_last = {
- "Exchg Last",
- "NOT exchg last"
+ "Exchg Last",
+ "NOT exchg last"
};
static const true_false_string tfs_fc_fctl_seq_last = {
- "Seq Last",
- "NOT seq last"
+ "Seq Last",
+ "NOT seq last"
};
static const true_false_string tfs_fc_fctl_priority = {
- "Priority",
- "CS_CTL"
+ "Priority",
+ "CS_CTL"
};
static const true_false_string tfs_fc_fctl_transfer_seq_initiative = {
- "Transfer Seq Initiative",
- "NOT transfer seq initiative"
+ "Transfer Seq Initiative",
+ "NOT transfer seq initiative"
};
static const true_false_string tfs_fc_fctl_rexmitted_seq = {
- "Retransmitted Sequence",
- "NOT retransmitted sequence"
+ "Retransmitted Sequence",
+ "NOT retransmitted sequence"
};
static const true_false_string tfs_fc_fctl_rel_offset = {
- "Rel Offset SET",
- "rel offset NOT set"
+ "Rel Offset SET",
+ "rel offset NOT set"
};
/*
@@ -565,108 +565,108 @@ dissect_fc_vft(proto_tree *parent_tree,
static void
dissect_fc_fctl(packet_info *pinfo _U_, proto_tree *parent_tree, tvbuff_t *tvb, int offset)
{
- proto_item *item=NULL;
- proto_tree *tree=NULL;
- guint32 flags;
-
- flags = tvb_get_guint8 (tvb, offset);
- flags = (flags<<8) | tvb_get_guint8 (tvb, offset+1);
- flags = (flags<<8) | tvb_get_guint8 (tvb, offset+2);
-
- if(parent_tree){
- item=proto_tree_add_uint(parent_tree, hf_fc_fctl, tvb, offset, 3, flags);
- tree=proto_item_add_subtree(item, ett_fctl);
- }
-
- proto_tree_add_boolean(tree, hf_fc_fctl_exchange_responder, tvb, offset, 3, flags);
- if (flags&FC_FCTL_EXCHANGE_RESPONDER){
- proto_item_append_text(item, " Exchange Responder");
- if (flags & (~( FC_FCTL_EXCHANGE_RESPONDER )))
- proto_item_append_text(item, ",");
- } else {
- proto_item_append_text(item, " Exchange Originator");
- if (flags & (~( FC_FCTL_EXCHANGE_RESPONDER )))
- proto_item_append_text(item, ",");
- }
- flags&=(~( FC_FCTL_EXCHANGE_RESPONDER ));
-
- proto_tree_add_boolean(tree, hf_fc_fctl_seq_recipient, tvb, offset, 3, flags);
- if (flags&FC_FCTL_SEQ_RECIPIENT){
- proto_item_append_text(item, " Seq Recipient");
- if (flags & (~( FC_FCTL_SEQ_RECIPIENT )))
- proto_item_append_text(item, ",");
- } else {
- proto_item_append_text(item, " Seq Initiator");
- if (flags & (~( FC_FCTL_SEQ_RECIPIENT )))
- proto_item_append_text(item, ",");
- }
- flags&=(~( FC_FCTL_SEQ_RECIPIENT ));
-
- proto_tree_add_boolean(tree, hf_fc_fctl_exchange_first, tvb, offset, 3, flags);
- if (flags&FC_FCTL_EXCHANGE_FIRST){
- proto_item_append_text(item, " Exchg First");
- if (flags & (~( FC_FCTL_EXCHANGE_FIRST )))
- proto_item_append_text(item, ",");
- }
- flags&=(~( FC_FCTL_EXCHANGE_FIRST ));
-
- proto_tree_add_boolean(tree, hf_fc_fctl_exchange_last, tvb, offset, 3, flags);
- if (flags&FC_FCTL_EXCHANGE_LAST){
- proto_item_append_text(item, " Exchg Last");
- if (flags & (~( FC_FCTL_EXCHANGE_LAST )))
- proto_item_append_text(item, ",");
- }
- flags&=(~( FC_FCTL_EXCHANGE_LAST ));
-
- proto_tree_add_boolean(tree, hf_fc_fctl_seq_last, tvb, offset, 3, flags);
- if (flags&FC_FCTL_SEQ_LAST){
- proto_item_append_text(item, " Seq Last");
- if (flags & (~( FC_FCTL_SEQ_LAST )))
- proto_item_append_text(item, ",");
- }
- flags&=(~( FC_FCTL_SEQ_LAST ));
-
- proto_tree_add_boolean(tree, hf_fc_fctl_priority, tvb, offset, 3, flags);
- if (flags&FC_FCTL_PRIORITY){
- proto_item_append_text(item, " Priority");
- if (flags & (~( FC_FCTL_PRIORITY )))
- proto_item_append_text(item, ",");
- } else {
- proto_item_append_text(item, " CS_CTL");
- if (flags & (~( FC_FCTL_PRIORITY )))
- proto_item_append_text(item, ",");
- }
- flags&=(~( FC_FCTL_PRIORITY ));
-
- proto_tree_add_boolean(tree, hf_fc_fctl_transfer_seq_initiative, tvb, offset, 3, flags);
- if (flags&FC_FCTL_TRANSFER_SEQ_INITIATIVE){
- proto_item_append_text(item, " Transfer Seq Initiative");
- if (flags & (~( FC_FCTL_TRANSFER_SEQ_INITIATIVE )))
- proto_item_append_text(item, ",");
- }
- flags&=(~( FC_FCTL_TRANSFER_SEQ_INITIATIVE ));
-
- proto_tree_add_uint(tree, hf_fc_fctl_last_data_frame, tvb, offset, 3, flags);
-
- proto_tree_add_uint(tree, hf_fc_fctl_ack_0_1, tvb, offset, 3, flags);
-
- proto_tree_add_boolean(tree, hf_fc_fctl_rexmitted_seq, tvb, offset, 3, flags);
- if (flags&FC_FCTL_REXMITTED_SEQ){
- proto_item_append_text(item, " Rexmitted Seq");
- if (flags & (~( FC_FCTL_REXMITTED_SEQ )))
- proto_item_append_text(item, ",");
- }
- flags&=(~( FC_FCTL_REXMITTED_SEQ ));
-
- proto_tree_add_uint(tree, hf_fc_fctl_abts_ack, tvb, offset, 3, flags);
-
- proto_tree_add_boolean(tree, hf_fc_fctl_rel_offset, tvb, offset, 3, flags);
- if (flags&FC_FCTL_REL_OFFSET){
- proto_item_append_text(item, " Rel Offset");
- if (flags & (~( FC_FCTL_REL_OFFSET )))
- proto_item_append_text(item, ",");
- }
- flags&=(~( FC_FCTL_REL_OFFSET ));
+ proto_item *item=NULL;
+ proto_tree *tree=NULL;
+ guint32 flags;
+
+ flags = tvb_get_guint8 (tvb, offset);
+ flags = (flags<<8) | tvb_get_guint8 (tvb, offset+1);
+ flags = (flags<<8) | tvb_get_guint8 (tvb, offset+2);
+
+ if(parent_tree){
+ item=proto_tree_add_uint(parent_tree, hf_fc_fctl, tvb, offset, 3, flags);
+ tree=proto_item_add_subtree(item, ett_fctl);
+ }
+
+ proto_tree_add_boolean(tree, hf_fc_fctl_exchange_responder, tvb, offset, 3, flags);
+ if (flags&FC_FCTL_EXCHANGE_RESPONDER){
+ proto_item_append_text(item, " Exchange Responder");
+ if (flags & (~( FC_FCTL_EXCHANGE_RESPONDER )))
+ proto_item_append_text(item, ",");
+ } else {
+ proto_item_append_text(item, " Exchange Originator");
+ if (flags & (~( FC_FCTL_EXCHANGE_RESPONDER )))
+ proto_item_append_text(item, ",");
+ }
+ flags&=(~( FC_FCTL_EXCHANGE_RESPONDER ));
+
+ proto_tree_add_boolean(tree, hf_fc_fctl_seq_recipient, tvb, offset, 3, flags);
+ if (flags&FC_FCTL_SEQ_RECIPIENT){
+ proto_item_append_text(item, " Seq Recipient");
+ if (flags & (~( FC_FCTL_SEQ_RECIPIENT )))
+ proto_item_append_text(item, ",");
+ } else {
+ proto_item_append_text(item, " Seq Initiator");
+ if (flags & (~( FC_FCTL_SEQ_RECIPIENT )))
+ proto_item_append_text(item, ",");
+ }
+ flags&=(~( FC_FCTL_SEQ_RECIPIENT ));
+
+ proto_tree_add_boolean(tree, hf_fc_fctl_exchange_first, tvb, offset, 3, flags);
+ if (flags&FC_FCTL_EXCHANGE_FIRST){
+ proto_item_append_text(item, " Exchg First");
+ if (flags & (~( FC_FCTL_EXCHANGE_FIRST )))
+ proto_item_append_text(item, ",");
+ }
+ flags&=(~( FC_FCTL_EXCHANGE_FIRST ));
+
+ proto_tree_add_boolean(tree, hf_fc_fctl_exchange_last, tvb, offset, 3, flags);
+ if (flags&FC_FCTL_EXCHANGE_LAST){
+ proto_item_append_text(item, " Exchg Last");
+ if (flags & (~( FC_FCTL_EXCHANGE_LAST )))
+ proto_item_append_text(item, ",");
+ }
+ flags&=(~( FC_FCTL_EXCHANGE_LAST ));
+
+ proto_tree_add_boolean(tree, hf_fc_fctl_seq_last, tvb, offset, 3, flags);
+ if (flags&FC_FCTL_SEQ_LAST){
+ proto_item_append_text(item, " Seq Last");
+ if (flags & (~( FC_FCTL_SEQ_LAST )))
+ proto_item_append_text(item, ",");
+ }
+ flags&=(~( FC_FCTL_SEQ_LAST ));
+
+ proto_tree_add_boolean(tree, hf_fc_fctl_priority, tvb, offset, 3, flags);
+ if (flags&FC_FCTL_PRIORITY){
+ proto_item_append_text(item, " Priority");
+ if (flags & (~( FC_FCTL_PRIORITY )))
+ proto_item_append_text(item, ",");
+ } else {
+ proto_item_append_text(item, " CS_CTL");
+ if (flags & (~( FC_FCTL_PRIORITY )))
+ proto_item_append_text(item, ",");
+ }
+ flags&=(~( FC_FCTL_PRIORITY ));
+
+ proto_tree_add_boolean(tree, hf_fc_fctl_transfer_seq_initiative, tvb, offset, 3, flags);
+ if (flags&FC_FCTL_TRANSFER_SEQ_INITIATIVE){
+ proto_item_append_text(item, " Transfer Seq Initiative");
+ if (flags & (~( FC_FCTL_TRANSFER_SEQ_INITIATIVE )))
+ proto_item_append_text(item, ",");
+ }
+ flags&=(~( FC_FCTL_TRANSFER_SEQ_INITIATIVE ));
+
+ proto_tree_add_uint(tree, hf_fc_fctl_last_data_frame, tvb, offset, 3, flags);
+
+ proto_tree_add_uint(tree, hf_fc_fctl_ack_0_1, tvb, offset, 3, flags);
+
+ proto_tree_add_boolean(tree, hf_fc_fctl_rexmitted_seq, tvb, offset, 3, flags);
+ if (flags&FC_FCTL_REXMITTED_SEQ){
+ proto_item_append_text(item, " Rexmitted Seq");
+ if (flags & (~( FC_FCTL_REXMITTED_SEQ )))
+ proto_item_append_text(item, ",");
+ }
+ flags&=(~( FC_FCTL_REXMITTED_SEQ ));
+
+ proto_tree_add_uint(tree, hf_fc_fctl_abts_ack, tvb, offset, 3, flags);
+
+ proto_tree_add_boolean(tree, hf_fc_fctl_rel_offset, tvb, offset, 3, flags);
+ if (flags&FC_FCTL_REL_OFFSET){
+ proto_item_append_text(item, " Rel Offset");
+ if (flags & (~( FC_FCTL_REL_OFFSET )))
+ proto_item_append_text(item, ",");
+ }
+ flags&=(~( FC_FCTL_REL_OFFSET ));
}
@@ -748,10 +748,10 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
* will use ip addresses instead and still work.
*/
if(!is_ifcp){
- SET_ADDRESS (&pinfo->dst, AT_FC, 3, tvb_get_ptr(tvb,offset+1,3));
- SET_ADDRESS (&pinfo->src, AT_FC, 3, tvb_get_ptr(tvb,offset+5,3));
- pinfo->srcport=0;
- pinfo->destport=0;
+ SET_ADDRESS (&pinfo->dst, AT_FC, 3, tvb_get_ptr(tvb,offset+1,3));
+ SET_ADDRESS (&pinfo->src, AT_FC, 3, tvb_get_ptr(tvb,offset+5,3));
+ pinfo->srcport=0;
+ pinfo->destport=0;
}
SET_ADDRESS(&fchdr.d_id, pinfo->dst.type, pinfo->dst.len, pinfo->dst.data);
SET_ADDRESS(&fchdr.s_id, pinfo->src.type, pinfo->src.len, pinfo->src.data);
@@ -793,19 +793,19 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
fc_ex->last_exchange_frame=0;
fc_ex->lun=0xffff;
fc_ex->scsi_opcode=0xffff;
- fc_ex->task_flags=0;
- fc_ex->data_length=0;
- fc_ex->bidir_data_length=0;
+ fc_ex->task_flags=0;
+ fc_ex->data_length=0;
+ fc_ex->bidir_data_length=0;
fc_ex->fc_time=pinfo->fd->abs_ts;
fc_ex->flags=0;
fc_ex->alloc_len=0;
- fc_ex->extra_data=NULL;
- se_tree_insert32(fc_conv_data->exchanges, fchdr.oxid, fc_ex);
+ fc_ex->extra_data=NULL;
+ se_tree_insert32(fc_conv_data->exchanges, fchdr.oxid, fc_ex);
}
/* populate the exchange struct */
if(!pinfo->fd->flags.visited){
if(fchdr.fctl&FC_FCTL_EXCHANGE_FIRST){
- fc_ex->first_exchange_frame=pinfo->fd->num;
+ fc_ex->first_exchange_frame=pinfo->fd->num;
fc_ex->fc_time = pinfo->fd->abs_ts;
}
if(fchdr.fctl&FC_FCTL_EXCHANGE_LAST){
@@ -1095,16 +1095,16 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
* these frames.
*/
if ((pinfo->ethertype == ETHERTYPE_UNK) || (pinfo->ethertype == ETHERTYPE_FCFT)) {
- if ((frag_size < MDSHDR_TRAILER_SIZE) ||
- ((frag_size == MDSHDR_TRAILER_SIZE) && (ftype != FC_FTYPE_LINKCTL) &&
- (ftype != FC_FTYPE_BLS) && (ftype != FC_FTYPE_OHMS)))
- THROW(ReportedBoundsError);
+ if ((frag_size < MDSHDR_TRAILER_SIZE) ||
+ ((frag_size == MDSHDR_TRAILER_SIZE) && (ftype != FC_FTYPE_LINKCTL) &&
+ (ftype != FC_FTYPE_BLS) && (ftype != FC_FTYPE_OHMS)))
+ THROW(ReportedBoundsError);
frag_size -= MDSHDR_TRAILER_SIZE;
} else if (pinfo->ethertype == ETHERTYPE_BRDWALK) {
- if ((frag_size <= 8) ||
- ((frag_size == MDSHDR_TRAILER_SIZE) && (ftype != FC_FTYPE_LINKCTL) &&
- (ftype != FC_FTYPE_BLS) && (ftype != FC_FTYPE_OHMS)))
- THROW(ReportedBoundsError);
+ if ((frag_size <= 8) ||
+ ((frag_size == MDSHDR_TRAILER_SIZE) && (ftype != FC_FTYPE_LINKCTL) &&
+ (ftype != FC_FTYPE_BLS) && (ftype != FC_FTYPE_OHMS)))
+ THROW(ReportedBoundsError);
frag_size -= 8; /* 4 byte of FC CRC +
4 bytes of error+EOF = 8 bytes */
}
@@ -1214,19 +1214,19 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
}
if ((ftype != FC_FTYPE_LINKCTL) && (ftype != FC_FTYPE_BLS)) {
- /* If relative offset is used, only dissect the pdu with
- * offset 0 (param) */
- if( (fchdr.fctl&FC_FCTL_REL_OFFSET) && param ){
+ /* If relative offset is used, only dissect the pdu with
+ * offset 0 (param) */
+ if( (fchdr.fctl&FC_FCTL_REL_OFFSET) && param ){
call_dissector (data_handle, next_tvb, pinfo, tree);
- } else {
- void *saved_private_data;
- saved_private_data = pinfo->private_data;
- pinfo->private_data = &fchdr;
- if (!dissector_try_port (fcftype_dissector_table, ftype,
- next_tvb, pinfo, tree)) {
- call_dissector (data_handle, next_tvb, pinfo, tree);
+ } else {
+ void *saved_private_data;
+ saved_private_data = pinfo->private_data;
+ pinfo->private_data = &fchdr;
+ if (!dissector_try_port (fcftype_dissector_table, ftype,
+ next_tvb, pinfo, tree)) {
+ call_dissector (data_handle, next_tvb, pinfo, tree);
}
- pinfo->private_data = saved_private_data;
+ pinfo->private_data = saved_private_data;
}
} else if (ftype == FC_FTYPE_BLS) {
if ((fchdr.r_ctl & 0x0F) == FC_BLS_BAACC) {
@@ -1505,7 +1505,7 @@ proto_register_fc(void)
&ett_fc,
&ett_fcbls,
&ett_fc_vft,
- &ett_fctl
+ &ett_fctl
};
module_t *fc_module;
diff --git a/epan/dissectors/packet-fcdns.c b/epan/dissectors/packet-fcdns.c
index 69ba949d43..ae5e48d662 100644
--- a/epan/dissectors/packet-fcdns.c
+++ b/epan/dissectors/packet-fcdns.c
@@ -8,12 +8,6 @@
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
- * Copied from WHATEVER_FILE_YOU_USED (where "WHATEVER_FILE_YOU_USED"
- * is a dissector file; if you just copied this from README.developer,
- * don't bother with the "Copied from" - you don't even need to put
- * in a "Copied from" if you copied an existing dissector, especially
- * if the bulk of the code in the new dissector is your code)
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@@ -106,24 +100,24 @@ static int hf_fcdns_portip = -1;
static int hf_fcdns_sw2_objfmt = -1;
static int hf_fcdns_num_fc4desc = -1;
static int hf_fcdns_rply_ownerid = -1;
-static int hf_fcdns_maxres_size = -1;
-static int hf_fcdns_reply_cos = -1;
-static int hf_fcdns_cos_f = -1;
-static int hf_fcdns_cos_1 = -1;
-static int hf_fcdns_cos_2 = -1;
-static int hf_fcdns_cos_3 = -1;
-static int hf_fcdns_cos_4 = -1;
-static int hf_fcdns_cos_6 = -1;
+static int hf_fcdns_maxres_size = -1;
+static int hf_fcdns_reply_cos = -1;
+static int hf_fcdns_cos_f = -1;
+static int hf_fcdns_cos_1 = -1;
+static int hf_fcdns_cos_2 = -1;
+static int hf_fcdns_cos_3 = -1;
+static int hf_fcdns_cos_4 = -1;
+static int hf_fcdns_cos_6 = -1;
static int hf_fcdns_fc4type_llcsnap = -1;
-static int hf_fcdns_fc4type_ip = -1;
-static int hf_fcdns_fc4type_fcp = -1;
-static int hf_fcdns_fc4type_swils = -1;
-static int hf_fcdns_fc4type_snmp = -1;
-static int hf_fcdns_fc4type_gs3 = -1;
-static int hf_fcdns_fc4type_vi = -1;
-static int hf_fcdns_fc4features = -1;
-static int hf_fcdns_fc4features_i = -1;
-static int hf_fcdns_fc4features_t = -1;
+static int hf_fcdns_fc4type_ip = -1;
+static int hf_fcdns_fc4type_fcp = -1;
+static int hf_fcdns_fc4type_swils = -1;
+static int hf_fcdns_fc4type_snmp = -1;
+static int hf_fcdns_fc4type_gs3 = -1;
+static int hf_fcdns_fc4type_vi = -1;
+static int hf_fcdns_fc4features = -1;
+static int hf_fcdns_fc4features_i = -1;
+static int hf_fcdns_fc4features_t = -1;
static int hf_fcdns_req_fc4type = -1;
/* Initialize the subtree pointers */
@@ -140,7 +134,7 @@ typedef struct _fcdns_conv_data {
guint32 opcode;
} fcdns_conv_data_t;
-GHashTable *fcdns_req_hash = NULL;
+static GHashTable *fcdns_req_hash = NULL;
static dissector_handle_t data_handle;
@@ -159,12 +153,12 @@ fcdns_equal(gconstpointer v, gconstpointer w)
static guint
fcdns_hash (gconstpointer v)
{
- const fcdns_conv_key_t *key = v;
- guint val;
+ const fcdns_conv_key_t *key = v;
+ guint val;
- val = key->conv_idx;
+ val = key->conv_idx;
- return val;
+ return val;
}
/*
@@ -173,97 +167,97 @@ fcdns_hash (gconstpointer v)
static void
fcdns_init_protocol(void)
{
- if (fcdns_req_hash)
- g_hash_table_destroy(fcdns_req_hash);
+ if (fcdns_req_hash)
+ g_hash_table_destroy(fcdns_req_hash);
- fcdns_req_hash = g_hash_table_new(fcdns_hash, fcdns_equal);
+ fcdns_req_hash = g_hash_table_new(fcdns_hash, fcdns_equal);
}
static const true_false_string tfs_fcdns_cos_f = {
- "F is set",
- "f is NOT set"
+ "F is set",
+ "f is NOT set"
};
static const true_false_string tfs_fcdns_cos_1 = {
- "1 is set",
- "1 is NOT set"
+ "1 is set",
+ "1 is NOT set"
};
static const true_false_string tfs_fcdns_cos_2 = {
- "2 is set",
- "2 is NOT set"
+ "2 is set",
+ "2 is NOT set"
};
static const true_false_string tfs_fcdns_cos_3 = {
- "3 is set",
- "3 is NOT set"
+ "3 is set",
+ "3 is NOT set"
};
static const true_false_string tfs_fcdns_cos_4 = {
- "4 is set",
- "4 is NOT set"
+ "4 is set",
+ "4 is NOT set"
};
static const true_false_string tfs_fcdns_cos_6 = {
- "6 is set",
- "6 is NOT set"
+ "6 is set",
+ "6 is NOT set"
};
static void
dissect_cos_flags (proto_tree *parent_tree, tvbuff_t *tvb, int offset, int hfindex)
{
- proto_item *item=NULL;
- proto_tree *tree=NULL;
- guint32 flags;
-
- flags = tvb_get_ntohl (tvb, offset);
- if(parent_tree){
- item=proto_tree_add_uint(parent_tree, hfindex,
- tvb, offset, 1, flags);
- tree=proto_item_add_subtree(item, ett_cos_flags);
- }
-
-
- proto_tree_add_boolean(tree, hf_fcdns_cos_f, tvb, offset, 4, flags);
- if (flags&0x01){
- proto_item_append_text(item, " F");
- }
- flags&=(~( 0x01 ));
-
- proto_tree_add_boolean(tree, hf_fcdns_cos_1, tvb, offset, 4, flags);
- if (flags&0x02){
- proto_item_append_text(item, " 1");
- }
- flags&=(~( 0x02 ));
-
- proto_tree_add_boolean(tree, hf_fcdns_cos_2, tvb, offset, 4, flags);
- if (flags&0x04){
- proto_item_append_text(item, " 2");
- }
- flags&=(~( 0x04 ));
-
- proto_tree_add_boolean(tree, hf_fcdns_cos_3, tvb, offset, 4, flags);
- if (flags&0x08){
- proto_item_append_text(item, " 3");
- }
- flags&=(~( 0x08 ));
-
- proto_tree_add_boolean(tree, hf_fcdns_cos_4, tvb, offset, 4, flags);
- if (flags&0x10){
- proto_item_append_text(item, " 4");
- }
- flags&=(~( 0x10 ));
-
- proto_tree_add_boolean(tree, hf_fcdns_cos_6, tvb, offset, 4, flags);
- if (flags&0x40){
- proto_item_append_text(item, " 6");
- }
- flags&=(~( 0x40 ));
+ proto_item *item=NULL;
+ proto_tree *tree=NULL;
+ guint32 flags;
+
+ flags = tvb_get_ntohl (tvb, offset);
+ if(parent_tree){
+ item=proto_tree_add_uint(parent_tree, hfindex,
+ tvb, offset, 1, flags);
+ tree=proto_item_add_subtree(item, ett_cos_flags);
+ }
+
+
+ proto_tree_add_boolean(tree, hf_fcdns_cos_f, tvb, offset, 4, flags);
+ if (flags&0x01){
+ proto_item_append_text(item, " F");
+ }
+ flags&=(~( 0x01 ));
+
+ proto_tree_add_boolean(tree, hf_fcdns_cos_1, tvb, offset, 4, flags);
+ if (flags&0x02){
+ proto_item_append_text(item, " 1");
+ }
+ flags&=(~( 0x02 ));
+
+ proto_tree_add_boolean(tree, hf_fcdns_cos_2, tvb, offset, 4, flags);
+ if (flags&0x04){
+ proto_item_append_text(item, " 2");
+ }
+ flags&=(~( 0x04 ));
+
+ proto_tree_add_boolean(tree, hf_fcdns_cos_3, tvb, offset, 4, flags);
+ if (flags&0x08){
+ proto_item_append_text(item, " 3");
+ }
+ flags&=(~( 0x08 ));
+
+ proto_tree_add_boolean(tree, hf_fcdns_cos_4, tvb, offset, 4, flags);
+ if (flags&0x10){
+ proto_item_append_text(item, " 4");
+ }
+ flags&=(~( 0x10 ));
+
+ proto_tree_add_boolean(tree, hf_fcdns_cos_6, tvb, offset, 4, flags);
+ if (flags&0x40){
+ proto_item_append_text(item, " 6");
+ }
+ flags&=(~( 0x40 ));
}
static const true_false_string tfs_fcdns_fc4features_i = {
- "I is set",
- "i is NOT set"
+ "I is set",
+ "i is NOT set"
};
static const true_false_string tfs_fcdns_fc4features_t = {
- "T is set",
- "t is NOT set"
+ "T is set",
+ "t is NOT set"
};
/* The feature routines just decode FCP's FC-4 features field
@@ -272,33 +266,33 @@ static const true_false_string tfs_fcdns_fc4features_t = {
static void
dissect_fc4features_and_type (proto_tree *parent_tree, tvbuff_t *tvb, int offset)
{
- proto_item *item=NULL;
- proto_tree *tree=NULL;
- guint8 flags, type;
-
- flags = tvb_get_guint8(tvb, offset);
- type = tvb_get_guint8(tvb, offset+1);
- if(parent_tree){
- item=proto_tree_add_uint(parent_tree, hf_fcdns_fc4features,
- tvb, offset, 1, flags);
- tree=proto_item_add_subtree(item, ett_fc4features);
- }
-
- if(type==FC_TYPE_SCSI){
- proto_tree_add_boolean(tree, hf_fcdns_fc4features_i, tvb, offset, 1, flags);
- if (flags&0x02){
- proto_item_append_text(item, " I");
- }
- flags&=(~( 0x02 ));
-
- proto_tree_add_boolean(tree, hf_fcdns_fc4features_t, tvb, offset, 1, flags);
- if (flags&0x01){
- proto_item_append_text(item, " T");
- }
- flags&=(~( 0x01 ));
- }
-
- proto_tree_add_item (tree, hf_fcdns_req_fc4type, tvb, offset+1, 1, 0);
+ proto_item *item=NULL;
+ proto_tree *tree=NULL;
+ guint8 flags, type;
+
+ flags = tvb_get_guint8(tvb, offset);
+ type = tvb_get_guint8(tvb, offset+1);
+ if(parent_tree){
+ item=proto_tree_add_uint(parent_tree, hf_fcdns_fc4features,
+ tvb, offset, 1, flags);
+ tree=proto_item_add_subtree(item, ett_fc4features);
+ }
+
+ if(type==FC_TYPE_SCSI){
+ proto_tree_add_boolean(tree, hf_fcdns_fc4features_i, tvb, offset, 1, flags);
+ if (flags&0x02){
+ proto_item_append_text(item, " I");
+ }
+ flags&=(~( 0x02 ));
+
+ proto_tree_add_boolean(tree, hf_fcdns_fc4features_t, tvb, offset, 1, flags);
+ if (flags&0x01){
+ proto_item_append_text(item, " T");
+ }
+ flags&=(~( 0x01 ));
+ }
+
+ proto_tree_add_item (tree, hf_fcdns_req_fc4type, tvb, offset+1, 1, 0);
}
/* The feature routines just decode FCP's FC-4 features field
@@ -306,123 +300,123 @@ dissect_fc4features_and_type (proto_tree *parent_tree, tvbuff_t *tvb, int offset
static void
dissect_fc4features (proto_tree *parent_tree, tvbuff_t *tvb, int offset)
{
- proto_item *item=NULL;
- proto_tree *tree=NULL;
- guint8 flags;
-
- flags = tvb_get_guint8(tvb, offset);
- if(parent_tree){
- item=proto_tree_add_uint(parent_tree, hf_fcdns_fc4features,
- tvb, offset, 1, flags);
- tree=proto_item_add_subtree(item, ett_fc4features);
- }
-
- proto_tree_add_boolean(tree, hf_fcdns_fc4features_i, tvb, offset, 1, flags);
- if (flags&0x02){
- proto_item_append_text(item, " I");
- }
- flags&=(~( 0x02 ));
-
- proto_tree_add_boolean(tree, hf_fcdns_fc4features_t, tvb, offset, 1, flags);
- if (flags&0x01){
- proto_item_append_text(item, " T");
- }
- flags&=(~( 0x01 ));
+ proto_item *item=NULL;
+ proto_tree *tree=NULL;
+ guint8 flags;
+
+ flags = tvb_get_guint8(tvb, offset);
+ if(parent_tree){
+ item=proto_tree_add_uint(parent_tree, hf_fcdns_fc4features,
+ tvb, offset, 1, flags);
+ tree=proto_item_add_subtree(item, ett_fc4features);
+ }
+
+ proto_tree_add_boolean(tree, hf_fcdns_fc4features_i, tvb, offset, 1, flags);
+ if (flags&0x02){
+ proto_item_append_text(item, " I");
+ }
+ flags&=(~( 0x02 ));
+
+ proto_tree_add_boolean(tree, hf_fcdns_fc4features_t, tvb, offset, 1, flags);
+ if (flags&0x01){
+ proto_item_append_text(item, " T");
+ }
+ flags&=(~( 0x01 ));
}
static const true_false_string tfs_fcdns_fc4type_llcsnap = {
- "LLC/SNAP is SET",
- "Llc/snap is NOT set"
+ "LLC/SNAP is SET",
+ "Llc/snap is NOT set"
};
static const true_false_string tfs_fcdns_fc4type_ip = {
- "IP is SET",
- "Ip is NOT set"
+ "IP is SET",
+ "Ip is NOT set"
};
static const true_false_string tfs_fcdns_fc4type_fcp = {
- "FCP is SET",
- "Fcp is NOT set"
+ "FCP is SET",
+ "Fcp is NOT set"
};
static const true_false_string tfs_fcdns_fc4type_swils = {
- "SW_ILS is SET",
- "Sw_ils is NOT set"
+ "SW_ILS is SET",
+ "Sw_ils is NOT set"
};
static const true_false_string tfs_fcdns_fc4type_snmp = {
- "SNMP is SET",
- "Snmp is NOT set"
+ "SNMP is SET",
+ "Snmp is NOT set"
};
static const true_false_string tfs_fcdns_fc4type_gs3 = {
- "GS3 is SET",
- "Gs3 is NOT set"
+ "GS3 is SET",
+ "Gs3 is NOT set"
};
static const true_false_string tfs_fcdns_fc4type_vi = {
- "VI is SET",
- "Vi is NOT set"
+ "VI is SET",
+ "Vi is NOT set"
};
/* Decodes LLC/SNAP, IP, FCP, VI, GS, SW_ILS types only */
static void
dissect_fc4type (proto_tree *parent_tree, tvbuff_t *tvb, int offset, int hfindex)
{
- proto_item *item=NULL;
- proto_tree *tree=NULL;
- guint32 flags;
-
- if(parent_tree){
- item=proto_tree_add_item(parent_tree, hfindex, tvb, offset,
- 32, TRUE);
- tree=proto_item_add_subtree(item, ett_fc4flags);
- }
-
- flags = tvb_get_ntohl (tvb, offset);
-
- proto_tree_add_boolean(tree, hf_fcdns_fc4type_fcp, tvb, offset, 4, flags);
- if (flags&0x0100){
- proto_item_append_text(item, " FCP");
- }
- flags&=(~( 0x0100 ));
-
- proto_tree_add_boolean(tree, hf_fcdns_fc4type_ip, tvb, offset, 4, flags);
- if (flags&0x0020){
- proto_item_append_text(item, " IP");
- }
- flags&=(~( 0x0020 ));
-
- proto_tree_add_boolean(tree, hf_fcdns_fc4type_llcsnap, tvb, offset, 4, flags);
- if (flags&0x0010){
- proto_item_append_text(item, " LLC/SNAP");
- }
- flags&=(~( 0x0010 ));
-
-
- flags = tvb_get_ntohl (tvb, offset+4);
-
- proto_tree_add_boolean(tree, hf_fcdns_fc4type_swils, tvb, offset+4, 4, flags);
- if (flags&0x0010){
- proto_item_append_text(item, " SW_ILS");
- }
- flags&=(~( 0x0010 ));
-
- proto_tree_add_boolean(tree, hf_fcdns_fc4type_snmp, tvb, offset+4, 4, flags);
- if (flags&0x0004){
- proto_item_append_text(item, " SNMP");
- }
- flags&=(~( 0x0004 ));
-
- proto_tree_add_boolean(tree, hf_fcdns_fc4type_gs3, tvb, offset+4, 4, flags);
- if (flags&0x0001){
- proto_item_append_text(item, " GS3");
- }
- flags&=(~( 0x0001 ));
-
-
- flags = tvb_get_ntohl (tvb, offset+8);
-
- proto_tree_add_boolean(tree, hf_fcdns_fc4type_vi, tvb, offset+8, 4, flags);
- if (flags&0x0001){
- proto_item_append_text(item, " VI");
- }
- flags&=(~( 0x0001 ));
+ proto_item *item=NULL;
+ proto_tree *tree=NULL;
+ guint32 flags;
+
+ if(parent_tree){
+ item=proto_tree_add_item(parent_tree, hfindex, tvb, offset,
+ 32, TRUE);
+ tree=proto_item_add_subtree(item, ett_fc4flags);
+ }
+
+ flags = tvb_get_ntohl (tvb, offset);
+
+ proto_tree_add_boolean(tree, hf_fcdns_fc4type_fcp, tvb, offset, 4, flags);
+ if (flags&0x0100){
+ proto_item_append_text(item, " FCP");
+ }
+ flags&=(~( 0x0100 ));
+
+ proto_tree_add_boolean(tree, hf_fcdns_fc4type_ip, tvb, offset, 4, flags);
+ if (flags&0x0020){
+ proto_item_append_text(item, " IP");
+ }
+ flags&=(~( 0x0020 ));
+
+ proto_tree_add_boolean(tree, hf_fcdns_fc4type_llcsnap, tvb, offset, 4, flags);
+ if (flags&0x0010){
+ proto_item_append_text(item, " LLC/SNAP");
+ }
+ flags&=(~( 0x0010 ));
+
+
+ flags = tvb_get_ntohl (tvb, offset+4);
+
+ proto_tree_add_boolean(tree, hf_fcdns_fc4type_swils, tvb, offset+4, 4, flags);
+ if (flags&0x0010){
+ proto_item_append_text(item, " SW_ILS");
+ }
+ flags&=(~( 0x0010 ));
+
+ proto_tree_add_boolean(tree, hf_fcdns_fc4type_snmp, tvb, offset+4, 4, flags);
+ if (flags&0x0004){
+ proto_item_append_text(item, " SNMP");
+ }
+ flags&=(~( 0x0004 ));
+
+ proto_tree_add_boolean(tree, hf_fcdns_fc4type_gs3, tvb, offset+4, 4, flags);
+ if (flags&0x0001){
+ proto_item_append_text(item, " GS3");
+ }
+ flags&=(~( 0x0001 ));
+
+
+ flags = tvb_get_ntohl (tvb, offset+8);
+
+ proto_tree_add_boolean(tree, hf_fcdns_fc4type_vi, tvb, offset+8, 4, flags);
+ if (flags&0x0001){
+ proto_item_append_text(item, " VI");
+ }
+ flags&=(~( 0x0001 ));
}
/* Code to actually dissect the packets */
@@ -494,7 +488,7 @@ dissect_fcdns_ganxt (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
offset+540, 16, 0);
}
if (tvb_offset_exists (tvb, 576)) {
- dissect_cos_flags(req_tree, tvb, offset+556, hf_fcdns_reply_cos);
+ dissect_cos_flags(req_tree, tvb, offset+556, hf_fcdns_reply_cos);
}
if (tvb_offset_exists (tvb, 608)) {
dissect_fc4type(req_tree, tvb, offset+560, hf_fcdns_rply_gft);
@@ -1039,7 +1033,7 @@ dissect_fcdns_rcsid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
offset+1, 3,
fc_to_str (tvb_get_ptr (tvb, offset+1,
3)));
- dissect_cos_flags(req_tree, tvb, offset+4, hf_fcdns_req_cos);
+ dissect_cos_flags(req_tree, tvb, offset+4, hf_fcdns_req_cos);
}
}
@@ -1232,7 +1226,7 @@ dissect_fcdns_zone_mbr (tvbuff_t *tvb, proto_tree *zmbr_tree, int offset)
3)));
break;
case FC_SWILS_ZONEMBR_ALIAS:
- str = zonenm_to_str (tvb, offset+4);
+ str = zonenm_to_str (tvb, offset+4);
proto_tree_add_string (zmbr_tree, hf_fcdns_zone_mbrid, tvb,
offset+4, idlen, str);
break;
@@ -1787,15 +1781,10 @@ dissect_fcdns (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Register the protocol with Wireshark */
-/* this format is required because a script is used to build the C function
- that calls all the protocol registration.
-*/
-
void
proto_register_fcdns (void)
{
-/* Setup list of header fields See Section 1.6.1 for details*/
static hf_register_info hf[] = {
{ &hf_fcdns_gssubtype,
{"GS_Subtype", "fcdns.gssubtype", FT_UINT8, BASE_HEX,
@@ -1998,20 +1987,14 @@ proto_register_fcdns (void)
&ett_fc4features,
};
- /* Register the protocol name and description */
proto_fcdns = proto_register_protocol("Fibre Channel Name Server",
"FC-dNS", "fcdns");
- /* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_fcdns, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
register_init_routine (&fcdns_init_protocol);
}
-/* If this dissector uses sub-dissector registration add a registration routine.
- This format is required because a script is used to find these routines and
- create the code that calls these routines.
-*/
void
proto_reg_handoff_fcdns (void)
{
diff --git a/epan/dissectors/packet-fcels.c b/epan/dissectors/packet-fcels.c
index 72a225c87f..4de1e6c31a 100644
--- a/epan/dissectors/packet-fcels.c
+++ b/epan/dissectors/packet-fcels.c
@@ -12,12 +12,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -57,177 +57,177 @@
#define FC_ELS_REQ 1
/* Initialize the protocol and registered fields */
-static int proto_fcels = -1;
-static int hf_fcels_opcode = -1;
-static int hf_fcels_rjtcode = -1;
-static int hf_fcels_rjtdetcode = -1;
-static int hf_fcels_vnduniq = -1;
-static int hf_fcels_b2b = -1;
-static int hf_fcels_cmnfeatures = -1;
-static int hf_fcels_bbscnum = -1;
-static int hf_fcels_rcvsize = -1;
-static int hf_fcels_maxconseq = -1;
-static int hf_fcels_reloffset = -1;
-static int hf_fcels_edtov = -1;
-static int hf_fcels_npname = -1;
-static int hf_fcels_fnname = -1;
-static int hf_fcels_cls1param = -1;
-static int hf_fcels_cls2param = -1;
-static int hf_fcels_cls3param = -1;
-static int hf_fcels_cls4param = -1;
-static int hf_fcels_vendorvers = -1;
-static int hf_fcels_svcavail = -1;
-static int hf_fcels_clsflags = -1;
-static int hf_fcels_clsrcvsize = -1;
-static int hf_fcels_conseq = -1;
-static int hf_fcels_e2e = -1;
-static int hf_fcels_openseq = -1;
-static int hf_fcels_nportid = -1;
-static int hf_fcels_oxid = -1;
-static int hf_fcels_rxid = -1;
-static int hf_fcels_recovqual = -1;
-static int hf_fcels_fabricaddr = -1;
-static int hf_fcels_fabricpname = -1;
-static int hf_fcels_failedrcvr = -1;
-static int hf_fcels_flacompliance = -1;
-static int hf_fcels_loopstate = -1;
-static int hf_fcels_publicloop_bmap = -1;
-static int hf_fcels_pvtloop_bmap = -1;
-static int hf_fcels_alpa_map = -1;
-static int hf_fcels_scrregn = -1;
-static int hf_fcels_farp_matchcodept = -1;
-static int hf_fcels_farp_respaction = -1;
-static int hf_fcels_resportid = -1;
-static int hf_fcels_respname = -1;
-static int hf_fcels_respnname = -1;
-static int hf_fcels_reqipaddr = -1;
-static int hf_fcels_respipaddr = -1;
-static int hf_fcels_hardaddr = -1;
-static int hf_fcels_rps_flag = -1;
-static int hf_fcels_rps_portnum = -1;
-static int hf_fcels_rps_portstatus = -1;
-static int hf_fcels_rnft_fc4type = -1;
-static int hf_fcels_rscn_evqual = -1;
-static int hf_fcels_rscn_addrfmt = -1;
-static int hf_fcels_rscn_domain = -1;
-static int hf_fcels_rscn_area = -1;
-static int hf_fcels_rscn_port = -1;
-static int hf_fcels_rec_fc4 = -1;
-static int hf_fcels_estat = -1;
-static int hf_fcels_estat_resp = -1;
-static int hf_fcels_estat_seq_init = -1;
-static int hf_fcels_estat_compl = -1;
-static int hf_fcels_nodeidfmt = -1;
-static int hf_fcels_spidlen = -1;
-static int hf_fcels_vendoruniq = -1;
-static int hf_fcels_vendorsp = -1;
-static int hf_fcels_asstype = -1;
-static int hf_fcels_physport = -1;
-static int hf_fcels_attnodes = -1;
-static int hf_fcels_nodemgmt = -1;
-static int hf_fcels_ipvers = -1;
-static int hf_fcels_tcpport = -1;
-static int hf_fcels_ip = -1;
-static int hf_fcels_cbind_liveness = -1;
-static int hf_fcels_cbind_addr_mode = -1;
-static int hf_fcels_cbind_ifcp_version = -1;
-static int hf_fcels_cbind_userinfo = -1;
-static int hf_fcels_cbind_snpname = -1;
-static int hf_fcels_cbind_dnpname = -1;
-static int hf_fcels_cbind_status = -1;
-static int hf_fcels_chandle = -1;
-static int hf_fcels_unbind_status = -1;
-static int hf_fcels_cmn_cios = -1;
-static int hf_fcels_cmn_rro = -1;
-static int hf_fcels_cmn_vvv = -1;
-static int hf_fcels_cmn_b2b = -1;
-static int hf_fcels_cmn_e_d_tov = -1;
-static int hf_fcels_cmn_simplex = -1;
-static int hf_fcels_cmn_multicast = -1;
-static int hf_fcels_cmn_broadcast = -1;
-static int hf_fcels_cmn_security = -1;
-static int hf_fcels_cmn_clk = -1;
-static int hf_fcels_cmn_dhd = -1;
-static int hf_fcels_cmn_seqcnt = -1;
-static int hf_fcels_cmn_payload = -1;
-static int hf_fcels_cls_cns = -1;
-static int hf_fcels_cls_sdr = -1;
-static int hf_fcels_cls_prio = -1;
-static int hf_fcels_cls_nzctl = -1;
-static int hf_fcels_initctl = -1;
-static int hf_fcels_initctl_initial_pa = -1;
-static int hf_fcels_initctl_ack0 = -1;
-static int hf_fcels_initctl_ackgaa = -1;
-static int hf_fcels_initctl_sync = -1;
-static int hf_fcels_rcptctl = -1;
-static int hf_fcels_rcptctl_ack0 = -1;
-static int hf_fcels_rcptctl_interlock = -1;
-static int hf_fcels_rcptctl_policy = -1;
-static int hf_fcels_rcptctl_category = -1;
-static int hf_fcels_rcptctl_sync = -1;
-static int hf_fcels_fcpflags = -1;
-static int hf_fcels_fcpflags_trireq = -1;
-static int hf_fcels_fcpflags_trirep = -1;
-static int hf_fcels_fcpflags_retry = -1;
-static int hf_fcels_fcpflags_ccomp = -1;
-static int hf_fcels_fcpflags_datao = -1;
-static int hf_fcels_fcpflags_initiator = -1;
-static int hf_fcels_fcpflags_target = -1;
-static int hf_fcels_fcpflags_rdxr = -1;
-static int hf_fcels_fcpflags_wrxr = -1;
-static int hf_fcels_prliloflags = -1;
-static int hf_fcels_tprloflags_opav = -1;
-static int hf_fcels_tprloflags_rpav = -1;
-static int hf_fcels_tprloflags_npv = -1;
-static int hf_fcels_tprloflags_gprlo = -1;
-static int hf_fcels_speedflags = -1;
-static int hf_fcels_speedflags_1gb = -1;
-static int hf_fcels_speedflags_2gb = -1;
-static int hf_fcels_speedflags_4gb = -1;
-static int hf_fcels_speedflags_10gb = -1;
-static int hf_fcels_prliloflags_opav = -1;
-static int hf_fcels_prliloflags_ipe = -1;
-static int hf_fcels_prliloflags_eip = -1;
-
-static gint ett_fcels = -1;
-static gint ett_fcels_lsrjt = -1;
-static gint ett_fcels_acc = -1;
-static gint ett_fcels_logi = -1;
-static gint ett_fcels_logi_cmnsvc = -1;
-static gint ett_fcels_logi_clssvc = -1;
-static gint ett_fcels_logo = -1;
-static gint ett_fcels_abtx = -1;
-static gint ett_fcels_rsi = -1;
-static gint ett_fcels_rrq = -1;
-static gint ett_fcels_rec = -1;
-static gint ett_fcels_prli = -1;
-static gint ett_fcels_prli_svcpg = -1;
-static gint ett_fcels_adisc = -1;
-static gint ett_fcels_farp = -1;
-static gint ett_fcels_rps = -1;
-static gint ett_fcels_rpl = -1;
-static gint ett_fcels_rplpb = -1;
-static gint ett_fcels_fan = -1;
-static gint ett_fcels_rscn = -1;
-static gint ett_fcels_rscn_rec = -1;
-static gint ett_fcels_estat = -1;
-static gint ett_fcels_scr = -1;
-static gint ett_fcels_rnft = -1;
-static gint ett_fcels_rnft_fc4 = -1;
-static gint ett_fcels_lsts = -1;
-static gint ett_fcels_rnid = -1;
-static gint ett_fcels_rlir = -1;
-static gint ett_fcels_lirr = -1;
-static gint ett_fcels_srl = -1;
-static gint ett_fcels_rpsc = -1;
-static gint ett_fcels_cbind = -1;
-static gint ett_fcels_cmnfeatures = -1;
-static gint ett_fcels_clsflags = -1;
-static gint ett_fcels_initctl = -1;
-static gint ett_fcels_rcptctl = -1;
-static gint ett_fcels_fcpflags = -1;
-static gint ett_fcels_prliloflags = -1;
-static gint ett_fcels_speedflags = -1;
+static int proto_fcels = -1;
+static int hf_fcels_opcode = -1;
+static int hf_fcels_rjtcode = -1;
+static int hf_fcels_rjtdetcode = -1;
+static int hf_fcels_vnduniq = -1;
+static int hf_fcels_b2b = -1;
+static int hf_fcels_cmnfeatures = -1;
+static int hf_fcels_bbscnum = -1;
+static int hf_fcels_rcvsize = -1;
+static int hf_fcels_maxconseq = -1;
+static int hf_fcels_reloffset = -1;
+static int hf_fcels_edtov = -1;
+static int hf_fcels_npname = -1;
+static int hf_fcels_fnname = -1;
+static int hf_fcels_cls1param = -1;
+static int hf_fcels_cls2param = -1;
+static int hf_fcels_cls3param = -1;
+static int hf_fcels_cls4param = -1;
+static int hf_fcels_vendorvers = -1;
+static int hf_fcels_svcavail = -1;
+static int hf_fcels_clsflags = -1;
+static int hf_fcels_clsrcvsize = -1;
+static int hf_fcels_conseq = -1;
+static int hf_fcels_e2e = -1;
+static int hf_fcels_openseq = -1;
+static int hf_fcels_nportid = -1;
+static int hf_fcels_oxid = -1;
+static int hf_fcels_rxid = -1;
+static int hf_fcels_recovqual = -1;
+static int hf_fcels_fabricaddr = -1;
+static int hf_fcels_fabricpname = -1;
+static int hf_fcels_failedrcvr = -1;
+static int hf_fcels_flacompliance = -1;
+static int hf_fcels_loopstate = -1;
+static int hf_fcels_publicloop_bmap = -1;
+static int hf_fcels_pvtloop_bmap = -1;
+static int hf_fcels_alpa_map = -1;
+static int hf_fcels_scrregn = -1;
+static int hf_fcels_farp_matchcodept = -1;
+static int hf_fcels_farp_respaction = -1;
+static int hf_fcels_resportid = -1;
+static int hf_fcels_respname = -1;
+static int hf_fcels_respnname = -1;
+static int hf_fcels_reqipaddr = -1;
+static int hf_fcels_respipaddr = -1;
+static int hf_fcels_hardaddr = -1;
+static int hf_fcels_rps_flag = -1;
+static int hf_fcels_rps_portnum = -1;
+static int hf_fcels_rps_portstatus = -1;
+static int hf_fcels_rnft_fc4type = -1;
+static int hf_fcels_rscn_evqual = -1;
+static int hf_fcels_rscn_addrfmt = -1;
+static int hf_fcels_rscn_domain = -1;
+static int hf_fcels_rscn_area = -1;
+static int hf_fcels_rscn_port = -1;
+static int hf_fcels_rec_fc4 = -1;
+static int hf_fcels_estat = -1;
+static int hf_fcels_estat_resp = -1;
+static int hf_fcels_estat_seq_init = -1;
+static int hf_fcels_estat_compl = -1;
+static int hf_fcels_nodeidfmt = -1;
+static int hf_fcels_spidlen = -1;
+static int hf_fcels_vendoruniq = -1;
+static int hf_fcels_vendorsp = -1;
+static int hf_fcels_asstype = -1;
+static int hf_fcels_physport = -1;
+static int hf_fcels_attnodes = -1;
+static int hf_fcels_nodemgmt = -1;
+static int hf_fcels_ipvers = -1;
+static int hf_fcels_tcpport = -1;
+static int hf_fcels_ip = -1;
+static int hf_fcels_cbind_liveness = -1;
+static int hf_fcels_cbind_addr_mode = -1;
+static int hf_fcels_cbind_ifcp_version = -1;
+static int hf_fcels_cbind_userinfo = -1;
+static int hf_fcels_cbind_snpname = -1;
+static int hf_fcels_cbind_dnpname = -1;
+static int hf_fcels_cbind_status = -1;
+static int hf_fcels_chandle = -1;
+static int hf_fcels_unbind_status = -1;
+static int hf_fcels_cmn_cios = -1;
+static int hf_fcels_cmn_rro = -1;
+static int hf_fcels_cmn_vvv = -1;
+static int hf_fcels_cmn_b2b = -1;
+static int hf_fcels_cmn_e_d_tov = -1;
+static int hf_fcels_cmn_simplex = -1;
+static int hf_fcels_cmn_multicast = -1;
+static int hf_fcels_cmn_broadcast = -1;
+static int hf_fcels_cmn_security = -1;
+static int hf_fcels_cmn_clk = -1;
+static int hf_fcels_cmn_dhd = -1;
+static int hf_fcels_cmn_seqcnt = -1;
+static int hf_fcels_cmn_payload = -1;
+static int hf_fcels_cls_cns = -1;
+static int hf_fcels_cls_sdr = -1;
+static int hf_fcels_cls_prio = -1;
+static int hf_fcels_cls_nzctl = -1;
+static int hf_fcels_initctl = -1;
+static int hf_fcels_initctl_initial_pa = -1;
+static int hf_fcels_initctl_ack0 = -1;
+static int hf_fcels_initctl_ackgaa = -1;
+static int hf_fcels_initctl_sync = -1;
+static int hf_fcels_rcptctl = -1;
+static int hf_fcels_rcptctl_ack0 = -1;
+static int hf_fcels_rcptctl_interlock = -1;
+static int hf_fcels_rcptctl_policy = -1;
+static int hf_fcels_rcptctl_category = -1;
+static int hf_fcels_rcptctl_sync = -1;
+static int hf_fcels_fcpflags = -1;
+static int hf_fcels_fcpflags_trireq = -1;
+static int hf_fcels_fcpflags_trirep = -1;
+static int hf_fcels_fcpflags_retry = -1;
+static int hf_fcels_fcpflags_ccomp = -1;
+static int hf_fcels_fcpflags_datao = -1;
+static int hf_fcels_fcpflags_initiator = -1;
+static int hf_fcels_fcpflags_target = -1;
+static int hf_fcels_fcpflags_rdxr = -1;
+static int hf_fcels_fcpflags_wrxr = -1;
+static int hf_fcels_prliloflags = -1;
+static int hf_fcels_tprloflags_opav = -1;
+static int hf_fcels_tprloflags_rpav = -1;
+static int hf_fcels_tprloflags_npv = -1;
+static int hf_fcels_tprloflags_gprlo = -1;
+static int hf_fcels_speedflags = -1;
+static int hf_fcels_speedflags_1gb = -1;
+static int hf_fcels_speedflags_2gb = -1;
+static int hf_fcels_speedflags_4gb = -1;
+static int hf_fcels_speedflags_10gb = -1;
+static int hf_fcels_prliloflags_opav = -1;
+static int hf_fcels_prliloflags_ipe = -1;
+static int hf_fcels_prliloflags_eip = -1;
+
+static gint ett_fcels = -1;
+static gint ett_fcels_lsrjt = -1;
+static gint ett_fcels_acc = -1;
+static gint ett_fcels_logi = -1;
+static gint ett_fcels_logi_cmnsvc = -1;
+static gint ett_fcels_logi_clssvc = -1;
+static gint ett_fcels_logo = -1;
+static gint ett_fcels_abtx = -1;
+static gint ett_fcels_rsi = -1;
+static gint ett_fcels_rrq = -1;
+static gint ett_fcels_rec = -1;
+static gint ett_fcels_prli = -1;
+static gint ett_fcels_prli_svcpg = -1;
+static gint ett_fcels_adisc = -1;
+static gint ett_fcels_farp = -1;
+static gint ett_fcels_rps = -1;
+static gint ett_fcels_rpl = -1;
+static gint ett_fcels_rplpb = -1;
+static gint ett_fcels_fan = -1;
+static gint ett_fcels_rscn = -1;
+static gint ett_fcels_rscn_rec = -1;
+static gint ett_fcels_estat = -1;
+static gint ett_fcels_scr = -1;
+static gint ett_fcels_rnft = -1;
+static gint ett_fcels_rnft_fc4 = -1;
+static gint ett_fcels_lsts = -1;
+static gint ett_fcels_rnid = -1;
+static gint ett_fcels_rlir = -1;
+static gint ett_fcels_lirr = -1;
+static gint ett_fcels_srl = -1;
+static gint ett_fcels_rpsc = -1;
+static gint ett_fcels_cbind = -1;
+static gint ett_fcels_cmnfeatures = -1;
+static gint ett_fcels_clsflags = -1;
+static gint ett_fcels_initctl = -1;
+static gint ett_fcels_rcptctl = -1;
+static gint ett_fcels_fcpflags = -1;
+static gint ett_fcels_prliloflags = -1;
+static gint ett_fcels_speedflags = -1;
static const int *hf_fcels_estat_fields[] = {
&hf_fcels_estat_resp,
@@ -301,7 +301,7 @@ typedef struct _fcels_conv_data {
guint32 opcode;
} fcels_conv_data_t;
-GHashTable *fcels_req_hash = NULL;
+static GHashTable *fcels_req_hash = NULL;
static dissector_handle_t data_handle, fcsp_handle;
@@ -320,12 +320,12 @@ fcels_equal(gconstpointer v, gconstpointer w)
static guint
fcels_hash (gconstpointer v)
{
- const fcels_conv_key_t *key = v;
- guint val;
+ const fcels_conv_key_t *key = v;
+ guint val;
- val = key->conv_idx;
+ val = key->conv_idx;
- return val;
+ return val;
}
/*
@@ -334,633 +334,633 @@ fcels_hash (gconstpointer v)
static void
fcels_init_protocol(void)
{
- if (fcels_req_hash)
- g_hash_table_destroy(fcels_req_hash);
+ if (fcels_req_hash)
+ g_hash_table_destroy(fcels_req_hash);
- fcels_req_hash = g_hash_table_new(fcels_hash, fcels_equal);
+ fcels_req_hash = g_hash_table_new(fcels_hash, fcels_equal);
}
static const true_false_string tfs_fc_fcels_cmn_cios = {
- "Cont. Incr. Offset Supported",
- "Cont. incr. offset NOT supported"
+ "Cont. Incr. Offset Supported",
+ "Cont. incr. offset NOT supported"
};
static const true_false_string tfs_fc_fcels_cmn_rro = {
- "RRO Supported",
- "Rro NOT supported"
+ "RRO Supported",
+ "Rro NOT supported"
};
static const true_false_string tfs_fc_fcels_cmn_vvv = {
- "Valid Vendor Version",
- "Vendor version NOT valid"
+ "Valid Vendor Version",
+ "Vendor version NOT valid"
};
static const true_false_string tfs_fc_fcels_cmn_b2b = {
- "Alt B2B Credit Mgmt",
- "Normal B2B Credit Mgmt"
+ "Alt B2B Credit Mgmt",
+ "Normal B2B Credit Mgmt"
};
static const true_false_string tfs_fc_fcels_cmn_e_d_tov = {
- "E_D_TOV Resolution in ns",
- "E_D_TOV Resolution in ms"
+ "E_D_TOV Resolution in ns",
+ "E_D_TOV Resolution in ms"
};
static const true_false_string tfs_fc_fcels_cmn_simplex = {
- "Simplex Dedicated Conn Supported",
- "Simplex dedicated conn NOT supported"
+ "Simplex Dedicated Conn Supported",
+ "Simplex dedicated conn NOT supported"
};
static const true_false_string tfs_fc_fcels_cmn_multicast = {
- "Multicast supported",
- "Multicast NOT supported"
+ "Multicast supported",
+ "Multicast NOT supported"
};
static const true_false_string tfs_fc_fcels_cmn_broadcast = {
- "Broadcast Supported",
- "Broadcast NOT supported"
+ "Broadcast Supported",
+ "Broadcast NOT supported"
};
static const true_false_string tfs_fc_fcels_cmn_security = {
- "SECURITY Bit is SET",
- "Security bit is NOT set"
+ "SECURITY Bit is SET",
+ "Security bit is NOT set"
};
static const true_false_string tfs_fc_fcels_cmn_clk = {
- "Clk Sync Prim Capable",
- "NOT clk sync prim capable"
+ "Clk Sync Prim Capable",
+ "NOT clk sync prim capable"
};
static const true_false_string tfs_fc_fcels_cmn_dhd = {
- "DHD Capable",
- "NOT dhd capable"
+ "DHD Capable",
+ "NOT dhd capable"
};
static const true_false_string tfs_fc_fcels_cmn_seqcnt = {
- "Cont. Incr SEQCNT rules",
- "Normal SEQCNT rules"
+ "Cont. Incr SEQCNT rules",
+ "Normal SEQCNT rules"
};
static const true_false_string tfs_fc_fcels_cmn_payload = {
- "Payload Len=256 bytes",
- "Payload Len=116 bytes"
+ "Payload Len=256 bytes",
+ "Payload Len=116 bytes"
};
static void
dissect_cmnsvc (proto_tree *parent_tree, tvbuff_t *tvb, int offset, guint16 flags, guint8 opcode)
{
- proto_item *item=NULL;
- proto_tree *tree=NULL;
-
- if(parent_tree){
- item=proto_tree_add_uint(parent_tree, hf_fcels_cmnfeatures,
- tvb, offset, 2, flags);
- tree=proto_item_add_subtree(item, ett_fcels_cmnfeatures);
- }
-
- proto_tree_add_boolean(tree, hf_fcels_cmn_cios, tvb, offset, 2, flags);
- if (flags&0x8000){
- proto_item_append_text(item, " Cont. Incr. Offset Supported");
- }
- flags&=(~( 0x8000 ));
-
- proto_tree_add_boolean(tree, hf_fcels_cmn_rro, tvb, offset, 2, flags);
- if (flags&0x4000){
- proto_item_append_text(item, " RRO Supported");
- }
- flags&=(~( 0x4000 ));
-
- proto_tree_add_boolean(tree, hf_fcels_cmn_vvv, tvb, offset, 2, flags);
- if (flags&0x2000){
- proto_item_append_text(item, " Valid Vendor Version");
- }
- flags&=(~( 0x2000 ));
-
- proto_tree_add_boolean(tree, hf_fcels_cmn_b2b, tvb, offset, 2, flags);
- if (flags&0x0800){
- proto_item_append_text(item, " Alt B2B Credit Mgmt");
- } else {
- proto_item_append_text(item, " Normal B2B Credit Mgmt");
- }
- flags&=(~( 0x0800 ));
+ proto_item *item=NULL;
+ proto_tree *tree=NULL;
+
+ if(parent_tree){
+ item=proto_tree_add_uint(parent_tree, hf_fcels_cmnfeatures,
+ tvb, offset, 2, flags);
+ tree=proto_item_add_subtree(item, ett_fcels_cmnfeatures);
+ }
+
+ proto_tree_add_boolean(tree, hf_fcels_cmn_cios, tvb, offset, 2, flags);
+ if (flags&0x8000){
+ proto_item_append_text(item, " Cont. Incr. Offset Supported");
+ }
+ flags&=(~( 0x8000 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_cmn_rro, tvb, offset, 2, flags);
+ if (flags&0x4000){
+ proto_item_append_text(item, " RRO Supported");
+ }
+ flags&=(~( 0x4000 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_cmn_vvv, tvb, offset, 2, flags);
+ if (flags&0x2000){
+ proto_item_append_text(item, " Valid Vendor Version");
+ }
+ flags&=(~( 0x2000 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_cmn_b2b, tvb, offset, 2, flags);
+ if (flags&0x0800){
+ proto_item_append_text(item, " Alt B2B Credit Mgmt");
+ } else {
+ proto_item_append_text(item, " Normal B2B Credit Mgmt");
+ }
+ flags&=(~( 0x0800 ));
if ((opcode == FC_ELS_PLOGI) || (opcode == FC_ELS_PDISC)) {
- proto_tree_add_boolean(tree, hf_fcels_cmn_e_d_tov, tvb, offset, 2, flags);
- if (flags&0x0400){
- proto_item_append_text(item, " E_D_TOV Resolution in ns");
- } else {
- proto_item_append_text(item, " E_D_TOV Resolution in ms");
- }
- flags&=(~( 0x0400 ));
-
- proto_tree_add_boolean(tree, hf_fcels_cmn_simplex, tvb, offset, 2, flags);
- if (flags&0x0040){
- proto_item_append_text(item, " Simplex Dedicated Conn Supported");
- }
- flags&=(~( 0x0040 ));
- }
-
- proto_tree_add_boolean(tree, hf_fcels_cmn_multicast, tvb, offset, 2, flags);
- if (flags&0x0200){
- proto_item_append_text(item, " Multicast Supported");
- }
- flags&=(~( 0x0200 ));
-
- proto_tree_add_boolean(tree, hf_fcels_cmn_broadcast, tvb, offset, 2, flags);
- if (flags&0x0100){
- proto_item_append_text(item, " Broadcast Supported");
- }
- flags&=(~( 0x0100 ));
-
- proto_tree_add_boolean(tree, hf_fcels_cmn_security, tvb, offset, 2, flags);
- if (flags&0x0020){
- proto_item_append_text(item, " Security Bit");
- }
- flags&=(~( 0x0020 ));
-
- proto_tree_add_boolean(tree, hf_fcels_cmn_clk, tvb, offset, 2, flags);
- if (flags&0x0010){
- proto_item_append_text(item, " Clk Sync Prim Capable");
- }
- flags&=(~( 0x0010 ));
-
- proto_tree_add_boolean(tree, hf_fcels_cmn_dhd, tvb, offset, 2, flags);
- if (flags&0x0004){
- proto_item_append_text(item, " DHD Capable");
- }
- flags&=(~( 0x0004 ));
-
+ proto_tree_add_boolean(tree, hf_fcels_cmn_e_d_tov, tvb, offset, 2, flags);
+ if (flags&0x0400){
+ proto_item_append_text(item, " E_D_TOV Resolution in ns");
+ } else {
+ proto_item_append_text(item, " E_D_TOV Resolution in ms");
+ }
+ flags&=(~( 0x0400 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_cmn_simplex, tvb, offset, 2, flags);
+ if (flags&0x0040){
+ proto_item_append_text(item, " Simplex Dedicated Conn Supported");
+ }
+ flags&=(~( 0x0040 ));
+ }
+
+ proto_tree_add_boolean(tree, hf_fcels_cmn_multicast, tvb, offset, 2, flags);
+ if (flags&0x0200){
+ proto_item_append_text(item, " Multicast Supported");
+ }
+ flags&=(~( 0x0200 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_cmn_broadcast, tvb, offset, 2, flags);
+ if (flags&0x0100){
+ proto_item_append_text(item, " Broadcast Supported");
+ }
+ flags&=(~( 0x0100 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_cmn_security, tvb, offset, 2, flags);
+ if (flags&0x0020){
+ proto_item_append_text(item, " Security Bit");
+ }
+ flags&=(~( 0x0020 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_cmn_clk, tvb, offset, 2, flags);
+ if (flags&0x0010){
+ proto_item_append_text(item, " Clk Sync Prim Capable");
+ }
+ flags&=(~( 0x0010 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_cmn_dhd, tvb, offset, 2, flags);
+ if (flags&0x0004){
+ proto_item_append_text(item, " DHD Capable");
+ }
+ flags&=(~( 0x0004 ));
+
if ((opcode == FC_ELS_PLOGI) || (opcode == FC_ELS_PDISC)) {
- proto_tree_add_boolean(tree, hf_fcels_cmn_seqcnt, tvb, offset, 2, flags);
- if (flags&0x0002){
- proto_item_append_text(item, " Cont. Incr SEQCNT rules");
- } else {
- proto_item_append_text(item, " Normal SEQCNT rules");
- }
- flags&=(~( 0x0002 ));
- }
-
- proto_tree_add_boolean(tree, hf_fcels_cmn_payload, tvb, offset, 2, flags);
- if (flags&0x0001){
- proto_item_append_text(item, " Payload Len=256 bytes");
- } else {
- proto_item_append_text(item, " Payload Len=116 bytes");
- }
- flags&=(~( 0x0001 ));
+ proto_tree_add_boolean(tree, hf_fcels_cmn_seqcnt, tvb, offset, 2, flags);
+ if (flags&0x0002){
+ proto_item_append_text(item, " Cont. Incr SEQCNT rules");
+ } else {
+ proto_item_append_text(item, " Normal SEQCNT rules");
+ }
+ flags&=(~( 0x0002 ));
+ }
+
+ proto_tree_add_boolean(tree, hf_fcels_cmn_payload, tvb, offset, 2, flags);
+ if (flags&0x0001){
+ proto_item_append_text(item, " Payload Len=256 bytes");
+ } else {
+ proto_item_append_text(item, " Payload Len=116 bytes");
+ }
+ flags&=(~( 0x0001 ));
}
static const true_false_string tfs_fc_fcels_cls_cns = {
- "Class IS Supported",
- "Class NOT supported"
+ "Class IS Supported",
+ "Class NOT supported"
};
static const true_false_string tfs_fc_fcels_cls_sdr = {
- "Seq Delivery Requested",
- "Out of Order Delivery Requested"
+ "Seq Delivery Requested",
+ "Out of Order Delivery Requested"
};
static const true_false_string tfs_fc_fcels_cls_prio = {
- "Priority/preemption Supported",
- "Priority/preemption NOT supported"
+ "Priority/preemption Supported",
+ "Priority/preemption NOT supported"
};
static const true_false_string tfs_fc_fcels_cls_nzctl = {
- "Non-zero CS_CTL Tolerated",
- "Non-zero CS_CTL Maybe Tolerated"
+ "Non-zero CS_CTL Tolerated",
+ "Non-zero CS_CTL Maybe Tolerated"
};
/* The next 3 routines decode only Class 2 & Class 3 relevant bits */
static void
dissect_clssvc_flags (proto_tree *parent_tree, tvbuff_t *tvb, int offset, guint16 flags, guint8 opcode)
{
- proto_item *item=NULL;
- proto_tree *tree=NULL;
-
- if(parent_tree){
- item=proto_tree_add_uint(parent_tree, hf_fcels_clsflags,
- tvb, offset, 2, flags);
- tree=proto_item_add_subtree(item, ett_fcels_clsflags);
- }
-
- proto_tree_add_boolean(tree, hf_fcels_cls_cns, tvb, offset, 2, flags);
- if (!(flags&0x8000)){
- proto_item_append_text(item, " Class Not Supported");
- return;
- }
- flags&=(~( 0x8000 ));
-
- if ((opcode == FC_ELS_FLOGI) || (opcode == FC_ELS_FDISC)) {
- proto_tree_add_boolean(tree, hf_fcels_cls_sdr, tvb, offset, 2, flags);
- if (flags&0x0800){
- proto_item_append_text(item, " Seq Delivery Requested");
- } else {
- proto_item_append_text(item, " Out of Order Delivery Requested");
- }
- flags&=(~( 0x0800 ));
- }
-
- proto_tree_add_boolean(tree, hf_fcels_cls_prio, tvb, offset, 2, flags);
- if (flags&0x0080){
- proto_item_append_text(item, " Priority/preemption Supported");
- }
- flags&=(~( 0x0080 ));
-
- if ((opcode == FC_ELS_PLOGI) || (opcode == FC_ELS_PDISC)) {
- proto_tree_add_boolean(tree, hf_fcels_cls_nzctl, tvb, offset, 2, flags);
- if (flags & 0x0040) {
- proto_item_append_text(item, " Non-zero CS_CTL Tolerated");
- } else {
- proto_item_append_text(item, " Non-zero CS_CTL Maybe Tolerated");
- }
- flags&=(~( 0x0040 ));
- }
+ proto_item *item=NULL;
+ proto_tree *tree=NULL;
+
+ if(parent_tree){
+ item=proto_tree_add_uint(parent_tree, hf_fcels_clsflags,
+ tvb, offset, 2, flags);
+ tree=proto_item_add_subtree(item, ett_fcels_clsflags);
+ }
+
+ proto_tree_add_boolean(tree, hf_fcels_cls_cns, tvb, offset, 2, flags);
+ if (!(flags&0x8000)){
+ proto_item_append_text(item, " Class Not Supported");
+ return;
+ }
+ flags&=(~( 0x8000 ));
+
+ if ((opcode == FC_ELS_FLOGI) || (opcode == FC_ELS_FDISC)) {
+ proto_tree_add_boolean(tree, hf_fcels_cls_sdr, tvb, offset, 2, flags);
+ if (flags&0x0800){
+ proto_item_append_text(item, " Seq Delivery Requested");
+ } else {
+ proto_item_append_text(item, " Out of Order Delivery Requested");
+ }
+ flags&=(~( 0x0800 ));
+ }
+
+ proto_tree_add_boolean(tree, hf_fcels_cls_prio, tvb, offset, 2, flags);
+ if (flags&0x0080){
+ proto_item_append_text(item, " Priority/preemption Supported");
+ }
+ flags&=(~( 0x0080 ));
+
+ if ((opcode == FC_ELS_PLOGI) || (opcode == FC_ELS_PDISC)) {
+ proto_tree_add_boolean(tree, hf_fcels_cls_nzctl, tvb, offset, 2, flags);
+ if (flags & 0x0040) {
+ proto_item_append_text(item, " Non-zero CS_CTL Tolerated");
+ } else {
+ proto_item_append_text(item, " Non-zero CS_CTL Maybe Tolerated");
+ }
+ flags&=(~( 0x0040 ));
+ }
}
static const true_false_string tfs_fc_fcels_fcpflags_trireq = {
- "Task Retry Ident REQUESTED",
- "Task retry ident NOT requested"
+ "Task Retry Ident REQUESTED",
+ "Task retry ident NOT requested"
};
static const true_false_string tfs_fc_fcels_fcpflags_trirep = {
- "Task Retry Ident ACCEPTED",
- "Task retry ident NOT accepted"
+ "Task Retry Ident ACCEPTED",
+ "Task retry ident NOT accepted"
};
static const true_false_string tfs_fc_fcels_fcpflags_retry = {
- "Retry Possible",
- "Retry NOT possible"
+ "Retry Possible",
+ "Retry NOT possible"
};
static const true_false_string tfs_fc_fcels_fcpflags_ccomp = {
- "Confirmed Comp",
- "Comp NOT confirmed"
+ "Confirmed Comp",
+ "Comp NOT confirmed"
};
static const true_false_string tfs_fc_fcels_fcpflags_datao = {
- "Data Overlay",
- "NO data overlay"
+ "Data Overlay",
+ "NO data overlay"
};
static const true_false_string tfs_fc_fcels_fcpflags_initiator = {
- "Initiator",
- "NOT an initiator"
+ "Initiator",
+ "NOT an initiator"
};
static const true_false_string tfs_fc_fcels_fcpflags_target = {
- "Target",
- "NOT a target"
+ "Target",
+ "NOT a target"
};
static const true_false_string tfs_fc_fcels_fcpflags_rdxr = {
- "Rd Xfer_Rdy Dis",
- "NO rd xfer_rdy dis"
+ "Rd Xfer_Rdy Dis",
+ "NO rd xfer_rdy dis"
};
static const true_false_string tfs_fc_fcels_fcpflags_wrxr = {
- "Wr Xfer_Rdy Dis",
- "NO wr xfer_rdy dis"
+ "Wr Xfer_Rdy Dis",
+ "NO wr xfer_rdy dis"
};
static void
dissect_fcp_flags (proto_tree *parent_tree, tvbuff_t *tvb, int offset, guint32 flags, guint8 isreq)
{
- proto_item *item=NULL;
- proto_tree *tree=NULL;
-
- if(parent_tree){
- item=proto_tree_add_uint(parent_tree, hf_fcels_fcpflags,
- tvb, offset, 4, flags);
- tree=proto_item_add_subtree(item, ett_fcels_fcpflags);
- }
-
- if (isreq) {
- proto_tree_add_boolean(tree, hf_fcels_fcpflags_trireq, tvb, offset, 4, flags);
- if (flags&0x2000){
- proto_item_append_text(item, " Task Retry Ident Req");
- }
- } else {
- proto_tree_add_boolean(tree, hf_fcels_fcpflags_trirep, tvb, offset, 4, flags);
- if (flags&0x2000){
- proto_item_append_text(item, " Task Retry Ident Acc");
- }
- }
- flags&=(~( 0x2000 ));
-
- proto_tree_add_boolean(tree, hf_fcels_fcpflags_retry, tvb, offset, 4, flags);
- if (flags&0x1000){
- proto_item_append_text(item, " Retry Possible");
- }
- flags&=(~( 0x1000 ));
-
- proto_tree_add_boolean(tree, hf_fcels_fcpflags_ccomp, tvb, offset, 4, flags);
- if (flags&0x0080){
- proto_item_append_text(item, " Confirmed Comp");
- }
- flags&=(~( 0x0080 ));
-
- proto_tree_add_boolean(tree, hf_fcels_fcpflags_datao, tvb, offset, 4, flags);
- if (flags&0x0040){
- proto_item_append_text(item, " Data Overlay");
- }
- flags&=(~( 0x0040 ));
-
- proto_tree_add_boolean(tree, hf_fcels_fcpflags_initiator, tvb, offset, 4, flags);
- if (flags&0x0020){
- proto_item_append_text(item, " Initiator");
- }
- flags&=(~( 0x0020 ));
-
- proto_tree_add_boolean(tree, hf_fcels_fcpflags_target, tvb, offset, 4, flags);
- if (flags&0x0010){
- proto_item_append_text(item, " Target");
- }
- flags&=(~( 0x0010 ));
-
- proto_tree_add_boolean(tree, hf_fcels_fcpflags_rdxr, tvb, offset, 4, flags);
- if (flags&0x0002){
- proto_item_append_text(item, " Rd Xfer_Rdy Dis");
- }
- flags&=(~( 0x0002 ));
-
- proto_tree_add_boolean(tree, hf_fcels_fcpflags_wrxr, tvb, offset, 4, flags);
- if (flags&0x0001){
- proto_item_append_text(item, " Wr Xfer_Rdy Dis");
- }
- flags&=(~( 0x0001 ));
+ proto_item *item=NULL;
+ proto_tree *tree=NULL;
+
+ if(parent_tree){
+ item=proto_tree_add_uint(parent_tree, hf_fcels_fcpflags,
+ tvb, offset, 4, flags);
+ tree=proto_item_add_subtree(item, ett_fcels_fcpflags);
+ }
+
+ if (isreq) {
+ proto_tree_add_boolean(tree, hf_fcels_fcpflags_trireq, tvb, offset, 4, flags);
+ if (flags&0x2000){
+ proto_item_append_text(item, " Task Retry Ident Req");
+ }
+ } else {
+ proto_tree_add_boolean(tree, hf_fcels_fcpflags_trirep, tvb, offset, 4, flags);
+ if (flags&0x2000){
+ proto_item_append_text(item, " Task Retry Ident Acc");
+ }
+ }
+ flags&=(~( 0x2000 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_fcpflags_retry, tvb, offset, 4, flags);
+ if (flags&0x1000){
+ proto_item_append_text(item, " Retry Possible");
+ }
+ flags&=(~( 0x1000 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_fcpflags_ccomp, tvb, offset, 4, flags);
+ if (flags&0x0080){
+ proto_item_append_text(item, " Confirmed Comp");
+ }
+ flags&=(~( 0x0080 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_fcpflags_datao, tvb, offset, 4, flags);
+ if (flags&0x0040){
+ proto_item_append_text(item, " Data Overlay");
+ }
+ flags&=(~( 0x0040 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_fcpflags_initiator, tvb, offset, 4, flags);
+ if (flags&0x0020){
+ proto_item_append_text(item, " Initiator");
+ }
+ flags&=(~( 0x0020 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_fcpflags_target, tvb, offset, 4, flags);
+ if (flags&0x0010){
+ proto_item_append_text(item, " Target");
+ }
+ flags&=(~( 0x0010 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_fcpflags_rdxr, tvb, offset, 4, flags);
+ if (flags&0x0002){
+ proto_item_append_text(item, " Rd Xfer_Rdy Dis");
+ }
+ flags&=(~( 0x0002 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_fcpflags_wrxr, tvb, offset, 4, flags);
+ if (flags&0x0001){
+ proto_item_append_text(item, " Wr Xfer_Rdy Dis");
+ }
+ flags&=(~( 0x0001 ));
}
static const true_false_string tfs_fc_fcels_speedflags_1gb = {
- "1Gbit/second supported",
- "1Gbit/second NOT supported"
+ "1Gbit/second supported",
+ "1Gbit/second NOT supported"
};
static const true_false_string tfs_fc_fcels_speedflags_2gb = {
- "2Gbit/second supported",
- "2Gbit/second NOT supported"
+ "2Gbit/second supported",
+ "2Gbit/second NOT supported"
};
static const true_false_string tfs_fc_fcels_speedflags_4gb = {
- "4Gbit/second supported",
- "4Gbit/second NOT supported"
+ "4Gbit/second supported",
+ "4Gbit/second NOT supported"
};
static const true_false_string tfs_fc_fcels_speedflags_10gb = {
- "10Gbit/second supported",
- "10Gbit/second NOT supported"
+ "10Gbit/second supported",
+ "10Gbit/second NOT supported"
};
static void
dissect_speed_flags (proto_tree *parent_tree, tvbuff_t *tvb, int offset, guint32 flags, int port)
{
- proto_item *item=NULL;
- proto_tree *tree=NULL;
-
- if(parent_tree){
- item=proto_tree_add_uint_format(parent_tree, hf_fcels_speedflags,
- tvb, offset, 2, flags,
- "Port Speed Capabilities (Port %u): 0x%04x",
- port, flags);
- tree=proto_item_add_subtree(item, ett_fcels_speedflags);
- }
-
- proto_tree_add_boolean(tree, hf_fcels_speedflags_1gb, tvb, offset, 2, flags);
- if (flags&0x8000){
- proto_item_append_text(item, " 1Gb");
- }
- flags&=(~( 0x8000 ));
-
- proto_tree_add_boolean(tree, hf_fcels_speedflags_2gb, tvb, offset, 2, flags);
- if (flags&0x4000){
- proto_item_append_text(item, " 2Gb");
- }
- flags&=(~( 0x4000 ));
-
- proto_tree_add_boolean(tree, hf_fcels_speedflags_4gb, tvb, offset, 2, flags);
- if (flags&0x2000){
- proto_item_append_text(item, " 4Gb");
- }
- flags&=(~( 0x2000 ));
-
- proto_tree_add_boolean(tree, hf_fcels_speedflags_10gb, tvb, offset, 2, flags);
- if (flags&0x1000){
- proto_item_append_text(item, " 10Gb");
- }
- flags&=(~( 0x1000 ));
+ proto_item *item=NULL;
+ proto_tree *tree=NULL;
+
+ if(parent_tree){
+ item=proto_tree_add_uint_format(parent_tree, hf_fcels_speedflags,
+ tvb, offset, 2, flags,
+ "Port Speed Capabilities (Port %u): 0x%04x",
+ port, flags);
+ tree=proto_item_add_subtree(item, ett_fcels_speedflags);
+ }
+
+ proto_tree_add_boolean(tree, hf_fcels_speedflags_1gb, tvb, offset, 2, flags);
+ if (flags&0x8000){
+ proto_item_append_text(item, " 1Gb");
+ }
+ flags&=(~( 0x8000 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_speedflags_2gb, tvb, offset, 2, flags);
+ if (flags&0x4000){
+ proto_item_append_text(item, " 2Gb");
+ }
+ flags&=(~( 0x4000 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_speedflags_4gb, tvb, offset, 2, flags);
+ if (flags&0x2000){
+ proto_item_append_text(item, " 4Gb");
+ }
+ flags&=(~( 0x2000 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_speedflags_10gb, tvb, offset, 2, flags);
+ if (flags&0x1000){
+ proto_item_append_text(item, " 10Gb");
+ }
+ flags&=(~( 0x1000 ));
}
static const true_false_string tfs_fc_fcels_tprloflags_opav = {
- "3rd Party Orig PA Valid",
- "3rd party orig pa is NOT valid"
+ "3rd Party Orig PA Valid",
+ "3rd party orig pa is NOT valid"
};
static const true_false_string tfs_fc_fcels_tprloflags_rpav = {
- "Resp PA Valid",
- "Resp pa is NOT valid"
+ "Resp PA Valid",
+ "Resp pa is NOT valid"
};
static const true_false_string tfs_fc_fcels_tprloflags_npv = {
- "3rd Party N_Port Valid",
- "3rd party n_port is NOT valid"
+ "3rd Party N_Port Valid",
+ "3rd party n_port is NOT valid"
};
static const true_false_string tfs_fc_fcels_tprloflags_gprlo = {
- "Global PRLO",
- "NO global prlo"
+ "Global PRLO",
+ "NO global prlo"
};
static const true_false_string tfs_fc_fcels_prliloflags_opav = {
- "Orig PA Valid",
- "Orig pa is NOT valid"
+ "Orig PA Valid",
+ "Orig pa is NOT valid"
};
static const true_false_string tfs_fc_fcels_prliloflags_ipe = {
- "Image Pair Estd",
- "Image pair NOT estd"
+ "Image Pair Estd",
+ "Image pair NOT estd"
};
static const true_false_string tfs_fc_fcels_prliloflags_eip = {
- "Est Image Pair & Exchg Svc Param",
- "Exchange Svc Param Only"
+ "Est Image Pair & Exchg Svc Param",
+ "Exchange Svc Param Only"
};
static void
dissect_prlilo_flags (proto_tree *parent_tree, tvbuff_t *tvb, int offset, int flags, guint8 opcode)
{
- proto_item *item=NULL;
- proto_tree *tree=NULL;
-
- if(parent_tree){
- item=proto_tree_add_uint(parent_tree, hf_fcels_prliloflags,
- tvb, offset, 1, flags);
- tree=proto_item_add_subtree(item, ett_fcels_prliloflags);
- }
-
- if (opcode == FC_ELS_TPRLO) {
- proto_tree_add_boolean(tree, hf_fcels_tprloflags_opav, tvb, offset, 1, flags);
- if (flags&0x80){
- proto_item_append_text(item, " 3rd Party Orig PA Valid");
- }
- flags&=(~( 0x80 ));
-
- proto_tree_add_boolean(tree, hf_fcels_tprloflags_rpav, tvb, offset, 1, flags);
- if (flags&0x40){
- proto_item_append_text(item, " Resp PA Valid");
- }
- flags&=(~( 0x40 ));
-
- proto_tree_add_boolean(tree, hf_fcels_tprloflags_npv, tvb, offset, 1, flags);
- if (flags&0x20){
- proto_item_append_text(item, " 3rd Party N_Port Valid");
- }
- flags&=(~( 0x20 ));
-
- proto_tree_add_boolean(tree, hf_fcels_tprloflags_gprlo, tvb, offset, 1, flags);
- if (flags&0x10){
- proto_item_append_text(item, " Global PRLO");
- }
- flags&=(~( 0x10 ));
- } else { /* opcode != TPRLO */
- proto_tree_add_boolean(tree, hf_fcels_prliloflags_opav, tvb, offset, 1, flags);
- if (flags&0x80){
- proto_item_append_text(item, " Orig PA Valid");
- }
- flags&=(~( 0x80 ));
-
- proto_tree_add_boolean(tree, hf_fcels_tprloflags_rpav, tvb, offset, 1, flags);
- if (flags&0x40){
- proto_item_append_text(item, " Resp PA Valid");
- }
- flags&=(~( 0x40 ));
-
- if (opcode == FC_ELS_PRLI) {
- proto_tree_add_boolean(tree, hf_fcels_prliloflags_ipe, tvb, offset, 1, flags);
- if (flags&0x20){
- proto_item_append_text(item, " Image Pair Estd");
- } else {
- proto_item_append_text(item, " Image Pair NOT Estd");
- }
- flags&=(~( 0x20 ));
- } else {
- proto_tree_add_boolean(tree, hf_fcels_prliloflags_eip, tvb, offset, 1, flags);
- if (flags&0x20){
- proto_item_append_text(item, " Est Image Pair & Exchg Svc Param");
- } else {
- proto_item_append_text(item, " Exchange Svc Param Only");
- }
- flags&=(~( 0x20 ));
- }
- }
+ proto_item *item=NULL;
+ proto_tree *tree=NULL;
+
+ if(parent_tree){
+ item=proto_tree_add_uint(parent_tree, hf_fcels_prliloflags,
+ tvb, offset, 1, flags);
+ tree=proto_item_add_subtree(item, ett_fcels_prliloflags);
+ }
+
+ if (opcode == FC_ELS_TPRLO) {
+ proto_tree_add_boolean(tree, hf_fcels_tprloflags_opav, tvb, offset, 1, flags);
+ if (flags&0x80){
+ proto_item_append_text(item, " 3rd Party Orig PA Valid");
+ }
+ flags&=(~( 0x80 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_tprloflags_rpav, tvb, offset, 1, flags);
+ if (flags&0x40){
+ proto_item_append_text(item, " Resp PA Valid");
+ }
+ flags&=(~( 0x40 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_tprloflags_npv, tvb, offset, 1, flags);
+ if (flags&0x20){
+ proto_item_append_text(item, " 3rd Party N_Port Valid");
+ }
+ flags&=(~( 0x20 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_tprloflags_gprlo, tvb, offset, 1, flags);
+ if (flags&0x10){
+ proto_item_append_text(item, " Global PRLO");
+ }
+ flags&=(~( 0x10 ));
+ } else { /* opcode != TPRLO */
+ proto_tree_add_boolean(tree, hf_fcels_prliloflags_opav, tvb, offset, 1, flags);
+ if (flags&0x80){
+ proto_item_append_text(item, " Orig PA Valid");
+ }
+ flags&=(~( 0x80 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_tprloflags_rpav, tvb, offset, 1, flags);
+ if (flags&0x40){
+ proto_item_append_text(item, " Resp PA Valid");
+ }
+ flags&=(~( 0x40 ));
+
+ if (opcode == FC_ELS_PRLI) {
+ proto_tree_add_boolean(tree, hf_fcels_prliloflags_ipe, tvb, offset, 1, flags);
+ if (flags&0x20){
+ proto_item_append_text(item, " Image Pair Estd");
+ } else {
+ proto_item_append_text(item, " Image Pair NOT Estd");
+ }
+ flags&=(~( 0x20 ));
+ } else {
+ proto_tree_add_boolean(tree, hf_fcels_prliloflags_eip, tvb, offset, 1, flags);
+ if (flags&0x20){
+ proto_item_append_text(item, " Est Image Pair & Exchg Svc Param");
+ } else {
+ proto_item_append_text(item, " Exchange Svc Param Only");
+ }
+ flags&=(~( 0x20 ));
+ }
+ }
}
static const value_string initial_pa_vals[] = {
- { 0, "Initial P_A Not Supported" },
- { 1, "Initial P_A Supported" },
- { 3, "Initial P_A Required & Supported" },
- { 0, NULL }
+ { 0, "Initial P_A Not Supported" },
+ { 1, "Initial P_A Supported" },
+ { 3, "Initial P_A Required & Supported" },
+ { 0, NULL }
};
static const true_false_string tfs_fc_fcels_initctl_ack0 = {
- "ACK0 Capable",
- "NOT Ack0 capable"
+ "ACK0 Capable",
+ "NOT Ack0 capable"
};
static const true_false_string tfs_fc_fcels_initctl_ackgaa = {
- "ACK Generation Assistance Avail",
- "NO ack generation assistance"
+ "ACK Generation Assistance Avail",
+ "NO ack generation assistance"
};
static const true_false_string tfs_fc_fcels_initctl_sync = {
- "Clock Sync ELS Supported",
- "NO clock sync els support"
+ "Clock Sync ELS Supported",
+ "NO clock sync els support"
};
static void
dissect_initctl_flags (proto_tree *parent_tree, tvbuff_t *tvb, int offset, guint16 flags, guint8 opcode)
{
- proto_item *item=NULL;
- proto_tree *tree=NULL;
-
- if(parent_tree){
- item=proto_tree_add_uint(parent_tree, hf_fcels_initctl,
- tvb, offset, 2, flags);
- tree=proto_item_add_subtree(item, ett_fcels_initctl);
- }
-
- if ((opcode == FC_ELS_PLOGI) || (opcode == FC_ELS_PDISC)) {
- proto_tree_add_uint(tree, hf_fcels_initctl_initial_pa,
- tvb, offset, 2, flags);
- proto_item_append_text(item, " %s",
- val_to_str((flags&0x3000)>>12, initial_pa_vals,
- "0x%02x")
- );
- flags&=(~( 0x3000 ));
-
- proto_tree_add_boolean(tree, hf_fcels_initctl_ack0, tvb, offset, 2, flags);
- if (flags&0x0800){
- proto_item_append_text(item, " ACK0 Capable");
- }
- flags&=(~( 0x0800 ));
-
- proto_tree_add_boolean(tree, hf_fcels_initctl_ackgaa, tvb, offset, 2, flags);
- if (flags&0x0200){
- proto_item_append_text(item, " ACK Generation Assistance Avail");
- }
- flags&=(~( 0x0200 ));
-
- }
-
-
- proto_tree_add_boolean(tree, hf_fcels_initctl_sync, tvb, offset, 2, flags);
- if (flags&0x0010){
- proto_item_append_text(item, " Clock Sync ELS Supported");
- }
- flags&=(~( 0x0010 ));
+ proto_item *item=NULL;
+ proto_tree *tree=NULL;
+
+ if(parent_tree){
+ item=proto_tree_add_uint(parent_tree, hf_fcels_initctl,
+ tvb, offset, 2, flags);
+ tree=proto_item_add_subtree(item, ett_fcels_initctl);
+ }
+
+ if ((opcode == FC_ELS_PLOGI) || (opcode == FC_ELS_PDISC)) {
+ proto_tree_add_uint(tree, hf_fcels_initctl_initial_pa,
+ tvb, offset, 2, flags);
+ proto_item_append_text(item, " %s",
+ val_to_str((flags&0x3000)>>12, initial_pa_vals,
+ "0x%02x")
+ );
+ flags&=(~( 0x3000 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_initctl_ack0, tvb, offset, 2, flags);
+ if (flags&0x0800){
+ proto_item_append_text(item, " ACK0 Capable");
+ }
+ flags&=(~( 0x0800 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_initctl_ackgaa, tvb, offset, 2, flags);
+ if (flags&0x0200){
+ proto_item_append_text(item, " ACK Generation Assistance Avail");
+ }
+ flags&=(~( 0x0200 ));
+
+ }
+
+
+ proto_tree_add_boolean(tree, hf_fcels_initctl_sync, tvb, offset, 2, flags);
+ if (flags&0x0010){
+ proto_item_append_text(item, " Clock Sync ELS Supported");
+ }
+ flags&=(~( 0x0010 ));
}
static const true_false_string tfs_fc_fcels_rcptctl_ack0 = {
- "ACK0 Supported",
- "Ack0 NOT supported"
+ "ACK0 Supported",
+ "Ack0 NOT supported"
};
static const true_false_string tfs_fc_fcels_rcptctl_interlock = {
- "X_ID Interlock Reqd",
- "X_id interlock NOT reqd"
+ "X_ID Interlock Reqd",
+ "X_id interlock NOT reqd"
};
static const value_string rcptctl_policy_vals[] = {
- { 0, "Error Policy: Discard Policy only" },
- { 1, "Error Policy: Reserved" },
- { 2, "Error Policy: Both discard and process policies supported" },
- { 3, "Error Policy: Reserved" },
- { 0, NULL }
+ { 0, "Error Policy: Discard Policy only" },
+ { 1, "Error Policy: Reserved" },
+ { 2, "Error Policy: Both discard and process policies supported" },
+ { 3, "Error Policy: Reserved" },
+ { 0, NULL }
};
static const value_string rcptctl_category_vals[] = {
- { 0, "1 Category/Seq" },
- { 1, "2 Categories/Seq" },
- { 3, "More than 2 Categories/Seq" },
- { 0, NULL }
+ { 0, "1 Category/Seq" },
+ { 1, "2 Categories/Seq" },
+ { 3, "More than 2 Categories/Seq" },
+ { 0, NULL }
};
static const true_false_string tfs_fc_fcels_rcptctl_sync = {
- "Clock Sync ELS Supported",
- "NO clock sync els support"
+ "Clock Sync ELS Supported",
+ "NO clock sync els support"
};
static void
dissect_rcptctl_flags (proto_tree *parent_tree, tvbuff_t *tvb, int offset, guint16 flags, guint8 opcode)
{
- proto_item *item=NULL;
- proto_tree *tree=NULL;
-
- if(parent_tree){
- item=proto_tree_add_uint(parent_tree, hf_fcels_rcptctl,
- tvb, offset, 2, flags);
- tree=proto_item_add_subtree(item, ett_fcels_rcptctl);
- }
-
- if ((opcode == FC_ELS_PLOGI) || (opcode == FC_ELS_PDISC)) {
- proto_tree_add_boolean(tree, hf_fcels_rcptctl_ack0, tvb, offset, 2, flags);
- if (flags&0x8000){
- proto_item_append_text(item, " ACK0 Supported");
- } else {
- proto_item_append_text(item, " ACK0 NOT Supported");
- }
- flags&=(~( 0x8000 ));
-
- proto_tree_add_boolean(tree, hf_fcels_rcptctl_interlock, tvb, offset, 2, flags);
- if (flags&0x2000){
- proto_item_append_text(item, " X_ID Interlock Reqd");
- }
- flags&=(~( 0x2000 ));
-
- proto_tree_add_uint(tree, hf_fcels_rcptctl_policy,
- tvb, offset, 2, flags);
- proto_item_append_text(item, " %s",
- val_to_str((flags&0x1800)>>11, rcptctl_policy_vals,
- "0x%02x")
- );
- flags&=(~( 0x1800 ));
-
- proto_tree_add_uint(tree, hf_fcels_rcptctl_category,
- tvb, offset, 2, flags);
- proto_item_append_text(item, " %s",
- val_to_str((flags&0x0030)>>4, rcptctl_category_vals,
- "0x%02x")
- );
- flags&=(~( 0x0030 ));
- }
-
- proto_tree_add_boolean(tree, hf_fcels_rcptctl_sync, tvb, offset, 2, flags);
- if (flags&0x0008){
- proto_item_append_text(item, " Clock Sync ELS Supported");
- }
- flags&=(~( 0x0008 ));
+ proto_item *item=NULL;
+ proto_tree *tree=NULL;
+
+ if(parent_tree){
+ item=proto_tree_add_uint(parent_tree, hf_fcels_rcptctl,
+ tvb, offset, 2, flags);
+ tree=proto_item_add_subtree(item, ett_fcels_rcptctl);
+ }
+
+ if ((opcode == FC_ELS_PLOGI) || (opcode == FC_ELS_PDISC)) {
+ proto_tree_add_boolean(tree, hf_fcels_rcptctl_ack0, tvb, offset, 2, flags);
+ if (flags&0x8000){
+ proto_item_append_text(item, " ACK0 Supported");
+ } else {
+ proto_item_append_text(item, " ACK0 NOT Supported");
+ }
+ flags&=(~( 0x8000 ));
+
+ proto_tree_add_boolean(tree, hf_fcels_rcptctl_interlock, tvb, offset, 2, flags);
+ if (flags&0x2000){
+ proto_item_append_text(item, " X_ID Interlock Reqd");
+ }
+ flags&=(~( 0x2000 ));
+
+ proto_tree_add_uint(tree, hf_fcels_rcptctl_policy,
+ tvb, offset, 2, flags);
+ proto_item_append_text(item, " %s",
+ val_to_str((flags&0x1800)>>11, rcptctl_policy_vals,
+ "0x%02x")
+ );
+ flags&=(~( 0x1800 ));
+
+ proto_tree_add_uint(tree, hf_fcels_rcptctl_category,
+ tvb, offset, 2, flags);
+ proto_item_append_text(item, " %s",
+ val_to_str((flags&0x0030)>>4, rcptctl_category_vals,
+ "0x%02x")
+ );
+ flags&=(~( 0x0030 ));
+ }
+
+ proto_tree_add_boolean(tree, hf_fcels_rcptctl_sync, tvb, offset, 2, flags);
+ if (flags&0x0008){
+ proto_item_append_text(item, " Clock Sync ELS Supported");
+ }
+ flags&=(~( 0x0008 ));
}
/* Maximum length of possible string from, construct_*_string
@@ -982,19 +982,19 @@ dissect_fcels_logi (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
if (tree) {
logi_tree = proto_item_add_subtree (ti, ett_fcels_logi);
proto_tree_add_item (logi_tree, hf_fcels_opcode, tvb, offset, 1, FALSE);
-
+
subti = proto_tree_add_text (logi_tree, tvb, offset+4, 16,
"Common Svc Parameters");
cmnsvc_tree = proto_item_add_subtree (subti, ett_fcels_logi_cmnsvc);
proto_tree_add_item (cmnsvc_tree, hf_fcels_b2b, tvb, offset+6, 2, FALSE);
flag = tvb_get_ntohs (tvb, offset+8);
-
+
if (flag & 0x0001) {
svcvld = 1;
}
dissect_cmnsvc (cmnsvc_tree, tvb, offset+8, flag, opcode);
-
+
proto_tree_add_item (cmnsvc_tree, hf_fcels_bbscnum, tvb, offset+10, 1, FALSE);
proto_tree_add_item (cmnsvc_tree, hf_fcels_rcvsize, tvb, offset+10, 2, FALSE);
proto_tree_add_item (cmnsvc_tree, hf_fcels_maxconseq, tvb, offset+12, 2, FALSE);
@@ -1070,7 +1070,7 @@ dissect_fcels_logout (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
/* Accept has no payload */
return;
}
-
+
proto_tree_add_string (logo_tree, hf_fcels_nportid, tvb, offset, 3,
fc_to_str (tvb_get_ptr (tvb, offset, 3)));
proto_tree_add_string (logo_tree, hf_fcels_npname, tvb, offset+3, 6,
@@ -1236,7 +1236,7 @@ dissect_fcels_farp (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
{
int offset = 4;
proto_tree *farp_tree;
-
+
if (tree) {
farp_tree = proto_item_add_subtree (ti, ett_fcels_farp);
@@ -1388,10 +1388,10 @@ dissect_fcels_rpl (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
}
else {
/* Reply consists of a header and a number of port blocks */
- proto_tree_add_text (rpl_tree, tvb, offset+2, 2,
+ proto_tree_add_text (rpl_tree, tvb, offset+2, 2,
"Payload Length: %u",
tvb_get_ntohs (tvb, offset+2));
- proto_tree_add_text (rpl_tree, tvb, offset+5, 3,
+ proto_tree_add_text (rpl_tree, tvb, offset+5, 3,
"List Length: %u",
tvb_get_ntoh24 (tvb, offset+5));
proto_tree_add_text (rpl_tree, tvb, offset+9, 3,
@@ -1464,7 +1464,7 @@ dissect_fcels_rscn (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
proto_tree_add_text (rscn_tree, tvb, offset+1, 2,
"Payload Len: %u", plen);
numrec = (plen - 4)/4;
-
+
offset = 4;
for (i = 0; i < numrec; i++) {
subti = proto_tree_add_text (rscn_tree, tvb, offset, 4,
@@ -1975,7 +1975,7 @@ dissect_fcels (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* decoding of this is done by each individual opcode handler */
opcode = tvb_get_guint8 (tvb, 0);
-
+
if (tree) {
ti = proto_tree_add_protocol_format (tree, proto_fcels, tvb, 0,
tvb_length (tvb), "FC ELS");
@@ -2009,31 +2009,31 @@ dissect_fcels (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
conversation = find_conversation (pinfo->fd->num, &pinfo->dst, &pinfo->src,
pinfo->ptype, pinfo->oxid,
pinfo->rxid, options);
-
+
if (!conversation) {
conversation = conversation_new (pinfo->fd->num, &pinfo->dst, &pinfo->src,
pinfo->ptype, pinfo->oxid,
pinfo->rxid, options);
}
-
+
ckey.conv_idx = conversation->index;
-
+
cdata = (fcels_conv_data_t *)g_hash_table_lookup (fcels_req_hash,
&ckey);
if (cdata) {
/* Since we never free the memory used by an exchange, this maybe a
* case of another request using the same exchange as a previous
- * req.
+ * req.
*/
cdata->opcode = opcode;
}
else {
req_key = se_alloc (sizeof(fcels_conv_key_t));
req_key->conv_idx = conversation->index;
-
+
cdata = se_alloc (sizeof(fcels_conv_data_t));
cdata->opcode = opcode;
-
+
g_hash_table_insert (fcels_req_hash, req_key, cdata);
}
}
@@ -2085,12 +2085,12 @@ dissect_fcels (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
failed_opcode = 0;
}
}
-
+
if (conversation) {
ckey.conv_idx = conversation->index;
-
+
cdata = (fcels_conv_data_t *)g_hash_table_lookup (fcels_req_hash, &ckey);
-
+
if (cdata != NULL) {
if ((options & NO_ADDR2) && (cdata->opcode != FC_ELS_FLOGI)) {
/* only FLOGI can have this special check */
@@ -2109,7 +2109,7 @@ dissect_fcels (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else
failed_opcode = cdata->opcode;
}
-
+
if (tree) {
if ((cdata == NULL) && (opcode != FC_ELS_LSRJT)) {
/* No record of what this accept is for. Can't decode */
@@ -2136,7 +2136,7 @@ dissect_fcels (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
val_to_str (opcode, fc_els_proto_val, "0x%x"));
}
}
-
+
switch (opcode) {
case FC_ELS_LSRJT:
dissect_fcels_lsrjt (tvb, pinfo, tree, isreq, ti);
@@ -2241,9 +2241,7 @@ dissect_fcels (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
void
proto_register_fcels (void)
-{
-
-/* Setup list of header fields See Section 1.6.1 for details*/
+{
static hf_register_info hf[] = {
{ &hf_fcels_opcode,
{"Cmd Code", "fcels.opcode", FT_UINT8, BASE_HEX,
@@ -2357,7 +2355,7 @@ proto_register_fcels (void)
{"Match Address Code Points", "fcels.matchcp", FT_UINT8, BASE_DEC,
NULL, 0x0, NULL, HFILL}},
{ &hf_fcels_farp_respaction,
- {"Responder Action", "fcels.respaction", FT_UINT8, BASE_HEX,
+ {"Responder Action", "fcels.respaction", FT_UINT8, BASE_HEX,
VALS (fc_els_farp_respaction_val), 0x0, NULL, HFILL}},
{ &hf_fcels_resportid,
{"Responding Port ID", "fcels.resportid", FT_STRING, BASE_NONE,
@@ -2434,7 +2432,7 @@ proto_register_fcels (void)
{"Vendor Specific", "fcels.rnid.vendorsp", FT_UINT16, BASE_HEX, NULL,
0x0, NULL, HFILL}},
{ &hf_fcels_asstype,
- {"Associated Type", "fcels.rnid.asstype", FT_UINT32, BASE_HEX,
+ {"Associated Type", "fcels.rnid.asstype", FT_UINT32, BASE_HEX,
VALS (fc_els_rnid_asstype_val), 0x0, NULL, HFILL}},
{ &hf_fcels_physport,
{"Physical Port Number", "fcels.rnid.physport", FT_UINT32, BASE_HEX,
@@ -2482,55 +2480,55 @@ proto_register_fcels (void)
{"Status", "fcels.unbind.status", FT_UINT16, BASE_DEC,
VALS(unbind_status_vals), 0x0, "Unbind status", HFILL}},
{ &hf_fcels_cmn_cios,
- {"Cont. Incr. Offset Supported", "fcels.cmn.cios", FT_BOOLEAN, 16,
+ {"Cont. Incr. Offset Supported", "fcels.cmn.cios", FT_BOOLEAN, 16,
TFS(&tfs_fc_fcels_cmn_cios), 0x8000, NULL, HFILL}},
{ &hf_fcels_cmn_rro,
- {"RRO Supported", "fcels.cmn.rro", FT_BOOLEAN, 16,
+ {"RRO Supported", "fcels.cmn.rro", FT_BOOLEAN, 16,
TFS(&tfs_fc_fcels_cmn_rro), 0x4000, NULL, HFILL}},
{ &hf_fcels_cmn_vvv,
- {"Valid Vendor Version", "fcels.cmn.vvv", FT_BOOLEAN, 16,
+ {"Valid Vendor Version", "fcels.cmn.vvv", FT_BOOLEAN, 16,
TFS(&tfs_fc_fcels_cmn_vvv), 0x2000, NULL, HFILL}},
{ &hf_fcels_cmn_b2b,
- {"B2B Credit Mgmt", "fcels.cmn.bbb", FT_BOOLEAN, 16,
+ {"B2B Credit Mgmt", "fcels.cmn.bbb", FT_BOOLEAN, 16,
TFS(&tfs_fc_fcels_cmn_b2b), 0x0800, NULL, HFILL}},
{ &hf_fcels_cmn_e_d_tov,
- {"E_D_TOV", "fcels.cmn.e_d_tov", FT_BOOLEAN, 16,
+ {"E_D_TOV", "fcels.cmn.e_d_tov", FT_BOOLEAN, 16,
TFS(&tfs_fc_fcels_cmn_e_d_tov), 0x0400, NULL, HFILL}},
{ &hf_fcels_cmn_simplex,
- {"Simplex", "fcels.cmn.simplex", FT_BOOLEAN, 16,
+ {"Simplex", "fcels.cmn.simplex", FT_BOOLEAN, 16,
TFS(&tfs_fc_fcels_cmn_simplex), 0x0040, NULL, HFILL}},
{ &hf_fcels_cmn_multicast,
- {"Multicast", "fcels.cmn.multicast", FT_BOOLEAN, 16,
+ {"Multicast", "fcels.cmn.multicast", FT_BOOLEAN, 16,
TFS(&tfs_fc_fcels_cmn_multicast), 0x0200, NULL, HFILL}},
{ &hf_fcels_cmn_broadcast,
- {"Broadcast", "fcels.cmn.broadcast", FT_BOOLEAN, 16,
+ {"Broadcast", "fcels.cmn.broadcast", FT_BOOLEAN, 16,
TFS(&tfs_fc_fcels_cmn_broadcast), 0x0100, NULL, HFILL}},
{ &hf_fcels_cmn_security,
- {"Security", "fcels.cmn.security", FT_BOOLEAN, 16,
+ {"Security", "fcels.cmn.security", FT_BOOLEAN, 16,
TFS(&tfs_fc_fcels_cmn_security), 0x0020, NULL, HFILL}},
{ &hf_fcels_cmn_clk,
- {"Clk Sync", "fcels.cmn.clk", FT_BOOLEAN, 16,
+ {"Clk Sync", "fcels.cmn.clk", FT_BOOLEAN, 16,
TFS(&tfs_fc_fcels_cmn_clk), 0x0010, NULL, HFILL}},
{ &hf_fcels_cmn_dhd,
- {"DHD Capable", "fcels.cmn.dhd", FT_BOOLEAN, 16,
+ {"DHD Capable", "fcels.cmn.dhd", FT_BOOLEAN, 16,
TFS(&tfs_fc_fcels_cmn_dhd), 0x0004, NULL, HFILL}},
{ &hf_fcels_cmn_seqcnt,
- {"SEQCNT", "fcels.cmn.seqcnt", FT_BOOLEAN, 16,
+ {"SEQCNT", "fcels.cmn.seqcnt", FT_BOOLEAN, 16,
TFS(&tfs_fc_fcels_cmn_seqcnt), 0x0002, NULL, HFILL}},
{ &hf_fcels_cmn_payload,
- {"Payload Len", "fcels.cmn.payload", FT_BOOLEAN, 16,
+ {"Payload Len", "fcels.cmn.payload", FT_BOOLEAN, 16,
TFS(&tfs_fc_fcels_cmn_payload), 0x0001, NULL, HFILL}},
{ &hf_fcels_cls_cns,
- {"Class Supported", "fcels.cls.cns", FT_BOOLEAN, 16,
+ {"Class Supported", "fcels.cls.cns", FT_BOOLEAN, 16,
TFS(&tfs_fc_fcels_cls_cns), 0x8000, NULL, HFILL}},
{ &hf_fcels_cls_sdr,
- {"Delivery Mode", "fcels.cls.sdr", FT_BOOLEAN, 16,
+ {"Delivery Mode", "fcels.cls.sdr", FT_BOOLEAN, 16,
TFS(&tfs_fc_fcels_cls_sdr), 0x0800, NULL, HFILL}},
{ &hf_fcels_cls_prio,
- {"Priority", "fcels.cls.prio", FT_BOOLEAN, 16,
+ {"Priority", "fcels.cls.prio", FT_BOOLEAN, 16,
TFS(&tfs_fc_fcels_cls_prio), 0x0080, NULL, HFILL}},
{ &hf_fcels_cls_nzctl,
- {"Non-zero CS_CTL", "fcels.cls.nzctl", FT_BOOLEAN, 16,
+ {"Non-zero CS_CTL", "fcels.cls.nzctl", FT_BOOLEAN, 16,
TFS(&tfs_fc_fcels_cls_nzctl), 0x0040, NULL, HFILL}},
{ &hf_fcels_initctl,
{"Initiator Ctl", "fcels.logi.initctl", FT_UINT16, BASE_HEX,
@@ -2548,13 +2546,13 @@ proto_register_fcels (void)
{"Clock Sync", "fcels.logi.initctl.sync", FT_BOOLEAN, 16,
TFS(&tfs_fc_fcels_initctl_sync), 0x0010, NULL, HFILL}},
{ &hf_fcels_rcptctl,
- {"Recipient Ctl", "fcels.logi.rcptctl", FT_UINT16, BASE_HEX,
+ {"Recipient Ctl", "fcels.logi.rcptctl", FT_UINT16, BASE_HEX,
NULL, 0x0, NULL, HFILL}},
{ &hf_fcels_rcptctl_ack0,
- {"ACK0", "fcels.logi.rcptctl.ack", FT_BOOLEAN, 16,
+ {"ACK0", "fcels.logi.rcptctl.ack", FT_BOOLEAN, 16,
TFS(&tfs_fc_fcels_rcptctl_ack0), 0x8000, NULL, HFILL}},
{ &hf_fcels_rcptctl_interlock,
- {"X_ID Interlock", "fcels.logi.rcptctl.interlock", FT_BOOLEAN, 16,
+ {"X_ID Interlock", "fcels.logi.rcptctl.interlock", FT_BOOLEAN, 16,
TFS(&tfs_fc_fcels_rcptctl_interlock), 0x2000, NULL, HFILL}},
{ &hf_fcels_rcptctl_policy,
{"Policy", "fcels.logi.rcptctl.policy", FT_UINT16, BASE_HEX,
@@ -2669,19 +2667,17 @@ proto_register_fcels (void)
&ett_fcels_srl,
&ett_fcels_rpsc,
&ett_fcels_cbind,
- &ett_fcels_cmnfeatures,
- &ett_fcels_clsflags,
- &ett_fcels_initctl,
- &ett_fcels_rcptctl,
- &ett_fcels_fcpflags,
- &ett_fcels_prliloflags,
- &ett_fcels_speedflags,
+ &ett_fcels_cmnfeatures,
+ &ett_fcels_clsflags,
+ &ett_fcels_initctl,
+ &ett_fcels_rcptctl,
+ &ett_fcels_fcpflags,
+ &ett_fcels_prliloflags,
+ &ett_fcels_speedflags,
};
- /* Register the protocol name and description */
proto_fcels = proto_register_protocol("FC Extended Link Svc", "FC ELS", "fcels");
- /* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_fcels, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
register_init_routine (&fcels_init_protocol);
diff --git a/epan/dissectors/packet-fcfcs.c b/epan/dissectors/packet-fcfcs.c
index da705466c3..b92fc72f90 100644
--- a/epan/dissectors/packet-fcfcs.c
+++ b/epan/dissectors/packet-fcfcs.c
@@ -7,17 +7,17 @@
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -98,7 +98,7 @@ typedef struct _fcfcs_conv_data {
guint32 opcode;
} fcfcs_conv_data_t;
-GHashTable *fcfcs_req_hash = NULL;
+static GHashTable *fcfcs_req_hash = NULL;
static dissector_handle_t data_handle;
@@ -117,12 +117,12 @@ fcfcs_equal(gconstpointer v, gconstpointer w)
static guint
fcfcs_hash (gconstpointer v)
{
- const fcfcs_conv_key_t *key = v;
- guint val;
+ const fcfcs_conv_key_t *key = v;
+ guint val;
- val = key->conv_idx;
+ val = key->conv_idx;
- return val;
+ return val;
}
/*
@@ -131,10 +131,10 @@ fcfcs_hash (gconstpointer v)
static void
fcfcs_init_protocol(void)
{
- if (fcfcs_req_hash)
- g_hash_table_destroy (fcfcs_req_hash);
+ if (fcfcs_req_hash)
+ g_hash_table_destroy (fcfcs_req_hash);
- fcfcs_req_hash = g_hash_table_new(fcfcs_hash, fcfcs_equal);
+ fcfcs_req_hash = g_hash_table_new(fcfcs_hash, fcfcs_equal);
}
/* Code to actually dissect the packets */
@@ -143,7 +143,7 @@ dissect_fcfcs_giel (tvbuff_t *tvb, proto_tree *tree, gboolean isreq)
{
int offset = 16; /* past the ct header */
int numelem, i;
-
+
if (!isreq && tree) {
numelem = tvb_get_ntohl (tvb, offset);
@@ -259,7 +259,7 @@ dissect_fcfcs_gmal (tvbuff_t *tvb, proto_tree *tree, gboolean isreq)
numelem = tvb_get_ntohl (tvb, offset);
proto_tree_add_text (tree, tvb, offset, 4,
"Number of Mgmt. Addresses: 0x%d", numelem);
-
+
offset += 4;
for (i = 0; i < numelem; i++) {
proto_tree_add_text (tree, tvb, offset, 1, "Name Length: %d",
@@ -779,13 +779,13 @@ dissect_fcfcs_rjt (tvbuff_t *tvb, proto_tree *tree)
0);
proto_tree_add_item (tree, hf_fcs_vendor, tvb, offset+15, 1, 0);
}
-
+
}
static void
dissect_fcfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
-
+
/* Set up structures needed to add the protocol subtree and manage it */
int offset = 0;
proto_item *ti;
@@ -800,7 +800,7 @@ dissect_fcfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Make entries in Protocol column and Info column on summary display */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "FC-FCS");
-
+
if (tree) {
ti = proto_tree_add_protocol_format (tree, proto_fcfcs, tvb, 0,
tvb_reported_length (tvb),
@@ -824,25 +824,25 @@ dissect_fcfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pinfo->ptype, pinfo->oxid,
pinfo->rxid, NO_PORT2);
}
-
+
ckey.conv_idx = conversation->index;
-
+
cdata = (fcfcs_conv_data_t *)g_hash_table_lookup (fcfcs_req_hash,
&ckey);
if (cdata) {
/* Since we never free the memory used by an exchange, this maybe a
* case of another request using the same exchange as a previous
- * req.
+ * req.
*/
cdata->opcode = opcode;
}
else {
req_key = se_alloc (sizeof(fcfcs_conv_key_t));
req_key->conv_idx = conversation->index;
-
+
cdata = se_alloc (sizeof(fcfcs_conv_data_t));
cdata->opcode = opcode;
-
+
g_hash_table_insert (fcfcs_req_hash, req_key, cdata);
}
if (check_col (pinfo->cinfo, COL_INFO)) {
@@ -881,7 +881,7 @@ dissect_fcfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else
failed_opcode = cdata->opcode;
}
-
+
if (check_col (pinfo->cinfo, COL_INFO)) {
if (opcode != FCCT_MSG_RJT) {
col_add_fstr (pinfo->cinfo, COL_INFO, "MSG_ACC (%s)",
@@ -895,7 +895,7 @@ dissect_fcfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
"0x%x"));
}
}
-
+
if (tree) {
if ((cdata == NULL) && (opcode != FCCT_MSG_RJT)) {
/* No record of what this accept is for. Can't decode */
@@ -907,7 +907,7 @@ dissect_fcfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
-
+
if (tree) {
proto_tree_add_item (fcfcs_tree, hf_fcs_opcode, tvb, offset+8, 2, 0);
proto_tree_add_item (fcfcs_tree, hf_fcs_maxres_size, tvb, offset+10,
@@ -1007,15 +1007,10 @@ dissect_fcfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Register the protocol with Wireshark */
-/* this format is require because a script is used to build the C function
- that calls all the protocol registration.
-*/
-
void
proto_register_fcfcs (void)
-{
+{
-/* Setup list of header fields See Section 1.6.1 for details*/
static hf_register_info hf[] = {
{ &hf_fcs_opcode,
{"Opcode", "fcs.opcode", FT_UINT16, BASE_HEX,
@@ -1112,32 +1107,25 @@ proto_register_fcfcs (void)
NULL, HFILL}},
};
- /* Setup protocol subtree array */
static gint *ett[] = {
&ett_fcfcs,
};
- /* Register the protocol name and description */
proto_fcfcs = proto_register_protocol("FC Fabric Configuration Server",
"FC-FCS", "fcs");
- /* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_fcfcs, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
register_init_routine (&fcfcs_init_protocol);
}
-/* If this dissector uses sub-dissector registration add a registration routine.
- This format is required because a script is used to find these routines and
- create the code that calls these routines.
-*/
void
proto_reg_handoff_fcfcs (void)
{
dissector_handle_t fcs_handle;
fcs_handle = create_dissector_handle (dissect_fcfcs, proto_fcfcs);
-
+
dissector_add("fcct.server", FCCT_GSRVR_FCS, fcs_handle);
data_handle = find_dissector ("data");
diff --git a/epan/dissectors/packet-fcfzs.c b/epan/dissectors/packet-fcfzs.c
index 12aa0cbcc3..d2e650f2f7 100644
--- a/epan/dissectors/packet-fcfzs.c
+++ b/epan/dissectors/packet-fcfzs.c
@@ -97,7 +97,7 @@ typedef struct _fcfzs_conv_data {
guint32 opcode;
} fcfzs_conv_data_t;
-GHashTable *fcfzs_req_hash = NULL;
+static GHashTable *fcfzs_req_hash = NULL;
static dissector_handle_t data_handle;
@@ -107,21 +107,21 @@ static dissector_handle_t data_handle;
static gint
fcfzs_equal(gconstpointer v, gconstpointer w)
{
- const fcfzs_conv_key_t *v1 = v;
- const fcfzs_conv_key_t *v2 = w;
+ const fcfzs_conv_key_t *v1 = v;
+ const fcfzs_conv_key_t *v2 = w;
- return (v1->conv_idx == v2->conv_idx);
+ return (v1->conv_idx == v2->conv_idx);
}
static guint
fcfzs_hash (gconstpointer v)
{
- const fcfzs_conv_key_t *key = v;
- guint val;
+ const fcfzs_conv_key_t *key = v;
+ guint val;
- val = key->conv_idx;
+ val = key->conv_idx;
- return val;
+ return val;
}
/*
@@ -130,10 +130,10 @@ fcfzs_hash (gconstpointer v)
static void
fcfzs_init_protocol(void)
{
- if (fcfzs_req_hash)
- g_hash_table_destroy (fcfzs_req_hash);
+ if (fcfzs_req_hash)
+ g_hash_table_destroy (fcfzs_req_hash);
- fcfzs_req_hash = g_hash_table_new (fcfzs_hash, fcfzs_equal);
+ fcfzs_req_hash = g_hash_table_new (fcfzs_hash, fcfzs_equal);
}
/* Code to actually dissect the packets */
@@ -247,94 +247,94 @@ dissect_fcfzs_zoneset (tvbuff_t *tvb, proto_tree *tree, int offset)
}
static const true_false_string tfs_fc_fcfzs_gzc_flags_hard_zones = {
- "Hard Zones Supported",
- "Hard zones NOT supported"
+ "Hard Zones Supported",
+ "Hard zones NOT supported"
};
static const true_false_string tfs_fc_fcfzs_gzc_flags_soft_zones = {
- "Soft Zones Supported",
- "Soft zones NOT supported"
+ "Soft Zones Supported",
+ "Soft zones NOT supported"
};
static const true_false_string tfs_fc_fcfzs_gzc_flags_zoneset_db = {
- "Zone Set Database is Available",
- "Zone set database is NOT available"
+ "Zone Set Database is Available",
+ "Zone set database is NOT available"
};
static void
dissect_fcfzs_gzc (tvbuff_t *tvb, int offset, proto_tree *parent_tree, guint8 isreq)
{
- if (!isreq) {
- guint8 flags;
- proto_item *item=NULL;
- proto_tree *tree=NULL;
-
- flags = tvb_get_guint8 (tvb, offset);
- if(parent_tree){
- item=proto_tree_add_uint(parent_tree, hf_fcfzs_gzc_flags, tvb, offset, 1, flags);
- tree=proto_item_add_subtree(item, ett_fcfzs_gzc_flags);
- }
-
- proto_tree_add_boolean(tree, hf_fcfzs_gzc_flags_hard_zones, tvb, offset, 1, flags);
- if (flags&0x80){
- proto_item_append_text(item, " Hard Zones");
- }
- flags&=(~( 0x80 ));
-
- proto_tree_add_boolean(tree, hf_fcfzs_gzc_flags_soft_zones, tvb, offset, 1, flags);
- if (flags&0x40){
- proto_item_append_text(item, " Soft Zones");
- }
- flags&=(~( 0x40 ));
-
- proto_tree_add_boolean(tree, hf_fcfzs_gzc_flags_zoneset_db, tvb, offset, 1, flags);
- if (flags&0x01){
- proto_item_append_text(item, " ZoneSet Database Available");
- }
- flags&=(~( 0x01 ));
-
- proto_tree_add_item (tree, hf_fcfzs_gzc_vendor, tvb, offset+4, 4, 0);
- }
+ if (!isreq) {
+ guint8 flags;
+ proto_item *item=NULL;
+ proto_tree *tree=NULL;
+
+ flags = tvb_get_guint8 (tvb, offset);
+ if(parent_tree){
+ item=proto_tree_add_uint(parent_tree, hf_fcfzs_gzc_flags, tvb, offset, 1, flags);
+ tree=proto_item_add_subtree(item, ett_fcfzs_gzc_flags);
+ }
+
+ proto_tree_add_boolean(tree, hf_fcfzs_gzc_flags_hard_zones, tvb, offset, 1, flags);
+ if (flags&0x80){
+ proto_item_append_text(item, " Hard Zones");
+ }
+ flags&=(~( 0x80 ));
+
+ proto_tree_add_boolean(tree, hf_fcfzs_gzc_flags_soft_zones, tvb, offset, 1, flags);
+ if (flags&0x40){
+ proto_item_append_text(item, " Soft Zones");
+ }
+ flags&=(~( 0x40 ));
+
+ proto_tree_add_boolean(tree, hf_fcfzs_gzc_flags_zoneset_db, tvb, offset, 1, flags);
+ if (flags&0x01){
+ proto_item_append_text(item, " ZoneSet Database Available");
+ }
+ flags&=(~( 0x01 ));
+
+ proto_tree_add_item (tree, hf_fcfzs_gzc_vendor, tvb, offset+4, 4, 0);
+ }
}
static const true_false_string tfs_fc_fcfzs_soft_zone_set_enforced = {
- "Soft Zone Set is ENFORCED",
- "Soft zone set is NOT enforced"
+ "Soft Zone Set is ENFORCED",
+ "Soft zone set is NOT enforced"
};
static const true_false_string tfs_fc_fcfzs_hard_zone_set_enforced = {
- "Hard Zone Set is ENFORCED",
- "Hard zone set is NOT enforced"
+ "Hard Zone Set is ENFORCED",
+ "Hard zone set is NOT enforced"
};
static void
dissect_fcfzs_gest (tvbuff_t *tvb, proto_tree *parent_tree, guint8 isreq)
{
- int offset = 16; /* past the fc_ct header */
-
- if (!isreq) {
- guint8 flags;
- proto_item *item=NULL;
- proto_tree *tree=NULL;
-
- flags = tvb_get_guint8 (tvb, offset);
- if(parent_tree){
- item=proto_tree_add_uint(parent_tree, hf_fcfzs_zone_state, tvb, offset, 1, flags);
- tree=proto_item_add_subtree(item, ett_fcfzs_zone_state);
- }
-
- proto_tree_add_boolean(tree, hf_fcfzs_soft_zone_set_enforced, tvb, offset, 1, flags);
- if (flags&0x80){
- proto_item_append_text(item, " Soft Zone Set Enforced");
- }
- flags&=(~( 0x80 ));
-
- proto_tree_add_boolean(tree, hf_fcfzs_hard_zone_set_enforced, tvb, offset, 1, flags);
- if (flags&0x40){
- proto_item_append_text(item, " Hard Zone Set Enforced");
- }
- flags&=(~( 0x40 ));
-
-
- proto_tree_add_item (parent_tree, hf_fcfzs_gest_vendor, tvb, offset+4, 4, 0);
- }
+ int offset = 16; /* past the fc_ct header */
+
+ if (!isreq) {
+ guint8 flags;
+ proto_item *item=NULL;
+ proto_tree *tree=NULL;
+
+ flags = tvb_get_guint8 (tvb, offset);
+ if(parent_tree){
+ item=proto_tree_add_uint(parent_tree, hf_fcfzs_zone_state, tvb, offset, 1, flags);
+ tree=proto_item_add_subtree(item, ett_fcfzs_zone_state);
+ }
+
+ proto_tree_add_boolean(tree, hf_fcfzs_soft_zone_set_enforced, tvb, offset, 1, flags);
+ if (flags&0x80){
+ proto_item_append_text(item, " Soft Zone Set Enforced");
+ }
+ flags&=(~( 0x80 ));
+
+ proto_tree_add_boolean(tree, hf_fcfzs_hard_zone_set_enforced, tvb, offset, 1, flags);
+ if (flags&0x40){
+ proto_item_append_text(item, " Hard Zone Set Enforced");
+ }
+ flags&=(~( 0x40 ));
+
+
+ proto_tree_add_item (parent_tree, hf_fcfzs_gest_vendor, tvb, offset+4, 4, 0);
+ }
}
static void
@@ -819,15 +819,10 @@ dissect_fcfzs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Register the protocol with Wireshark */
-/* this format is require because a script is used to build the C function
- that calls all the protocol registration.
-*/
-
void
proto_register_fcfzs(void)
{
-/* Setup list of header fields See Section 1.6.1 for details*/
static hf_register_info hf[] = {
{ &hf_fcfzs_opcode,
{"Opcode", "fcfzs.opcode", FT_UINT16, BASE_HEX,
@@ -912,27 +907,20 @@ proto_register_fcfzs(void)
TFS(&tfs_fc_fcfzs_hard_zone_set_enforced), 0x40, NULL, HFILL}},
};
- /* Setup protocol subtree array */
static gint *ett[] = {
&ett_fcfzs,
&ett_fcfzs_gzc_flags,
&ett_fcfzs_zone_state,
};
- /* Register the protocol name and description */
proto_fcfzs = proto_register_protocol("Fibre Channel Fabric Zone Server", "FC FZS", "fcfzs");
- /* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_fcfzs, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
register_init_routine (&fcfzs_init_protocol);
}
-/* If this dissector uses sub-dissector registration add a registration routine.
- This format is required because a script is used to find these routines and
- create the code that calls these routines.
-*/
void
proto_reg_handoff_fcfzs (void)
{
diff --git a/epan/dissectors/packet-fcswils.c b/epan/dissectors/packet-fcswils.c
index 1494576140..7ea2c0fa54 100644
--- a/epan/dissectors/packet-fcswils.c
+++ b/epan/dissectors/packet-fcswils.c
@@ -63,132 +63,132 @@
#define ZONENAME_LEN(x, y) (tvb_get_guint8(x, y)+4)
/* Initialize the protocol and registered fields */
-static int proto_fcswils = -1;
-static int hf_swils_opcode = -1;
-static int hf_swils_elp_rev = -1;
-static int hf_swils_elp_flags = -1;
-static int hf_swils_elp_r_a_tov = -1;
-static int hf_swils_elp_e_d_tov = -1;
-static int hf_swils_elp_req_epn = -1;
-static int hf_swils_elp_req_esn = -1;
-static int hf_swils_elp_clsf_svcp = -1;
-static int hf_swils_elp_clsf_rcvsz = -1;
-static int hf_swils_elp_clsf_conseq = -1;
-static int hf_swils_elp_clsf_e2e = -1;
-static int hf_swils_elp_clsf_openseq = -1;
-static int hf_swils_elp_cls1_svcp = -1;
-static int hf_swils_elp_cls1_rcvsz = -1;
-static int hf_swils_elp_cls2_svcp = -1;
-static int hf_swils_elp_cls2_rcvsz = -1;
-static int hf_swils_elp_cls3_svcp = -1;
-static int hf_swils_elp_cls3_rcvsz = -1;
-static int hf_swils_elp_isl_fc_mode = -1;
-static int hf_swils_elp_fcplen = -1;
-static int hf_swils_elp_b2bcredit = -1;
-static int hf_swils_elp_compat1 = -1;
-static int hf_swils_elp_compat2 = -1;
-static int hf_swils_elp_compat3 = -1;
-static int hf_swils_elp_compat4 = -1;
-static int hf_swils_efp_rec_type = -1;
-static int hf_swils_efp_dom_id = -1;
-static int hf_swils_efp_switch_name = -1;
-static int hf_swils_efp_mcast_grpno = -1;
-static int hf_swils_efp_alias_token = -1;
-static int hf_swils_efp_record_len = -1;
-static int hf_swils_efp_payload_len = -1;
-static int hf_swils_efp_pswitch_pri = -1;
-static int hf_swils_efp_pswitch_name = -1;
-static int hf_swils_dia_switch_name = -1;
-static int hf_swils_rdi_payload_len = -1;
-static int hf_swils_rdi_req_sname = -1;
-static int hf_swils_fspfh_cmd = -1;
-static int hf_swils_fspfh_rev = -1;
-static int hf_swils_fspfh_ar_num = -1;
-static int hf_swils_fspfh_auth_type = -1;
-static int hf_swils_fspfh_dom_id = -1;
-static int hf_swils_fspfh_auth = -1;
-static int hf_swils_hlo_options = -1;
-static int hf_swils_hlo_hloint = -1;
-static int hf_swils_hlo_deadint = -1;
-static int hf_swils_hlo_rcv_domid = -1;
-static int hf_swils_hlo_orig_pidx = -1;
-static int hf_swils_ldrec_linkid = -1;
-static int hf_swils_ldrec_out_pidx = -1;
-static int hf_swils_ldrec_nbr_pidx = -1;
-static int hf_swils_ldrec_link_type = -1;
-static int hf_swils_ldrec_link_cost = -1;
-static int hf_swils_lsrh_lsr_type = -1;
-static int hf_swils_lsrh_lsid = -1;
-static int hf_swils_lsrh_adv_domid = -1;
-static int hf_swils_lsrh_ls_incid = -1;
-static int hf_swils_esc_pdesc_vendorid = -1;
-static int hf_swils_esc_swvendorid = -1;
-static int hf_swils_esc_protocolid = -1;
-static int hf_swils_rscn_evtype = -1;
-static int hf_swils_rscn_addrfmt = -1;
-static int hf_swils_rscn_detectfn = -1;
-static int hf_swils_rscn_affectedport = -1;
-static int hf_swils_rscn_portstate = -1;
-static int hf_swils_rscn_portid = -1;
-static int hf_swils_rscn_pwwn = -1;
-static int hf_swils_rscn_nwwn = -1;
-static int hf_swils_zone_activezonenm = -1;
-static int hf_swils_zone_objname = -1;
-static int hf_swils_zone_objtype = -1;
-static int hf_swils_zone_mbrtype = -1;
-static int hf_swils_zone_protocol = -1;
-static int hf_swils_zone_mbrid = -1;
-static int hf_swils_zone_status = -1;
-static int hf_swils_zone_reason = -1;
-static int hf_swils_aca_domainid = -1;
-static int hf_swils_sfc_opcode = -1;
-static int hf_swils_sfc_zonenm = -1;
-static int hf_swils_rjt = -1;
-static int hf_swils_rjtdet = -1;
-static int hf_swils_rjtvendor = -1;
-static int hf_swils_zone_mbrid_lun = -1;
-static int hf_swils_ess_rev = -1;
-static int hf_swils_ess_len = -1;
-static int hf_swils_ess_numobj = -1;
+static int proto_fcswils = -1;
+static int hf_swils_opcode = -1;
+static int hf_swils_elp_rev = -1;
+static int hf_swils_elp_flags = -1;
+static int hf_swils_elp_r_a_tov = -1;
+static int hf_swils_elp_e_d_tov = -1;
+static int hf_swils_elp_req_epn = -1;
+static int hf_swils_elp_req_esn = -1;
+static int hf_swils_elp_clsf_svcp = -1;
+static int hf_swils_elp_clsf_rcvsz = -1;
+static int hf_swils_elp_clsf_conseq = -1;
+static int hf_swils_elp_clsf_e2e = -1;
+static int hf_swils_elp_clsf_openseq = -1;
+static int hf_swils_elp_cls1_svcp = -1;
+static int hf_swils_elp_cls1_rcvsz = -1;
+static int hf_swils_elp_cls2_svcp = -1;
+static int hf_swils_elp_cls2_rcvsz = -1;
+static int hf_swils_elp_cls3_svcp = -1;
+static int hf_swils_elp_cls3_rcvsz = -1;
+static int hf_swils_elp_isl_fc_mode = -1;
+static int hf_swils_elp_fcplen = -1;
+static int hf_swils_elp_b2bcredit = -1;
+static int hf_swils_elp_compat1 = -1;
+static int hf_swils_elp_compat2 = -1;
+static int hf_swils_elp_compat3 = -1;
+static int hf_swils_elp_compat4 = -1;
+static int hf_swils_efp_rec_type = -1;
+static int hf_swils_efp_dom_id = -1;
+static int hf_swils_efp_switch_name = -1;
+static int hf_swils_efp_mcast_grpno = -1;
+static int hf_swils_efp_alias_token = -1;
+static int hf_swils_efp_record_len = -1;
+static int hf_swils_efp_payload_len = -1;
+static int hf_swils_efp_pswitch_pri = -1;
+static int hf_swils_efp_pswitch_name = -1;
+static int hf_swils_dia_switch_name = -1;
+static int hf_swils_rdi_payload_len = -1;
+static int hf_swils_rdi_req_sname = -1;
+static int hf_swils_fspfh_cmd = -1;
+static int hf_swils_fspfh_rev = -1;
+static int hf_swils_fspfh_ar_num = -1;
+static int hf_swils_fspfh_auth_type = -1;
+static int hf_swils_fspfh_dom_id = -1;
+static int hf_swils_fspfh_auth = -1;
+static int hf_swils_hlo_options = -1;
+static int hf_swils_hlo_hloint = -1;
+static int hf_swils_hlo_deadint = -1;
+static int hf_swils_hlo_rcv_domid = -1;
+static int hf_swils_hlo_orig_pidx = -1;
+static int hf_swils_ldrec_linkid = -1;
+static int hf_swils_ldrec_out_pidx = -1;
+static int hf_swils_ldrec_nbr_pidx = -1;
+static int hf_swils_ldrec_link_type = -1;
+static int hf_swils_ldrec_link_cost = -1;
+static int hf_swils_lsrh_lsr_type = -1;
+static int hf_swils_lsrh_lsid = -1;
+static int hf_swils_lsrh_adv_domid = -1;
+static int hf_swils_lsrh_ls_incid = -1;
+static int hf_swils_esc_pdesc_vendorid = -1;
+static int hf_swils_esc_swvendorid = -1;
+static int hf_swils_esc_protocolid = -1;
+static int hf_swils_rscn_evtype = -1;
+static int hf_swils_rscn_addrfmt = -1;
+static int hf_swils_rscn_detectfn = -1;
+static int hf_swils_rscn_affectedport = -1;
+static int hf_swils_rscn_portstate = -1;
+static int hf_swils_rscn_portid = -1;
+static int hf_swils_rscn_pwwn = -1;
+static int hf_swils_rscn_nwwn = -1;
+static int hf_swils_zone_activezonenm = -1;
+static int hf_swils_zone_objname = -1;
+static int hf_swils_zone_objtype = -1;
+static int hf_swils_zone_mbrtype = -1;
+static int hf_swils_zone_protocol = -1;
+static int hf_swils_zone_mbrid = -1;
+static int hf_swils_zone_status = -1;
+static int hf_swils_zone_reason = -1;
+static int hf_swils_aca_domainid = -1;
+static int hf_swils_sfc_opcode = -1;
+static int hf_swils_sfc_zonenm = -1;
+static int hf_swils_rjt = -1;
+static int hf_swils_rjtdet = -1;
+static int hf_swils_rjtvendor = -1;
+static int hf_swils_zone_mbrid_lun = -1;
+static int hf_swils_ess_rev = -1;
+static int hf_swils_ess_len = -1;
+static int hf_swils_ess_numobj = -1;
static int hf_swils_interconnect_list_len = -1;
-static int hf_swils_ess_vendorname = -1;
-static int hf_swils_ess_modelname = -1;
-static int hf_swils_ess_relcode = -1;
-static int hf_swils_ess_vendorspecific = -1;
-static int hf_swils_ess_cap_type = -1;
-static int hf_swils_ess_cap_subtype = -1;
-static int hf_swils_ess_cap_numentries = -1;
-static int hf_swils_ess_cap_svc = -1;
-static int hf_swils_ess_dns_obj0h = -1;
-static int hf_swils_ess_dns_obj1h = -1;
-static int hf_swils_ess_dns_obj2h = -1;
-static int hf_swils_ess_dns_obj3h = -1;
-static int hf_swils_ess_dns_zlacc = -1;
-static int hf_swils_ess_dns_vendor = -1;
-static int hf_swils_ess_fctlr_rscn = -1;
-static int hf_swils_ess_fctlr_vendor = -1;
-static int hf_swils_ess_fcs_basic = -1;
-static int hf_swils_ess_fcs_platform = -1;
-static int hf_swils_ess_fcs_topology = -1;
-static int hf_swils_ess_fcs_enhanced = -1;
-static int hf_swils_ess_fzs_enh_supp = -1;
-static int hf_swils_ess_fzs_enh_ena = -1;
-static int hf_swils_ess_fzs_mr = -1;
-static int hf_swils_ess_fzs_zsdb_supp = -1;
-static int hf_swils_ess_fzs_zsdb_ena = -1;
-static int hf_swils_ess_fzs_adc_supp = -1;
-static int hf_swils_ess_fzs_hardzone = -1;
-static int hf_swils_mrra_rev = -1;
-static int hf_swils_mrra_size = -1;
-static int hf_swils_mrra_vendorid = -1;
-static int hf_swils_mrra_reply = -1;
-static int hf_swils_mrra_reply_size = -1;
-static int hf_swils_mrra_waittime = -1;
-static int hf_swils_ess_cap_t10 = -1;
-static int hf_swils_ess_cap_vendorobj = -1;
-static int hf_swils_ess_fzs_defzone = -1;
-static int hf_swils_ess_cap_len = -1;
-static int hf_swils_mrra_vendorinfo = -1;
+static int hf_swils_ess_vendorname = -1;
+static int hf_swils_ess_modelname = -1;
+static int hf_swils_ess_relcode = -1;
+static int hf_swils_ess_vendorspecific = -1;
+static int hf_swils_ess_cap_type = -1;
+static int hf_swils_ess_cap_subtype = -1;
+static int hf_swils_ess_cap_numentries = -1;
+static int hf_swils_ess_cap_svc = -1;
+static int hf_swils_ess_dns_obj0h = -1;
+static int hf_swils_ess_dns_obj1h = -1;
+static int hf_swils_ess_dns_obj2h = -1;
+static int hf_swils_ess_dns_obj3h = -1;
+static int hf_swils_ess_dns_zlacc = -1;
+static int hf_swils_ess_dns_vendor = -1;
+static int hf_swils_ess_fctlr_rscn = -1;
+static int hf_swils_ess_fctlr_vendor = -1;
+static int hf_swils_ess_fcs_basic = -1;
+static int hf_swils_ess_fcs_platform = -1;
+static int hf_swils_ess_fcs_topology = -1;
+static int hf_swils_ess_fcs_enhanced = -1;
+static int hf_swils_ess_fzs_enh_supp = -1;
+static int hf_swils_ess_fzs_enh_ena = -1;
+static int hf_swils_ess_fzs_mr = -1;
+static int hf_swils_ess_fzs_zsdb_supp = -1;
+static int hf_swils_ess_fzs_zsdb_ena = -1;
+static int hf_swils_ess_fzs_adc_supp = -1;
+static int hf_swils_ess_fzs_hardzone = -1;
+static int hf_swils_mrra_rev = -1;
+static int hf_swils_mrra_size = -1;
+static int hf_swils_mrra_vendorid = -1;
+static int hf_swils_mrra_reply = -1;
+static int hf_swils_mrra_reply_size = -1;
+static int hf_swils_mrra_waittime = -1;
+static int hf_swils_ess_cap_t10 = -1;
+static int hf_swils_ess_cap_vendorobj = -1;
+static int hf_swils_ess_fzs_defzone = -1;
+static int hf_swils_ess_cap_len = -1;
+static int hf_swils_mrra_vendorinfo = -1;
/* Initialize the subtree pointers */
@@ -428,7 +428,7 @@ typedef struct _fcswils_conv_data {
guint32 opcode;
} fcswils_conv_data_t;
-GHashTable *fcswils_req_hash = NULL;
+static GHashTable *fcswils_req_hash = NULL;
/* list of commands for each commandset */
typedef void (*fcswils_dissector_t)(tvbuff_t *tvb, proto_tree *tree, guint8 isreq);
@@ -1919,14 +1919,9 @@ dissect_fcswils (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Register the protocol with Wireshark */
-/* this format is require because a script is used to build the C function
- that calls all the protocol registration.
-*/
-
void
proto_register_fcswils (void)
{
-/* Setup list of header fields See Section 1.6.1 for details*/
static hf_register_info hf[] = {
{ &hf_swils_opcode,
{"Cmd Code", "swils.opcode",
@@ -2152,11 +2147,11 @@ proto_register_fcswils (void)
FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}},
{ &hf_swils_zone_status,
{"Zone Command Status", "swils.zone.status",
- FT_UINT8, BASE_HEX, VALS (fc_swils_mr_rsp_val), 0x0,
+ FT_UINT8, BASE_HEX, VALS (fc_swils_mr_rsp_val), 0x0,
"Applies to MR, ACA, RCA, SFC, UFC", HFILL}},
{ &hf_swils_zone_reason,
{"Zone Command Reason Code", "swils.zone.reason",
- FT_UINT8, BASE_HEX, VALS (fc_swils_mr_reason_val), 0x0,
+ FT_UINT8, BASE_HEX, VALS (fc_swils_mr_reason_val), 0x0,
"Applies to MR, ACA, RCA, SFC, UFC", HFILL}},
{ &hf_swils_aca_domainid,
{"Known Domain ID", "swils.aca.domainid",
@@ -2307,7 +2302,6 @@ proto_register_fcswils (void)
FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}},
};
- /* Setup protocol subtree array */
static gint *ett[] = {
&ett_fcswils,
&ett_fcswils_swacc,
@@ -2343,19 +2337,13 @@ proto_register_fcswils (void)
&ett_fcswils_capinfo
};
- /* Register the protocol name and description */
proto_fcswils = proto_register_protocol("Fibre Channel SW_ILS", "FC-SWILS", "swils");
- /* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_fcswils, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
register_init_routine(&fcswils_init_protocol);
}
-/* If this dissector uses sub-dissector registration add a registration routine.
- This format is required because a script is used to find these routines and
- create the code that calls these routines.
-*/
void
proto_reg_handoff_fcswils (void)
{
diff --git a/epan/dissectors/packet-gopher.c b/epan/dissectors/packet-gopher.c
index 26403259ec..ee889a495d 100644
--- a/epan/dissectors/packet-gopher.c
+++ b/epan/dissectors/packet-gopher.c
@@ -56,28 +56,28 @@ static int hf_gopher_unknown = -1;
static gint ett_gopher = -1;
static gint ett_dir_item = -1;
-dissector_handle_t gopher_handle;
+static dissector_handle_t gopher_handle;
/* RFC 1436 section 3.8 */
static const value_string item_types[] = {
- { '+', "Redundant server" },
- { '0', "Text file" },
- { '1', "Menu" },
- { '2', "CSO phone book entity" },
- { '3', "Error" },
- { '4', "BinHexed Macintosh file" },
- { '5', "DOS binary file" },
- { '6', "Uuencoded file" },
- { '7', "Index server" },
- { '8', "Telnet session" },
- { '9', "Binary file" },
- { 'g', "GIF file" },
- { 'h', "HTML file" }, /* Not in RFC 1436 */
- { 'i', "Informational message"}, /* Not in RFC 1436 */
- { 'I', "Image file" },
- { 's', "Audio file" }, /* Not in RFC 1436 */
- { 'T', "Tn3270 session" },
- { 0, NULL }
+ { '+', "Redundant server" },
+ { '0', "Text file" },
+ { '1', "Menu" },
+ { '2', "CSO phone book entity" },
+ { '3', "Error" },
+ { '4', "BinHexed Macintosh file" },
+ { '5', "DOS binary file" },
+ { '6', "Uuencoded file" },
+ { '7', "Index server" },
+ { '8', "Telnet session" },
+ { '9', "Binary file" },
+ { 'g', "GIF file" },
+ { 'h', "HTML file" }, /* Not in RFC 1436 */
+ { 'i', "Informational message"}, /* Not in RFC 1436 */
+ { 'I', "Image file" },
+ { 's', "Audio file" }, /* Not in RFC 1436 */
+ { 'T', "Tn3270 session" },
+ { 0, NULL }
};
#define TCP_DEFAULT_RANGE "70"
@@ -88,10 +88,10 @@ static range_t *gopher_tcp_range = NULL;
/* Returns TRUE if the packet is from a client */
static gboolean
is_client(packet_info *pinfo) {
- if (value_is_in_range(gopher_tcp_range, pinfo->destport)) {
- return TRUE;
- }
- return FALSE;
+ if (value_is_in_range(gopher_tcp_range, pinfo->destport)) {
+ return TRUE;
+ }
+ return FALSE;
}
/* Name + Tab + Selector + Tab + Host + Tab + Port */
@@ -99,34 +99,34 @@ is_client(packet_info *pinfo) {
#define MIN_DIR_LINE_LEN (0 + 1 + 0 + 1 + 1 + 1 + 1)
static gboolean
find_dir_tokens(tvbuff_t *tvb, gint name_start, gint *sel_start, gint *host_start, gint *port_start, gint *line_len, gint *next_offset) {
- gint remain;
+ gint remain;
- if (tvb_length_remaining(tvb, name_start) < MIN_DIR_LINE_LEN)
- return FALSE;
+ if (tvb_length_remaining(tvb, name_start) < MIN_DIR_LINE_LEN)
+ return FALSE;
- if (! (sel_start && host_start && port_start && line_len && next_offset) )
- return FALSE;
+ if (! (sel_start && host_start && port_start && line_len && next_offset) )
+ return FALSE;
- *line_len = tvb_find_line_end(tvb, name_start, MAX_DIR_LINE_LEN, next_offset, FALSE);
- if (*line_len < MIN_DIR_LINE_LEN)
- return FALSE;
+ *line_len = tvb_find_line_end(tvb, name_start, MAX_DIR_LINE_LEN, next_offset, FALSE);
+ if (*line_len < MIN_DIR_LINE_LEN)
+ return FALSE;
- remain = *line_len;
- *sel_start = tvb_find_guint8(tvb, name_start, remain, '\t') + 1;
- if (*sel_start < name_start + 1)
- return FALSE;
+ remain = *line_len;
+ *sel_start = tvb_find_guint8(tvb, name_start, remain, '\t') + 1;
+ if (*sel_start < name_start + 1)
+ return FALSE;
- remain -= *sel_start - name_start;
- *host_start = tvb_find_guint8(tvb, *sel_start, remain, '\t') + 1;
- if (*host_start < *sel_start + 1)
- return FALSE;
+ remain -= *sel_start - name_start;
+ *host_start = tvb_find_guint8(tvb, *sel_start, remain, '\t') + 1;
+ if (*host_start < *sel_start + 1)
+ return FALSE;
- remain -= *host_start - *sel_start;
- *port_start = tvb_find_guint8(tvb, *host_start, remain, '\t') + 1;
- if (*port_start < *host_start + 1)
- return FALSE;
+ remain -= *host_start - *sel_start;
+ *port_start = tvb_find_guint8(tvb, *host_start, remain, '\t') + 1;
+ if (*port_start < *host_start + 1)
+ return FALSE;
- return TRUE;
+ return TRUE;
}
/* Dissect the packets */
@@ -134,71 +134,71 @@ find_dir_tokens(tvbuff_t *tvb, gint name_start, gint *sel_start, gint *host_star
static int
dissect_gopher(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
proto_item *ti;
- proto_tree *gopher_tree, *dir_tree = NULL;
- gboolean client = is_client(pinfo);
- gint line_len;
- gchar *request = "[Invalid request]";
- gboolean is_dir = FALSE;
- gint offset = 0, next_offset;
- gint sel_start, host_start, port_start;
- gchar *name;
-
+ proto_tree *gopher_tree, *dir_tree = NULL;
+ gboolean client = is_client(pinfo);
+ gint line_len;
+ gchar *request = "[Invalid request]";
+ gboolean is_dir = FALSE;
+ gint offset = 0, next_offset;
+ gint sel_start, host_start, port_start;
+ gchar *name;
+
/* Fill in our protocol and info columns */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Gopher");
- if (client) {
- line_len = tvb_find_line_end(tvb, 0, -1, NULL, FALSE);
- if (line_len == 0) {
- request = "[Directory list]";
- } else if (line_len > 0) {
- request = tvb_get_ephemeral_string(tvb, 0, line_len);
- }
- col_add_fstr(pinfo->cinfo, COL_INFO, "Request: %s", request);
- } else {
- col_add_fstr(pinfo->cinfo, COL_INFO, "Response");
- }
+ if (client) {
+ line_len = tvb_find_line_end(tvb, 0, -1, NULL, FALSE);
+ if (line_len == 0) {
+ request = "[Directory list]";
+ } else if (line_len > 0) {
+ request = tvb_get_ephemeral_string(tvb, 0, line_len);
+ }
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Request: %s", request);
+ } else {
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Response");
+ }
if (tree) {
/* Create display subtree for the protocol */
ti = proto_tree_add_item(tree, proto_gopher, tvb, 0, -1, FALSE);
- gopher_tree = proto_item_add_subtree(ti, ett_gopher);
-
- if (client) {
- proto_item_append_text(ti, " request: %s", request);
- proto_tree_add_string(gopher_tree, hf_gopher_request, tvb,
- 0, -1, request);
- } else {
- proto_item_append_text(ti, " response: ");
-
- while (find_dir_tokens(tvb, offset + 1, &sel_start, &host_start, &port_start, &line_len, &next_offset)) {
- if (!is_dir) { /* First time */
- proto_item_append_text(ti, "[Directory list]");
- col_append_fstr(pinfo->cinfo, COL_INFO, ": [Directory list]");
- }
-
- name = tvb_get_string(tvb, offset + 1, sel_start - offset - 2);
- ti = proto_tree_add_string(gopher_tree, hf_gopher_dir_item, tvb,
- offset, line_len + 1, name);
- dir_tree = proto_item_add_subtree(ti, ett_dir_item);
- proto_tree_add_item(dir_tree, hf_gopher_di_type, tvb, offset, 1, FALSE);
- proto_tree_add_item(dir_tree, hf_gopher_di_name, tvb, offset + 1,
- sel_start - offset - 2, FALSE);
- proto_tree_add_item(dir_tree, hf_gopher_di_selector, tvb, sel_start,
- host_start - sel_start - 1, FALSE);
- proto_tree_add_item(dir_tree, hf_gopher_di_host, tvb, host_start,
- port_start - host_start - 1, FALSE);
- proto_tree_add_item(dir_tree, hf_gopher_di_port, tvb, port_start,
- line_len - (port_start - offset - 1), FALSE);
- is_dir = TRUE;
- offset = next_offset;
- }
-
- if (!is_dir) {
- proto_item_append_text(ti, "[Unknown]");
- proto_tree_add_item(gopher_tree, hf_gopher_unknown, tvb, 0, -1, FALSE);
- }
- }
-
+ gopher_tree = proto_item_add_subtree(ti, ett_gopher);
+
+ if (client) {
+ proto_item_append_text(ti, " request: %s", request);
+ proto_tree_add_string(gopher_tree, hf_gopher_request, tvb,
+ 0, -1, request);
+ } else {
+ proto_item_append_text(ti, " response: ");
+
+ while (find_dir_tokens(tvb, offset + 1, &sel_start, &host_start, &port_start, &line_len, &next_offset)) {
+ if (!is_dir) { /* First time */
+ proto_item_append_text(ti, "[Directory list]");
+ col_append_fstr(pinfo->cinfo, COL_INFO, ": [Directory list]");
+ }
+
+ name = tvb_get_string(tvb, offset + 1, sel_start - offset - 2);
+ ti = proto_tree_add_string(gopher_tree, hf_gopher_dir_item, tvb,
+ offset, line_len + 1, name);
+ dir_tree = proto_item_add_subtree(ti, ett_dir_item);
+ proto_tree_add_item(dir_tree, hf_gopher_di_type, tvb, offset, 1, FALSE);
+ proto_tree_add_item(dir_tree, hf_gopher_di_name, tvb, offset + 1,
+ sel_start - offset - 2, FALSE);
+ proto_tree_add_item(dir_tree, hf_gopher_di_selector, tvb, sel_start,
+ host_start - sel_start - 1, FALSE);
+ proto_tree_add_item(dir_tree, hf_gopher_di_host, tvb, host_start,
+ port_start - host_start - 1, FALSE);
+ proto_tree_add_item(dir_tree, hf_gopher_di_port, tvb, port_start,
+ line_len - (port_start - offset - 1), FALSE);
+ is_dir = TRUE;
+ offset = next_offset;
+ }
+
+ if (!is_dir) {
+ proto_item_append_text(ti, "[Unknown]");
+ proto_tree_add_item(gopher_tree, hf_gopher_unknown, tvb, 0, -1, FALSE);
+ }
+ }
+
}
/* Return the amount of data this dissector was able to dissect */
@@ -293,18 +293,18 @@ proto_register_gopher(void)
/* Initialize dissector preferences */
gopher_module = prefs_register_protocol(proto_gopher, gopher_prefs_apply);
- range_convert_str(&global_gopher_tcp_range, TCP_DEFAULT_RANGE, 65535);
- gopher_tcp_range = range_empty();
- prefs_register_range_preference(gopher_module, "tcp.port", "TCP Ports",
- "TCP Ports range",
- &global_gopher_tcp_range, 65535);
+ range_convert_str(&global_gopher_tcp_range, TCP_DEFAULT_RANGE, 65535);
+ gopher_tcp_range = range_empty();
+ prefs_register_range_preference(gopher_module, "tcp.port", "TCP Ports",
+ "TCP Ports range",
+ &global_gopher_tcp_range, 65535);
}
void
proto_reg_handoff_gopher(void)
{
gopher_handle = new_create_dissector_handle(dissect_gopher, proto_gopher);
- gopher_prefs_apply();
+ gopher_prefs_apply();
}
/*
@@ -312,12 +312,12 @@ proto_reg_handoff_gopher(void)
*
* Local variables:
* c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: t
+ * tab-width: 8
+ * indent-tabs-mode: nil
* End:
*
- * vi: set shiftwidth=4 tabstop=4 noexpandtab
- * :indentSize=4:tabSize=4:noTabs=false:
+ * vi: set shiftwidth=4 tabstop=8 expandtab
+ * :indentSize=4:tabSize=8:noTabs=true:
*/