aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2011-11-27 15:34:07 +0000
committerBill Meier <wmeier@newsguy.com>2011-11-27 15:34:07 +0000
commitc4ace59928e1a14fb17d3989fd2e718ca9499ffd (patch)
treeb8ba30b3c3ae196e25fb8a0f6257d6c0727329eb
parentac9bcb9e7a3455e1e790eeccb2239fbf7cf5d3d2 (diff)
Various Minor cleanup:
- Remove unneeded #includes; - Use val_to_str_const() in several places; - Reformat long lines; - Fix whitepace and indentation. svn path=/trunk/; revision=40016
-rw-r--r--epan/dissectors/packet-hdfsdata.c29
-rw-r--r--epan/dissectors/packet-knet.c163
-rw-r--r--epan/dissectors/packet-mime-encap.c6
-rw-r--r--epan/dissectors/packet-opensafety.c630
-rw-r--r--epan/dissectors/packet-rdp.c1
-rw-r--r--epan/dissectors/packet-spice.c136
-rw-r--r--epan/dissectors/packet-ua.c152
7 files changed, 704 insertions, 413 deletions
diff --git a/epan/dissectors/packet-hdfsdata.c b/epan/dissectors/packet-hdfsdata.c
index 0c576b8d9c..e266f700fd 100644
--- a/epan/dissectors/packet-hdfsdata.c
+++ b/epan/dissectors/packet-hdfsdata.c
@@ -1,4 +1,4 @@
-/* packet-hdfs.c
+/* packet-hdfsdata.c
* HDFS data Protocol and dissectors
*
* Copyright (c) 2011 by Isilon Systems.
@@ -36,8 +36,10 @@
#include "epan/dissectors/packet-tcp.h"
+#if 0
#define NAMENODE_PORT 8020
#define DATANODE_PORT 8021
+#endif
#define FIRST_READ_FRAGMENT_LEN 15
#define SECOND_READ_FRAGMENT_LEN 29
@@ -374,7 +376,8 @@ dissect_write_response(tvbuff_t *tvb, proto_tree *hdfsdata_tree, int offset)
}
/* determine PDU length of protocol */
-static guint get_hdfsdata_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
+static guint
+get_hdfsdata_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
{
/* get data packet len, add FIRST_READ_FRAGMENT_LEN for first fragment (before len),
SECOND_READ_FRAGMENT_LEN for second fragment (incl len), subtract 4 for length itself. */
@@ -762,25 +765,25 @@ proto_register_hdfsdata(void)
&ett_hdfsdata
};
- module_t *hdfsdata_module;
+ module_t *hdfsdata_module;
proto_hdfsdata = proto_register_protocol (
- "HDFSDATA Protocol", /* name */
- "HDFSDATA", /* short name */
- "hdfsdata" /* abbrev */
- );
+ "HDFSDATA Protocol", /* name */
+ "HDFSDATA", /* short name */
+ "hdfsdata" /* abbrev */
+ );
proto_register_field_array(proto_hdfsdata, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- hdfsdata_module = prefs_register_protocol(proto_hdfsdata, proto_reg_handoff_hdfsdata);
+ hdfsdata_module = prefs_register_protocol(proto_hdfsdata, proto_reg_handoff_hdfsdata);
prefs_register_uint_preference(hdfsdata_module,
- "tcp.port",
- "TCP port for HDFSDATA",
- "Set the TCP port for HDFSDATA",
- 10,
- &tcp_port);
+ "tcp.port",
+ "TCP port for HDFSDATA",
+ "Set the TCP port for HDFSDATA",
+ 10,
+ &tcp_port);
register_dissector("hdfsdata", dissect_hdfsdata, proto_hdfsdata);
}
diff --git a/epan/dissectors/packet-knet.c b/epan/dissectors/packet-knet.c
index 972d29d42c..6c74120735 100644
--- a/epan/dissectors/packet-knet.c
+++ b/epan/dissectors/packet-knet.c
@@ -1,5 +1,5 @@
/* packet-knet.c
- * Routines for the KristalliNet (kNet) protocol.
+ * Routines for the KristalliNet (kNet) protocol.
* Kari Vatjus-Anttila <kari.vatjus-anttila@cie.fi>
* Ville Saarinen <ville.saarinen@cie.fi>
*
@@ -28,11 +28,9 @@
# include "config.h"
#endif
-#include <stdio.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/dissectors/packet-tcp.h>
-#include <string.h>
#define PROTO_TAG_KNET "KNET" /*!< Definition of kNet Protocol */
#define PORT 2345
@@ -46,10 +44,10 @@
* Message ID:s of the kNet protocol
*/
/**@{*/
-#define PINGREQUEST 1 /*!< Message ID definition: Ping Request */
-#define PINGREPLY 2 /*!< Message ID definition: Ping Reply */
-#define FLOWCONTROLREQUEST 3 /*!< Message ID definition: Flow Control Request */
-#define PACKETACK 4 /*!< Message ID definition: Packet Acknowledge */
+#define PINGREQUEST 1 /*!< Message ID definition: Ping Request */
+#define PINGREPLY 2 /*!< Message ID definition: Ping Reply */
+#define FLOWCONTROLREQUEST 3 /*!< Message ID definition: Flow Control Request */
+#define PACKETACK 4 /*!< Message ID definition: Packet Acknowledge */
#define DISCONNECT 255 /*!< Message ID definition: Disconnect */
#define DISCONNECTACK 254 /*!< Message ID definition: Disconnect Ack */
#define CONNECTSYN 253 /*!< Message ID definition: Connect Syn */
@@ -73,18 +71,18 @@ static int proto_knet = -1;
* Header fields of the kNet datagram
*/
/* *@{*/
-
+
/* Fields used by the TCP/SCTP dissector */
static int hf_knet_message_tree = -1; /*!< Message tree */
static int hf_knet_content_length = -1; /*!< Content Length */
/* Fields used by the UDP dissector */
-static int hf_knet_datagram_tree = -1; /*!< Datagram subtree */
-static int hf_knet_flags = -1; /*!< UDP Flags subtree */
-static int hf_knet_inorder = -1; /*!< Inorder Flag */
-static int hf_knet_reliable = -1; /*!< Reliable Flag */
-static int hf_knet_packetid = -1; /*!< PacketID */
-static int hf_knet_rmib = -1; /*!< Reliable Message Index Base */
+static int hf_knet_datagram_tree = -1; /*!< Datagram subtree */
+static int hf_knet_flags = -1; /*!< UDP Flags subtree */
+static int hf_knet_inorder = -1; /*!< Inorder Flag */
+static int hf_knet_reliable = -1; /*!< Reliable Flag */
+static int hf_knet_packetid = -1; /*!< PacketID */
+static int hf_knet_rmib = -1; /*!< Reliable Message Index Base */
static int hf_knet_msg_flags = -1; /*!< Message Block Flags subtree */
static int hf_knet_msg_fs = -1; /*!< Fragment Start */
static int hf_knet_msg_ff = -1; /*!< Fragment Flag */
@@ -93,9 +91,9 @@ static int hf_knet_msg_reliable = -1; /*!< Reliable Flag */
static int hf_knet_msg_reliable_message_number = -1; /*!< Reliable Message Number */
static int hf_knet_payload_tree = -1; /*!< Payload subtree */
-static int hf_knet_payload = -1; /*!< Payload subtree */
+static int hf_knet_payload = -1; /*!< Payload subtree */
static int hf_knet_messageid = -1; /*!< MessageID of the packet */
-static int hf_knet_pingid = -1;
+static int hf_knet_pingid = -1;
static int hf_knet_flowctrlreq = -1;
static int hf_knet_packetack = -1;
static int hf_knet_seqnumber = -1;
@@ -107,12 +105,12 @@ static int hf_knet_seqnumber = -1;
/* *@{*/
/*Knet Subtrees */
-static gint ett_knet_main = -1; /*!< Main kNet tree */
-static gint ett_knet_message = -1; /*!< Message tree */
-static gint ett_knet_payload = -1; /*!< Payload tree */
-static gint ett_knet_message_flags = -1; /*!< Message flags tree */
+static gint ett_knet_main = -1; /*!< Main kNet tree */
+static gint ett_knet_message = -1; /*!< Message tree */
+static gint ett_knet_payload = -1; /*!< Payload tree */
+static gint ett_knet_message_flags = -1; /*!< Message flags tree */
static gint ett_knet_datagram = -1;
-static gint ett_knet_flags = -1;
+static gint ett_knet_flags = -1;
/**@}*/
/* Few Utility Variables */
@@ -166,7 +164,7 @@ count_vle_bytes(tvbuff_t *tvb, int offset)
* dissect_packetid is a utility function which calculates
* the packets Packet ID from the data. Packet ID is a field
* located in the datagram header.
- *
+ *
* @see dissect_reliable_message_index_base()
* @see dissect_reliable_message_number()
* @see dissect_content_length()
@@ -193,10 +191,10 @@ dissect_packetid(tvbuff_t *buffer, int offset, proto_tree *tree)
}
/**
- * dissect_reliable_message_index_base is a utility function
+ * dissect_reliable_message_index_base is a utility function
* which calculates the packets RMIB if and only if the reliable
* flag is set to 1.
- *
+ *
* @see dissect_packetid()
* @see dissect_content_length()
* @see dissect_reliable_message_number()
@@ -277,7 +275,7 @@ dissect_content_length_vle(tvbuff_t *buffer, int *offset, proto_tree *tree)
* dissect_content_length is a utility function which
* calculates how long is the payload section of the message
* in bytes. Used only by the UDP dissector.
- *
+ *
* @see dissect_packetid()
* @see dissect_reliable_message_index_base()
* @see dissect_reliable_message_number()
@@ -321,7 +319,7 @@ dissect_content_length(tvbuff_t *buffer, int offset, proto_tree *tree)
* dissect_reliable_message_number is a utility function which
* calculates the RMN if and only if the reliable flag in the
* message block is set to 1.
- *
+ *
* @see dissect_packetid()
* @see dissect_reliable_message_index_base()
* @see dissect_content_length()
@@ -352,7 +350,7 @@ dissect_reliable_message_number(tvbuff_t *buffer, int offset, proto_tree *tree)
/**
* dissect_messageid is a utility function which
* calculates the ID of the message.
- *
+ *
* @see dissect_packetid()
* @see dissect_reliable_message_index_base()
* @see dissect_content_length()
@@ -387,9 +385,9 @@ dissect_messageid(tvbuff_t *buffer, int *offset, proto_tree *tree, packet_info *
}
proto_tree_add_bytes_format(tree, hf_knet_messageid, buffer, *offset, messageid_length, NULL,
- "Message ID: %s (%d)", val_to_str(messageid, packettypenames, "AppData or Malformed Message ID"), messageid);
+ "Message ID: %s (%d)", val_to_str_const(messageid, packettypenames, "AppData or Malformed Message ID"), messageid);
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(messageid, packettypenames, "AppData "));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(messageid, packettypenames, "AppData "));
*offset += messageid_length;
@@ -401,7 +399,7 @@ dissect_messageid(tvbuff_t *buffer, int *offset, proto_tree *tree, packet_info *
/**
* dissect_payload is a utility function which
* calculates the actual payload of the message.
- *
+ *
* @see dissect_packetid()
* @see dissect_reliable_message_index_base()
* @see dissect_content_length()
@@ -460,7 +458,7 @@ dissect_payload(tvbuff_t *buffer, int offset, int messageid, proto_tree *tree, i
* by dissect_knet when the dissector has dissected the
* datagram header. This subdissector dissects all of the
* messages which are encapsulated in the kNet datagram.
- *
+ *
* @see dissect_knet()
* @param tvb the buffer to the data
* @param pinfo the packet info structure
@@ -508,7 +506,7 @@ dissect_knet_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
/**
* dissect_knet is the dissector which is called
* by Wireshark when kNet packets are captured. Here
- * is dissected the SCTP and TCP packets in its own
+ * is dissected the SCTP and TCP packets in its own
* section and UDP packets in its own, because UDP
* packets differ quite a lot from SCTP and TCP.
* SCTP and TCP in the other hand has quite the same
@@ -558,7 +556,7 @@ dissect_knet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(current_protocol == KNET_SCTP_PACKET || current_protocol == KNET_TCP_PACKET)
{
/* Attach kNet main tree to Wireshark tree */
- knet_ti = proto_tree_add_item(tree, proto_knet, tvb, 0, -1, ENC_NA);
+ knet_ti = proto_tree_add_item(tree, proto_knet, tvb, 0, -1, ENC_NA);
knet_tree = proto_item_add_subtree(knet_ti, ett_knet_main);
next_tvb = tvb_new_subset(tvb, offset, -1, -1); /* Prepare the next tvb for the next message */
@@ -671,7 +669,7 @@ get_knet_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
/**
* dissect_knet_tcp is the dissector which is called
* by Wireshark when kNet TCP packets are captured.
- *
+ *
* @param tvb the buffer to the data
* @param pinfo the packet info structure
* @param tree the parent tree where the dissected data is going to be inserted
@@ -689,7 +687,7 @@ dissect_knet_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/**
* dissect_knet_sctp is the dissector which is called
* by Wireshark when kNet STCP packets are captured.
- *
+ *
* @param tvb the buffer to the data
* @param pinfo the packet info structure
@@ -709,7 +707,7 @@ dissect_knet_sctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/**
* dissect_knet_udp is the dissector which is called
* by Wireshark when kNet UDP packets are captured.
- *
+ *
* @param tvb the buffer to the data
* @param pinfo the packet info structure
@@ -728,7 +726,7 @@ dissect_knet_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/**
* proto_register_knet registers our kNet protocol,
* headerfield- and subtree-array to Wireshark.
- *
+ *
* @return void
*
*/
@@ -739,31 +737,74 @@ proto_register_knet(void)
static hf_register_info hf_knet[] =
{
- /* TCP & SCTP Header */
- {&hf_knet_content_length, {"Content Length", "knet.length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}},
- {&hf_knet_message_tree, {"Message Block", "knet.msg", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}},
+ /* TCP & SCTP Header */
+ {&hf_knet_content_length,
+ {"Content Length", "knet.length",
+ FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}},
+ {&hf_knet_message_tree,
+ {"Message Block", "knet.msg",
+ FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}},
+
/* UDP Header */
- {&hf_knet_datagram_tree, {"Datagram Header", "knet.datagram", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}},
- {&hf_knet_flags, {"Flags", "knet.datagram.flags", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}},
- {&hf_knet_inorder, {"Inorder Flag", "knet.datagram.inorder", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},
- {&hf_knet_reliable, {"Reliable Flag", "knet.datagram.reliable", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},
- {&hf_knet_packetid, {"Packet ID", "knet.datagram.packetid", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}},
- {&hf_knet_rmib, {"Reliable Message Index Base", "knet.datagram.rmib", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}},
- {&hf_knet_msg_flags, {"Flags", "knet.msg.flags", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}},
- {&hf_knet_msg_fs, {"Fragment Start", "knet.msg.flags.fs", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},
- {&hf_knet_msg_ff, {"Fragment Flag", "knet.msg.flags.ff", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},
- {&hf_knet_msg_inorder, {"Inorder Flag", "knet.msg.flags.inorder", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},
- {&hf_knet_msg_reliable, {"Reliable Flag", "knet.msg.flags.reliable", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},
- {&hf_knet_msg_reliable_message_number, {"Reliable Message Number", "knet.msg.reliable_number", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}},
+ {&hf_knet_datagram_tree,
+ {"Datagram Header", "knet.datagram",
+ FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}},
+ {&hf_knet_flags,
+ {"Flags", "knet.datagram.flags",
+ FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}},
+ {&hf_knet_inorder,
+ {"Inorder Flag", "knet.datagram.inorder",
+ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},
+ {&hf_knet_reliable,
+ {"Reliable Flag", "knet.datagram.reliable",
+ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},
+ {&hf_knet_packetid,
+ {"Packet ID", "knet.datagram.packetid",
+ FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}},
+ {&hf_knet_rmib,
+ {"Reliable Message Index Base", "knet.datagram.rmib",
+ FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}},
+ {&hf_knet_msg_flags,
+ {"Flags", "knet.msg.flags",
+ FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}},
+ {&hf_knet_msg_fs,
+ {"Fragment Start", "knet.msg.flags.fs",
+ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},
+ {&hf_knet_msg_ff,
+ {"Fragment Flag", "knet.msg.flags.ff",
+ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},
+ {&hf_knet_msg_inorder,
+ {"Inorder Flag", "knet.msg.flags.inorder",
+ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},
+ {&hf_knet_msg_reliable,
+ {"Reliable Flag", "knet.msg.flags.reliable",
+ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},
+ {&hf_knet_msg_reliable_message_number,
+ {"Reliable Message Number", "knet.msg.reliable_number",
+ FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}},
/* Payload */
- {&hf_knet_payload_tree, {"Payload", "knet.payload.tree", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}},
- {&hf_knet_payload, {"Payload", "knet.payload.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}},
- {&hf_knet_messageid, {"Message ID", "knet.payload.messageid", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}},
- {&hf_knet_pingid, {"Ping ID", "knet.payload.pingid", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},
- {&hf_knet_flowctrlreq, {"Flowcontrol Request", "knet.payload.flowctrlreq", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}},
- {&hf_knet_packetack, {"Packet Ack", "knet.payload.packetack", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}},
- {&hf_knet_seqnumber, {"Sequence Number", "knet.payload.seqnumber", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}
+ {&hf_knet_payload_tree,
+ {"Payload", "knet.payload.tree",
+ FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}},
+ {&hf_knet_payload,
+ {"Payload", "knet.payload.data",
+ FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}},
+ {&hf_knet_messageid,
+ {"Message ID", "knet.payload.messageid",
+ FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}},
+ {&hf_knet_pingid,
+ {"Ping ID", "knet.payload.pingid",
+ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},
+ {&hf_knet_flowctrlreq,
+ {"Flowcontrol Request", "knet.payload.flowctrlreq",
+ FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}},
+ {&hf_knet_packetack,
+ {"Packet Ack", "knet.payload.packetack",
+ FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}},
+ {&hf_knet_seqnumber,
+ {"Sequence Number", "knet.payload.seqnumber",
+ FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}
};
static gint *ett_knet[] =
@@ -792,11 +833,11 @@ proto_register_knet(void)
prefs_register_uint_preference(knet_module, "sctp.port", "kNet SCTP Port",
"Set the SCTP port for kNet messages",
10, &knet_sctp_port);
-
+
prefs_register_uint_preference(knet_module, "tcp.port", "kNet TCP Port",
"Set the TCP port for kNet messages",
10, &knet_tcp_port);
-
+
prefs_register_uint_preference(knet_module, "udp.port", "kNet UDP Port",
"Set the UDP port for kNet messages",
10, &knet_udp_port);
diff --git a/epan/dissectors/packet-mime-encap.c b/epan/dissectors/packet-mime-encap.c
index 2142b965e6..6fd44cd663 100644
--- a/epan/dissectors/packet-mime-encap.c
+++ b/epan/dissectors/packet-mime-encap.c
@@ -25,14 +25,8 @@
# include "config.h"
#endif
-#include <stdlib.h>
-#include <string.h>
#include <glib.h>
#include <epan/packet.h>
-#include <epan/expert.h>
-#include <epan/prefs.h>
-#include <epan/uat.h>
-#include <epan/emem.h>
static int proto_mime_encap = -1;
diff --git a/epan/dissectors/packet-opensafety.c b/epan/dissectors/packet-opensafety.c
index 6537ee734e..3554c8a8f6 100644
--- a/epan/dissectors/packet-opensafety.c
+++ b/epan/dissectors/packet-opensafety.c
@@ -73,10 +73,10 @@
#define OPENSAFETY_CHECKSUM_CRC32 0x04
static const value_string message_crc_type[] = {
- { OPENSAFETY_CHECKSUM_CRC8, "CRC8" },
- { OPENSAFETY_CHECKSUM_CRC16, "CRC16" },
- { OPENSAFETY_CHECKSUM_CRC32, "CRC32" },
- { 0, NULL }
+ { OPENSAFETY_CHECKSUM_CRC8, "CRC8" },
+ { OPENSAFETY_CHECKSUM_CRC16, "CRC16" },
+ { OPENSAFETY_CHECKSUM_CRC32, "CRC32" },
+ { 0, NULL }
};
/* openSAFETY Message Types */
@@ -86,11 +86,11 @@ static const value_string message_crc_type[] = {
#define OPENSAFETY_SNMT_MESSAGE_TYPE 0xA0
static const value_string message_id_values[] = {
- { OPENSAFETY_SPDO_MESSAGE_TYPE, "openSAFETY SPDO" },
- { OPENSAFETY_SSDO_MESSAGE_TYPE, "openSAFETY SSDO" },
- { OPENSAFETY_SLIM_SSDO_MESSAGE_TYPE, "openSAFETY Slim SSDO" },
- { OPENSAFETY_SNMT_MESSAGE_TYPE, "openSAFETY SNMT" },
- { 0, NULL }
+ { OPENSAFETY_SPDO_MESSAGE_TYPE, "openSAFETY SPDO" },
+ { OPENSAFETY_SSDO_MESSAGE_TYPE, "openSAFETY SSDO" },
+ { OPENSAFETY_SLIM_SSDO_MESSAGE_TYPE, "openSAFETY Slim SSDO" },
+ { OPENSAFETY_SNMT_MESSAGE_TYPE, "openSAFETY SNMT" },
+ { 0, NULL }
};
/* openSAFETY Message IDs */
@@ -113,24 +113,24 @@ static const value_string message_id_values[] = {
#define OPENSAFETY_MSG_SNMT_SN_RESET_GUARDING_SCM 0xBC
static const value_string message_type_values[] = {
- { OPENSAFETY_MSG_SPDO_DATA_ONLY, "SPDO Data only" },
- { OPENSAFETY_MSG_SPDO_DATA_WITH_TIME_REQUEST, "SPDO Data with Time Request" },
- { OPENSAFETY_MSG_SPDO_DATA_WITH_TIME_RESPONSE, "SPDO Data with Time Response" },
- { OPENSAFETY_MSG_SPDO_RESERVED, "SPDO Reserved" },
-
- { OPENSAFETY_MSG_SSDO_SERVICE_REQUEST, "SSDO Service Request" },
- { OPENSAFETY_MSG_SSDO_SERVICE_RESPONSE, "SSDO Service Response" },
- { OPENSAFETY_MSG_SSDO_SLIM_SERVICE_REQUEST, "SSDO Slim Service Request" },
- { OPENSAFETY_MSG_SSDO_SLIM_SERVICE_RESPONSE, "SSDO Slim Service Response" },
-
- { OPENSAFETY_MSG_SNMT_REQUEST_UDID, "SNMT Request UDID" },
- { OPENSAFETY_MSG_SNMT_RESPONSE_UDID, "SNMT Response UDID" },
- { OPENSAFETY_MSG_SNMT_ASSIGN_SADR, "SNMT Assign SADR" },
- { OPENSAFETY_MSG_SNMT_SADR_ASSIGNED, "SNMT SADR Assigned" },
- { OPENSAFETY_MSG_SNMT_SERVICE_REQUEST, "SNMT Service Request" },
- { OPENSAFETY_MSG_SNMT_SERVICE_RESPONSE, "SNMT Service Response" },
- { OPENSAFETY_MSG_SNMT_SN_RESET_GUARDING_SCM, "SNMT SN reset guarding SCM" },
- {0, NULL }
+ { OPENSAFETY_MSG_SPDO_DATA_ONLY, "SPDO Data only" },
+ { OPENSAFETY_MSG_SPDO_DATA_WITH_TIME_REQUEST, "SPDO Data with Time Request" },
+ { OPENSAFETY_MSG_SPDO_DATA_WITH_TIME_RESPONSE, "SPDO Data with Time Response" },
+ { OPENSAFETY_MSG_SPDO_RESERVED, "SPDO Reserved" },
+
+ { OPENSAFETY_MSG_SSDO_SERVICE_REQUEST, "SSDO Service Request" },
+ { OPENSAFETY_MSG_SSDO_SERVICE_RESPONSE, "SSDO Service Response" },
+ { OPENSAFETY_MSG_SSDO_SLIM_SERVICE_REQUEST, "SSDO Slim Service Request" },
+ { OPENSAFETY_MSG_SSDO_SLIM_SERVICE_RESPONSE, "SSDO Slim Service Response" },
+
+ { OPENSAFETY_MSG_SNMT_REQUEST_UDID, "SNMT Request UDID" },
+ { OPENSAFETY_MSG_SNMT_RESPONSE_UDID, "SNMT Response UDID" },
+ { OPENSAFETY_MSG_SNMT_ASSIGN_SADR, "SNMT Assign SADR" },
+ { OPENSAFETY_MSG_SNMT_SADR_ASSIGNED, "SNMT SADR Assigned" },
+ { OPENSAFETY_MSG_SNMT_SERVICE_REQUEST, "SNMT Service Request" },
+ { OPENSAFETY_MSG_SNMT_SERVICE_RESPONSE, "SNMT Service Response" },
+ { OPENSAFETY_MSG_SNMT_SN_RESET_GUARDING_SCM, "SNMT SN reset guarding SCM" },
+ {0, NULL }
};
/* SNTM extended Services */
@@ -150,21 +150,21 @@ static const value_string message_type_values[] = {
#define OPENSAFETY_MSG_SNMT_EXT_SN_ASSIGNED_UDID_SCM 0x0F
static const value_string message_service_type[] = {
- { OPENSAFETY_MSG_SNMT_EXT_SN_SET_TO_PRE_OP, "SN set to pre Operational" },
- { OPENSAFETY_MSG_SNMT_EXT_SN_SET_TO_OP, "SN set to Operational" },
- { OPENSAFETY_MSG_SNMT_EXT_SCM_SET_TO_STOP, "SCM set to Stop" },
- { OPENSAFETY_MSG_SNMT_EXT_SCM_SET_TO_OP, "SCM set to Operational" },
- { OPENSAFETY_MSG_SNMT_EXT_SCM_GUARD_SN, "SCM guard SN" },
- { OPENSAFETY_MSG_SNMT_EXT_ASSIGN_ADDITIONAL_SADR, "Assign additional SADR" },
- { OPENSAFETY_MSG_SNMT_EXT_SN_ACKNOWLEDGE, "SN Acknowledge" },
- { OPENSAFETY_MSG_SNMT_EXT_SN_ASSIGN_UDID_SCM, "SN assign UDID SCM" },
- { OPENSAFETY_MSG_SNMT_EXT_SN_STATUS_PRE_OP, "SN status pre Operational" },
- { OPENSAFETY_MSG_SNMT_EXT_SN_STATUS_OP, "SN status Operational" },
- { OPENSAFETY_MSG_SNMT_EXT_SN_ASSIGNED_ADDITIONAL_SADR, "Assigned additional SADR" },
- { OPENSAFETY_MSG_SNMT_EXT_SN_FAIL, "SN Fail" },
- { OPENSAFETY_MSG_SNMT_EXT_SN_BUSY, "SN Busy" },
- { OPENSAFETY_MSG_SNMT_EXT_SN_ASSIGNED_UDID_SCM, "SN assigned UDID SCM" },
- { 0, NULL }
+ { OPENSAFETY_MSG_SNMT_EXT_SN_SET_TO_PRE_OP, "SN set to pre Operational" },
+ { OPENSAFETY_MSG_SNMT_EXT_SN_SET_TO_OP, "SN set to Operational" },
+ { OPENSAFETY_MSG_SNMT_EXT_SCM_SET_TO_STOP, "SCM set to Stop" },
+ { OPENSAFETY_MSG_SNMT_EXT_SCM_SET_TO_OP, "SCM set to Operational" },
+ { OPENSAFETY_MSG_SNMT_EXT_SCM_GUARD_SN, "SCM guard SN" },
+ { OPENSAFETY_MSG_SNMT_EXT_ASSIGN_ADDITIONAL_SADR, "Assign additional SADR" },
+ { OPENSAFETY_MSG_SNMT_EXT_SN_ACKNOWLEDGE, "SN Acknowledge" },
+ { OPENSAFETY_MSG_SNMT_EXT_SN_ASSIGN_UDID_SCM, "SN assign UDID SCM" },
+ { OPENSAFETY_MSG_SNMT_EXT_SN_STATUS_PRE_OP, "SN status pre Operational" },
+ { OPENSAFETY_MSG_SNMT_EXT_SN_STATUS_OP, "SN status Operational" },
+ { OPENSAFETY_MSG_SNMT_EXT_SN_ASSIGNED_ADDITIONAL_SADR, "Assigned additional SADR" },
+ { OPENSAFETY_MSG_SNMT_EXT_SN_FAIL, "SN Fail" },
+ { OPENSAFETY_MSG_SNMT_EXT_SN_BUSY, "SN Busy" },
+ { OPENSAFETY_MSG_SNMT_EXT_SN_ASSIGNED_UDID_SCM, "SN assigned UDID SCM" },
+ { 0, NULL }
};
@@ -178,7 +178,7 @@ static const value_string message_service_type[] = {
#define OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_SEGMENTED 0x29
#define OPENSAFETY_MSG_SSDO_UPLOAD_SEGMENT_END 0x48
#define OPENSAFETY_MSG_SSDO_DOWNLOAD_SEGMENT_END 0x49
-/*
+#if 0
#define OPENSAFETY_MSG_SSDO_BLOCK_UPLOAD_SEGMENT_MIDDLE 0x88
#define OPENSAFETY_MSG_SSDO_BLOCK_DOWNLOAD_SEGMENT_MIDDLE 0x89
#define OPENSAFETY_MSG_SSDO_BLOCK_UPLOAD_INITIATE 0xA8
@@ -186,24 +186,28 @@ static const value_string message_service_type[] = {
#define OPENSAFETY_MSG_SSDO_BLOCK_UPLOAD_INITIATE_EXPEDITED 0xC0
#define OPENSAFETY_MSG_SSDO_BLOCK_UPLOAD_SEGMENT_END 0x40
#define OPENSAFETY_MSG_SSDO_BLOCK_DOWNLOAD_SEGMENT_END 0xC9
-*/
+#endif
+
static const value_string ssdo_sacmd_values[] = {
- /* { OPENSAFETY_MSG_SSDO_BLOCK_DOWNLOAD_SEGMENT_END, "Block Download Segment End" },
- { OPENSAFETY_MSG_SSDO_BLOCK_UPLOAD_INITIATE, "Block Upload Expedited Initiate" },
- { OPENSAFETY_MSG_SSDO_BLOCK_UPLOAD_INITIATE_EXPEDITED,"Block Upload Initiate" },
- { OPENSAFETY_MSG_SSDO_BLOCK_DOWNLOAD_INITIATE, "Block Download Initiate" },
- { OPENSAFETY_MSG_SSDO_BLOCK_DOWNLOAD_SEGMENT_MIDDLE, "Block Download Middle Segment" },
- { OPENSAFETY_MSG_SSDO_BLOCK_UPLOAD_SEGMENT_END, "Block Upload End Segment" },*/
- { OPENSAFETY_MSG_SSDO_DOWNLOAD_SEGMENT_END, "Download End Segment" },
- { OPENSAFETY_MSG_SSDO_UPLOAD_SEGMENT_END, "Upload End Segment" },
- { OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_EXPEDITED, "Download Expedited Initiate" },
- { OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_SEGMENTED, "Upload Initiate Segmented" },
- { OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_SEGMENTED, "Download Initiate Segmented" },
- { OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_EXPEDITED, "Upload Expedited Initiate" },
- { OPENSAFETY_MSG_SSDO_DOWNLOAD_SEGMENT_MIDDLE, "Download Middle Segment" },
- { OPENSAFETY_MSG_SSDO_UPLOAD_SEGMENT_MIDDLE, "Upload Middle Segment" },
- { OPENSAFETY_MSG_SSDO_ABORT, "Abort" },
- { 0, NULL }
+#if 0
+ { OPENSAFETY_MSG_SSDO_BLOCK_DOWNLOAD_SEGMENT_END, "Block Download Segment End" },
+ { OPENSAFETY_MSG_SSDO_BLOCK_UPLOAD_INITIATE, "Block Upload Expedited Initiate" },
+ { OPENSAFETY_MSG_SSDO_BLOCK_UPLOAD_INITIATE_EXPEDITED,"Block Upload Initiate" },
+ { OPENSAFETY_MSG_SSDO_BLOCK_DOWNLOAD_INITIATE, "Block Download Initiate" },
+ { OPENSAFETY_MSG_SSDO_BLOCK_DOWNLOAD_SEGMENT_MIDDLE, "Block Download Middle Segment" },
+ { OPENSAFETY_MSG_SSDO_BLOCK_UPLOAD_SEGMENT_MIDDLE, "Block Upload Middle Segment" },
+ { OPENSAFETY_MSG_SSDO_BLOCK_UPLOAD_SEGMENT_END, "Block Upload End Segment" },
+#endif
+ { OPENSAFETY_MSG_SSDO_DOWNLOAD_SEGMENT_END, "Download End Segment" },
+ { OPENSAFETY_MSG_SSDO_UPLOAD_SEGMENT_END, "Upload End Segment" },
+ { OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_EXPEDITED, "Download Expedited Initiate" },
+ { OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_SEGMENTED, "Upload Initiate Segmented" },
+ { OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_SEGMENTED, "Download Initiate Segmented" },
+ { OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_EXPEDITED, "Upload Expedited Initiate" },
+ { OPENSAFETY_MSG_SSDO_DOWNLOAD_SEGMENT_MIDDLE, "Download Middle Segment" },
+ { OPENSAFETY_MSG_SSDO_UPLOAD_SEGMENT_MIDDLE, "Upload Middle Segment" },
+ { OPENSAFETY_MSG_SSDO_ABORT, "Abort" },
+ { 0, NULL }
};
#define OPENSAFETY_SSDO_SACMD_ACC 0x01
@@ -230,46 +234,46 @@ static const true_false_string opensafety_sacmd_blk = { "Block Transfer", "Norm
static const value_string abort_codes[] = {
- /* SSDO abort codes */
- { 0x05030000, "Reserved" },
+ /* SSDO abort codes */
+ { 0x05030000, "Reserved" },
- { 0x05040000, "SSDO protocol timed out" },
- { 0x05040001, "Client/server Command ID not valid or unknown" },
- { 0x05040002, "Invalid block size" },
- { 0x05040003, "Invalid sequence number" },
- { 0x05040004, "Reserved" },
- { 0x05040005, "Out of memory" },
+ { 0x05040000, "SSDO protocol timed out" },
+ { 0x05040001, "Client/server Command ID not valid or unknown" },
+ { 0x05040002, "Invalid block size" },
+ { 0x05040003, "Invalid sequence number" },
+ { 0x05040004, "Reserved" },
+ { 0x05040005, "Out of memory" },
- { 0x06010000, "Unsupported access to an object" },
- { 0x06010001, "Attempt to read a write-only object" },
- { 0x06010002, "Attempt to write a read-only object" },
+ { 0x06010000, "Unsupported access to an object" },
+ { 0x06010001, "Attempt to read a write-only object" },
+ { 0x06010002, "Attempt to write a read-only object" },
- { 0x06020000, "Object does not exist in the object dictionary" },
+ { 0x06020000, "Object does not exist in the object dictionary" },
- { 0x06040041, "Object cannot be mapped to the SPDO" },
- { 0x06040042, "The number and length of the objects to be mapped would exceed SPDO length" },
- { 0x06040043, "General parameter incompatibility" },
- { 0x06040047, "General internal incompatibility in the device" },
+ { 0x06040041, "Object cannot be mapped to the SPDO" },
+ { 0x06040042, "The number and length of the objects to be mapped would exceed SPDO length" },
+ { 0x06040043, "General parameter incompatibility" },
+ { 0x06040047, "General internal incompatibility in the device" },
- { 0x06060000, "Access failed due to a hardware error" },
+ { 0x06060000, "Access failed due to a hardware error" },
- { 0x06070010, "Data type does not match, length of service parameter does not match" },
- { 0x06070012, "Data type does not match, length of service parameter too high" },
- { 0x06070013, "Data type does not match, length of service parameter too low" },
+ { 0x06070010, "Data type does not match, length of service parameter does not match" },
+ { 0x06070012, "Data type does not match, length of service parameter too high" },
+ { 0x06070013, "Data type does not match, length of service parameter too low" },
- { 0x06090011, "Sub-index does not exist" },
- { 0x06090030, "Value range o parameter exceeded (only for write access)" },
- { 0x06090031, "Value of parameter written too high" },
- { 0x06090032, "Value of parameter written too low" },
- { 0x06090036, "Maximum value is less than minimum value" },
+ { 0x06090011, "Sub-index does not exist" },
+ { 0x06090030, "Value range o parameter exceeded (only for write access)" },
+ { 0x06090031, "Value of parameter written too high" },
+ { 0x06090032, "Value of parameter written too low" },
+ { 0x06090036, "Maximum value is less than minimum value" },
- { 0x08000000, "General error" },
- { 0x08000020, "Data cannot be transferred or stored to the application" },
- { 0x08000021, "Data cannot be transferred or stored to the application because of local control" },
- { 0x08000022, "Data cannot be transferred or stored to the application because of the present device state" },
- { 0x08000023, "Data cannot be transferred or stored to the application because of the object data is not available now" },
+ { 0x08000000, "General error" },
+ { 0x08000020, "Data cannot be transferred or stored to the application" },
+ { 0x08000021, "Data cannot be transferred or stored to the application because of local control" },
+ { 0x08000022, "Data cannot be transferred or stored to the application because of the present device state" },
+ { 0x08000023, "Data cannot be transferred or stored to the application because of the object data is not available now" },
- { 0, NULL }
+ { 0, NULL }
};
static const true_false_string opensafety_message_direction = { "Request", "Response" };
@@ -341,7 +345,7 @@ static int hf_oss_ssdo_inhibit_time = -1;
static int hf_oss_ssdo_abort_code = -1;
static int hf_oss_ssdo_sacmd_access_type = -1;
-static int hf_oss_ssdo_sacmd_reserved = -1;
+static int hf_oss_ssdo_sacmd_reserved = -1;
static int hf_oss_ssdo_sacmd_abort_transfer = -1;
static int hf_oss_ssdo_sacmd_segmentation = -1;
static int hf_oss_ssdo_sacmd_toggle = -1;
@@ -379,35 +383,35 @@ void proto_reg_handoff_opensafety(void);
/* Tracks the information that the packet pinfo has been received by receiver, and adds that information to the tree, using pos, as
* byte position in the PDU */
#define PACKET_RECEIVER(pinfo, recv, pos, posnet, sdn) { \
- proto_item * psf_item = NULL; \
- proto_tree *psf_tree = NULL; \
- psf_item = proto_tree_add_uint(opensafety_tree, hf_oss_msg_receiver, message_tvb, pos, 2, recv); \
- psf_tree = proto_item_add_subtree(psf_item, ett_opensafety_receiver); \
+ proto_item * psf_item = NULL; \
+ proto_tree *psf_tree = NULL; \
+ psf_item = proto_tree_add_uint(opensafety_tree, hf_oss_msg_receiver, message_tvb, pos, 2, recv); \
+ psf_tree = proto_item_add_subtree(psf_item, ett_opensafety_receiver); \
psf_item = proto_tree_add_uint(psf_tree, hf_oss_msg_node, message_tvb, pos, 2, recv);\
PROTO_ITEM_SET_GENERATED(psf_item); \
psf_item = proto_tree_add_uint_format_value(psf_tree, hf_oss_msg_network, message_tvb, posnet, 2, sdn, ( sdn > 0 ? "0x%04X" : "Unknown (0x%04X)" ), sdn);\
PROTO_ITEM_SET_GENERATED(psf_item); \
- }
+ }
/* Tracks the information that the packet pinfo has been sent by sender, and received by everyone else, and adds that information to
* the tree, using pos, as byte position in the PDU */
#define PACKET_SENDER(pinfo, sender, pos, posnet, sdn) { \
- proto_item * psf_item = NULL; \
- proto_tree *psf_tree = NULL; \
- psf_item = proto_tree_add_uint(opensafety_tree, hf_oss_msg_sender, message_tvb, pos, 2, sender); \
- psf_tree = proto_item_add_subtree(psf_item, ett_opensafety_sender); \
+ proto_item * psf_item = NULL; \
+ proto_tree *psf_tree = NULL; \
+ psf_item = proto_tree_add_uint(opensafety_tree, hf_oss_msg_sender, message_tvb, pos, 2, sender); \
+ psf_tree = proto_item_add_subtree(psf_item, ett_opensafety_sender); \
psf_item = proto_tree_add_uint(psf_tree, hf_oss_msg_node, message_tvb, pos, 2, sender);\
PROTO_ITEM_SET_GENERATED(psf_item); \
psf_item = proto_tree_add_uint_format_value(psf_tree, hf_oss_msg_network, message_tvb, posnet, 2, sdn, ( sdn > 0 ? "0x%04X" : "Unknown (0x%04X)" ), sdn);\
PROTO_ITEM_SET_GENERATED(psf_item); \
- }
+ }
/* Tracks the information that the packet pinfo has been sent by sender, and received by receiver, and adds that information to
* the tree, using pos for the sender and pos2 for the receiver, as byte position in the PDU */
#define PACKET_SENDER_RECEIVER(pinfo, send, pos, recv, pos2, posnet, sdn) { \
- PACKET_SENDER(pinfo, send, pos, posnet, sdn); \
- PACKET_RECEIVER(pinfo, recv, pos2, posnet, sdn); \
- }
+ PACKET_SENDER(pinfo, send, pos, posnet, sdn); \
+ PACKET_RECEIVER(pinfo, recv, pos2, posnet, sdn); \
+ }
static guint16
findFrame1Position ( guint8 byteStream[], guint8 dataLength, gboolean checkIfSlimMistake )
@@ -575,7 +579,7 @@ static guint8 findSafetyFrame ( guint8 * pBuffer, guint32 length, guint u_Offset
/** Seem redundant if b_frame2First is false. But in this case, the function is needed for the
* simple detection of a possible openSAFETY frame. */
if ( b_frame2first && found )
- *u_frameOffset = u_Offset;
+ *u_frameOffset = u_Offset;
return (found ? 1 : 0);
}
@@ -601,27 +605,32 @@ dissect_opensafety_spdo_message(tvbuff_t *message_tvb, proto_tree *opensafety_t
/* Network address is xor'ed into the start of the second frame, but only legible, if the scm given is valid */
taddr = ( ( OSS_FRAME_ADDR(bytes, frameStart1) ) ^ ( OSS_FRAME_ADDR(bytes, frameStart2) ) );
if ( ! validSCMUDID )
- taddr = 0;
+ taddr = 0;
/* An SPDO get's always send by the producer, to everybody else */
PACKET_SENDER( pinfo, OSS_FRAME_ADDR(bytes, frameStart1), OSS_FRAME_POS_ADDR + frameStart1, frameStart2, taddr );
- item = proto_tree_add_uint_format_value(opensafety_tree, hf_oss_msg_category, message_tvb, OSS_FRAME_POS_ID + frameStart1, 1,
- OPENSAFETY_SPDO_MESSAGE_TYPE, "%s", val_to_str(OPENSAFETY_SPDO_MESSAGE_TYPE, message_id_values, "Unknown") );
+ item = proto_tree_add_uint_format_value(opensafety_tree, hf_oss_msg_category, message_tvb,
+ OSS_FRAME_POS_ID + frameStart1, 1, OPENSAFETY_SPDO_MESSAGE_TYPE,
+ "%s", val_to_str_const(OPENSAFETY_SPDO_MESSAGE_TYPE, message_id_values, "Unknown") );
PROTO_ITEM_SET_GENERATED(item);
spdo_tree = proto_item_add_subtree(item, ett_opensafety_spdo);
if ( b_ID == OPENSAFETY_MSG_SPDO_DATA_WITH_TIME_RESPONSE )
- proto_tree_add_boolean(spdo_tree, hf_oss_msg_direction, message_tvb, OSS_FRAME_POS_ID + frameStart1, 1, OPENSAFETY_RESPONSE);
+ proto_tree_add_boolean(spdo_tree, hf_oss_msg_direction, message_tvb,
+ OSS_FRAME_POS_ID + frameStart1, 1, OPENSAFETY_RESPONSE);
else if ( b_ID == OPENSAFETY_MSG_SPDO_DATA_WITH_TIME_REQUEST || b_ID == OPENSAFETY_MSG_SPDO_DATA_ONLY )
- proto_tree_add_boolean(spdo_tree, hf_oss_msg_direction, message_tvb, OSS_FRAME_POS_ID + frameStart1, 1, OPENSAFETY_REQUEST);
+ proto_tree_add_boolean(spdo_tree, hf_oss_msg_direction, message_tvb,
+ OSS_FRAME_POS_ID + frameStart1, 1, OPENSAFETY_REQUEST);
proto_tree_add_uint_format_value(spdo_tree, hf_oss_msg, message_tvb, OSS_FRAME_POS_ID + frameStart1, 1,
- b_ID, "%s", val_to_str(b_ID, message_type_values, "Unknown") );
+ b_ID, "%s", val_to_str_const(b_ID, message_type_values, "Unknown") );
- proto_tree_add_uint(spdo_tree, hf_oss_spdo_producer, message_tvb, OSS_FRAME_POS_ADDR + frameStart1, 2, OSS_FRAME_ADDR(bytes, frameStart1));
- proto_tree_add_boolean(spdo_tree, hf_oss_spdo_connection_valid, message_tvb, OSS_FRAME_POS_ID + frameStart1, 1, conn_Valid);
+ proto_tree_add_uint(spdo_tree, hf_oss_spdo_producer, message_tvb,
+ OSS_FRAME_POS_ADDR + frameStart1, 2, OSS_FRAME_ADDR(bytes, frameStart1));
+ proto_tree_add_boolean(spdo_tree, hf_oss_spdo_connection_valid, message_tvb,
+ OSS_FRAME_POS_ID + frameStart1, 1, conn_Valid);
/* taddr is the 4th octet in the second frame */
taddr = OSS_FRAME_ADDR(bytes, frameStart2 + 3);
@@ -630,11 +639,14 @@ dissect_opensafety_spdo_message(tvbuff_t *message_tvb, proto_tree *opensafety_t
if ( b_ID == OPENSAFETY_MSG_SPDO_DATA_WITH_TIME_REQUEST )
{
item = proto_tree_add_uint_format_value(spdo_tree, hf_oss_spdo_time_value_sn, message_tvb, 0, 0, ct,
- "0x%04X [%d] (%s)", ct, ct, (validSCMUDID ? "Complete" : "Low byte only"));
+ "0x%04X [%d] (%s)", ct, ct,
+ (validSCMUDID ? "Complete" : "Low byte only"));
PROTO_ITEM_SET_GENERATED(item);
- proto_tree_add_uint(spdo_tree, hf_oss_spdo_time_request, message_tvb, OSS_FRAME_POS_ADDR + frameStart2 + 4, 1, tr);
- proto_tree_add_uint(spdo_tree, hf_oss_spdo_time_request_from, message_tvb, OSS_FRAME_POS_ADDR + frameStart2 + 3, 2, taddr);
+ proto_tree_add_uint(spdo_tree, hf_oss_spdo_time_request, message_tvb,
+ OSS_FRAME_POS_ADDR + frameStart2 + 4, 1, tr);
+ proto_tree_add_uint(spdo_tree, hf_oss_spdo_time_request_from, message_tvb,
+ OSS_FRAME_POS_ADDR + frameStart2 + 3, 2, taddr);
}
else
{
@@ -690,7 +702,8 @@ dissect_opensafety_ssdo_message(tvbuff_t *message_tvb , packet_info * pinfo, pro
taddr = OSS_FRAME_ADDR(bytes, frameStart2 + 3);
PACKET_SENDER_RECEIVER( pinfo, OSS_FRAME_ADDR(bytes, frameStart1), frameStart1, taddr, frameStart2 + 3,
- frameStart2, ( ( OSS_FRAME_ADDR(bytes, frameStart1) ) ^ ( OSS_FRAME_ADDR(bytes, frameStart2) ) ));
+ frameStart2,
+ ( ( OSS_FRAME_ADDR(bytes, frameStart1) ) ^ ( OSS_FRAME_ADDR(bytes, frameStart2) ) ));
}
else if ( ! isRequest )
{
@@ -699,11 +712,14 @@ dissect_opensafety_ssdo_message(tvbuff_t *message_tvb , packet_info * pinfo, pro
if ( ( OSS_FRAME_ID(bytes, frameStart1) == OPENSAFETY_MSG_SSDO_SLIM_SERVICE_REQUEST ) ||
( OSS_FRAME_ID(bytes, frameStart1) == OPENSAFETY_MSG_SSDO_SLIM_SERVICE_RESPONSE ) )
- item = proto_tree_add_uint_format_value(opensafety_tree, hf_oss_msg_category, message_tvb, OSS_FRAME_POS_ID + frameStart1, 1,
- OPENSAFETY_SLIM_SSDO_MESSAGE_TYPE, "%s", val_to_str(OPENSAFETY_SLIM_SSDO_MESSAGE_TYPE, message_id_values, "Unknown") );
+ item = proto_tree_add_uint_format_value(opensafety_tree, hf_oss_msg_category, message_tvb,
+ OSS_FRAME_POS_ID + frameStart1, 1,
+ OPENSAFETY_SLIM_SSDO_MESSAGE_TYPE,
+ "%s", val_to_str_const(OPENSAFETY_SLIM_SSDO_MESSAGE_TYPE, message_id_values, "Unknown") );
else
- item = proto_tree_add_uint_format_value(opensafety_tree, hf_oss_msg_category, message_tvb, OSS_FRAME_POS_ID + frameStart1, 1,
- OPENSAFETY_SSDO_MESSAGE_TYPE, "%s", val_to_str(OPENSAFETY_SSDO_MESSAGE_TYPE, message_id_values, "Unknown") );
+ item = proto_tree_add_uint_format_value(opensafety_tree, hf_oss_msg_category, message_tvb, OSS_FRAME_POS_ID + frameStart1, 1,
+ OPENSAFETY_SSDO_MESSAGE_TYPE,
+ "%s", val_to_str_const(OPENSAFETY_SSDO_MESSAGE_TYPE, message_id_values, "Unknown") );
PROTO_ITEM_SET_GENERATED(item);
ssdo_tree = proto_item_add_subtree(item, ett_opensafety_ssdo);
@@ -715,7 +731,8 @@ dissect_opensafety_ssdo_message(tvbuff_t *message_tvb , packet_info * pinfo, pro
proto_tree_add_boolean(ssdo_tree, hf_oss_msg_direction, message_tvb, OSS_FRAME_POS_ID + frameStart1, 1, OPENSAFETY_REQUEST);
proto_tree_add_uint_format_value(ssdo_tree, hf_oss_msg, message_tvb, OSS_FRAME_POS_ID + frameStart1, 1,
- OSS_FRAME_ID(bytes, frameStart1), "%s", val_to_str(OSS_FRAME_ID(bytes, frameStart1), message_type_values, "Unknown") );
+ OSS_FRAME_ID(bytes, frameStart1),
+ "%s", val_to_str_const(OSS_FRAME_ID(bytes, frameStart1), message_type_values, "Unknown") );
if ( isRequest )
{
@@ -743,7 +760,7 @@ dissect_opensafety_ssdo_message(tvbuff_t *message_tvb , packet_info * pinfo, pro
}
item = proto_tree_add_uint(ssdo_tree, hf_oss_ssdo_sacmd, message_tvb, db0Offset, 1, sacmd);
- col_append_fstr(pinfo->cinfo, COL_INFO, ", SACMD: %s", val_to_str(sacmd, ssdo_sacmd_values, " "));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", SACMD: %s", val_to_str_const(sacmd, ssdo_sacmd_values, " "));
ssdo_sacmd_tree = proto_item_add_subtree(item, ett_opensafety_ssdo_sacmd);
proto_tree_add_boolean(ssdo_sacmd_tree, hf_oss_ssdo_sacmd_block_transfer, message_tvb, db0Offset, 1, db0);
@@ -783,7 +800,7 @@ dissect_opensafety_ssdo_message(tvbuff_t *message_tvb , packet_info * pinfo, pro
proto_tree_add_uint_format_value(ssdo_tree, hf_oss_ssdo_abort_code, message_tvb, payloadOffset, 4, abortcode,
"0x%04X %04X - %s", (guint16)(abortcode >> 16), (guint16)(abortcode),
- val_to_str(abortcode, abort_codes, "Unknown"));
+ val_to_str_const(abortcode, abort_codes, "Unknown"));
} else if ( ( isRequest && (sacmd == OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_SEGMENTED ||
@@ -859,16 +876,17 @@ dissect_opensafety_snmt_message(tvbuff_t *message_tvb, packet_info *pinfo , prot
( (db0 ^ OPENSAFETY_MSG_SNMT_EXT_SCM_SET_TO_STOP) == 0 || (db0 ^ OPENSAFETY_MSG_SNMT_EXT_SCM_SET_TO_OP) == 0 ) )
{
PACKET_RECEIVER( pinfo, addr, OSS_FRAME_POS_ADDR + frameStart1, frameStart2,
- ( OSS_FRAME_ADDR(bytes, frameStart1) ^ OSS_FRAME_ADDR(bytes, frameStart2) ) );
+ ( OSS_FRAME_ADDR(bytes, frameStart1) ^ OSS_FRAME_ADDR(bytes, frameStart2) ) );
}
else
{
PACKET_SENDER_RECEIVER ( pinfo, taddr, frameStart2 + 3, addr, OSS_FRAME_POS_ADDR + frameStart1, frameStart2,
- ( OSS_FRAME_ADDR(bytes, frameStart1) ^ OSS_FRAME_ADDR(bytes, frameStart2) ) );
+ ( OSS_FRAME_ADDR(bytes, frameStart1) ^ OSS_FRAME_ADDR(bytes, frameStart2) ) );
}
item = proto_tree_add_uint_format_value(opensafety_tree, hf_oss_msg_category, message_tvb, OSS_FRAME_POS_ID + frameStart1, 1,
- OPENSAFETY_SNMT_MESSAGE_TYPE, "%s", val_to_str(OPENSAFETY_SNMT_MESSAGE_TYPE, message_id_values, "Unknown") );
+ OPENSAFETY_SNMT_MESSAGE_TYPE,
+ "%s", val_to_str_const(OPENSAFETY_SNMT_MESSAGE_TYPE, message_id_values, "Unknown") );
PROTO_ITEM_SET_GENERATED(item);
snmt_tree = proto_item_add_subtree(item, ett_opensafety_snmt);
@@ -881,7 +899,8 @@ dissect_opensafety_snmt_message(tvbuff_t *message_tvb, packet_info *pinfo , prot
proto_tree_add_boolean(snmt_tree, hf_oss_msg_direction, message_tvb, OSS_FRAME_POS_ID + frameStart1, 1, OPENSAFETY_REQUEST);
proto_tree_add_uint_format_value(snmt_tree, hf_oss_msg, message_tvb, OSS_FRAME_POS_ID + frameStart1, 1,
- OSS_FRAME_ID(bytes, frameStart1), "%s", val_to_str(OSS_FRAME_ID(bytes, frameStart1), message_type_values, "Unknown") );
+ OSS_FRAME_ID(bytes, frameStart1),
+ "%s", val_to_str_const(OSS_FRAME_ID(bytes, frameStart1), message_type_values, "Unknown") );
if ( (OSS_FRAME_ID(bytes, frameStart1) ^ OPENSAFETY_MSG_SNMT_SN_RESET_GUARDING_SCM) == 0 )
{
@@ -891,7 +910,7 @@ dissect_opensafety_snmt_message(tvbuff_t *message_tvb, packet_info *pinfo , prot
else if ( (OSS_FRAME_ID(bytes, frameStart1) ^ OPENSAFETY_MSG_SNMT_SERVICE_RESPONSE) == 0 )
{
proto_tree_add_uint(snmt_tree, hf_oss_snmt_service_id, message_tvb, OSS_FRAME_POS_DATA + frameStart1, 1, db0);
- col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str(db0, message_service_type, " "));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str_const(db0, message_service_type, " "));
proto_tree_add_uint(snmt_tree, hf_oss_snmt_master, message_tvb, OSS_FRAME_POS_ADDR + frameStart1, 2, addr);
proto_tree_add_uint(snmt_tree, hf_oss_snmt_slave, message_tvb, frameStart2 + 3, 2, taddr);
@@ -910,7 +929,7 @@ dissect_opensafety_snmt_message(tvbuff_t *message_tvb, packet_info *pinfo , prot
else if ( (OSS_FRAME_ID(bytes, frameStart1) ^ OPENSAFETY_MSG_SNMT_SERVICE_REQUEST) == 0 )
{
proto_tree_add_uint(snmt_tree, hf_oss_snmt_service_id, message_tvb, OSS_FRAME_POS_DATA + frameStart1, 1, db0);
- col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str(db0, message_service_type, " "));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str_const(db0, message_service_type, " "));
if ( (db0 ^ OPENSAFETY_MSG_SNMT_EXT_SCM_SET_TO_STOP) == 0 || (db0 ^ OPENSAFETY_MSG_SNMT_EXT_SCM_SET_TO_OP) == 0 )
{
@@ -1009,7 +1028,7 @@ dissect_opensafety_checksum(tvbuff_t *message_tvb, proto_tree *opensafety_tree ,
static gboolean
dissect_opensafety_message(guint16 frameStart1, guint16 frameStart2, guint8 type,
- tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *opensafety_tree, guint8 u_nrInPackage)
+ tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *opensafety_tree, guint8 u_nrInPackage)
{
guint8 b_ID;
guint length;
@@ -1074,19 +1093,19 @@ dissect_opensafety_message(guint16 frameStart1, guint16 frameStart2, guint8 type
}
else
{
- messageTypeUnknown = TRUE;
+ messageTypeUnknown = TRUE;
}
}
item = proto_tree_add_uint(opensafety_tree, hf_oss_length, message_tvb, OSS_FRAME_POS_LEN + frameStart1, 1, OSS_FRAME_LENGTH(bytes, frameStart1));
- if ( messageTypeUnknown )
- {
- expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR, "Unknown openSAFETY message type" );
- }
- else
- {
- dissect_opensafety_checksum ( message_tvb, opensafety_tree, bytes, frameStart1 );
- }
+ if ( messageTypeUnknown )
+ {
+ expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR, "Unknown openSAFETY message type" );
+ }
+ else
+ {
+ dissect_opensafety_checksum ( message_tvb, opensafety_tree, bytes, frameStart1 );
+ }
}
return TRUE;
@@ -1094,8 +1113,8 @@ dissect_opensafety_message(guint16 frameStart1, guint16 frameStart2, guint8 type
static gboolean
opensafety_package_dissector(const gchar * protocolName, const gchar * sub_diss_handle,
- gboolean b_frame2First, gboolean do_byte_swap,
- tvbuff_t *message_tvb , packet_info *pinfo , proto_tree *tree )
+ gboolean b_frame2First, gboolean do_byte_swap,
+ tvbuff_t *message_tvb , packet_info *pinfo , proto_tree *tree )
{
tvbuff_t *next_tvb;
guint length, len, frameOffset, frameLength, nodeAddress;
@@ -1120,10 +1139,10 @@ opensafety_package_dissector(const gchar * protocolName, const gchar * sub_diss_
if ( strlen( sub_diss_handle ) > 0 )
{
- call_sub_dissector = TRUE;
- protocol_dissector = find_dissector ( sub_diss_handle );
- if ( protocol_dissector == NULL )
- protocol_dissector = find_dissector ( "data" );
+ call_sub_dissector = TRUE;
+ protocol_dissector = find_dissector ( sub_diss_handle );
+ if ( protocol_dissector == NULL )
+ protocol_dissector = find_dissector ( "data" );
}
reported_len = tvb_reported_length_remaining(message_tvb, 0);
@@ -1147,17 +1166,17 @@ opensafety_package_dissector(const gchar * protocolName, const gchar * sub_diss_
while ( frameOffset < length )
{
- /** This case can occurs only during fuzztest or randpkt testing. */
+ /** This case can occurs only during fuzztest or randpkt testing. */
if ( ( length - frameOffset ) <= 0 )
- break;
+ break;
/** Finding the start of the first possible safety frame */
if ( findSafetyFrame(bytes, length - frameOffset, frameOffset, b_frame2First, &frameOffset, &frameLength) )
{
- /** frameLength is calculated/read directly from the dissected data. If frameLenght and frameOffset together
- * are bigger than the reported length, the package is not really an openSAFETY package */
- if ( ( frameOffset + frameLength ) > (guint)reported_len )
- break;
+ /** frameLength is calculated/read directly from the dissected data. If frameLenght and frameOffset together
+ * are bigger than the reported length, the package is not really an openSAFETY package */
+ if ( ( frameOffset + frameLength ) > (guint)reported_len )
+ break;
found++;
/* Freeing memory before dissector, as otherwise we would waste it */
@@ -1193,9 +1212,9 @@ opensafety_package_dissector(const gchar * protocolName, const gchar * sub_diss_
* also increase the search offset, just doing a continue will result in an infinite loop. */
if (frameStart1 == frameStart2)
{
- found--;
- frameOffset += frameLength ;
- continue;
+ found--;
+ frameOffset += frameLength ;
+ continue;
}
/* We determine the possible type, and return false, if there could not be one */
@@ -1227,9 +1246,9 @@ opensafety_package_dissector(const gchar * protocolName, const gchar * sub_diss_
else if ( ( OSS_FRAME_ID(bytesOffset, frameStart1) & OPENSAFETY_SNMT_MESSAGE_TYPE ) == OPENSAFETY_SNMT_MESSAGE_TYPE )
type = OPENSAFETY_SNMT_MESSAGE_TYPE;
else {
- /* Skip this frame. We cannot continue without
- advancing frameOffset - just doing a continue
- will result in an infinite loop. */
+ /* Skip this frame. We cannot continue without
+ advancing frameOffset - just doing a continue
+ will result in an infinite loop. */
frameOffset += frameLength;
continue;
}
@@ -1245,9 +1264,9 @@ opensafety_package_dissector(const gchar * protocolName, const gchar * sub_diss_
* is malformed. Instead of declining dissection, the package get's marked as malformed */
if ( type == OPENSAFETY_SPDO_MESSAGE_TYPE )
{
- nodeAddress = OSS_FRAME_ADDR(bytesOffset, frameStart1);
- if ( nodeAddress > 1024 ) {
- markAsMalformed = TRUE;
+ nodeAddress = OSS_FRAME_ADDR(bytesOffset, frameStart1);
+ if ( nodeAddress > 1024 ) {
+ markAsMalformed = TRUE;
}
}
@@ -1256,12 +1275,12 @@ opensafety_package_dissector(const gchar * protocolName, const gchar * sub_diss_
* is fault, and therefore we return false.
*/
if ( ( (gint)frameLength - (gint)( frameStart2 > frameStart1 ? frameStart2 : frameLength - frameStart1 ) ) < 0 )
- return FALSE;
+ return FALSE;
if ( ! dissectorCalled )
{
- if ( call_sub_dissector )
- call_dissector(protocol_dissector, message_tvb, pinfo, tree);
+ if ( call_sub_dissector )
+ call_dissector(protocol_dissector, message_tvb, pinfo, tree);
dissectorCalled = TRUE;
col_set_str(pinfo->cinfo, COL_PROTOCOL, protocolName);
@@ -1281,8 +1300,8 @@ opensafety_package_dissector(const gchar * protocolName, const gchar * sub_diss_
if ( markAsMalformed )
{
- if ( OSS_FRAME_ADDR(bytesOffset, frameStart1) > 1024 )
- expert_add_info_format(pinfo, opensafety_item, PI_MALFORMED, PI_ERROR, "SPDO address is invalid" );
+ if ( OSS_FRAME_ADDR(bytesOffset, frameStart1) > 1024 )
+ expert_add_info_format(pinfo, opensafety_item, PI_MALFORMED, PI_ERROR, "SPDO address is invalid" );
}
} else {
opensafety_tree = NULL;
@@ -1300,8 +1319,8 @@ opensafety_package_dissector(const gchar * protocolName, const gchar * sub_diss_
if ( ! handled )
{
- if ( call_sub_dissector )
- call_dissector(protocol_dissector, message_tvb, pinfo, tree);
+ if ( call_sub_dissector )
+ call_dissector(protocol_dissector, message_tvb, pinfo, tree);
handled = TRUE;
}
return ( handled ? TRUE : FALSE );
@@ -1321,19 +1340,19 @@ dissect_opensafety_epl(tvbuff_t *message_tvb , packet_info *pinfo , proto_tree *
{
calledOnce = TRUE;
- firstByte = ( tvb_get_guint8(message_tvb, 0) << 1 );
+ firstByte = ( tvb_get_guint8(message_tvb, 0) << 1 );
- /* No frames can be sent in SoA and SoC messages, therefore those get filtered right away */
- if ( ( firstByte != 0x02 ) && ( firstByte != 0x0A ) )
- {
- result = opensafety_package_dissector("openSAFETY/Powerlink", "epl",
- FALSE, FALSE, message_tvb, pinfo, tree);
- }
+ /* No frames can be sent in SoA and SoC messages, therefore those get filtered right away */
+ if ( ( firstByte != 0x02 ) && ( firstByte != 0x0A ) )
+ {
+ result = opensafety_package_dissector("openSAFETY/Powerlink", "epl",
+ FALSE, FALSE, message_tvb, pinfo, tree);
+ }
- calledOnce = FALSE;
- }
+ calledOnce = FALSE;
+ }
- return result;
+ return result;
}
@@ -1346,7 +1365,7 @@ dissect_opensafety_siii(tvbuff_t *message_tvb , packet_info *pinfo , proto_tree
if ( pinfo->ipproto == IPPROTO_UDP )
{
- return opensafety_package_dissector("openSAFETY/SercosIII UDP", "", FALSE, FALSE, message_tvb, pinfo, tree);
+ return opensafety_package_dissector("openSAFETY/SercosIII UDP", "", FALSE, FALSE, message_tvb, pinfo, tree);
}
/* We can assume to have a SercosIII package, as the SercosIII dissector won't detect
@@ -1362,8 +1381,8 @@ dissect_opensafety_siii(tvbuff_t *message_tvb , packet_info *pinfo , proto_tree
firstByte = ( tvb_get_guint8(message_tvb, 0) << 1 );
if ( ( firstByte & 0x40 ) != 0x40 )
{
- result = opensafety_package_dissector("openSAFETY/SercosIII", "sercosiii",
- FALSE, FALSE, message_tvb, pinfo, tree);
+ result = opensafety_package_dissector("openSAFETY/SercosIII", "sercosiii",
+ FALSE, FALSE, message_tvb, pinfo, tree);
}
calledOnce = FALSE;
}
@@ -1383,29 +1402,29 @@ dissect_opensafety_pn_io(tvbuff_t *message_tvb , packet_info *pinfo , proto_tree
if ( calledOnce == FALSE )
{
calledOnce = TRUE;
- result = opensafety_package_dissector("openSAFETY/Profinet IO", "pn_io",
- FALSE, FALSE, message_tvb, pinfo, tree);
- calledOnce = FALSE;
- }
+ result = opensafety_package_dissector("openSAFETY/Profinet IO", "pn_io",
+ FALSE, FALSE, message_tvb, pinfo, tree);
+ calledOnce = FALSE;
+ }
- return result;
+ return result;
}
static gboolean
dissect_opensafety_mbtcp(tvbuff_t *message_tvb , packet_info *pinfo , proto_tree *tree )
{
- /* When Modbus/TCP get's dissected, openSAFETY would be sorted as a child protocol. Although,
- * this behaviour is technically correct, it differs from other implemented IEM protocol handlers.
- * Therefore, the openSAFETY frame get's put one up, if the parent is not NULL */
- return opensafety_package_dissector("openSAFETY/Modbus TCP", "", FALSE, TRUE,
- message_tvb, pinfo, ( tree->parent != NULL ? tree->parent : tree ));
+ /* When Modbus/TCP get's dissected, openSAFETY would be sorted as a child protocol. Although,
+ * this behaviour is technically correct, it differs from other implemented IEM protocol handlers.
+ * Therefore, the openSAFETY frame get's put one up, if the parent is not NULL */
+ return opensafety_package_dissector("openSAFETY/Modbus TCP", "", FALSE, TRUE,
+ message_tvb, pinfo, ( tree->parent != NULL ? tree->parent : tree ));
}
static gboolean
dissect_opensafety_udp(tvbuff_t *message_tvb , packet_info *pinfo , proto_tree *tree )
{
- return opensafety_package_dissector((pinfo->destport == UDP_PORT_SIII ? "openSAFETY/SercosIII" : "openSAFETY/UDP" ),
- "", TRUE, FALSE, message_tvb, pinfo, tree);
+ return opensafety_package_dissector((pinfo->destport == UDP_PORT_SIII ? "openSAFETY/SercosIII" : "openSAFETY/UDP" ),
+ "", TRUE, FALSE, message_tvb, pinfo, tree);
}
static void
@@ -1444,68 +1463,167 @@ proto_register_opensafety(void)
{
/* Setup list of header fields */
static hf_register_info hf[] = {
- /* General fields for subframe 1 */
-
- { &hf_oss_scm_udid, { "SCM UDID Configured", "opensafety.scm_udid", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_scm_udid_valid, { "SCM UDID Valid", "opensafety.scm_udid_valid", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } },
-
- { &hf_oss_msg, { "Message", "opensafety.msg.id", FT_UINT8, BASE_HEX, VALS(message_type_values), 0x0, NULL, HFILL } },
- { &hf_oss_msg_category, { "Type", "opensafety.msg.type", FT_UINT16, BASE_NONE, VALS(message_id_values), 0x0, NULL, HFILL } },
- { &hf_oss_msg_direction, { "Direction", "opensafety.msg.direction", FT_BOOLEAN, BASE_NONE, TFS(&opensafety_message_direction), 0x0, NULL, HFILL } },
- { &hf_oss_msg_node, { "Safety Node", "opensafety.msg.node", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_msg_network, { "Safety Domain", "opensafety.msg.network", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_msg_sender, { "Sender", "opensafety.msg.sender", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_msg_receiver, { "Receiver", "opensafety.msg.receiver", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_length, { "Length", "opensafety.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_data, { "Data", "opensafety.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_crc, { "CRC", "opensafety.crc.data", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
-
- { &hf_oss_crc_valid, { "Is Valid", "opensafety.crc.valid", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_crc_type, { "CRC Type", "opensafety.crc.type", FT_UINT8, BASE_DEC, VALS(message_crc_type), 0x0, NULL, HFILL } },
-
- /* SNMT Specific fields */
- { &hf_oss_snmt_slave, { "SNMT Slave", "opensafety.snmt.slave", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_snmt_master, { "SNMT Master", "opensafety.snmt.master", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_snmt_scm, { "SCM", "opensafety.snmt.scm", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_snmt_tool, { "Tool ID", "opensafety.snmt.tool_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_snmt_udid, { "UDID for SN", "opensafety.snmt.udid", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_snmt_timestamp, { "Parameter Timestamp", "opensafety.snmt.timestamp", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_snmt_service_id, { "Extended Service ID", "opensafety.snmt.service_id", FT_UINT8, BASE_HEX, VALS(message_service_type), 0x0, NULL, HFILL } },
- { &hf_oss_snmt_error_group, { "Error Group", "opensafety.snmt.error_group", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_snmt_error_code, { "Error Code", "opensafety.snmt.error_code", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
-
- /* SSDO Specific fields */
- { &hf_oss_ssdo_server, { "SSDO Server", "opensafety.ssdo.master", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_ssdo_client, { "SSDO Client", "opensafety.ssdo.client", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_ssdo_sano, { "SOD Access Request Number", "opensafety.ssdo.sano", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_ssdo_sacmd, { "SOD Access Command", "opensafety.ssdo.sacmd", FT_UINT8, BASE_HEX, VALS(ssdo_sacmd_values), 0x0, NULL, HFILL } },
- { &hf_oss_ssdo_sod_index, { "SOD Index", "opensafety.ssdo.sod_index", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_ssdo_sod_subindex, { "SOD Sub Index", "opensafety.ssdo.sod_subindex", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_ssdo_payload, { "SOD Payload", "opensafety.ssdo.payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_ssdo_payload_size, { "SOD Payload Size", "opensafety.ssdo.payloadsize", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_ssdo_segment_size, { "SOD Segment Size", "opensafety.ssdo.segmentsize", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_ssdo_inhibit_time, { "Inhibit Time", "opensafety.ssdo.inhibittime", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_ssdo_abort_code, { "Abort Code", "opensafety.ssdo.abortcode", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } },
-
- /* SSDO SACmd specific fields */
- { &hf_oss_ssdo_sacmd_access_type, { "Access Type", "opensafety.ssdo.sacmd.access", FT_BOOLEAN, 8, TFS(&opensafety_sacmd_acc), OPENSAFETY_SSDO_SACMD_ACC, NULL, HFILL } },
- { &hf_oss_ssdo_sacmd_reserved, { "Reserved", "opensafety.ssdo.sacmd.reserved", FT_BOOLEAN, 8, TFS(&opensafety_sacmd_res), OPENSAFETY_SSDO_SACMD_RES, NULL, HFILL } },
- { &hf_oss_ssdo_sacmd_abort_transfer, { "Abort Transfer", "opensafety.ssdo.sacmd.abort_transfer", FT_BOOLEAN, 8, TFS(&opensafety_sacmd_abrt), OPENSAFETY_SSDO_SACMD_ABRT, NULL, HFILL } },
- { &hf_oss_ssdo_sacmd_segmentation, { "Segmentation", "opensafety.ssdo.sacmd.segmentation", FT_BOOLEAN, 8, TFS(&opensafety_sacmd_seg), OPENSAFETY_SSDO_SACMD_SEG, NULL, HFILL } },
- { &hf_oss_ssdo_sacmd_toggle, { "Toggle Bit", "opensafety.ssdo.sacmd.toggle", FT_BOOLEAN, 8, TFS(&opensafety_on_off), OPENSAFETY_SSDO_SACMD_TGL, NULL, HFILL } },
- { &hf_oss_ssdo_sacmd_initiate, { "Initiate Transfer", "opensafety.ssdo.sacmd.initiate", FT_BOOLEAN, 8, TFS(&opensafety_sacmd_ini), OPENSAFETY_SSDO_SACMD_INI, NULL, HFILL } },
- { &hf_oss_ssdo_sacmd_end_segment, { "End Segment", "opensafety.ssdo.sacmd.end_segment", FT_BOOLEAN, 8, TFS(&opensafety_sacmd_ensg), OPENSAFETY_SSDO_SACMD_ENSG, NULL, HFILL } },
- { &hf_oss_ssdo_sacmd_block_transfer, { "Block Transfer", "opensafety.ssdo.sacmd.block_transfer", FT_BOOLEAN, 8, TFS(&opensafety_sacmd_blk), OPENSAFETY_SSDO_SACMD_BLK, NULL, HFILL } },
-
- /* SPDO Specific fields */
- { &hf_oss_spdo_connection_valid, { "Connection Valid Bit", "opensafety.spdo.connection_valid", FT_BOOLEAN, 8, TFS(&opensafety_set_notset), 0x0, NULL, HFILL } },
- { &hf_oss_spdo_payload, { "SPDO Payload", "opensafety.spdo.payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_spdo_producer, { "Producer", "opensafety.spdo.producer", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_spdo_producer_time, { "Internal Time Producer", "opensafety.spdo.time.producer", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_spdo_time_value_sn, { "Internal Time SN", "opensafety.spdo.time.sn", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_spdo_time_request, { "Time Request Counter", "opensafety.spdo.time.request_counter", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_spdo_time_request_to, { "Time Request from", "opensafety.spdo.time.request_from", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
- { &hf_oss_spdo_time_request_from, { "Time Request by", "opensafety.spdo.time.request_to", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ /* General fields for subframe 1 */
+
+ { &hf_oss_scm_udid,
+ { "SCM UDID Configured", "opensafety.scm_udid",
+ FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_scm_udid_valid,
+ { "SCM UDID Valid", "opensafety.scm_udid_valid",
+ FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+
+ { &hf_oss_msg,
+ { "Message", "opensafety.msg.id",
+ FT_UINT8, BASE_HEX, VALS(message_type_values), 0x0, NULL, HFILL } },
+ { &hf_oss_msg_category,
+ { "Type", "opensafety.msg.type",
+ FT_UINT16, BASE_NONE, VALS(message_id_values), 0x0, NULL, HFILL } },
+ { &hf_oss_msg_direction,
+ { "Direction", "opensafety.msg.direction",
+ FT_BOOLEAN, BASE_NONE, TFS(&opensafety_message_direction), 0x0, NULL, HFILL } },
+ { &hf_oss_msg_node,
+ { "Safety Node", "opensafety.msg.node",
+ FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_msg_network,
+ { "Safety Domain", "opensafety.msg.network",
+ FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_msg_sender,
+ { "Sender", "opensafety.msg.sender",
+ FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_msg_receiver,
+ { "Receiver", "opensafety.msg.receiver",
+ FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_length,
+ { "Length", "opensafety.length",
+ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_data,
+ { "Data", "opensafety.data",
+ FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_crc,
+ { "CRC", "opensafety.crc.data",
+ FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+
+ { &hf_oss_crc_valid,
+ { "Is Valid", "opensafety.crc.valid",
+ FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_crc_type,
+ { "CRC Type", "opensafety.crc.type",
+ FT_UINT8, BASE_DEC, VALS(message_crc_type), 0x0, NULL, HFILL } },
+
+ /* SNMT Specific fields */
+ { &hf_oss_snmt_slave,
+ { "SNMT Slave", "opensafety.snmt.slave",
+ FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_snmt_master,
+ { "SNMT Master", "opensafety.snmt.master",
+ FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_snmt_scm,
+ { "SCM", "opensafety.snmt.scm",
+ FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_snmt_tool,
+ { "Tool ID", "opensafety.snmt.tool_id",
+ FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_snmt_udid,
+ { "UDID for SN", "opensafety.snmt.udid",
+ FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_snmt_timestamp,
+ { "Parameter Timestamp", "opensafety.snmt.timestamp",
+ FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_snmt_service_id,
+ { "Extended Service ID", "opensafety.snmt.service_id",
+ FT_UINT8, BASE_HEX, VALS(message_service_type), 0x0, NULL, HFILL } },
+ { &hf_oss_snmt_error_group,
+ { "Error Group", "opensafety.snmt.error_group",
+ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_snmt_error_code,
+ { "Error Code", "opensafety.snmt.error_code",
+ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+
+ /* SSDO Specific fields */
+ { &hf_oss_ssdo_server,
+ { "SSDO Server", "opensafety.ssdo.master",
+ FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_ssdo_client,
+ { "SSDO Client", "opensafety.ssdo.client",
+ FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_ssdo_sano,
+ { "SOD Access Request Number", "opensafety.ssdo.sano",
+ FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_ssdo_sacmd,
+ { "SOD Access Command", "opensafety.ssdo.sacmd",
+ FT_UINT8, BASE_HEX, VALS(ssdo_sacmd_values), 0x0, NULL, HFILL } },
+ { &hf_oss_ssdo_sod_index,
+ { "SOD Index", "opensafety.ssdo.sod_index",
+ FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_ssdo_sod_subindex,
+ { "SOD Sub Index", "opensafety.ssdo.sod_subindex",
+ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_ssdo_payload,
+ { "SOD Payload", "opensafety.ssdo.payload",
+ FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_ssdo_payload_size,
+ { "SOD Payload Size", "opensafety.ssdo.payloadsize",
+ FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_ssdo_segment_size,
+ { "SOD Segment Size", "opensafety.ssdo.segmentsize",
+ FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_ssdo_inhibit_time,
+ { "Inhibit Time", "opensafety.ssdo.inhibittime",
+ FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_ssdo_abort_code,
+ { "Abort Code", "opensafety.ssdo.abortcode", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+
+ /* SSDO SACmd specific fields */
+ { &hf_oss_ssdo_sacmd_access_type,
+ { "Access Type", "opensafety.ssdo.sacmd.access",
+ FT_BOOLEAN, 8, TFS(&opensafety_sacmd_acc), OPENSAFETY_SSDO_SACMD_ACC, NULL, HFILL } },
+ { &hf_oss_ssdo_sacmd_reserved,
+ { "Reserved", "opensafety.ssdo.sacmd.reserved",
+ FT_BOOLEAN, 8, TFS(&opensafety_sacmd_res), OPENSAFETY_SSDO_SACMD_RES, NULL, HFILL } },
+ { &hf_oss_ssdo_sacmd_abort_transfer,
+ { "Abort Transfer", "opensafety.ssdo.sacmd.abort_transfer",
+ FT_BOOLEAN, 8, TFS(&opensafety_sacmd_abrt), OPENSAFETY_SSDO_SACMD_ABRT, NULL, HFILL } },
+ { &hf_oss_ssdo_sacmd_segmentation,
+ { "Segmentation", "opensafety.ssdo.sacmd.segmentation",
+ FT_BOOLEAN, 8, TFS(&opensafety_sacmd_seg), OPENSAFETY_SSDO_SACMD_SEG, NULL, HFILL } },
+ { &hf_oss_ssdo_sacmd_toggle,
+ { "Toggle Bit", "opensafety.ssdo.sacmd.toggle",
+ FT_BOOLEAN, 8, TFS(&opensafety_on_off), OPENSAFETY_SSDO_SACMD_TGL, NULL, HFILL } },
+ { &hf_oss_ssdo_sacmd_initiate,
+ { "Initiate Transfer", "opensafety.ssdo.sacmd.initiate",
+ FT_BOOLEAN, 8, TFS(&opensafety_sacmd_ini), OPENSAFETY_SSDO_SACMD_INI, NULL, HFILL } },
+ { &hf_oss_ssdo_sacmd_end_segment,
+ { "End Segment", "opensafety.ssdo.sacmd.end_segment",
+ FT_BOOLEAN, 8, TFS(&opensafety_sacmd_ensg), OPENSAFETY_SSDO_SACMD_ENSG, NULL, HFILL } },
+ { &hf_oss_ssdo_sacmd_block_transfer,
+ { "Block Transfer", "opensafety.ssdo.sacmd.block_transfer",
+ FT_BOOLEAN, 8, TFS(&opensafety_sacmd_blk), OPENSAFETY_SSDO_SACMD_BLK, NULL, HFILL } },
+
+ /* SPDO Specific fields */
+ { &hf_oss_spdo_connection_valid,
+ { "Connection Valid Bit", "opensafety.spdo.connection_valid",
+ FT_BOOLEAN, 8, TFS(&opensafety_set_notset), 0x0, NULL, HFILL } },
+ { &hf_oss_spdo_payload,
+ { "SPDO Payload", "opensafety.spdo.payload",
+ FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_spdo_producer,
+ { "Producer", "opensafety.spdo.producer",
+ FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_spdo_producer_time,
+ { "Internal Time Producer", "opensafety.spdo.time.producer",
+ FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_spdo_time_value_sn,
+ { "Internal Time SN", "opensafety.spdo.time.sn",
+ FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_spdo_time_request,
+ { "Time Request Counter", "opensafety.spdo.time.request_counter",
+ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_spdo_time_request_to,
+ { "Time Request from", "opensafety.spdo.time.request_from",
+ FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ { &hf_oss_spdo_time_request_from,
+ { "Time Request by", "opensafety.spdo.time.request_to",
+ FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
};
diff --git a/epan/dissectors/packet-rdp.c b/epan/dissectors/packet-rdp.c
index 1d68fa1252..c628a6cdf5 100644
--- a/epan/dissectors/packet-rdp.c
+++ b/epan/dissectors/packet-rdp.c
@@ -28,7 +28,6 @@
# include "config.h"
#endif
-/* #include <stdio.h> */
#include <glib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
diff --git a/epan/dissectors/packet-spice.c b/epan/dissectors/packet-spice.c
index a17d70a15d..729821c593 100644
--- a/epan/dissectors/packet-spice.c
+++ b/epan/dissectors/packet-spice.c
@@ -33,11 +33,9 @@
#include <glib.h>
+#include <epan/packet.h>
#include <epan/conversation.h>
#include <epan/emem.h>
-#include <epan/packet.h>
-#include <epan/prefs.h>
-
#define SPICE_MAGIC 0x52454451 /* = "REDQ" */
@@ -1499,9 +1497,11 @@ dissect_SpiceRect(tvbuff_t *tvb, proto_tree *tree, const guint32 offset, const g
if (tree) {
if (id != -1) {
- ti = proto_tree_add_text(tree, tvb, offset, sizeof_SpiceRect, "RECT %u: (%u-%u, %u-%u)", id, rect.left, rect.top, rect.right, rect.bottom);
+ ti = proto_tree_add_text(tree, tvb, offset, sizeof_SpiceRect,
+ "RECT %u: (%u-%u, %u-%u)", id, rect.left, rect.top, rect.right, rect.bottom);
} else { /* single rectangle */
- ti = proto_tree_add_text(tree, tvb, offset, sizeof_SpiceRect, "RECT: (%u-%u, %u-%u)", rect.left, rect.top, rect.right, rect.bottom);
+ ti = proto_tree_add_text(tree, tvb, offset, sizeof_SpiceRect,
+ "RECT: (%u-%u, %u-%u)", rect.left, rect.top, rect.right, rect.bottom);
}
rect_tree = proto_item_add_subtree(ti, ett_rect);
@@ -1529,7 +1529,8 @@ dissect_RectList(tvbuff_t *tvb, proto_tree *tree, guint32 offset)
const guint32 rectlist_size = tvb_get_letohl(tvb, offset);
if (tree) {
- ti = proto_tree_add_text(tree, tvb, offset, 4 + (rectlist_size * sizeof_SpiceRect), "RectList (%d rects)", rectlist_size);
+ ti = proto_tree_add_text(tree, tvb, offset, 4 + (rectlist_size * sizeof_SpiceRect),
+ "RectList (%d rects)", rectlist_size);
rectlist_tree = proto_item_add_subtree(ti, ett_rectlist);
proto_tree_add_item(rectlist_tree, hf_rectlist_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
@@ -1656,7 +1657,9 @@ dissect_Brush(tvbuff_t *tvb, proto_tree *tree, guint32 offset)
brush_tree = proto_item_add_subtree(ti, ett_brush);
proto_tree_add_item(brush_tree, hf_brush_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
- /* FIXME: this is supposed to be the offset to the image to be used as the pattern. For now the hack is that callers check if the returned size was not 5 (therefore SOLID, it's a pattern and later on dissect the image. That's bad. Really. */
+ /* FIXME: this is supposed to be the offset to the image to be used as the pattern. */
+ /* For now the hack is that callers check if the returned size was not 5 (therefore SOLID, */
+ /* it's a pattern and later on dissect the image. That's bad. Really. */
dissect_ID(tvb, brush_tree, offset);
offset += 4;
dissect_POINT32(tvb, brush_tree, offset);
@@ -1843,7 +1846,8 @@ dissect_spice_common_server_messages(tvbuff_t *tvb, proto_tree *tree, const guin
proto_tree_add_item(server_message_tree, hf_red_timestamp, tvb, offset, 8, ENC_LITTLE_ENDIAN);
offset += 8;
if (total_message_size > 12) {
- proto_tree_add_text(server_message_tree, tvb, offset, total_message_size - 12, "PING DATA (%d bytes)", total_message_size - 12);
+ proto_tree_add_text(server_message_tree, tvb, offset, total_message_size - 12,
+ "PING DATA (%d bytes)", total_message_size - 12);
offset += (total_message_size - 12);
}
break;
@@ -1854,10 +1858,12 @@ dissect_spice_common_server_messages(tvbuff_t *tvb, proto_tree *tree, const guin
offset += 8;
/* TODO: properly dissect severity and visibility flags, using hf_ and proto_tree_add_item */
severity = tvb_get_letohl(tvb, offset);
- proto_tree_add_text(server_message_tree, tvb, offset, 4, "Severity: %s (%d)", val_to_str_const(severity, spice_severity_vs, "unknown severity"), severity);
+ proto_tree_add_text(server_message_tree, tvb, offset, 4,
+ "Severity: %s (%d)", val_to_str_const(severity, spice_severity_vs, "unknown severity"), severity);
offset += 4;
visibility = tvb_get_letohl(tvb, offset);
- proto_tree_add_text(server_message_tree, tvb, offset, 4, "Visibility: %s (%d)", val_to_str_const(visibility, spice_visibility_vs, "unknown visibility"), visibility);
+ proto_tree_add_text(server_message_tree, tvb, offset, 4,
+ "Visibility: %s (%d)", val_to_str_const(visibility, spice_visibility_vs, "unknown visibility"), visibility);
offset += 4;
/*TODO: based on severity, dissect the error code */
proto_tree_add_text(server_message_tree, tvb, offset, 4, "error/warning/info code: %d", tvb_get_letohl(tvb, offset));
@@ -2347,7 +2353,8 @@ dissect_spice_main_server(tvbuff_t *tvb, proto_tree *tree, const guint16 message
offset += 4;
for (i = 1; i <= num_channels; i++ ) {
channel_type = tvb_get_guint8(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, 1, "Type: %s [%d]", val_to_str_const(channel_type, channel_types_vs, "Unknown"), channel_type);
+ proto_tree_add_text(tree, tvb, offset, 1,
+ "Type: %s [%d]", val_to_str_const(channel_type, channel_types_vs, "Unknown"), channel_type);
offset += 1;
proto_tree_add_text(tree, tvb, offset, 1, "\tID: %d", tvb_get_guint8(tvb, offset));
offset += 1;
@@ -2539,7 +2546,10 @@ dissect_spice_data_server_pdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinf
message_type = tvb_get_letohs(tvb, offset + 8);
message_size = tvb_get_letohl(tvb, offset + 10);
- msg_ti = proto_tree_add_text(tree, tvb, offset, 0, "%s (%d bytes)", get_message_type_string(message_type, spice_info, FALSE), message_size + sizeof_SpiceDataHeader);
+ msg_ti = proto_tree_add_text(tree, tvb, offset, 0,
+ "%s (%d bytes)",
+ get_message_type_string(message_type, spice_info, FALSE),
+ message_size + sizeof_SpiceDataHeader);
message_tree = proto_item_add_subtree(msg_ti, ett_message);
ti = proto_tree_add_item(message_tree, hf_data, tvb, offset, sizeof_SpiceDataHeader, ENC_NA);
@@ -2584,7 +2594,10 @@ dissect_spice_data_server_pdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinf
}
if((offset - old_offset) != message_size) {
- g_warning("dissect_spice_data_server_pdu() - FIXME:message type %s (%u) in packet %d was not fully dissected - dissected %d (offset %d [0x%x], total message size: %d).\r\n", get_message_type_string(message_type, spice_info, FALSE), message_type, pinfo->fd->num, offset - old_offset, offset, offset, message_size + sizeof_SpiceDataHeader);
+ g_warning("dissect_spice_data_server_pdu() - FIXME:message type %s (%u) in packet %d was not fully dissected"
+ " - dissected %d (offset %d [0x%x], total message size: %d).\r\n",
+ get_message_type_string(message_type, spice_info, FALSE),
+ message_type, pinfo->fd->num, offset - old_offset, offset, offset, message_size + sizeof_SpiceDataHeader);
offset = old_offset + message_size;
}
@@ -2609,7 +2622,8 @@ dissect_spice_data_client_pdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinf
col_append_str(pinfo->cinfo, COL_INFO, get_message_type_string(message_type, spice_info, TRUE));
offset += sizeof_SpiceDataHeader;
- /* TODO: deal with sub-messages list first. As implementation does not uses sub-messsages list yet, it cannot be implemented in the dissector yet.*/
+ /* TODO: deal with sub-messages list first. As implementation does not uses sub-messsages list yet, */
+ /* it cannot be implemented in the dissector yet. */
if (message_type < SPICE_FIRST_AVAIL_MESSAGE) { /* this is a common message */
return dissect_spice_common_client_messages(tvb, tree, message_type, offset);
@@ -2750,14 +2764,18 @@ dissect_spice_link_client_pdu(tvbuff_t *tvb, proto_tree *tree, spice_conversatio
offset += sizeof_SpiceDataHeader;
if (common_caps_len > 0) {
- ti = proto_tree_add_text(tree, tvb, offset, common_caps_len * 4, "Common Capabilities (%d bytes)", common_caps_len * 4); /* caps_len multiplied by 4 as length is in UINT32 units */
+ ti = proto_tree_add_text(tree, tvb, offset, common_caps_len * 4,
+ "Common Capabilities (%d bytes)",
+ common_caps_len * 4); /* caps_len multiplied by 4 as length is in UINT32 units */
caps_tree = proto_item_add_subtree(ti, ett_link_caps);
caps_tree = proto_item_add_subtree(ti, ett_link_caps);
dissect_spice_common_capabilities(tvb, caps_tree, offset, common_caps_len, spice_info, TRUE);
offset += (common_caps_len * 4);
}
if (channel_caps_len > 0) {
- ti = proto_tree_add_text(tree, tvb, offset, channel_caps_len * 4, "Channel Capabilities (%d bytes)", channel_caps_len * 4); /* caps_len multiplied by 4 as length is in UINT32 units */
+ ti = proto_tree_add_text(tree, tvb, offset, channel_caps_len * 4,
+ "Channel Capabilities (%d bytes)",
+ channel_caps_len * 4); /* caps_len multiplied by 4 as length is in UINT32 units */
caps_tree = proto_item_add_subtree(ti, ett_link_caps);
dissect_spice_link_capabilities(tvb, caps_tree, offset, channel_caps_len, spice_info);
}
@@ -2795,13 +2813,17 @@ dissect_spice_link_server_pdu(tvbuff_t *tvb, proto_tree *tree, spice_conversatio
offset += sizeof_SpiceLinkHeader + SPICE_TICKET_PUBKEY_BYTES;
if (common_caps_len > 0) {
- ti = proto_tree_add_text(tree, tvb, offset, common_caps_len * 4, "Common Capabilities (%d bytes)", common_caps_len * 4); /* caps_len multiplied by 4 as length is in UINT32 units */
+ ti = proto_tree_add_text(tree, tvb, offset, common_caps_len * 4,
+ "Common Capabilities (%d bytes)",
+ common_caps_len * 4); /* caps_len multiplied by 4 as length is in UINT32 units */
caps_tree = proto_item_add_subtree(ti, ett_link_caps);
dissect_spice_common_capabilities(tvb, caps_tree, offset, common_caps_len, spice_info, FALSE);
offset += (common_caps_len * 4);
}
if (channel_caps_len > 0) {
- ti = proto_tree_add_text(tree, tvb, offset, channel_caps_len * 4, "Channel Capabilities (%d bytes)", channel_caps_len * 4); /* caps_len multiplied by 4 as length is in UINT32 units */
+ ti = proto_tree_add_text(tree, tvb, offset, channel_caps_len * 4,
+ "Channel Capabilities (%d bytes)",
+ channel_caps_len * 4); /* caps_len multiplied by 4 as length is in UINT32 units */
caps_tree = proto_item_add_subtree(ti, ett_link_caps);
dissect_spice_link_capabilities(tvb, caps_tree, offset, channel_caps_len, spice_info);
}
@@ -2860,7 +2882,8 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
spice_tree = proto_item_add_subtree(ti, ett_spice);
}
dissect_spice_link_client_pdu(tvb, spice_tree, spice_info);
- col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
+ col_add_fstr(pinfo->cinfo, COL_PROTOCOL,
+ "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
spice_info->next_state = SPICE_LINK_SERVER;
return pdu_len;
break;
@@ -2871,13 +2894,16 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pdu_len = tvb_get_letohl(tvb, 12) + sizeof_SpiceLinkHeader;
GET_PDU_FROM_OFFSET(0)
col_set_str(pinfo->cinfo, COL_INFO, "Server link message");
- col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
+ col_add_fstr(pinfo->cinfo, COL_PROTOCOL,
+ "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
if (tree) {
ti = proto_tree_add_item(tree, proto_spice, tvb, 0, pdu_len, ENC_NA);
spice_tree = proto_item_add_subtree(ti, ett_spice);
}
dissect_spice_link_server_pdu(tvb, spice_tree, spice_info);
- if (!(spice_info->server_auth & SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION_MASK) || !(spice_info->client_auth & SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION_MASK)) { /* Server or clients support spice ticket auth only */
+ if (!(spice_info->server_auth & SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION_MASK) ||
+ !(spice_info->client_auth & SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION_MASK)) {
+ /* Server or clients support spice ticket auth only */
spice_info->next_state = SPICE_TICKET_CLIENT;
} else { /* Protocol selection between client and server */
spice_info->next_state = SPICE_CLIENT_AUTH_SELECT;
@@ -2893,7 +2919,8 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pdu_len = 4;
GET_PDU_FROM_OFFSET(0)
col_set_str(pinfo->cinfo, COL_INFO, "Client authentication method selection");
- col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
+ col_add_fstr(pinfo->cinfo, COL_PROTOCOL,
+ "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
if (tree) {
ti = proto_tree_add_item(tree, proto_spice, tvb, 0, 4, ENC_NA);
spice_tree = proto_item_add_subtree(ti, ett_auth_select_client);
@@ -2923,7 +2950,8 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_spice, tvb, offset, 4, ENC_NA);
spice_tree = proto_item_add_subtree(ti, ett_spice);
}
- col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
+ col_add_fstr(pinfo->cinfo, COL_PROTOCOL,
+ "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
proto_tree_add_text(spice_tree, tvb, offset, 4, "SASL message length: %u", pdu_len);
pdu_len += 4;
GET_PDU_FROM_OFFSET(offset)
@@ -2931,7 +2959,8 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_INFO, "SASL supported authentication mechanisms (init from server)");
proto_tree_add_text(spice_tree, tvb, offset, 4, "Supported authentication mechanisms list length: %u", pdu_len - 4);
offset += 4;
- proto_tree_add_text(spice_tree, tvb, offset, pdu_len - 4, "Supported authentication mechanisms list: %s", tvb_format_text(tvb, offset, pdu_len - 4));
+ proto_tree_add_text(spice_tree, tvb, offset, pdu_len - 4,
+ "Supported authentication mechanisms list: %s", tvb_format_text(tvb, offset, pdu_len - 4));
offset += (pdu_len - 4);
spice_info->next_state = SPICE_SASL_START_TO_SERVER;
return offset;
@@ -2946,9 +2975,11 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_spice, tvb, offset, 4, ENC_NA);
spice_tree = proto_item_add_subtree(ti, ett_spice);
}
- col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
+ col_add_fstr(pinfo->cinfo, COL_PROTOCOL,
+ "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
proto_tree_add_text(spice_tree, tvb, offset, 4, "SASL message length: %u", pdu_len);
- if (pdu_len == 0) { /* meaning, empty PDU - assuming the client_out_list, which may be empty*/
+ if (pdu_len == 0) {
+ /* meaning, empty PDU - assuming the client_out_list, which may be empty*/
col_set_str(pinfo->cinfo, COL_INFO, "SASL authentication (start to server)");
spice_info->next_state = SPICE_SASL_START_FROM_SERVER;
pdu_len = 4; /* only the size field.*/
@@ -2962,12 +2993,15 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_INFO, "Client selected SASL authentication mechanism (start to server)");
proto_tree_add_text(spice_tree, tvb, offset, 4, "Selected authentication mechanism length: %u", pdu_len - 4);
offset += 4;
- proto_tree_add_text(spice_tree, tvb, offset, pdu_len - 4, "Selected authentication mechanism: %s", tvb_format_text(tvb, offset, pdu_len - 4));
- } else { /* this is the client out list, ending the start from client message */
+ proto_tree_add_text(spice_tree, tvb, offset, pdu_len - 4,
+ "Selected authentication mechanism: %s", tvb_format_text(tvb, offset, pdu_len - 4));
+ } else {
+ /* this is the client out list, ending the start from client message */
col_set_str(pinfo->cinfo, COL_INFO, "Client out mechanism (start to server)");
proto_tree_add_text(spice_tree, tvb, offset, 4, "Client out mechanism length: %u", pdu_len - 4);
offset += 4;
- proto_tree_add_text(spice_tree, tvb, offset, pdu_len - 4, "Selected client out mechanism: %s", tvb_format_text(tvb, offset, pdu_len - 4));
+ proto_tree_add_text(spice_tree, tvb, offset, pdu_len - 4,
+ "Selected client out mechanism: %s", tvb_format_text(tvb, offset, pdu_len - 4));
spice_info->next_state = SPICE_SASL_START_FROM_SERVER;
}
offset += (pdu_len - 4);
@@ -2987,7 +3021,8 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_spice, tvb, offset, pdu_len + 4, ENC_NA);
spice_tree = proto_item_add_subtree(ti, ett_spice);
}
- col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
+ col_add_fstr(pinfo->cinfo, COL_PROTOCOL,
+ "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
if (per_packet_info->state == SPICE_SASL_START_FROM_SERVER) {
col_set_str(pinfo->cinfo, COL_INFO, "SASL authentication (start from server)");
} else {
@@ -3021,17 +3056,20 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_spice, tvb, offset, 1, ENC_NA);
spice_tree = proto_item_add_subtree(ti, ett_spice);
}
- col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
+ col_add_fstr(pinfo->cinfo, COL_PROTOCOL,
+ "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
col_set_str(pinfo->cinfo, COL_INFO, "SASL authentication - result from server");
sasl_auth_result = tvb_get_guint8(tvb, offset);
proto_tree_add_item(spice_tree, hf_spice_sasl_auth_result, tvb, offset, 1, ENC_NA);
offset += 1;
- if (per_packet_info->state == SPICE_SASL_START_FROM_SERVER_CONT) { /* if we are in the sasl start, and can continue */
+ if (per_packet_info->state == SPICE_SASL_START_FROM_SERVER_CONT) {
+ /* if we are in the sasl start, and can continue */
if (sasl_auth_result == 0) { /* 0 = continue */
spice_info->next_state = SPICE_SASL_STEP_TO_SERVER;
} else {
- g_warning("SPICE_SASL_START_FROM_SERVER_CONT and sasl_auth_result is %d, packet %d", sasl_auth_result, pinfo->fd->num);
+ g_warning("SPICE_SASL_START_FROM_SERVER_CONT and sasl_auth_result is %d, packet %d",
+ sasl_auth_result, pinfo->fd->num);
}
} else { /* SPICE_SASL_STEP_FROM_SERVER_CONT state. */
spice_info->next_state = SPICE_TICKET_SERVER;
@@ -3050,9 +3088,11 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_spice, tvb, offset, 4, ENC_NA);
spice_tree = proto_item_add_subtree(ti, ett_spice);
}
- col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
+ col_add_fstr(pinfo->cinfo, COL_PROTOCOL,
+ "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
proto_tree_add_text(spice_tree, tvb, offset, 4, "SASL message length: %u", pdu_len);
- if (pdu_len == 0) { /* meaning, empty PDU - assuming the client_out_list, which may be empty*/
+ if (pdu_len == 0) {
+ /* meaning, empty PDU - assuming the client_out_list, which may be empty*/
col_set_str(pinfo->cinfo, COL_INFO, "SASL authentication from client (step to server)");
spice_info->next_state = SPICE_SASL_STEP_FROM_SERVER;
pdu_len = 4; /* only the size field.*/
@@ -3064,7 +3104,8 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_INFO, "Clientout (step to server)");
proto_tree_add_text(spice_tree, tvb, offset, 4, "clientout length: %u", pdu_len - 4);
offset += 4;
- proto_tree_add_text(spice_tree, tvb, offset, pdu_len - 4, "clientout list: %s", tvb_format_text(tvb, offset, pdu_len - 4));
+ proto_tree_add_text(spice_tree, tvb, offset, pdu_len - 4,
+ "clientout list: %s", tvb_format_text(tvb, offset, pdu_len - 4));
spice_info->next_state = SPICE_SASL_STEP_FROM_SERVER;
offset += (pdu_len - 4);
}
@@ -3090,7 +3131,8 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
GET_PDU_FROM_OFFSET(offset)
proto_item_set_len(ti, pdu_len);
- col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "Spice %s (SASL wrapped)", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
+ col_add_fstr(pinfo->cinfo, COL_PROTOCOL,
+ "Spice %s (SASL wrapped)", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
col_set_str(pinfo->cinfo, COL_INFO, "SASL wrapped Spice message");
offset += 4;
@@ -3106,15 +3148,21 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pdu_len = sizeof_SpiceDataHeader;
GET_PDU_FROM_OFFSET(offset)
pdu_len = tvb_get_letohl(tvb, offset + 14); /* this is actually the sub-message list size */
- if (pdu_len == 0) { /* if there are no sub-messages, get the usual message body size. Note that we do not dissect properly yet sub-messages - but they are not used in the protcol either */
+ if (pdu_len == 0) {
+ /* if there are no sub-messages, get the usual message body size. */
+ /* Note that we do not dissect properly yet sub-messages - but they */
+ /* are not used in the protcol either */
pdu_len = tvb_get_letohl(tvb, offset + 10);
} else {
pdu_len = tvb_get_letohl(tvb, offset + 10);
}
- pdu_len += sizeof_SpiceDataHeader; /* +sizeof_SpiceDataHeader since you need to exclude the SPICE data header, which is sizeof_SpiceDataHeader (18) bytes long) */
+ pdu_len += sizeof_SpiceDataHeader; /* +sizeof_SpiceDataHeader since you need to exclude the SPICE */
+ /* data header, which is sizeof_SpiceDataHeader (18) bytes long) */
GET_PDU_FROM_OFFSET(offset)
- col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
- if (!first_record_in_frame) { /* if it's not the first dissected PDU, we want in COL_INFO to have: "PDU_type_A, PDU_typeB, PDU_typeC, etc. */
+ col_add_fstr(pinfo->cinfo, COL_PROTOCOL,
+ "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
+ if (!first_record_in_frame) {
+ /* if it's not the first dissected PDU, we want in COL_INFO to have: "PDU_type_A, PDU_typeB, PDU_typeC, etc. */
col_append_str(pinfo->cinfo, COL_INFO, ", ");
}
if (tree && spice_data_tree == NULL) {
@@ -3139,7 +3187,8 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pdu_len = 128;
GET_PDU_FROM_OFFSET(0)
col_set_str(pinfo->cinfo, COL_INFO, "Client ticket");
- col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
+ col_add_fstr(pinfo->cinfo, COL_PROTOCOL,
+ "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
if (tree) {
ti = proto_tree_add_item(tree, proto_spice, tvb, 0, 128, ENC_NA);
spice_tree = proto_item_add_subtree(ti, ett_ticket_client);
@@ -3155,7 +3204,8 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pdu_len = 4;
GET_PDU_FROM_OFFSET(0)
col_set_str(pinfo->cinfo, COL_INFO, "Server ticket");
- col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
+ col_add_fstr(pinfo->cinfo, COL_PROTOCOL,
+ "Spice %s", val_to_str_const(spice_info->channel_type,channel_types_vs, "Unknown"));
if (tree) {
ti = proto_tree_add_item(tree, proto_spice, tvb, 0, 4, ENC_NA);
spice_tree = proto_item_add_subtree(ti, ett_ticket_server);
diff --git a/epan/dissectors/packet-ua.c b/epan/dissectors/packet-ua.c
index e36eb74785..132abb80e5 100644
--- a/epan/dissectors/packet-ua.c
+++ b/epan/dissectors/packet-ua.c
@@ -42,7 +42,6 @@
#endif
#include <epan/packet.h>
-#include <epan/prefs.h>
static void DissectNOE(tvbuff_t *pTvb, proto_tree *pRootUA);
static void DissectNOE_type(tvbuff_t *pTvb, proto_tree *pNoeItem);
@@ -681,38 +680,125 @@ void proto_register_ua(void)
{
static hf_register_info hf[] =
{
- { &hf_noe, { "NOE", "ua.noe", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
- { &hf_noe_length, { "Length", "ua.noe.length", FT_UINT16, BASE_DEC, NULL, 0x0, "NOE item length (without 2 bytes containing the length)", HFILL }},
- { &hf_noe_type, { "Type", "ua.noe.type", FT_UINT8, BASE_DEC, VALS(szNoeType), 0x0, "NOE item type", HFILL }},
- { &hf_noe_method, { "Method", "ua.noe.method", FT_UINT8, BASE_DEC, VALS(szCallServerMethod), 0x0, "Call Server method", HFILL }},
- { &hf_noe_class, { "Class", "ua.noe.class", FT_UINT8, BASE_DEC, VALS(szCallServerClass), 0x0, "Call Server class", HFILL }},
- { &hf_noe_objid, { "ObjectID", "ua.noe.objid", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, "Call Server object id", HFILL }},
- { &hf_noe_event, { "Event", "ua.noe.event", FT_UINT8, BASE_DEC, VALS(szCallServerEvent), 0x0, "Call Server event", HFILL }},
- { &hf_noe_keychar, { "KeyChar", "ua.noe.event.keychar", FT_BYTES, BASE_NONE, NULL, 0x0, "Event key char", HFILL }},
- { &hf_noe_voicemode, { "VoiceMode", "ua.noe.voicemode", FT_UINT8, BASE_DEC, VALS(szNoeVoiceMode), 0x0, NULL, HFILL }},
-
- { &hf_noe_action, { "Action", "ua.noe.action", FT_UINT8, BASE_DEC, VALS(szNoeAction), 0x0, "IP action", HFILL }},
- { &hf_noe_reserved, { "Reserved", "ua.noe.action.startrtp.reserved", FT_UINT8, BASE_DEC, NULL, 0x0, "IP start rtp reserved", HFILL }},
- { &hf_noe_property, { "Property", "ua.noe.action.startrtp.property", FT_NONE, BASE_NONE, NULL, 0x0, "IP property", HFILL }},
- { &hf_noe_id, { "ID", "ua.noe.action.startrtp.property.id", FT_UINT8, BASE_DEC, VALS(szStartRtpPropID), 0x0, "IP property id", HFILL }},
- { &hf_noe_size, { "Size", "ua.noe.action.startrtp.property.size", FT_UINT8, BASE_DEC, NULL, 0x0, "IP property size", HFILL }},
- { &hf_noe_data, { "Data", "ua.noe.action.startrtp.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
-
- { &hf_noe_local_port, { "LocalPort", "ua.noe.action.startrtp.localport", FT_UINT16, BASE_DEC, NULL, 0x0, "IP start rtp property localport", HFILL }},
- { &hf_noe_remote_ip, { "RemoteIP", "ua.noe.action.startrtp.remoteip", FT_IPv4, BASE_NONE, NULL, 0x0, "IP start rtp property remote ipv4", HFILL }},
- { &hf_noe_remote_port, { "RemotePort", "ua.noe.action.startrtp.remoteport", FT_UINT16, BASE_DEC, NULL, 0x0, "IP start rtp property remoteport", HFILL }},
- { &hf_noe_compressor, { "Payload", "ua.noe.action.startrtp.payload", FT_UINT8, BASE_DEC, VALS(szStartRtpPayload), 0x0, "IP start rtp property payload", HFILL }},
- { &hf_noe_typeofservice,{ "TypeOfService", "ua.noe.action.startrtp.typeofservice", FT_UINT8, BASE_DEC, NULL, 0x0, "IP start rtp property type of service", HFILL }},
- { &hf_noe_payloadconcat,{ "Payld Concat", "ua.noe.action.startrtp.payldconcat", FT_UINT8, BASE_DEC, NULL, 0x0, "IP start rtp property payload concatenation (in ms)", HFILL }},
-
- { &hf_tlv, { "TLV", "ua.noe.tlv", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
- { &hf_tlv_property, { "Property", "ua.noe.tlv.property", FT_UINT8, BASE_DEC, VALS(szTlvProperty), 0x0, "TLV property", HFILL }},
- { &hf_tlv_arrindex, { "ArrIndex", "ua.noe.tlv.arrindex", FT_UINT8, BASE_DEC, NULL, 0x0, "TLV array index", HFILL }},
- { &hf_tlv_propsize, { "PropSize", "ua.noe.tlv.propsize", FT_UINT8, BASE_DEC, NULL, 0x0, "TLV property size", HFILL }},
- { &hf_tlv_data, { "Data", "ua.noe.tlv.data", FT_BYTES, BASE_NONE, NULL, 0x0, "TLV data", HFILL }},
- { &hf_tlv_label, { "Label", "ua.noe.tlv.label", FT_STRING, BASE_NONE, NULL, 0x0, "TLV label", HFILL }},
- { &hf_tlv_year, { "Year", "ua.noe.tlv.year", FT_UINT16, BASE_DEC, NULL, 0x0, "TLV year", HFILL }},
- { &hf_tlv_number, { "Number", "ua.noe.tlv.number", FT_STRING, BASE_NONE, NULL, 0x0, "TLV remote phone number", HFILL }},
+ { &hf_noe,
+ { "NOE", "ua.noe",
+ FT_NONE, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+ { &hf_noe_length,
+ { "Length", "ua.noe.length",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "NOE item length (without 2 bytes containing the length)", HFILL }},
+ { &hf_noe_type,
+ { "Type", "ua.noe.type",
+ FT_UINT8, BASE_DEC, VALS(szNoeType), 0x0,
+ "NOE item type", HFILL }},
+ { &hf_noe_method,
+ { "Method", "ua.noe.method",
+ FT_UINT8, BASE_DEC, VALS(szCallServerMethod), 0x0,
+ "Call Server method", HFILL }},
+ { &hf_noe_class,
+ { "Class", "ua.noe.class",
+ FT_UINT8, BASE_DEC, VALS(szCallServerClass), 0x0,
+ "Call Server class", HFILL }},
+ { &hf_noe_objid,
+ { "ObjectID", "ua.noe.objid",
+ FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
+ "Call Server object id", HFILL }},
+ { &hf_noe_event,
+ { "Event", "ua.noe.event",
+ FT_UINT8, BASE_DEC, VALS(szCallServerEvent), 0x0,
+ "Call Server event", HFILL }},
+ { &hf_noe_keychar,
+ { "KeyChar", "ua.noe.event.keychar",
+ FT_BYTES, BASE_NONE, NULL, 0x0,
+ "Event key char", HFILL }},
+ { &hf_noe_voicemode,
+ { "VoiceMode", "ua.noe.voicemode",
+ FT_UINT8, BASE_DEC, VALS(szNoeVoiceMode), 0x0,
+ NULL, HFILL }},
+
+ { &hf_noe_action,
+ { "Action", "ua.noe.action",
+ FT_UINT8, BASE_DEC, VALS(szNoeAction), 0x0,
+ "IP action", HFILL }},
+ { &hf_noe_reserved,
+ { "Reserved", "ua.noe.action.startrtp.reserved",
+ FT_UINT8, BASE_DEC, NULL, 0x0,
+ "IP start rtp reserved", HFILL }},
+ { &hf_noe_property,
+ { "Property", "ua.noe.action.startrtp.property",
+ FT_NONE, BASE_NONE, NULL, 0x0,
+ "IP property", HFILL }},
+ { &hf_noe_id,
+ { "ID", "ua.noe.action.startrtp.property.id",
+ FT_UINT8, BASE_DEC, VALS(szStartRtpPropID), 0x0,
+ "IP property id", HFILL }},
+ { &hf_noe_size,
+ { "Size", "ua.noe.action.startrtp.property.size",
+ FT_UINT8, BASE_DEC, NULL, 0x0,
+ "IP property size", HFILL }},
+ { &hf_noe_data,
+ { "Data", "ua.noe.action.startrtp.data",
+ FT_BYTES, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_noe_local_port,
+ { "LocalPort", "ua.noe.action.startrtp.localport",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "IP start rtp property localport", HFILL }},
+ { &hf_noe_remote_ip,
+ { "RemoteIP", "ua.noe.action.startrtp.remoteip",
+ FT_IPv4, BASE_NONE, NULL, 0x0,
+ "IP start rtp property remote ipv4", HFILL }},
+ { &hf_noe_remote_port,
+ { "RemotePort", "ua.noe.action.startrtp.remoteport",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "IP start rtp property remoteport", HFILL }},
+ { &hf_noe_compressor,
+ { "Payload", "ua.noe.action.startrtp.payload",
+ FT_UINT8, BASE_DEC, VALS(szStartRtpPayload), 0x0,
+ "IP start rtp property payload", HFILL }},
+ { &hf_noe_typeofservice,
+ { "TypeOfService", "ua.noe.action.startrtp.typeofservice",
+ FT_UINT8, BASE_DEC, NULL, 0x0,
+ "IP start rtp property type of service", HFILL }},
+ { &hf_noe_payloadconcat,
+ { "Payld Concat", "ua.noe.action.startrtp.payldconcat",
+ FT_UINT8, BASE_DEC, NULL, 0x0,
+ "IP start rtp property payload concatenation (in ms)", HFILL }},
+
+ { &hf_tlv,
+ { "TLV", "ua.noe.tlv",
+ FT_NONE, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+ { &hf_tlv_property,
+ { "Property", "ua.noe.tlv.property",
+ FT_UINT8, BASE_DEC, VALS(szTlvProperty), 0x0,
+ "TLV property", HFILL }},
+ { &hf_tlv_arrindex,
+ { "ArrIndex", "ua.noe.tlv.arrindex",
+ FT_UINT8, BASE_DEC, NULL, 0x0,
+ "TLV array index", HFILL }},
+ { &hf_tlv_propsize,
+ { "PropSize", "ua.noe.tlv.propsize",
+ FT_UINT8, BASE_DEC, NULL, 0x0,
+ "TLV property size", HFILL }},
+ { &hf_tlv_data,
+ { "Data", "ua.noe.tlv.data",
+ FT_BYTES, BASE_NONE, NULL, 0x0,
+ "TLV data", HFILL }},
+ { &hf_tlv_label,
+ { "Label", "ua.noe.tlv.label",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ "TLV label", HFILL }},
+ { &hf_tlv_year,
+ { "Year", "ua.noe.tlv.year",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "TLV year", HFILL }},
+ { &hf_tlv_number,
+ { "Number", "ua.noe.tlv.number",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ "TLV remote phone number", HFILL }},
};
static gint *ett[] =
{