summaryrefslogtreecommitdiff
path: root/plugins/opcua
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2014-10-05 21:34:19 -0400
committerBill Meier <wmeier@newsguy.com>2014-10-06 01:42:32 +0000
commit0111e461938d47efd1eb8dc17f135b93b253ab52 (patch)
tree9409d7bf28086b3fd230993210264df1e884ec5b /plugins/opcua
parent9e776a1ed114bb3982c061b41389143cb67b94de (diff)
downloadwireshark-0111e461938d47efd1eb8dc17f135b93b253ab52.tar.gz
plugins: Add editor modelines; Adjust whitespace as needed.
Change-Id: I36124f6021d46a228721bdc976f6b9fef1c8c088 Reviewed-on: https://code.wireshark.org/review/4488 Reviewed-by: Bill Meier <wmeier@newsguy.com>
Diffstat (limited to 'plugins/opcua')
-rw-r--r--plugins/opcua/opcua.c107
-rw-r--r--plugins/opcua/opcua_application_layer.c13
-rw-r--r--plugins/opcua/opcua_security_layer.c13
-rw-r--r--plugins/opcua/opcua_simpletypes.c113
-rw-r--r--plugins/opcua/opcua_transport_layer.c12
5 files changed, 158 insertions, 100 deletions
diff --git a/plugins/opcua/opcua.c b/plugins/opcua/opcua.c
index 43a6d945c2..a61623b031 100644
--- a/plugins/opcua/opcua.c
+++ b/plugins/opcua/opcua.c
@@ -362,20 +362,20 @@ static int dissect_opcua_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
static int dissect_opcua(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, FRAME_HEADER_LEN,
- get_opcua_message_len, dissect_opcua_message, data);
- return tvb_reported_length(tvb);
+ get_opcua_message_len, dissect_opcua_message, data);
+ return tvb_reported_length(tvb);
}
static void register_tcp_port(guint32 port)
{
- if (port != 0)
- dissector_add_uint("tcp.port", port, opcua_handle);
+ if (port != 0)
+ dissector_add_uint("tcp.port", port, opcua_handle);
}
static void unregister_tcp_port(guint32 port)
{
- if (port != 0)
- dissector_delete_uint("tcp.port", port, opcua_handle);
+ if (port != 0)
+ dissector_delete_uint("tcp.port", port, opcua_handle);
}
static void
@@ -393,29 +393,29 @@ void proto_register_opcua(void)
char *tmp;
static hf_register_info hf[] =
- {
- /* id full name abbreviation type display strings bitmask blurb HFILL */
- {&hf_opcua_fragments, {"Message fragments", "opcua.fragments", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL}},
- {&hf_opcua_fragment, {"Message fragment", "opcua.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL}},
- {&hf_opcua_fragment_overlap, {"Message fragment overlap", "opcua.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL}},
- {&hf_opcua_fragment_overlap_conflicts, {"Message fragment overlapping with conflicting data", "opcua.fragment.overlap.conflicts", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL}},
- {&hf_opcua_fragment_multiple_tails, {"Message has multiple tail fragments", "opcua.fragment.multiple_tails", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL}},
- {&hf_opcua_fragment_too_long_fragment, {"Message fragment too long", "opcua.fragment.too_long_fragment", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL}},
- {&hf_opcua_fragment_error, {"Message defragmentation error", "opcua.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL}},
- {&hf_opcua_fragment_count, {"Message fragment count", "opcua.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL}},
- {&hf_opcua_reassembled_in, {"Reassembled in", "opcua.reassembled.in", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL}},
- {&hf_opcua_reassembled_length, {"Reassembled length", "opcua.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL}}
- };
+ {
+ /* id full name abbreviation type display strings bitmask blurb HFILL */
+ {&hf_opcua_fragments, {"Message fragments", "opcua.fragments", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL}},
+ {&hf_opcua_fragment, {"Message fragment", "opcua.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL}},
+ {&hf_opcua_fragment_overlap, {"Message fragment overlap", "opcua.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL}},
+ {&hf_opcua_fragment_overlap_conflicts, {"Message fragment overlapping with conflicting data", "opcua.fragment.overlap.conflicts", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL}},
+ {&hf_opcua_fragment_multiple_tails, {"Message has multiple tail fragments", "opcua.fragment.multiple_tails", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL}},
+ {&hf_opcua_fragment_too_long_fragment, {"Message fragment too long", "opcua.fragment.too_long_fragment", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL}},
+ {&hf_opcua_fragment_error, {"Message defragmentation error", "opcua.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL}},
+ {&hf_opcua_fragment_count, {"Message fragment count", "opcua.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL}},
+ {&hf_opcua_reassembled_in, {"Reassembled in", "opcua.reassembled.in", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL}},
+ {&hf_opcua_reassembled_length, {"Reassembled length", "opcua.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL}}
+ };
/** Setup protocol subtree array */
static gint *ett[] =
- {
- &ett_opcua_extensionobject,
- &ett_opcua_nodeid,
- &ett_opcua_transport,
- &ett_opcua_fragment,
- &ett_opcua_fragments
- };
+ {
+ &ett_opcua_extensionobject,
+ &ett_opcua_nodeid,
+ &ett_opcua_transport,
+ &ett_opcua_fragment,
+ &ett_opcua_fragments
+ };
module_t *opcua_module;
@@ -447,35 +447,46 @@ void proto_register_opcua(void)
/* register user preferences */
opcua_module = prefs_register_protocol(proto_opcua, proto_reg_handoff_opcua);
prefs_register_range_preference(opcua_module, "tcp_ports",
- "OPC UA TCP Ports",
- "The TCP ports for the OPC UA TCP Binary Protocol (comma separated list)",
- &global_tcp_ports_opcua, 65535);
+ "OPC UA TCP Ports",
+ "The TCP ports for the OPC UA TCP Binary Protocol (comma separated list)",
+ &global_tcp_ports_opcua, 65535);
}
void proto_reg_handoff_opcua(void)
{
- static gboolean opcua_initialized = FALSE;
- static range_t *tcp_ports_opcua = NULL;
-
- if(!opcua_initialized)
- {
- opcua_handle = new_create_dissector_handle(dissect_opcua, proto_opcua);
- opcua_initialized = TRUE;
- }
- else
- {
- /* clean up ports and their lists */
- if (tcp_ports_opcua != NULL)
+ static gboolean opcua_initialized = FALSE;
+ static range_t *tcp_ports_opcua = NULL;
+
+ if(!opcua_initialized)
{
- range_foreach(tcp_ports_opcua, unregister_tcp_port);
- g_free(tcp_ports_opcua);
+ opcua_handle = new_create_dissector_handle(dissect_opcua, proto_opcua);
+ opcua_initialized = TRUE;
+ }
+ else
+ {
+ /* clean up ports and their lists */
+ if (tcp_ports_opcua != NULL)
+ {
+ range_foreach(tcp_ports_opcua, unregister_tcp_port);
+ g_free(tcp_ports_opcua);
+ }
}
- }
- /* If we now have a PDU tree, register for the port or ports we have */
- tcp_ports_opcua = range_copy(global_tcp_ports_opcua);
- range_foreach(tcp_ports_opcua, register_tcp_port);
+ /* If we now have a PDU tree, register for the port or ports we have */
+ tcp_ports_opcua = range_copy(global_tcp_ports_opcua);
+ range_foreach(tcp_ports_opcua, register_tcp_port);
}
-
+/*
+ * Editor modelines - http://www.wireshark.org/tools/modelines.html
+ *
+ * Local variables:
+ * c-basic-offset: 4
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * vi: set shiftwidth=4 tabstop=8 expandtab:
+ * :indentSize=4:tabSize=8:noTabs=true:
+ */
diff --git a/plugins/opcua/opcua_application_layer.c b/plugins/opcua/opcua_application_layer.c
index 6de2765e59..3ec3e16e3c 100644
--- a/plugins/opcua/opcua_application_layer.c
+++ b/plugins/opcua/opcua_application_layer.c
@@ -105,4 +105,15 @@ int parseServiceNodeId(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
return Numeric;
}
-
+/*
+ * Editor modelines - http://www.wireshark.org/tools/modelines.html
+ *
+ * Local variables:
+ * c-basic-offset: 4
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * vi: set shiftwidth=4 tabstop=8 expandtab:
+ * :indentSize=4:tabSize=8:noTabs=true:
+ */
diff --git a/plugins/opcua/opcua_security_layer.c b/plugins/opcua/opcua_security_layer.c
index 5eb7bf6016..a49125980c 100644
--- a/plugins/opcua/opcua_security_layer.c
+++ b/plugins/opcua/opcua_security_layer.c
@@ -54,4 +54,15 @@ void parseSecurityLayer(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
proto_tree_add_item(tree, hf_opcua_security_rqid, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
}
-
+/*
+ * Editor modelines - http://www.wireshark.org/tools/modelines.html
+ *
+ * Local variables:
+ * c-basic-offset: 4
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * vi: set shiftwidth=4 tabstop=8 expandtab:
+ * :indentSize=4:tabSize=8:noTabs=true:
+ */
diff --git a/plugins/opcua/opcua_simpletypes.c b/plugins/opcua/opcua_simpletypes.c
index 5d4097dcf8..c500722079 100644
--- a/plugins/opcua/opcua_simpletypes.c
+++ b/plugins/opcua/opcua_simpletypes.c
@@ -185,16 +185,16 @@ OpcUa_BuiltInType;
/** Variant encoding mask table */
static const value_string g_VariantTypes[] = {
- { 0, "Null" },
- { 1, "Boolean" },
- { 2, "SByte" },
- { 3, "Byte" },
- { 4, "Int16" },
- { 5, "UInt16" },
- { 6, "Int32" },
- { 7, "UInt32" },
- { 8, "Int64" },
- { 9, "UInt64" },
+ { 0, "Null" },
+ { 1, "Boolean" },
+ { 2, "SByte" },
+ { 3, "Byte" },
+ { 4, "Int16" },
+ { 5, "UInt16" },
+ { 6, "Int32" },
+ { 7, "UInt32" },
+ { 8, "Int64" },
+ { 9, "UInt64" },
{ 10, "Float" },
{ 11, "Double" },
{ 12, "String" },
@@ -311,46 +311,46 @@ gint ett_opcua_array_DataValue = -1;
gint ett_opcua_array_Variant = -1;
static gint *ett[] =
{
- &ett_opcua_diagnosticinfo,
- &ett_opcua_diagnosticinfo_encodingmask,
- &ett_opcua_nodeid,
- &ett_opcua_expandednodeid,
- &ett_opcua_localizedtext,
- &ett_opcua_localizedtext_encodingmask,
- &ett_opcua_qualifiedname,
- &ett_opcua_datavalue,
- &ett_opcua_datavalue_encodingmask,
- &ett_opcua_variant,
- &ett_opcua_variant_arraydims,
- &ett_opcua_extensionobject,
- &ett_opcua_extensionobject_encodingmask,
- &ett_opcua_statuscode,
- &ett_opcua_statuscode_info,
- &ett_opcua_array_Boolean,
- &ett_opcua_array_SByte,
- &ett_opcua_array_Byte,
- &ett_opcua_array_Int16,
- &ett_opcua_array_UInt16,
- &ett_opcua_array_Int32,
- &ett_opcua_array_UInt32,
- &ett_opcua_array_Int64,
- &ett_opcua_array_UInt64,
- &ett_opcua_array_Float,
- &ett_opcua_array_Double,
- &ett_opcua_array_String,
- &ett_opcua_array_DateTime,
- &ett_opcua_array_Guid,
- &ett_opcua_array_ByteString,
- &ett_opcua_array_XmlElement,
- &ett_opcua_array_NodeId,
- &ett_opcua_array_ExpandedNodeId,
- &ett_opcua_array_StatusCode,
- &ett_opcua_array_DiagnosticInfo,
- &ett_opcua_array_QualifiedName,
- &ett_opcua_array_LocalizedText,
- &ett_opcua_array_ExtensionObject,
- &ett_opcua_array_DataValue,
- &ett_opcua_array_Variant
+ &ett_opcua_diagnosticinfo,
+ &ett_opcua_diagnosticinfo_encodingmask,
+ &ett_opcua_nodeid,
+ &ett_opcua_expandednodeid,
+ &ett_opcua_localizedtext,
+ &ett_opcua_localizedtext_encodingmask,
+ &ett_opcua_qualifiedname,
+ &ett_opcua_datavalue,
+ &ett_opcua_datavalue_encodingmask,
+ &ett_opcua_variant,
+ &ett_opcua_variant_arraydims,
+ &ett_opcua_extensionobject,
+ &ett_opcua_extensionobject_encodingmask,
+ &ett_opcua_statuscode,
+ &ett_opcua_statuscode_info,
+ &ett_opcua_array_Boolean,
+ &ett_opcua_array_SByte,
+ &ett_opcua_array_Byte,
+ &ett_opcua_array_Int16,
+ &ett_opcua_array_UInt16,
+ &ett_opcua_array_Int32,
+ &ett_opcua_array_UInt32,
+ &ett_opcua_array_Int64,
+ &ett_opcua_array_UInt64,
+ &ett_opcua_array_Float,
+ &ett_opcua_array_Double,
+ &ett_opcua_array_String,
+ &ett_opcua_array_DateTime,
+ &ett_opcua_array_Guid,
+ &ett_opcua_array_ByteString,
+ &ett_opcua_array_XmlElement,
+ &ett_opcua_array_NodeId,
+ &ett_opcua_array_ExpandedNodeId,
+ &ett_opcua_array_StatusCode,
+ &ett_opcua_array_DiagnosticInfo,
+ &ett_opcua_array_QualifiedName,
+ &ett_opcua_array_LocalizedText,
+ &ett_opcua_array_ExtensionObject,
+ &ett_opcua_array_DataValue,
+ &ett_opcua_array_Variant
};
void registerSimpleTypes(int proto)
@@ -1176,3 +1176,16 @@ guint32 getExtensionObjectType(tvbuff_t *tvb, gint *pOffset)
return Numeric;
}
+
+/*
+ * Editor modelines - http://www.wireshark.org/tools/modelines.html
+ *
+ * Local variables:
+ * c-basic-offset: 4
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * vi: set shiftwidth=4 tabstop=8 expandtab:
+ * :indentSize=4:tabSize=8:noTabs=true:
+ */
diff --git a/plugins/opcua/opcua_transport_layer.c b/plugins/opcua/opcua_transport_layer.c
index 00f754e0b5..a9ae9905fd 100644
--- a/plugins/opcua/opcua_transport_layer.c
+++ b/plugins/opcua/opcua_transport_layer.c
@@ -217,3 +217,15 @@ int parseCloseSecureChannel(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
return ServiceId;
}
+/*
+ * Editor modelines - http://www.wireshark.org/tools/modelines.html
+ *
+ * Local variables:
+ * c-basic-offset: 4
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * vi: set shiftwidth=4 tabstop=8 expandtab:
+ * :indentSize=4:tabSize=8:noTabs=true:
+ */