diff options
author | Bill Meier <wmeier@newsguy.com> | 2012-05-17 20:13:22 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2012-05-17 20:13:22 +0000 |
commit | bab856a50433ce4b172ebc7a180a3bfb3e721503 (patch) | |
tree | 33c51d7fbfa41575c0c3ad159c7ddb3780d85c46 /epan | |
parent | b4624651e9c8c0689e25306f071f3f241f3dfdb4 (diff) |
General cleanup including as appropriate:
- Remove unneeded #include files (string.h, addr_resolv.h);
- Remove unneeded 'if(!initialized){...}' in proto_reg_handoff();
- Reformat hf[] entries;
- Remove unneeded variable initializations;
- "localize" some variables;
- Whitespace/indentation/long lines/formatting
(in one case: re-order code slightly to not do col_set_str() & etc until
after initial "frame acceptance testing" by dissector.
svn path=/trunk/; revision=42683
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-hpteam.c | 20 | ||||
-rw-r--r-- | epan/dissectors/packet-mactelnet.c | 594 | ||||
-rw-r--r-- | epan/dissectors/packet-netbios.c | 1 | ||||
-rw-r--r-- | epan/dissectors/packet-ntp.c | 71 | ||||
-rw-r--r-- | epan/dissectors/packet-rtcp.c | 933 | ||||
-rw-r--r-- | epan/dissectors/packet-rtp-midi.c | 1305 | ||||
-rw-r--r-- | epan/dissectors/packet-slowprotocols.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-v5dl.c | 35 | ||||
-rw-r--r-- | epan/dissectors/packet-v5ef.c | 47 | ||||
-rw-r--r-- | epan/dissectors/packet-yhoo.c | 194 |
10 files changed, 1600 insertions, 1604 deletions
diff --git a/epan/dissectors/packet-hpteam.c b/epan/dissectors/packet-hpteam.c index e03bc51dc7..100b0d26b6 100644 --- a/epan/dissectors/packet-hpteam.c +++ b/epan/dissectors/packet-hpteam.c @@ -29,9 +29,9 @@ #endif #include <glib.h> + #include <epan/packet.h> #include <epan/oui.h> -#include <string.h> #include <packet-llc.h> @@ -92,18 +92,17 @@ static gint ett_hpteam = -1; static void dissect_hpteam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - proto_item *hpteam_item; - proto_tree *hpteam_tree; - guint32 offset = 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "HP NIC Team"); col_add_fstr(pinfo->cinfo, COL_INFO, "HP NIC Teaming Heartbeat; Port MAC = %s", ep_address_to_str(&pinfo->dl_src)); if (tree) { /* we are being asked for details */ + proto_item *hpteam_item; + proto_tree *hpteam_tree; hpteam_item = proto_tree_add_item(tree, proto_hpteam, tvb, 0, -1, ENC_NA); hpteam_tree = proto_item_add_subtree(hpteam_item, ett_hpteam); - proto_tree_add_item(hpteam_tree, hf_hpteam, tvb, offset, -1, ENC_NA); + proto_tree_add_item(hpteam_tree, hf_hpteam, tvb, 0, -1, ENC_NA); } } @@ -111,14 +110,17 @@ void proto_register_hpteam(void) { static hf_register_info hf_pid = { &hf_llc_hpteam_pid, - { "PID", "llc.hpteam_pid", FT_UINT16, BASE_HEX, - VALS(hpteam_pid_vals), 0x0, NULL, HFILL } + { "PID", "llc.hpteam_pid", + FT_UINT16, BASE_HEX, VALS(hpteam_pid_vals), + 0x0, NULL, HFILL } }; static hf_register_info hf_data[] = { {&hf_hpteam, - { "Proprietary Data", "hpteam.data", FT_BYTES, BASE_NONE, - NULL, 0x0, NULL, HFILL }} + { "Proprietary Data", "hpteam.data", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL } + } }; static gint *ett[] = { diff --git a/epan/dissectors/packet-mactelnet.c b/epan/dissectors/packet-mactelnet.c index c048919a07..5c13ead97c 100644 --- a/epan/dissectors/packet-mactelnet.c +++ b/epan/dissectors/packet-mactelnet.c @@ -33,11 +33,9 @@ #endif #include <glib.h> -#include <string.h> #include <epan/packet.h> #include <epan/prefs.h> -#include <epan/addr_resolv.h> #define PROTO_TAG_MACTELNET "MAC-Telnet" @@ -77,307 +75,343 @@ static dissector_handle_t data_handle; /* Packet types */ static const value_string packettypenames[] = { - { 0, "Start session" }, - { 1, "Data" }, - { 2, "Acknowledge" }, - { 4, "Ping request" }, - { 5, "Ping response" }, - { 255, "End session" }, - { 0, NULL } + { 0, "Start session" }, + { 1, "Data" }, + { 2, "Acknowledge" }, + { 4, "Ping request" }, + { 5, "Ping response" }, + { 255, "End session" }, + { 0, NULL } }; /* Known client types */ static const value_string clienttypenames[] = { - { 0x0015, "MAC Telnet" }, - { 0x0f90, "Winbox" }, - { 0, NULL } + { 0x0015, "MAC Telnet" }, + { 0x0f90, "Winbox" }, + { 0, NULL } }; /* Known control-packet types */ static const value_string controlpackettypenames[] = { - { 0, "Begin authentication" }, - { 1, "Encryption key" }, - { 2, "Password" }, - { 3, "Username" }, - { 4, "Terminal type" }, - { 5, "Terminal width" }, - { 6, "Terminal height" }, - { 9, "End authentication" }, - { 0, NULL } + { 0, "Begin authentication" }, + { 1, "Encryption key" }, + { 2, "Password" }, + { 3, "Username" }, + { 4, "Terminal type" }, + { 5, "Terminal width" }, + { 6, "Terminal height" }, + { 9, "End authentication" }, + { 0, NULL } }; static int dissect_mactelnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - proto_item *mactelnet_item; - proto_tree *mactelnet_tree; - proto_item *mactelnet_control_item; - proto_tree *mactelnet_control_tree; - int foundping = -1; - int foundclient = -1; - int foundserver = -1; - guint16 type; - - /* Check that there's enough data */ - if (tvb_length(tvb) < 18) - return 0; - - /* Make entries in Protocol column and Info column on summary display */ - col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_TAG_MACTELNET); - - /* Get the type byte */ - type = tvb_get_guint8(tvb, 1); - - if ((type == 4 || type == 5)) { /* Ping */ - foundping = 1; - } else { - int i = 0; - while (clienttypenames[i].strptr != NULL) { - if (tvb_get_ntohs(tvb, 14) == clienttypenames[i].value) { - foundserver = i; - break; - } - if (tvb_get_ntohs(tvb, 16) == clienttypenames[i].value) { - foundclient = i; - break; - } - i++; - } - } - - /* Not a mactelnet packet */ - if (foundping < 0 && foundclient < 0 && foundserver < 0) { - return 0; - } - - col_add_fstr(pinfo->cinfo, COL_INFO, "%s > %s Direction: %s Type: %s", - tvb_ether_to_str(tvb, 2), - tvb_ether_to_str(tvb, 8), - (foundclient >= 0 || type == 4 ? "Client->Server" : "Server->Client" ), - val_to_str(type, packettypenames, "Unknown Type:0x%02x") - ); - - if (tree) { - guint32 offset = 0; - - /* create display subtree for the protocol */ - mactelnet_item = proto_tree_add_item(tree, proto_mactelnet, tvb, 0, -1, ENC_NA); - mactelnet_tree = proto_item_add_subtree(mactelnet_item, ett_mactelnet); - - /* ver(1) */ - proto_tree_add_item(mactelnet_tree, hf_mactelnet_protocolver, tvb, offset, 1, ENC_NA); - offset++; - - /* ptype(1) */ - proto_tree_add_item(mactelnet_tree, hf_mactelnet_type, tvb, offset, 1, ENC_NA); - offset++; - - /* saddr(6) */ - proto_tree_add_item(mactelnet_tree, hf_mactelnet_source_mac, tvb, offset, 6, ENC_NA); - offset += 6; - - /* dstaddr(6) */ - proto_tree_add_item(mactelnet_tree, hf_mactelnet_destination_mac, tvb, offset, 6, ENC_NA); - offset += 6; - - if (foundserver >= 0) { - /* Server to client */ - - /* sessionid(2) */ - proto_tree_add_item(mactelnet_tree, hf_mactelnet_session_id, tvb, offset+2, 2, ENC_BIG_ENDIAN); - offset += 2; - - /* clienttype(2) */ - proto_tree_add_item(mactelnet_tree, hf_mactelnet_client_type, tvb, offset-2, 2, ENC_BIG_ENDIAN); - offset += 2; - } else if (foundclient >= 0) { - /* Client to server */ - - /* sessionid(2) */ - proto_tree_add_item(mactelnet_tree, hf_mactelnet_session_id, tvb, offset, 2, ENC_BIG_ENDIAN); - offset += 2; - - /* clienttype(2) */ - proto_tree_add_item(mactelnet_tree, hf_mactelnet_client_type, tvb, offset, 2, ENC_BIG_ENDIAN); - offset += 2; - } else if (foundping >= 0) { - /* Skip empty data */ - offset += 4; - } - - if (foundping < 0) { - /* counter(4) */ - proto_tree_add_item(mactelnet_tree, hf_mactelnet_databytes, tvb, offset, 4, ENC_BIG_ENDIAN); - offset += 4; - } - - /* Data packets only */ - if (type == 1) { - while(tvb_reported_length_remaining(tvb, offset) > 0) { - if (tvb_reported_length_remaining(tvb, offset) > 4 && tvb_get_ntohl(tvb, offset) == control_packet) { - guint8 datatype; - guint32 datalength; - - /* Add subtree for control packet */ - mactelnet_control_item = proto_tree_add_item(mactelnet_tree, hf_mactelnet_control, tvb, offset, -1, ENC_NA); - mactelnet_control_tree = proto_item_add_subtree(mactelnet_control_item, ett_mactelnet); - /* Control packet magic number (4) */ - proto_tree_add_item(mactelnet_control_tree, hf_mactelnet_control_packet, tvb, offset, 4, ENC_BIG_ENDIAN); - offset += 4; - - /* Control packet type (1) */ - datatype = tvb_get_guint8(tvb, offset); - proto_tree_add_item(mactelnet_control_tree, hf_mactelnet_datatype, tvb, offset, 1, ENC_NA); - offset++; - - /* Control packet length (4) */ - datalength = tvb_get_ntohl(tvb, offset); - proto_tree_add_item(mactelnet_control_tree, hf_mactelnet_control_length, tvb, offset, 4, ENC_BIG_ENDIAN); - offset += 4; - - switch (datatype) { - case 1: /* Encryption Key */ - proto_tree_add_item(mactelnet_control_tree, hf_mactelnet_control_encryption_key, tvb, offset, datalength, ENC_NA); - break; - - case 2: /* Password */ - proto_tree_add_item(mactelnet_control_tree, hf_mactelnet_control_password, tvb, offset, datalength, ENC_NA); - break; - - case 3: /* Username */ - proto_tree_add_item(mactelnet_control_tree, hf_mactelnet_control_username, tvb, offset, datalength, ENC_ASCII|ENC_NA); - break; - - case 4: /* Terminal type */ - proto_tree_add_item(mactelnet_control_tree, hf_mactelnet_control_terminal, tvb, offset, datalength, ENC_ASCII|ENC_NA); - break; - - case 5: /* Terminal width */ - proto_tree_add_item(mactelnet_control_tree, hf_mactelnet_control_width, tvb, offset, 2, ENC_LITTLE_ENDIAN); - break; - - case 6: /* Terminal height */ - proto_tree_add_item(mactelnet_control_tree, hf_mactelnet_control_height, tvb, offset, 2, ENC_LITTLE_ENDIAN); - break; - - case 9: /* End authentication (no data) */ - break; - } - proto_item_set_len (mactelnet_control_item, datalength + 9); - offset += datalength; - } else { - /* Data packet, let wireshark handle it */ - tvbuff_t *next_client = tvb_new_subset_remaining(tvb, offset); - return call_dissector(data_handle, next_client, pinfo, mactelnet_tree); - } - } - } else if (type == 4 || type == 5) { - /* Data packet, let wireshark handle it */ - tvbuff_t *next_client = tvb_new_subset_remaining(tvb, offset); - return call_dissector(data_handle, next_client, pinfo, mactelnet_tree); - } - - - } - return tvb_reported_length(tvb); + proto_item *mactelnet_item; + proto_tree *mactelnet_tree; + proto_item *mactelnet_control_item; + proto_tree *mactelnet_control_tree; + int foundping = -1; + int foundclient = -1; + int foundserver = -1; + guint16 type; + + /* Check that there's enough data */ + if (tvb_length(tvb) < 18) + return 0; + + /* Get the type byte */ + type = tvb_get_guint8(tvb, 1); + + if ((type == 4) || (type == 5)) { /* Ping */ + foundping = 1; + } else { + int i = 0; + while (clienttypenames[i].strptr != NULL) { + if (tvb_get_ntohs(tvb, 14) == clienttypenames[i].value) { + foundserver = i; + break; + } + if (tvb_get_ntohs(tvb, 16) == clienttypenames[i].value) { + foundclient = i; + break; + } + i++; + } + } + + /* Not a mactelnet packet */ + if ((foundping < 0) && (foundclient < 0) && (foundserver < 0)) { + return 0; + } + + /* Make entries in Protocol column and Info column on summary display */ + col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_TAG_MACTELNET); + + if (check_col(pinfo->cinfo, COL_INFO)) { + col_add_fstr(pinfo->cinfo, COL_INFO, "%s > %s Direction: %s Type: %s", + tvb_ether_to_str(tvb, 2), + tvb_ether_to_str(tvb, 8), + ((foundclient >= 0) || (type == 4) ? "Client->Server" : "Server->Client" ), + val_to_str(type, packettypenames, "Unknown Type:0x%02x") + ); + } + + if (tree) { + guint32 offset = 0; + + /* create display subtree for the protocol */ + mactelnet_item = proto_tree_add_item(tree, proto_mactelnet, tvb, 0, -1, ENC_NA); + mactelnet_tree = proto_item_add_subtree(mactelnet_item, ett_mactelnet); + + /* ver(1) */ + proto_tree_add_item(mactelnet_tree, hf_mactelnet_protocolver, tvb, offset, 1, ENC_NA); + offset += 1; + + /* ptype(1) */ + proto_tree_add_item(mactelnet_tree, hf_mactelnet_type, tvb, offset, 1, ENC_NA); + offset += 1; + + /* saddr(6) */ + proto_tree_add_item(mactelnet_tree, hf_mactelnet_source_mac, tvb, offset, 6, ENC_NA); + offset += 6; + + /* dstaddr(6) */ + proto_tree_add_item(mactelnet_tree, hf_mactelnet_destination_mac, tvb, offset, 6, ENC_NA); + offset += 6; + + if (foundserver >= 0) { + /* Server to client */ + + /* sessionid(2) */ + proto_tree_add_item(mactelnet_tree, hf_mactelnet_session_id, tvb, offset+2, 2, ENC_BIG_ENDIAN); + offset += 2; + + /* clienttype(2) */ + proto_tree_add_item(mactelnet_tree, hf_mactelnet_client_type, tvb, offset-2, 2, ENC_BIG_ENDIAN); + offset += 2; + } else if (foundclient >= 0) { + /* Client to server */ + + /* sessionid(2) */ + proto_tree_add_item(mactelnet_tree, hf_mactelnet_session_id, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; + + /* clienttype(2) */ + proto_tree_add_item(mactelnet_tree, hf_mactelnet_client_type, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; + } else if (foundping >= 0) { + /* Skip empty data */ + offset += 4; + } + + if (foundping < 0) { + /* counter(4) */ + proto_tree_add_item(mactelnet_tree, hf_mactelnet_databytes, tvb, offset, 4, ENC_BIG_ENDIAN); + offset += 4; + } + + /* Data packets only */ + if (type == 1) { + while(tvb_reported_length_remaining(tvb, offset) > 0) { + if ((tvb_reported_length_remaining(tvb, offset) > 4) && (tvb_get_ntohl(tvb, offset) == control_packet)) { + guint8 datatype; + guint32 datalength; + + /* Add subtree for control packet */ + mactelnet_control_item = proto_tree_add_item(mactelnet_tree, hf_mactelnet_control, tvb, offset, -1, ENC_NA); + mactelnet_control_tree = proto_item_add_subtree(mactelnet_control_item, ett_mactelnet); + /* Control packet magic number (4) */ + proto_tree_add_item(mactelnet_control_tree, hf_mactelnet_control_packet, tvb, offset, 4, ENC_BIG_ENDIAN); + offset += 4; + + /* Control packet type (1) */ + datatype = tvb_get_guint8(tvb, offset); + proto_tree_add_item(mactelnet_control_tree, hf_mactelnet_datatype, tvb, offset, 1, ENC_NA); + offset += 1; + + /* Control packet length (4) */ + datalength = tvb_get_ntohl(tvb, offset); + proto_tree_add_item(mactelnet_control_tree, hf_mactelnet_control_length, tvb, offset, 4, ENC_BIG_ENDIAN); + offset += 4; + + switch (datatype) { + case 1: /* Encryption Key */ + proto_tree_add_item(mactelnet_control_tree, hf_mactelnet_control_encryption_key, tvb, offset, datalength, ENC_NA); + break; + + case 2: /* Password */ + proto_tree_add_item(mactelnet_control_tree, hf_mactelnet_control_password, tvb, offset, datalength, ENC_NA); + break; + + case 3: /* Username */ + proto_tree_add_item(mactelnet_control_tree, hf_mactelnet_control_username, tvb, offset, datalength, ENC_ASCII|ENC_NA); + break; + + case 4: /* Terminal type */ + proto_tree_add_item(mactelnet_control_tree, hf_mactelnet_control_terminal, tvb, offset, datalength, ENC_ASCII|ENC_NA); + break; + + case 5: /* Terminal width */ + proto_tree_add_item(mactelnet_control_tree, hf_mactelnet_control_width, tvb, offset, 2, ENC_LITTLE_ENDIAN); + break; + + case 6: /* Terminal height */ + proto_tree_add_item(mactelnet_control_tree, hf_mactelnet_control_height, tvb, offset, 2, ENC_LITTLE_ENDIAN); + break; + + case 9: /* End authentication (no data) */ + break; + } + proto_item_set_len (mactelnet_control_item, datalength + 9); + offset += datalength; + } else { + /* Data packet, let wireshark handle it */ + tvbuff_t *next_client = tvb_new_subset_remaining(tvb, offset); + return call_dissector(data_handle, next_client, pinfo, mactelnet_tree); + } + } + } else if ((type == 4) || (type == 5)) { + /* Data packet, let wireshark handle it */ + tvbuff_t *next_client = tvb_new_subset_remaining(tvb, offset); + return call_dissector(data_handle, next_client, pinfo, mactelnet_tree); + } + + + } + return tvb_reported_length(tvb); } void proto_register_mactelnet(void) { - static hf_register_info hf[] = { - { &hf_mactelnet_control_packet, - { "Control Packet Magic Number", "mactelnet.control_packet", FT_UINT32, BASE_HEX, NULL, 0x0, - NULL, HFILL }}, - { &hf_mactelnet_type, - { "Type", "mactelnet.type", FT_UINT8, BASE_DEC, VALS(packettypenames), 0x0, - "Packet Type", HFILL }}, - { &hf_mactelnet_protocolver, - { "Protocol Version", "mactelnet.protocol_version", FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - { &hf_mactelnet_source_mac, - { "Source MAC", "mactelnet.source_mac", FT_ETHER, BASE_NONE, NULL , 0x0, - NULL, HFILL }}, - { &hf_mactelnet_destination_mac, - { "Destination MAC", "mactelnet.destination_mac", FT_ETHER, BASE_NONE, NULL , 0x0, - NULL, HFILL }}, - { &hf_mactelnet_session_id, - { "Session ID", "mactelnet.session_id", FT_UINT16, BASE_HEX, NULL , 0x0, - "Session ID for this connection", HFILL }}, - { &hf_mactelnet_client_type, - { "Client Type", "mactelnet.client_type", FT_UINT16, BASE_HEX, VALS(clienttypenames) , 0x0, - NULL, HFILL }}, - { &hf_mactelnet_databytes, - { "Session Data Bytes", "mactelnet.session_bytes", FT_UINT32, BASE_DEC, NULL , 0x0, - "Session data bytes received", HFILL }}, - { &hf_mactelnet_datatype, - { "Data Packet Type", "mactelnet.data_type", FT_UINT8, BASE_HEX, VALS(controlpackettypenames) , 0x0, - NULL, HFILL }}, - { &hf_mactelnet_control, - { "Control Packet", "mactelnet.control", FT_NONE, BASE_NONE, NULL , 0x0, - NULL, HFILL }}, - { &hf_mactelnet_control_length, - { "Control Data Length", "mactelnet.control_length", FT_UINT32, BASE_DEC, NULL , 0x0, - "Control packet length", HFILL }}, - { &hf_mactelnet_control_encryption_key, - { "Encryption Key", "mactelnet.control_encryptionkey", FT_BYTES, BASE_NONE, NULL , 0x0, - "Login encryption key", HFILL }}, - { &hf_mactelnet_control_password, - { "Password MD5", "mactelnet.control_password", FT_BYTES, BASE_NONE, NULL , 0x0, - "Null padded MD5 password", HFILL }}, - { &hf_mactelnet_control_username, - { "Username", "mactelnet.control_username", FT_STRING, BASE_NONE, NULL , 0x0, - NULL, HFILL }}, - { &hf_mactelnet_control_terminal, - { "Terminal Type", "mactelnet.control_terminaltype", FT_STRING, BASE_NONE, NULL , 0x0, - NULL, HFILL }}, - { &hf_mactelnet_control_width, - { "Terminal Width", "mactelnet.control_width", FT_UINT16, BASE_DEC, NULL , 0x0, - NULL, HFILL }}, - { &hf_mactelnet_control_height, - { "Terminal Height", "mactelnet.control_height", FT_UINT16, BASE_DEC, NULL , 0x0, - NULL, HFILL }} - }; - - /* Setup protocol subtree array */ - static gint *ett[] = { - &ett_mactelnet, - &ett_mactelnet_control, - }; - - module_t *mactelnet_module; - - /* Register the protocol name and description */ - proto_mactelnet = proto_register_protocol ("MikroTik MAC-Telnet Protocol", PROTO_TAG_MACTELNET, "mactelnet"); - - /* Required function calls to register the header fields and subtrees used */ - proto_register_field_array (proto_mactelnet, hf, array_length (hf)); - proto_register_subtree_array (ett, array_length (ett)); - - mactelnet_module = prefs_register_protocol(proto_mactelnet, proto_reg_handoff_mactelnet); - - prefs_register_uint_preference(mactelnet_module, "port", "UDP Port", - "MAC-Telnet UDP port if other than the default", - 10, &global_mactelnet_port); + static hf_register_info hf[] = { + { &hf_mactelnet_control_packet, + { "Control Packet Magic Number", "mactelnet.control_packet", + FT_UINT32, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + { &hf_mactelnet_type, + { "Type", "mactelnet.type", + FT_UINT8, BASE_DEC, VALS(packettypenames), 0x0, + "Packet Type", HFILL } + }, + { &hf_mactelnet_protocolver, + { "Protocol Version", "mactelnet.protocol_version", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_mactelnet_source_mac, + { "Source MAC", "mactelnet.source_mac", + FT_ETHER, BASE_NONE, NULL , 0x0, + NULL, HFILL } + }, + { &hf_mactelnet_destination_mac, + { "Destination MAC", "mactelnet.destination_mac", + FT_ETHER, BASE_NONE, NULL , 0x0, + NULL, HFILL } + }, + { &hf_mactelnet_session_id, + { "Session ID", "mactelnet.session_id", + FT_UINT16, BASE_HEX, NULL , 0x0, + "Session ID for this connection", HFILL } + }, + { &hf_mactelnet_client_type, + { "Client Type", "mactelnet.client_type", + FT_UINT16, BASE_HEX, VALS(clienttypenames) , 0x0, + NULL, HFILL } + }, + { &hf_mactelnet_databytes, + { "Session Data Bytes", "mactelnet.session_bytes", + FT_UINT32, BASE_DEC, NULL , 0x0, + "Session data bytes received", HFILL } + }, + { &hf_mactelnet_datatype, + { "Data Packet Type", "mactelnet.data_type", + FT_UINT8, BASE_HEX, VALS(controlpackettypenames) , 0x0, + NULL, HFILL } + }, + { &hf_mactelnet_control, + { "Control Packet", "mactelnet.control", + FT_NONE, BASE_NONE, NULL , 0x0, + NULL, HFILL } + }, + { &hf_mactelnet_control_length, + { "Control Data Length", "mactelnet.control_length", + FT_UINT32, BASE_DEC, NULL , 0x0, + "Control packet length", HFILL } + }, + { &hf_mactelnet_control_encryption_key, + { "Encryption Key", "mactelnet.control_encryptionkey", + FT_BYTES, BASE_NONE, NULL , 0x0, + "Login encryption key", HFILL } + }, + { &hf_mactelnet_control_password, + { "Password MD5", "mactelnet.control_password", + FT_BYTES, BASE_NONE, NULL , 0x0, + "Null padded MD5 password", HFILL } + }, + { &hf_mactelnet_control_username, + { "Username", "mactelnet.control_username", + FT_STRING, BASE_NONE, NULL , 0x0, + NULL, HFILL } + }, + { &hf_mactelnet_control_terminal, + { "Terminal Type", "mactelnet.control_terminaltype", + FT_STRING, BASE_NONE, NULL , 0x0, + NULL, HFILL } + }, + { &hf_mactelnet_control_width, + { "Terminal Width", "mactelnet.control_width", + FT_UINT16, BASE_DEC, NULL , 0x0, + NULL, HFILL } + }, + { &hf_mactelnet_control_height, + { "Terminal Height", "mactelnet.control_height", + FT_UINT16, BASE_DEC, NULL , 0x0, + NULL, HFILL } + } + }; + + /* Setup protocol subtree array */ + static gint *ett[] = { + &ett_mactelnet, + &ett_mactelnet_control, + }; + + module_t *mactelnet_module; + + /* Register the protocol name and description */ + proto_mactelnet = proto_register_protocol ("MikroTik MAC-Telnet Protocol", PROTO_TAG_MACTELNET, "mactelnet"); + + /* Required function calls to register the header fields and subtrees used */ + proto_register_field_array (proto_mactelnet, hf, array_length (hf)); + proto_register_subtree_array (ett, array_length (ett)); + + mactelnet_module = prefs_register_protocol(proto_mactelnet, proto_reg_handoff_mactelnet); + + prefs_register_uint_preference(mactelnet_module, "port", "UDP Port", + "MAC-Telnet UDP port if other than the default", + 10, &global_mactelnet_port); } void proto_reg_handoff_mactelnet(void) { - static gboolean initialized = FALSE; - static guint current_port; - static dissector_handle_t mactelnet_handle; - - if (!initialized) { - mactelnet_handle = new_create_dissector_handle(dissect_mactelnet, proto_mactelnet); - data_handle = find_dissector("data"); - initialized = TRUE; - } else { - dissector_delete_uint("udp.port", current_port, mactelnet_handle); - } - - current_port = global_mactelnet_port; - dissector_add_uint("udp.port", current_port, mactelnet_handle); + static gboolean initialized = FALSE; + static guint current_port; + static dissector_handle_t mactelnet_handle; + + if (!initialized) { + mactelnet_handle = new_create_dissector_handle(dissect_mactelnet, proto_mactelnet); + data_handle = find_dissector("data"); + initialized = TRUE; + } else { + dissector_delete_uint("udp.port", current_port, mactelnet_handle); + } + + current_port = global_mactelnet_port; + dissector_add_uint("udp.port", current_port, mactelnet_handle); } diff --git a/epan/dissectors/packet-netbios.c b/epan/dissectors/packet-netbios.c index d6ec41e23f..554136d099 100644 --- a/epan/dissectors/packet-netbios.c +++ b/epan/dissectors/packet-netbios.c @@ -30,7 +30,6 @@ # include "config.h" #endif -#include <string.h> #include <glib.h> #include <epan/packet.h> diff --git a/epan/dissectors/packet-ntp.c b/epan/dissectors/packet-ntp.c index ea84ce87b0..fdb2288156 100644 --- a/epan/dissectors/packet-ntp.c +++ b/epan/dissectors/packet-ntp.c @@ -29,9 +29,8 @@ # include "config.h" #endif -#include <string.h> -#include <time.h> #include <math.h> + #include <glib.h> #include <epan/packet.h> @@ -585,11 +584,11 @@ static tvbparse_wanted_t* want_ignore; const char * tvb_ntp_fmt_ts(tvbuff_t *tvb, gint offset) { - guint32 tempstmp, tempfrac; - time_t temptime; - struct tm *bd; - double fractime; - char *buff; + guint32 tempstmp, tempfrac; + time_t temptime; + struct tm *bd; + double fractime; + char *buff; tempstmp = tvb_get_ntohl(tvb, offset); tempfrac = tvb_get_ntohl(tvb, offset+4); @@ -606,7 +605,7 @@ tvb_ntp_fmt_ts(tvbuff_t *tvb, gint offset) fractime = bd->tm_sec + tempfrac / NTP_FLOAT_DENOM; buff=ep_alloc(NTP_TS_SIZE); g_snprintf(buff, NTP_TS_SIZE, - "%s %2d, %d %02d:%02d:%09.6f UTC", + "%s %2d, %d %02d:%02d:%09.6f UTC", mon_names[bd->tm_mon], bd->tm_mday, bd->tm_year + 1900, @@ -635,7 +634,7 @@ dissect_ntp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree *ntp_tree; proto_item *ti = NULL; - guint8 flags; + guint8 flags; void (*dissector)(tvbuff_t *, proto_item *, guint8); col_set_str(pinfo->cinfo, COL_PROTOCOL, "NTP"); @@ -679,17 +678,17 @@ dissect_ntp_std(tvbuff_t *tvb, proto_tree *ntp_tree, guint8 flags) { proto_tree *flags_tree; proto_item *tf; - guint8 stratum; - guint8 ppoll; - gint8 precision; - double rootdelay; - double rootdispersion; - guint32 refid_addr; + guint8 stratum; + guint8 ppoll; + gint8 precision; + double rootdelay; + double rootdispersion; + guint32 refid_addr; const gchar *buffc; gchar *buff; - int i; - int macofs; - gint maclen; + int i; + int macofs; + gint maclen; tf = proto_tree_add_uint(ntp_tree, hf_ntp_flags, tvb, 0, 1, flags); @@ -845,10 +844,10 @@ dissect_ntp_ext(tvbuff_t *tvb, proto_tree *ntp_tree, int offset) { proto_tree *ext_tree, *flags_tree; proto_item *tf; - guint16 extlen; - int endoffset; - guint8 flags; - guint32 vallen, vallen_round, siglen; + guint16 extlen; + int endoffset; + guint8 flags; + guint32 vallen, vallen_round, siglen; extlen = tvb_get_ntohs(tvb, offset+2); if (extlen < 8) { @@ -1031,18 +1030,18 @@ dissect_ntp_ctrl_clockstatus(tvbuff_t *tvb, proto_tree *status_tree, guint16 off static void dissect_ntp_ctrl(tvbuff_t *tvb, proto_tree *ntp_tree, guint8 flags) { - proto_tree *flags_tree; - proto_item *tf; - guint8 flags2; - - proto_tree *status_tree, *data_tree, *item_tree; - proto_item *ts, *td, *ti; - guint16 status; - guint16 associd; - guint16 datalen; - guint16 data_offset; - - tvbparse_t *tt; + proto_tree *flags_tree; + proto_item *tf; + guint8 flags2; + + proto_tree *status_tree, *data_tree, *item_tree; + proto_item *ts, *td, *ti; + guint16 status; + guint16 associd; + guint16 datalen; + guint16 data_offset; + + tvbparse_t *tt; tvbparse_elem_t *element; tf = proto_tree_add_uint(ntp_tree, hf_ntp_flags, tvb, 0, 1, flags); @@ -1194,7 +1193,7 @@ dissect_ntp_priv(tvbuff_t *tvb, proto_tree *ntp_tree, guint8 flags) { proto_tree *flags_tree; proto_item *tf; - guint8 auth_seq, impl, reqcode; + guint8 auth_seq, impl, reqcode; tf = proto_tree_add_uint(ntp_tree, hf_ntp_flags, tvb, 0, 1, flags); @@ -1422,7 +1421,7 @@ proto_register_ntp(void) { &hf_ntppriv_reqcode, { "Request code", "ntppriv.reqcode", FT_UINT8, BASE_DEC, VALS(priv_rc_types), 0, NULL, HFILL }} - }; + }; static gint *ett[] = { &ett_ntp, &ett_ntp_flags, diff --git a/epan/dissectors/packet-rtcp.c b/epan/dissectors/packet-rtcp.c index f5d2a972d6..fe7fd8f9a4 100644 --- a/epan/dissectors/packet-rtcp.c +++ b/epan/dissectors/packet-rtcp.c @@ -66,12 +66,11 @@ # include "config.h" #endif +#include <stdlib.h> + #include <glib.h> #include <epan/packet.h> -#include <stdlib.h> -#include <string.h> - #include "packet-rtcp.h" #include "packet-rtp.h" #include "packet-ntp.h" @@ -125,61 +124,61 @@ static const value_string rtcp_version_vals[] = static const value_string rtcp_packet_type_vals[] = { - { RTCP_SR, "Sender Report" }, - { RTCP_RR, "Receiver Report" }, - { RTCP_SDES, "Source description" }, - { RTCP_BYE, "Goodbye" }, - { RTCP_APP, "Application specific" }, - { RTCP_RTPFB,"Generic RTP Feedback" }, - { RTCP_PSFB, "Payload-specific" }, - { RTCP_XR, "Extended report (RFC 3611)"}, - { RTCP_AVB, "AVB RTCP packet (IEEE1733)" }, - { RTCP_RSI, "Receiver Summary Information" }, - { RTCP_FIR, "Full Intra-frame Request (H.261)" }, - { RTCP_NACK, "Negative Acknowledgement (H.261)" }, + { RTCP_SR, "Sender Report" }, + { RTCP_RR, "Receiver Report" }, + { RTCP_SDES, "Source description" }, + { RTCP_BYE, "Goodbye" }, + { RTCP_APP, "Application specific" }, + { RTCP_RTPFB, "Generic RTP Feedback" }, + { RTCP_PSFB, "Payload-specific" }, + { RTCP_XR, "Extended report (RFC 3611)"}, + { RTCP_AVB, "AVB RTCP packet (IEEE1733)" }, + { RTCP_RSI, "Receiver Summary Information" }, + { RTCP_FIR, "Full Intra-frame Request (H.261)" }, + { RTCP_NACK, "Negative Acknowledgement (H.261)" }, { RTCP_SMPTETC, "SMPTE time-code mapping" }, - { RTCP_IJ, "Extended inter-arrival jitter report" }, + { RTCP_IJ, "Extended inter-arrival jitter report" }, { 0, NULL } }; /* RTCP SDES types (Section A.11.2) */ -#define RTCP_SDES_END 0 -#define RTCP_SDES_CNAME 1 -#define RTCP_SDES_NAME 2 -#define RTCP_SDES_EMAIL 3 -#define RTCP_SDES_PHONE 4 -#define RTCP_SDES_LOC 5 -#define RTCP_SDES_TOOL 6 -#define RTCP_SDES_NOTE 7 -#define RTCP_SDES_PRIV 8 -#define RTCP_SDES_H323_CADDR 9 +#define RTCP_SDES_END 0 +#define RTCP_SDES_CNAME 1 +#define RTCP_SDES_NAME 2 +#define RTCP_SDES_EMAIL 3 +#define RTCP_SDES_PHONE 4 +#define RTCP_SDES_LOC 5 +#define RTCP_SDES_TOOL 6 +#define RTCP_SDES_NOTE 7 +#define RTCP_SDES_PRIV 8 +#define RTCP_SDES_H323_CADDR 9 static const value_string rtcp_sdes_type_vals[] = { - { RTCP_SDES_END, "END" }, - { RTCP_SDES_CNAME, "CNAME (user and domain)" }, - { RTCP_SDES_NAME, "NAME (common name)" }, - { RTCP_SDES_EMAIL, "EMAIL (e-mail address)" }, - { RTCP_SDES_PHONE, "PHONE (phone number)" }, - { RTCP_SDES_LOC, "LOC (geographic location)" }, - { RTCP_SDES_TOOL, "TOOL (name/version of source app)" }, - { RTCP_SDES_NOTE, "NOTE (note about source)" }, - { RTCP_SDES_PRIV, "PRIV (private extensions)" }, - { RTCP_SDES_H323_CADDR,"H323-CADDR (H.323 callable address)"}, + { RTCP_SDES_END, "END" }, + { RTCP_SDES_CNAME, "CNAME (user and domain)" }, + { RTCP_SDES_NAME, "NAME (common name)" }, + { RTCP_SDES_EMAIL, "EMAIL (e-mail address)" }, + { RTCP_SDES_PHONE, "PHONE (phone number)" }, + { RTCP_SDES_LOC, "LOC (geographic location)" }, + { RTCP_SDES_TOOL, "TOOL (name/version of source app)" }, + { RTCP_SDES_NOTE, "NOTE (note about source)" }, + { RTCP_SDES_PRIV, "PRIV (private extensions)" }, + { RTCP_SDES_H323_CADDR, "H323-CADDR (H.323 callable address)"}, { 0, NULL } }; /* RTCP XR Blocks (Section 4, RTC 3611) * or http://www.iana.org/assignments/rtcp-xr-block-types */ -#define RTCP_XR_LOSS_RLE 1 -#define RTCP_XR_DUP_RLE 2 -#define RTCP_XR_PKT_RXTIMES 3 -#define RTCP_XR_REF_TIME 4 -#define RTCP_XR_DLRR 5 -#define RTCP_XR_STATS_SUMRY 6 -#define RTCP_XR_VOIP_METRCS 7 -#define RTCP_XR_BT_XNQ 8 -#define RTCP_XR_TI_VOIP 9 +#define RTCP_XR_LOSS_RLE 1 +#define RTCP_XR_DUP_RLE 2 +#define RTCP_XR_PKT_RXTIMES 3 +#define RTCP_XR_REF_TIME 4 +#define RTCP_XR_DLRR 5 +#define RTCP_XR_STATS_SUMRY 6 +#define RTCP_XR_VOIP_METRCS 7 +#define RTCP_XR_BT_XNQ 8 +#define RTCP_XR_TI_VOIP 9 #define RTCP_XR_PR_LOSS_RLE 10 #define RTCP_XR_MC_ACQ 11 #define RTCP_XR_IDMS 12 @@ -197,7 +196,7 @@ static const value_string rtcp_xr_type_vals[] = { RTCP_XR_TI_VOIP, "Texas Instruments Extended VoIP Quality Block" }, { RTCP_XR_PR_LOSS_RLE, "Post-repair Loss RLE Report Block" }, { RTCP_XR_MC_ACQ, "Multicast Acquisition Report Block" }, - { RTCP_XR_IDMS, "Inter-destination Media Synchronization Block" }, /* [http://www.etsi.org/deliver/etsi_ts/183000_183099/183063/][ETSI 183 063][Miguel_Angel_Reina_Ortega] */ + { RTCP_XR_IDMS, "Inter-destination Media Synchronization Block" }, /* [http://www.etsi.org/deliver/etsi_ts/183000_183099/183063/][ETSI 183 063][Miguel_Angel_Reina_Ortega] */ { 0, NULL} }; @@ -234,16 +233,16 @@ static const value_string rtcp_xr_ip_ttl_vals[] = /* XR IDMS synchronization packet sender type */ static const value_string rtcp_xr_idms_spst[] = { - { 0, "Reserved" }, - { 1, "SC" }, - { 2, "MSAS" }, - { 3, "SC' INPUT" }, - { 4, "SC' OUTPUT" }, - { 5, "Reserved" }, - { 6, "Reserved" }, - { 7, "Reserved" }, - { 8, "Reserved" }, - { 9, "Reserved" }, + { 0, "Reserved" }, + { 1, "SC" }, + { 2, "MSAS" }, + { 3, "SC' INPUT" }, + { 4, "SC' OUTPUT" }, + { 5, "Reserved" }, + { 6, "Reserved" }, + { 7, "Reserved" }, + { 8, "Reserved" }, + { 9, "Reserved" }, { 10, "Reserved" }, { 11, "Reserved" }, { 12, "Reserved" }, @@ -348,102 +347,102 @@ static const value_string rtcp_app_mux_selection_vals[] = /* RFC 4585 and RFC 5104 */ static const value_string rtcp_rtpfb_fmt_vals[] = { - { 1, "Generic negative acknowledgement (NACK)"}, - { 3, "Temporary Maximum Media Stream Bit Rate Request (TMMBR)"}, - { 4, "Temporary Maximum Media Stream Bit Rate Notification (TMMBN)"}, + { 1, "Generic negative acknowledgement (NACK)"}, + { 3, "Temporary Maximum Media Stream Bit Rate Request (TMMBR)"}, + { 4, "Temporary Maximum Media Stream Bit Rate Notification (TMMBN)"}, { 31, "Reserved for future extensions"}, - { 0, NULL } + { 0, NULL } }; static const value_string rtcp_psfb_fmt_vals[] = { - { 1, "Picture Loss Indication"}, - { 2, "Slice Loss Indication"}, - { 3, "Reference Picture Selection Indication"}, - { 4, "Full Intra Request (FIR) Command"}, - { 5, "Temporal-Spatial Trade-off Request (TSTR)"}, - { 6, "Temporal-Spatial Trade-off Notification (TSTN"}, - { 7, "Video Back Channel Message (VBCM)"}, + { 1, "Picture Loss Indication"}, + { 2, "Slice Loss Indication"}, + { 3, "Reference Picture Selection Indication"}, + { 4, "Full Intra Request (FIR) Command"}, + { 5, "Temporal-Spatial Trade-off Request (TSTR)"}, + { 6, "Temporal-Spatial Trade-off Notification (TSTN"}, + { 7, "Video Back Channel Message (VBCM)"}, { 15, "Application Layer Feedback"}, { 31, "Reserved for future extensions"}, - { 0, NULL } + { 0, NULL } }; /* RTCP header fields */ -static int proto_rtcp = -1; -static int hf_rtcp_version = -1; -static int hf_rtcp_padding = -1; -static int hf_rtcp_rc = -1; -static int hf_rtcp_sc = -1; -static int hf_rtcp_pt = -1; -static int hf_rtcp_length = -1; -static int hf_rtcp_ssrc_sender = -1; +static int proto_rtcp = -1; +static int hf_rtcp_version = -1; +static int hf_rtcp_padding = -1; +static int hf_rtcp_rc = -1; +static int hf_rtcp_sc = -1; +static int hf_rtcp_pt = -1; +static int hf_rtcp_length = -1; +static int hf_rtcp_ssrc_sender = -1; static int hf_rtcp_ssrc_media_source = -1; -static int hf_rtcp_ntp = -1; -static int hf_rtcp_ntp_msw = -1; -static int hf_rtcp_ntp_lsw = -1; -static int hf_rtcp_rtp_timestamp = -1; -static int hf_rtcp_sender_pkt_cnt = -1; -static int hf_rtcp_sender_oct_cnt = -1; -static int hf_rtcp_ssrc_source = -1; -static int hf_rtcp_ssrc_fraction = -1; -static int hf_rtcp_ssrc_cum_nr = -1; -static int hf_rtcp_ssrc_discarded = -1; +static int hf_rtcp_ntp = -1; +static int hf_rtcp_ntp_msw = -1; +static int hf_rtcp_ntp_lsw = -1; +static int hf_rtcp_rtp_timestamp = -1; +static int hf_rtcp_sender_pkt_cnt = -1; +static int hf_rtcp_sender_oct_cnt = -1; +static int hf_rtcp_ssrc_source = -1; +static int hf_rtcp_ssrc_fraction = -1; +static int hf_rtcp_ssrc_cum_nr = -1; +static int hf_rtcp_ssrc_discarded = -1; /* First the 32 bit number, then the split * up 16 bit values */ /* These two are added to a subtree */ static int hf_rtcp_ssrc_ext_high_seq = -1; -static int hf_rtcp_ssrc_high_seq = -1; -static int hf_rtcp_ssrc_high_cycles = -1; -static int hf_rtcp_ssrc_jitter = -1; -static int hf_rtcp_ssrc_lsr = -1; -static int hf_rtcp_ssrc_dlsr = -1; -static int hf_rtcp_ssrc_csrc = -1; -static int hf_rtcp_sdes_type = -1; -static int hf_rtcp_sdes_length = -1; -static int hf_rtcp_sdes_text = -1; -static int hf_rtcp_sdes_prefix_len = -1; -static int hf_rtcp_sdes_prefix_string= -1; -static int hf_rtcp_subtype = -1; -static int hf_rtcp_name_ascii = -1; -static int hf_rtcp_app_data = -1; -static int hf_rtcp_fsn = -1; -static int hf_rtcp_blp = -1; -static int hf_rtcp_padding_count = -1; -static int hf_rtcp_padding_data = -1; +static int hf_rtcp_ssrc_high_seq = -1; +static int hf_rtcp_ssrc_high_cycles = -1; +static int hf_rtcp_ssrc_jitter = -1; +static int hf_rtcp_ssrc_lsr = -1; +static int hf_rtcp_ssrc_dlsr = -1; +static int hf_rtcp_ssrc_csrc = -1; +static int hf_rtcp_sdes_type = -1; +static int hf_rtcp_sdes_length = -1; +static int hf_rtcp_sdes_text = -1; +static int hf_rtcp_sdes_prefix_len = -1; +static int hf_rtcp_sdes_prefix_string = -1; +static int hf_rtcp_subtype = -1; +static int hf_rtcp_name_ascii = -1; +static int hf_rtcp_app_data = -1; +static int hf_rtcp_fsn = -1; +static int hf_rtcp_blp = -1; +static int hf_rtcp_padding_count = -1; +static int hf_rtcp_padding_data = -1; static int hf_rtcp_profile_specific_extension = -1; -static int hf_rtcp_app_poc1 = -1; -static int hf_rtcp_app_poc1_subtype = -1; -static int hf_rtcp_app_poc1_sip_uri = -1; +static int hf_rtcp_app_poc1 = -1; +static int hf_rtcp_app_poc1_subtype = -1; +static int hf_rtcp_app_poc1_sip_uri = -1; static int hf_rtcp_app_poc1_disp_name = -1; -static int hf_rtcp_app_poc1_priority = -1; -static int hf_rtcp_app_poc1_request_ts = -1; -static int hf_rtcp_app_poc1_stt = -1; -static int hf_rtcp_app_poc1_partic = -1; -static int hf_rtcp_app_poc1_ssrc_granted = -1; +static int hf_rtcp_app_poc1_priority = -1; +static int hf_rtcp_app_poc1_request_ts = -1; +static int hf_rtcp_app_poc1_stt = -1; +static int hf_rtcp_app_poc1_partic = -1; +static int hf_rtcp_app_poc1_ssrc_granted = -1; static int hf_rtcp_app_poc1_last_pkt_seq_no = -1; static int hf_rtcp_app_poc1_ignore_seq_no = -1; -static int hf_rtcp_app_poc1_reason_code1 = -1; -static int hf_rtcp_app_poc1_reason1_phrase = -1; -static int hf_rtcp_app_poc1_reason_code2 = -1; -static int hf_rtcp_app_poc1_new_time_request = -1; -static int hf_rtcp_app_poc1_ack_subtype = -1; +static int hf_rtcp_app_poc1_reason_code1 = -1; +static int hf_rtcp_app_poc1_reason1_phrase = -1; +static int hf_rtcp_app_poc1_reason_code2 = -1; +static int hf_rtcp_app_poc1_new_time_request = -1; +static int hf_rtcp_app_poc1_ack_subtype = -1; static int hf_rtcp_app_poc1_ack_reason_code = -1; static int hf_rtcp_app_poc1_qsresp_priority = -1; static int hf_rtcp_app_poc1_qsresp_position = -1; static int hf_rtcp_app_poc1_conn_content[5] = { -1, -1, -1, -1, -1 }; -static int hf_rtcp_app_poc1_conn_session_type = -1; -static int hf_rtcp_app_poc1_conn_add_ind_mao = -1; +static int hf_rtcp_app_poc1_conn_session_type = -1; +static int hf_rtcp_app_poc1_conn_add_ind_mao = -1; static int hf_rtcp_app_poc1_conn_sdes_items[5] = { -1, -1, -1, -1, -1 }; -static int hf_rtcp_app_mux = -1; -static int hf_rtcp_app_mux_mux = -1; -static int hf_rtcp_app_mux_cp = -1; +static int hf_rtcp_app_mux = -1; +static int hf_rtcp_app_mux_mux = -1; +static int hf_rtcp_app_mux_cp = -1; static int hf_rtcp_app_mux_selection = -1; static int hf_rtcp_app_mux_localmuxport = -1; -static int hf_rtcp_xr_block_type = -1; +static int hf_rtcp_xr_block_type = -1; static int hf_rtcp_xr_block_specific = -1; -static int hf_rtcp_xr_block_length = -1; -static int hf_rtcp_xr_thinning = -1; +static int hf_rtcp_xr_block_length = -1; +static int hf_rtcp_xr_thinning = -1; static int hf_rtcp_xr_voip_metrics_burst_density = -1; static int hf_rtcp_xr_voip_metrics_gap_density = -1; static int hf_rtcp_xr_voip_metrics_burst_duration = -1; @@ -523,14 +522,14 @@ static int hf_rtcp_xr_btxnq_ses = -1; static int hf_rtcp_xr_btxnq_spare = -1; /* RTCP setup fields */ -static int hf_rtcp_setup = -1; -static int hf_rtcp_setup_frame = -1; +static int hf_rtcp_setup = -1; +static int hf_rtcp_setup_frame = -1; static int hf_rtcp_setup_method = -1; /* RTCP roundtrip delay fields */ -static int hf_rtcp_last_sr_timestamp_frame = -1; +static int hf_rtcp_last_sr_timestamp_frame = -1; static int hf_rtcp_time_since_last_sr = -1; -static int hf_rtcp_roundtrip_delay = -1; +static int hf_rtcp_roundtrip_delay = -1; @@ -598,9 +597,9 @@ void srtcp_add_address( packet_info *pinfo, const gchar *setup_method, guint32 setup_frame_number, struct srtp_info *srtcp_info) { - address null_addr; - conversation_t* p_conv; - struct _rtcp_conversation_info *p_conv_data = NULL; + address null_addr; + conversation_t *p_conv; + struct _rtcp_conversation_info *p_conv_data; /* * If this isn't the first time this packet has been processed, @@ -729,8 +728,9 @@ dissect_rtcp_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) actual bytes this translates to (i.e. (raw value + 1) * 4) */ int dissect_rtcp_length_field( proto_tree *tree, tvbuff_t *tvb, int offset) { - proto_item *ti; - unsigned short raw_length = tvb_get_ntohs( tvb, offset ); + proto_item *ti; + unsigned short raw_length = tvb_get_ntohs( tvb, offset ); + ti = proto_tree_add_item( tree, hf_rtcp_length, tvb, offset, 2, ENC_BIG_ENDIAN); proto_item_append_text(ti, " (%u bytes)", (raw_length+1)*4); offset += 2; @@ -769,19 +769,19 @@ dissect_rtcp_nack( tvbuff_t *tvb, int offset, proto_tree *tree ) static int dissect_rtcp_rtpfb_tmmbr( tvbuff_t *tvb, int offset, proto_tree *rtcp_tree, proto_item *top_item, int num_fci, int is_notification) { - int bitrate = 0; - int exp = 0; - guint32 mantissa = 0; - proto_item *ti = (proto_item*) NULL; - proto_tree *fci_tree = (proto_tree*) NULL; + int bitrate; + int exp; + guint32 mantissa; + proto_item *ti; + proto_tree *fci_tree; if (is_notification == 1) { - ti = proto_tree_add_text( rtcp_tree, tvb, offset, 8, "TMMBN %d", num_fci ); + ti = proto_tree_add_text( rtcp_tree, tvb, offset, 8, "TMMBN %d", num_fci ); } else { - ti = proto_tree_add_text( rtcp_tree, tvb, offset, 8, "TMMBR %d", num_fci ); + ti = proto_tree_add_text( rtcp_tree, tvb, offset, 8, "TMMBR %d", num_fci ); } - fci_tree = proto_item_add_subtree( ti, ett_ssrc ); + fci_tree = proto_item_add_subtree( ti, ett_ssrc ); /* SSRC 32 bit*/ proto_tree_add_item( fci_tree, hf_rtcp_rtpfb_tmbbr_fci_ssrc, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; @@ -808,46 +808,46 @@ dissect_rtcp_rtpfb_tmmbr( tvbuff_t *tvb, int offset, proto_tree *rtcp_tree, prot static int dissect_rtcp_rtpfb_nack( tvbuff_t *tvb, int offset, proto_tree *rtcp_tree, proto_item *top_item) { - int i; - char strbuf[64]; - int nack_num_frames_lost = 0; - proto_tree *bitfield_tree; - unsigned int rtcp_rtpfb_nack_pid = 0; - unsigned int rtcp_rtpfb_nack_blp = 0; - proto_item *ti = (proto_item*) NULL; + int i; + char strbuf[64]; + int nack_num_frames_lost; + proto_tree *bitfield_tree; + unsigned int rtcp_rtpfb_nack_pid; + unsigned int rtcp_rtpfb_nack_blp; + proto_item *ti; proto_tree_add_item(rtcp_tree, hf_rtcp_rtpfb_nack_pid, tvb, offset, 2, ENC_BIG_ENDIAN); - rtcp_rtpfb_nack_pid = tvb_get_ntohs(tvb, offset); + rtcp_rtpfb_nack_pid = tvb_get_ntohs(tvb, offset); offset += 2; ti = proto_tree_add_item(rtcp_tree, hf_rtcp_rtpfb_nack_blp, tvb, offset, 2, ENC_BIG_ENDIAN); proto_item_set_text(ti, "RTCP Transport Feedback NACK BLP: "); - rtcp_rtpfb_nack_blp = tvb_get_ntohs(tvb, offset); - bitfield_tree = proto_item_add_subtree( ti, ett_rtcp_nack_blp); - nack_num_frames_lost ++; - if (rtcp_rtpfb_nack_blp) { - for (i = 0; i < 16; i ++) { - g_snprintf(strbuf, 64, "Frame %d also lost", rtcp_rtpfb_nack_pid + i + 1); - proto_tree_add_text(bitfield_tree, tvb, offset, 2, "%s", - decode_boolean_bitfield(rtcp_rtpfb_nack_blp, (1<<i), 16, strbuf, "")); - - if (rtcp_rtpfb_nack_blp & (1<<i)) { - proto_item *hidden_ti; - hidden_ti = proto_tree_add_uint(bitfield_tree, hf_rtcp_rtpfb_nack_pid, tvb, offset, 2, rtcp_rtpfb_nack_pid + i + 1); - PROTO_ITEM_SET_HIDDEN(hidden_ti); - proto_item_append_text(ti, "%d ", rtcp_rtpfb_nack_pid + i + 1); - nack_num_frames_lost ++; - } + rtcp_rtpfb_nack_blp = tvb_get_ntohs(tvb, offset); + bitfield_tree = proto_item_add_subtree( ti, ett_rtcp_nack_blp); + nack_num_frames_lost = 1; + if (rtcp_rtpfb_nack_blp) { + for (i = 0; i < 16; i ++) { + g_snprintf(strbuf, 64, "Frame %d also lost", rtcp_rtpfb_nack_pid + i + 1); + proto_tree_add_text(bitfield_tree, tvb, offset, 2, "%s", + decode_boolean_bitfield(rtcp_rtpfb_nack_blp, (1<<i), 16, strbuf, "")); + + if (rtcp_rtpfb_nack_blp & (1<<i)) { + proto_item *hidden_ti; + hidden_ti = proto_tree_add_uint(bitfield_tree, hf_rtcp_rtpfb_nack_pid, tvb, offset, 2, rtcp_rtpfb_nack_pid + i + 1); + PROTO_ITEM_SET_HIDDEN(hidden_ti); + proto_item_append_text(ti, "%d ", rtcp_rtpfb_nack_pid + i + 1); + nack_num_frames_lost ++; } - } else { - proto_item_set_text(ti, "0 (No additional frames lost)"); } + } else { + proto_item_set_text(ti, "0 (No additional frames lost)"); + } offset += 2; if (top_item != NULL) { - proto_item_append_text(top_item, ": NACK: %d frames lost", nack_num_frames_lost); - } + proto_item_append_text(top_item, ": NACK: %d frames lost", nack_num_frames_lost); + } return offset; } @@ -855,10 +855,10 @@ dissect_rtcp_rtpfb_nack( tvbuff_t *tvb, int offset, proto_tree *rtcp_tree, proto static int dissect_rtcp_rtpfb( tvbuff_t *tvb, int offset, proto_tree *rtcp_tree, proto_item *top_item) { - unsigned int counter = 0; - unsigned int rtcp_rtpfb_fmt = 0; - int packet_length = 0; - int start_offset = offset; + unsigned int counter; + unsigned int rtcp_rtpfb_fmt; + int packet_length; + int start_offset = offset; /* Transport layer FB message */ /* Feedback message type (FMT): 5 bits */ @@ -883,6 +883,7 @@ dissect_rtcp_rtpfb( tvbuff_t *tvb, int offset, proto_tree *rtcp_tree, proto_item offset += 4; /* Transport-Layer Feedback Message Elements */ + counter = 0; while ((offset - start_offset) < packet_length) { counter++; if (rtcp_rtpfb_fmt == 1) { @@ -904,13 +905,13 @@ static int dissect_rtcp_psfb( tvbuff_t *tvb, int offset, proto_tree *rtcp_tree, int packet_length ) { - unsigned int counter = 0; - unsigned int num_fci = 0; - unsigned int read_fci = 0; - proto_tree *fci_tree = (proto_tree*) NULL; - proto_item *ti = (proto_item*) NULL; - unsigned int rtcp_psfb_fmt = 0; - int base_offset = offset; + unsigned int counter; + unsigned int num_fci; + unsigned int read_fci; + proto_tree *fci_tree; + proto_item *ti; + unsigned int rtcp_psfb_fmt; + int base_offset = offset; /* Payload-specific FB message */ /* Feedback message type (FMT): 5 bits */ @@ -924,7 +925,7 @@ dissect_rtcp_psfb( tvbuff_t *tvb, int offset, proto_tree *rtcp_tree, /* Packet length in 32 bit words MINUS one, 16 bits */ num_fci = (tvb_get_ntohs(tvb, offset) - 2); - offset = dissect_rtcp_length_field(rtcp_tree, tvb, offset); + offset = dissect_rtcp_length_field(rtcp_tree, tvb, offset); /* SSRC of packet sender, 32 bits */ proto_tree_add_item( rtcp_tree, hf_rtcp_ssrc_sender, tvb, offset, 4, ENC_BIG_ENDIAN ); @@ -935,32 +936,34 @@ dissect_rtcp_psfb( tvbuff_t *tvb, int offset, proto_tree *rtcp_tree, offset += 4; /* Feedback Control Information (FCI) */ - while ( read_fci < num_fci ) { - /* Handle FIR */ - if (rtcp_psfb_fmt == 4) { - /* Create a new subtree for a length of 8 bytes */ - ti = proto_tree_add_text( rtcp_tree, tvb, offset, 8, "FIR %u", ++counter ); - fci_tree = proto_item_add_subtree( ti, ett_ssrc ); - /* SSRC 32 bit*/ - proto_tree_add_item( fci_tree, hf_rtcp_psfb_fir_fci_ssrc, tvb, offset, 4, ENC_BIG_ENDIAN ); - offset += 4; - /* Command Sequence Number 8 bit*/ - proto_tree_add_item( fci_tree, hf_rtcp_psfb_fir_fci_csn, tvb, offset, 1, ENC_BIG_ENDIAN ); - /*proto_tree_add_item( ssrc_tree, hf_rtcp_ssrc_source, tvb, offset, 4, ENC_BIG_ENDIAN );*/ - offset += 1; - /* Reserved 24 bit*/ - proto_tree_add_item( fci_tree, hf_rtcp_psfb_fir_fci_reserved, tvb, offset, 3, ENC_BIG_ENDIAN ); - offset += 3; - read_fci += 2; - } else { - break; - } + counter = 0; + read_fci = 0; + while ( read_fci < num_fci ) { + /* Handle FIR */ + if (rtcp_psfb_fmt == 4) { + /* Create a new subtree for a length of 8 bytes */ + ti = proto_tree_add_text( rtcp_tree, tvb, offset, 8, "FIR %u", ++counter ); + fci_tree = proto_item_add_subtree( ti, ett_ssrc ); + /* SSRC 32 bit*/ + proto_tree_add_item( fci_tree, hf_rtcp_psfb_fir_fci_ssrc, tvb, offset, 4, ENC_BIG_ENDIAN ); + offset += 4; + /* Command Sequence Number 8 bit*/ + proto_tree_add_item( fci_tree, hf_rtcp_psfb_fir_fci_csn, tvb, offset, 1, ENC_BIG_ENDIAN ); + /*proto_tree_add_item( ssrc_tree, hf_rtcp_ssrc_source, tvb, offset, 4, ENC_BIG_ENDIAN );*/ + offset += 1; + /* Reserved 24 bit*/ + proto_tree_add_item( fci_tree, hf_rtcp_psfb_fir_fci_reserved, tvb, offset, 3, ENC_BIG_ENDIAN ); + offset += 3; + read_fci += 2; + } else { + break; + } } /* Append undecoded FCI information */ if ((packet_length - (offset - base_offset)) > 0) { - proto_tree_add_item( rtcp_tree, hf_rtcp_fci, tvb, offset, packet_length - (offset - base_offset), ENC_NA ); - offset = base_offset + packet_length; + proto_tree_add_item( rtcp_tree, hf_rtcp_fci, tvb, offset, packet_length - (offset - base_offset), ENC_NA ); + offset = base_offset + packet_length; } return offset; } @@ -990,12 +993,12 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree unsigned int padding, unsigned int packet_len, guint rtcp_subtype, guint32 app_length ) { - unsigned int counter = 0; - char ascii_name[5]; - guint sdes_type = 0; - guint item_len = 0; - proto_tree *PoC1_tree; - proto_item *PoC1_item; + unsigned int counter; + char ascii_name[5]; + guint sdes_type; + guint item_len; + proto_tree *PoC1_tree; + proto_item *PoC1_item; /* XXX If more application types are to be dissected it may be useful to use a table like in packet-sip.c */ static const char poc1_app_name_str[] = "PoC1"; @@ -1004,7 +1007,7 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree /* SSRC / CSRC */ proto_tree_add_item( tree, hf_rtcp_ssrc_source, tvb, offset, 4, ENC_BIG_ENDIAN ); - offset += 4; + offset += 4; packet_len -= 4; /* Application Name (ASCII) */ @@ -1019,17 +1022,17 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree if ( g_ascii_strncasecmp(ascii_name, poc1_app_name_str,4 ) == 0 ) { /* PoC1 Application */ - guint8 t2timer_code, participants_code; + guint8 t2timer_code, participants_code; proto_item *item; - item = proto_tree_add_uint( tree, hf_rtcp_app_poc1_subtype, tvb, offset - 8, 1, rtcp_subtype ); + item = proto_tree_add_uint( tree, hf_rtcp_app_poc1_subtype, tvb, offset - 8, 1, rtcp_subtype ); PROTO_ITEM_SET_GENERATED(item); col_add_fstr(pinfo->cinfo, COL_INFO,"(%s) %s",ascii_name, val_to_str(rtcp_subtype,rtcp_app_poc1_floor_cnt_type_vals,"unknown (%u)") ); - offset += 4; - packet_len -= 4; - app_length = app_length -8; + offset += 4; + packet_len -= 4; + app_length = app_length -8; if ( packet_len == 0 ) - return offset; /* No more data */ + return offset; /* No more data */ /* Applications specific data */ if ( padding ) { /* If there's padding present, we have to remove that from the data part @@ -1049,7 +1052,7 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree case TBCP_BURST_REQUEST: { - guint8 code; + guint8 code; guint16 priority; /* Both items here are optional */ @@ -1059,38 +1062,38 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree } /* Look for a code in the first byte */ - code = tvb_get_guint8(tvb, offset); - offset += 1; - packet_len -=1; + code = tvb_get_guint8(tvb, offset); + offset += 1; + packet_len -= 1; /* Priority (optional) */ if (code == 102) { - item_len = tvb_get_guint8(tvb, offset); - offset += 1; + item_len = tvb_get_guint8(tvb, offset); + offset += 1; packet_len -= 1; if (item_len != 2) /* SHALL be 2 */ return offset; - priority = tvb_get_ntohs(tvb, offset); + priority = tvb_get_ntohs(tvb, offset); proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_priority, tvb, offset, 2, ENC_BIG_ENDIAN ); - offset += 2; + offset += 2; packet_len -= 2; col_append_fstr(pinfo->cinfo, COL_INFO, " \"%s\"", - val_to_str(priority, - rtcp_app_poc1_qsresp_priority_vals, - "Unknown")); + val_to_str_const(priority, + rtcp_app_poc1_qsresp_priority_vals, + "Unknown")); /* Look for (optional) next code */ if (tvb_reported_length_remaining( tvb, offset) == 0) { return offset; } - code = tvb_get_guint8(tvb, offset); - offset += 1; - packet_len -=1; + code = tvb_get_guint8(tvb, offset); + offset += 1; + packet_len -= 1; } @@ -1099,8 +1102,8 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree { const gchar *buff; - item_len = tvb_get_guint8(tvb, offset); - offset += 1; + item_len = tvb_get_guint8(tvb, offset); + offset += 1; packet_len -= 1; if (item_len != 8) /* SHALL be 8 */ return offset; @@ -1109,8 +1112,8 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree tvb, offset, 8, ENC_TIME_NTP|ENC_BIG_ENDIAN); buff = tvb_ntp_fmt_ts(tvb, offset); - offset += 8; - packet_len -=8; + offset += 8; + packet_len -= 8; col_append_fstr(pinfo->cinfo, COL_INFO, " ts=\"%s\"", buff); } @@ -1120,18 +1123,18 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree case TBCP_BURST_GRANTED: { proto_item *ti; - guint16 stop_talking_time; - guint16 participants; + guint16 stop_talking_time; + guint16 participants; /* Stop talking timer (now mandatory) */ - t2timer_code = tvb_get_guint8(tvb, offset); - offset += 1; - packet_len -=1; + t2timer_code = tvb_get_guint8(tvb, offset); + offset += 1; + packet_len -= 1; if (t2timer_code != 101) /* SHALL be 101 */ return offset; - item_len = tvb_get_guint8(tvb, offset); - offset += 1; + item_len = tvb_get_guint8(tvb, offset); + offset += 1; packet_len -= 1; if (item_len != 2) /* SHALL be 2 */ return offset; @@ -1152,7 +1155,7 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree proto_item_append_text(ti, " seconds"); break; } - offset += item_len; + offset += item_len; packet_len -= item_len; col_append_fstr(pinfo->cinfo, COL_INFO, " stop-talking-time=%u", @@ -1163,20 +1166,20 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree { return offset; } - participants_code = tvb_get_guint8(tvb, offset); - offset += 1; - packet_len -=1; + participants_code = tvb_get_guint8(tvb, offset); + offset += 1; + packet_len -= 1; if (participants_code != 100) /* SHALL be 100 */ return offset; - item_len = tvb_get_guint8(tvb, offset); - offset += 1; + item_len = tvb_get_guint8(tvb, offset); + offset += 1; packet_len -= 1; if (item_len != 2) /* SHALL be 2 */ return offset; participants = tvb_get_ntohs(tvb, offset); - ti = proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_partic, tvb, offset, 2, ENC_BIG_ENDIAN ); + ti = proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_partic, tvb, offset, 2, ENC_BIG_ENDIAN ); /* Append text with meanings of extreme values */ switch (participants) @@ -1190,7 +1193,7 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree default: break; } - offset += item_len; + offset += item_len; packet_len -= item_len; col_append_fstr(pinfo->cinfo, COL_INFO, " participants=%u", @@ -1206,7 +1209,7 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree /* SSRC of PoC client */ proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_ssrc_granted, tvb, offset, 4, ENC_BIG_ENDIAN ); - offset += 4; + offset += 4; packet_len -= 4; /* SDES type (must be CNAME) */ @@ -1229,8 +1232,8 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree col_append_fstr(pinfo->cinfo, COL_INFO, " CNAME=\"%s\"", tvb_get_ephemeral_string(tvb, offset, item_len)); - offset += item_len; - packet_len = packet_len - item_len - 1; + offset += item_len; + packet_len = packet_len - item_len - 1; /* In the application dependent data, the TBCP Talk Burst Taken message SHALL carry * a SSRC field and SDES items, CNAME and MAY carry SDES item NAME to identify the @@ -1260,8 +1263,8 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree col_append_fstr(pinfo->cinfo, COL_INFO, " DISPLAY-NAME=\"%s\"", tvb_get_ephemeral_string(tvb, offset, item_len)); - offset += item_len; - packet_len = packet_len - item_len - 1; + offset += item_len; + packet_len = packet_len - item_len - 1; if (packet_len == 0) { return offset; @@ -1269,9 +1272,9 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree /* Move onto next 4-byte boundary */ if (offset % 4) { - int padding2 = (4-(offset%4)); - offset += padding2; - packet_len -= padding2; + int padding2 = (4-(offset%4)); + offset += padding2; + packet_len -= padding2; } } @@ -1279,14 +1282,14 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree if (tvb_reported_length_remaining( tvb, offset) == 0) { return offset; } - participants_code = tvb_get_guint8(tvb, offset); - offset += 1; - packet_len -=1; + participants_code = tvb_get_guint8(tvb, offset); + offset += 1; + packet_len -= 1; if (participants_code != 100) { /* SHALL be 100 */ return offset; } - item_len = tvb_get_guint8(tvb, offset); - offset += 1; + item_len = tvb_get_guint8(tvb, offset); + offset += 1; packet_len -= 1; if (item_len != 2) { /* SHALL be 2 */ return offset; @@ -1309,7 +1312,7 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree col_append_fstr(pinfo->cinfo, COL_INFO, " Participants=%u", participants); - offset += item_len; + offset += item_len; packet_len -= item_len; } break; @@ -1325,16 +1328,16 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree packet_len--; col_append_fstr(pinfo->cinfo, COL_INFO, " reason-code=\"%s\"", - val_to_str(reason_code, - rtcp_app_poc1_reason_code1_vals, - "Unknown")); + val_to_str_const(reason_code, + rtcp_app_poc1_reason_code1_vals, + "Unknown")); /* Reason phrase */ item_len = tvb_get_guint8( tvb, offset ); if ( item_len != 0 ) proto_tree_add_item( PoC1_tree, hf_rtcp_app_poc1_reason1_phrase, tvb, offset, 1, ENC_ASCII|ENC_NA ); - offset += (item_len+1); + offset += (item_len+1); packet_len -= (item_len+1); } break; @@ -1359,8 +1362,8 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree /* 15 bits of padding follows */ - offset += 2; - packet_len-=4; + offset += 2; + packet_len -= 4; } break; @@ -1392,11 +1395,11 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree } col_append_fstr(pinfo->cinfo, COL_INFO, " reason-code=\"%s\"", - val_to_str(reason_code, - rtcp_app_poc1_reason_code2_vals, - "Unknown")); - offset += 4; - packet_len-=4; + val_to_str_const(reason_code, + rtcp_app_poc1_reason_code2_vals, + "Unknown")); + offset += 4; + packet_len -= 4; } break; @@ -1409,9 +1412,9 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree proto_tree_add_item( PoC1_tree, hf_rtcp_app_poc1_ack_subtype, tvb, offset, 1, ENC_BIG_ENDIAN ); col_append_fstr(pinfo->cinfo, COL_INFO, " (for %s)", - val_to_str(subtype, - rtcp_app_poc1_floor_cnt_type_vals, - "Unknown")); + val_to_str_const(subtype, + rtcp_app_poc1_floor_cnt_type_vals, + "Unknown")); /* Reason code only seen if subtype was Connect */ if (subtype == TBCP_CONNECT) @@ -1420,7 +1423,7 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree } /* 16 bits of padding follow */ - offset += 4; + offset += 4; packet_len -= 4; } break; @@ -1430,7 +1433,7 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree case TBCP_QUEUE_STATUS_RESPONSE: { - guint16 position; + guint16 position; proto_item *ti; /* Priority */ @@ -1452,7 +1455,7 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree /* 1 bytes of padding follows */ - offset += 4; + offset += 4; packet_len -= 4; } break; @@ -1462,10 +1465,10 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree case TBCP_CONNECT: { - proto_item *content = proto_tree_add_text(PoC1_tree, tvb, offset, 2, "SDES item content"); - gboolean contents[5]; - unsigned int i; - guint8 items_set = 0; + proto_item *content = proto_tree_add_text(PoC1_tree, tvb, offset, 2, "SDES item content"); + gboolean contents[5]; + unsigned int i; + guint8 items_set = 0; proto_tree *content_tree = proto_item_add_subtree(content, ett_poc1_conn_contents); guint16 items_field = tvb_get_ntohs(tvb, offset ); @@ -1487,7 +1490,7 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree /* Additional indications */ proto_tree_add_item( PoC1_tree, hf_rtcp_app_poc1_conn_add_ind_mao, tvb, offset + 3, 1, ENC_BIG_ENDIAN ); - offset += 4; + offset += 4; packet_len -= 4; /* One SDES item for every set flag in contents array */ @@ -1521,7 +1524,7 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree { /* 3GPP Nb protocol extension (3GPP 29.414) for RTP Multiplexing */ col_append_fstr(pinfo->cinfo, COL_INFO,"( %s ) subtype=%u",ascii_name, rtcp_subtype); - offset += 4; + offset += 4; packet_len -= 4; /* Applications specific data */ if ( padding ) { @@ -1534,8 +1537,8 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree { guint16 local_port = 0; - proto_item* mux_item = proto_tree_add_item(tree, hf_rtcp_app_mux, tvb, offset, packet_len, ENC_NA); - proto_tree* mux_tree = proto_item_add_subtree( mux_item, ett_mux ); + proto_item *mux_item = proto_tree_add_item(tree, hf_rtcp_app_mux, tvb, offset, packet_len, ENC_NA); + proto_tree *mux_tree = proto_item_add_subtree( mux_item, ett_mux ); proto_tree_add_item( mux_tree, hf_rtcp_app_mux_mux, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( mux_tree, hf_rtcp_app_mux_cp, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( mux_tree, hf_rtcp_app_mux_selection, tvb, offset, 1, ENC_BIG_ENDIAN ); @@ -1554,14 +1557,14 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree else { tvbuff_t *next_tvb; /* tvb to pass to subdissector */ - /* tvb == Pass the entire APP payload so the subdissector can have access to the + /* tvb == Pass the entire APP payload so the subdissector can have access to the * entire data set */ - next_tvb = tvb_new_subset(tvb, offset-8, app_length+4, app_length+4); + next_tvb = tvb_new_subset(tvb, offset-8, app_length+4, app_length+4); /* look for registered sub-dissectors */ if (dissector_try_string(rtcp_dissector_table, ascii_name, next_tvb, pinfo, tree)) { /* found subdissector - return tvb_length */ - offset += 4; + offset += 4; packet_len -= 4; if ( padding ) { /* If there's padding present, we have to remove that from the data part @@ -1576,7 +1579,7 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree { /* Unhandled application type, just show app name and raw data */ col_append_fstr(pinfo->cinfo, COL_INFO,"( %s ) subtype=%u",ascii_name, rtcp_subtype); - offset += 4; + offset += 4; packet_len -= 4; /* Applications specific data */ if ( padding ) { @@ -1599,11 +1602,11 @@ static int dissect_rtcp_bye( tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree, unsigned int count ) { - unsigned int chunk = 1; - unsigned int reason_length = 0; - gint reason_offset = 0; - char* reason_text = NULL; + unsigned int chunk; + unsigned int reason_length = 0; + gint reason_offset = 0; + chunk = 1; while ( chunk <= count ) { /* source identifier, 32 bits */ proto_tree_add_item( tree, hf_rtcp_ssrc_source, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -1612,6 +1615,7 @@ dissect_rtcp_bye( tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tre } if ( tvb_reported_length_remaining( tvb, offset ) > 0 ) { + char *reason_text; /* Bye reason consists of an 8 bit length l and a string with length l */ reason_length = tvb_get_guint8( tvb, offset ); proto_tree_add_item( tree, hf_rtcp_sdes_length, tvb, offset, 1, ENC_BIG_ENDIAN ); @@ -1655,18 +1659,19 @@ static int dissect_rtcp_sdes( tvbuff_t *tvb, int offset, proto_tree *tree, unsigned int count ) { - unsigned int chunk = 1; - proto_item *sdes_item; - proto_tree *sdes_tree; - proto_tree *sdes_item_tree; - proto_item *ti; - int start_offset; - int items_start_offset; - guint32 ssrc; - unsigned int item_len = 0; - unsigned int sdes_type = 0; - unsigned int prefix_len = 0; - + unsigned int chunk; + proto_item *sdes_item; + proto_tree *sdes_tree; + proto_tree *sdes_item_tree; + proto_item *ti; + int start_offset; + int items_start_offset; + guint32 ssrc; + unsigned int item_len; + unsigned int sdes_type; + unsigned int prefix_len; + + chunk = 1; while ( chunk <= count ) { /* Create a subtree for this chunk; we don't yet know the length. */ @@ -1729,7 +1734,7 @@ dissect_rtcp_sdes( tvbuff_t *tvb, int offset, proto_tree *tree, offset++; proto_tree_add_item( sdes_item_tree, hf_rtcp_sdes_prefix_string, tvb, offset, prefix_len, ENC_ASCII|ENC_NA ); - offset += prefix_len; + offset += prefix_len; item_len -= prefix_len +1; if ( item_len == 0 ) continue; @@ -1763,22 +1768,22 @@ static void parse_xr_type_specific_field(tvbuff_t *tvb, gint offset, guint block guint8 flags = tvb_get_guint8(tvb, offset); switch (block_type) { - case RTCP_XR_LOSS_RLE: - case RTCP_XR_DUP_RLE: - case RTCP_XR_PKT_RXTIMES: - proto_tree_add_item(tree, hf_rtcp_xr_thinning, tvb, offset, 1, ENC_BIG_ENDIAN); - break; - - case RTCP_XR_STATS_SUMRY: - proto_tree_add_boolean(tree, hf_rtcp_xr_stats_loss_flag, tvb, offset, 1, flags); - proto_tree_add_boolean(tree, hf_rtcp_xr_stats_dup_flag, tvb, offset, 1, flags); - proto_tree_add_boolean(tree, hf_rtcp_xr_stats_jitter_flag, tvb, offset, 1, flags); - proto_tree_add_item(tree, hf_rtcp_xr_stats_ttl, tvb, offset, 1, ENC_BIG_ENDIAN); - break; - - default: - proto_tree_add_item(tree, hf_rtcp_xr_block_specific, tvb, offset, 1, ENC_BIG_ENDIAN); - break; + case RTCP_XR_LOSS_RLE: + case RTCP_XR_DUP_RLE: + case RTCP_XR_PKT_RXTIMES: + proto_tree_add_item(tree, hf_rtcp_xr_thinning, tvb, offset, 1, ENC_BIG_ENDIAN); + break; + + case RTCP_XR_STATS_SUMRY: + proto_tree_add_boolean(tree, hf_rtcp_xr_stats_loss_flag, tvb, offset, 1, flags); + proto_tree_add_boolean(tree, hf_rtcp_xr_stats_dup_flag, tvb, offset, 1, flags); + proto_tree_add_boolean(tree, hf_rtcp_xr_stats_jitter_flag, tvb, offset, 1, flags); + proto_tree_add_item(tree, hf_rtcp_xr_stats_ttl, tvb, offset, 1, ENC_BIG_ENDIAN); + break; + + default: + proto_tree_add_item(tree, hf_rtcp_xr_block_specific, tvb, offset, 1, ENC_BIG_ENDIAN); + break; } } @@ -1788,33 +1793,33 @@ static gboolean validate_xr_block_length(tvbuff_t *tvb, packet_info *pinfo, int ti = proto_tree_add_uint(tree, hf_rtcp_xr_block_length, tvb, offset, 2, block_len); switch (block_type) { - case RTCP_XR_REF_TIME: - if (block_len != 2) - expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN, - "Invalid block length, should be 2"); - return FALSE; - - case RTCP_XR_STATS_SUMRY: - if (block_len != 9) - expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN, - "Invalid block length, should be 9"); - return FALSE; - - case RTCP_XR_VOIP_METRCS: - case RTCP_XR_BT_XNQ: - if (block_len != 8) - expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN, - "Invalid block length, should be 8"); - return FALSE; + case RTCP_XR_REF_TIME: + if (block_len != 2) + expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN, + "Invalid block length, should be 2"); + return FALSE; + + case RTCP_XR_STATS_SUMRY: + if (block_len != 9) + expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN, + "Invalid block length, should be 9"); + return FALSE; + + case RTCP_XR_VOIP_METRCS: + case RTCP_XR_BT_XNQ: + if (block_len != 8) + expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN, + "Invalid block length, should be 8"); + return FALSE; - case RTCP_XR_IDMS: - if (block_len != 7) - expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN, - "Invalid block length, should be 7"); - return FALSE; + case RTCP_XR_IDMS: + if (block_len != 7) + expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN, + "Invalid block length, should be 7"); + return FALSE; - default: - break; + default: + break; } return TRUE; } @@ -1822,11 +1827,7 @@ static gboolean validate_xr_block_length(tvbuff_t *tvb, packet_info *pinfo, int static int dissect_rtcp_xr(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree, gint packet_len) { - guint block_num = 1; - guint temp_value = 0; /* used when checking spare bits in block type 8 */ - proto_item *item; - int hour,min,sec,msec; - guint32 tmp_ts; + guint block_num; /* Packet length should at least be 4 */ if (packet_len < 4) { @@ -1836,19 +1837,19 @@ dissect_rtcp_xr(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree, /* SSRC */ proto_tree_add_item( tree, hf_rtcp_ssrc_sender, tvb, offset, 4, ENC_BIG_ENDIAN ); - offset += 4; + offset += 4; packet_len -= 4; - for(;packet_len > 0; block_num++) { - guint block_type = tvb_get_guint8(tvb, offset), block_length = 0; - gint content_length = 0; + for( block_num = 1; packet_len > 0; block_num++) { + guint block_type = tvb_get_guint8(tvb, offset), block_length = 0; + gint content_length = 0; /*gboolean valid = TRUE;*/ /* Create a subtree for this block, dont know the length yet*/ - proto_item *block = proto_tree_add_text(tree, tvb, offset, -1, "Block %u", block_num); + proto_item *block = proto_tree_add_text(tree, tvb, offset, -1, "Block %u", block_num); proto_tree *xr_block_tree = proto_item_add_subtree(block, ett_xr_block); - proto_item *contents = NULL; - proto_item *content_tree = NULL; + proto_item *contents; + proto_tree *content_tree; proto_tree_add_item(xr_block_tree, hf_rtcp_xr_block_type, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -1871,7 +1872,7 @@ dissect_rtcp_xr(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree, proto_tree_add_text(xr_block_tree, tvb, offset + 2, 2, "Block length is greater than packet length"); } - offset += 4; + offset += 4; packet_len -= 4; contents = proto_tree_add_text(xr_block_tree, tvb, offset, content_length, "Contents"); @@ -2129,7 +2130,7 @@ dissect_rtcp_xr(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree, "Chunk: %u -- Null Terminator ", count); } else if ( ! ( value & 0x8000 )) { - const gchar* run_type = (value & 0x4000) ? "1s" : "0s"; + const gchar *run_type = (value & 0x4000) ? "1s" : "0s"; value &= 0x3FFF; proto_tree_add_text(chunks_tree, tvb, offset, 2, "Chunk: %u -- Length Run %s, length: %u", @@ -2147,6 +2148,7 @@ dissect_rtcp_xr(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree, break; } case RTCP_XR_BT_XNQ: { /* BT XNQ block as defined in RFC5093 */ + guint temp_value; /* used when checking spare bits in block type 8 */ proto_tree_add_item(content_tree, hf_rtcp_xr_btxnq_begseq, tvb, offset, 2, ENC_BIG_ENDIAN); /* Begin Sequence number */ proto_tree_add_item(content_tree, hf_rtcp_xr_btxnq_endseq, tvb, offset+2, 2, ENC_BIG_ENDIAN); /* End Sequence number */ @@ -2164,69 +2166,75 @@ dissect_rtcp_xr(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree, offset += 4; temp_value = tvb_get_ntohl(tvb, offset); /* tDegNet */ - if( (temp_value & 0x0ff000000) != 0) + if ((temp_value & 0x0ff000000) != 0) proto_tree_add_string(content_tree, hf_rtcp_xr_btxnq_spare, tvb, offset, 1, "Warning - spare bits not 0"); proto_tree_add_uint(content_tree, hf_rtcp_xr_btxnq_tdegnet, tvb, offset+1, 3, temp_value & 0x0ffffff); offset += 4; temp_value = tvb_get_ntohl(tvb, offset); /* tDegJit */ - if( (temp_value & 0x0ff000000) != 0) + if ((temp_value & 0x0ff000000) != 0) proto_tree_add_string(content_tree, hf_rtcp_xr_btxnq_spare, tvb, offset, 1, "Warning - spare bits not 0"); proto_tree_add_uint(content_tree, hf_rtcp_xr_btxnq_tdegjit, tvb, offset+1, 3, temp_value & 0x0ffffff); offset += 4; temp_value = tvb_get_ntohl(tvb, offset); /* ES */ - if( (temp_value & 0x0ff000000) != 0) + if ((temp_value & 0x0ff000000) != 0) proto_tree_add_string(content_tree, hf_rtcp_xr_btxnq_spare, tvb, offset, 1, "Warning - spare bits not 0"); proto_tree_add_uint(content_tree, hf_rtcp_xr_btxnq_es, tvb, offset+1, 3, temp_value & 0x0ffffff); offset += 4; temp_value = tvb_get_ntohl(tvb, offset); /* SES */ - if( (temp_value & 0x0ff000000) != 0) + if ((temp_value & 0x0ff000000) != 0) proto_tree_add_string(content_tree, hf_rtcp_xr_btxnq_spare, tvb, offset, 1, "Warning - spare bits not 0"); proto_tree_add_uint(content_tree, hf_rtcp_xr_btxnq_ses, tvb, offset+1, 3, temp_value & 0x0ffffff); offset += 4; break; } - case RTCP_XR_IDMS: - offset -= 3; - proto_tree_add_item(content_tree, hf_rtcp_xr_idms_spst, tvb, offset, 1, ENC_BIG_ENDIAN); - offset+=3; - proto_tree_add_item(content_tree, hf_rtcp_xr_idms_pt, tvb, offset, 1, ENC_BIG_ENDIAN); - offset+=4; - proto_tree_add_item(content_tree, hf_rtcp_xr_idms_msci, tvb, offset, 4, ENC_BIG_ENDIAN); - offset+=4; - proto_tree_add_item(content_tree, hf_rtcp_xr_idms_source_ssrc, tvb, offset, 4, ENC_BIG_ENDIAN); - offset+=4; - proto_tree_add_item(content_tree, hf_rtcp_xr_idms_ntp_rcv_ts_msw, tvb, offset, 4, ENC_BIG_ENDIAN); - offset+=4; - proto_tree_add_item(content_tree, hf_rtcp_xr_idms_ntp_rcv_ts_lsw, tvb, offset, 4, ENC_BIG_ENDIAN); - offset+=4; - item = proto_tree_add_item(content_tree, hf_rtcp_ntp, tvb, offset-8, 8, ENC_TIME_NTP|ENC_BIG_ENDIAN); - PROTO_ITEM_SET_GENERATED(item); + case RTCP_XR_IDMS: { + proto_item *item; + int hour,min,sec,msec; + guint32 tmp_ts; + offset -= 3; + proto_tree_add_item(content_tree, hf_rtcp_xr_idms_spst, tvb, offset, 1, ENC_BIG_ENDIAN); + offset+=3; + proto_tree_add_item(content_tree, hf_rtcp_xr_idms_pt, tvb, offset, 1, ENC_BIG_ENDIAN); + offset+=4; + proto_tree_add_item(content_tree, hf_rtcp_xr_idms_msci, tvb, offset, 4, ENC_BIG_ENDIAN); + offset+=4; + proto_tree_add_item(content_tree, hf_rtcp_xr_idms_source_ssrc, tvb, offset, 4, ENC_BIG_ENDIAN); + offset+=4; + proto_tree_add_item(content_tree, hf_rtcp_xr_idms_ntp_rcv_ts_msw, tvb, offset, 4, ENC_BIG_ENDIAN); + offset+=4; + proto_tree_add_item(content_tree, hf_rtcp_xr_idms_ntp_rcv_ts_lsw, tvb, offset, 4, ENC_BIG_ENDIAN); + offset+=4; + item = proto_tree_add_item(content_tree, hf_rtcp_ntp, tvb, offset-8, 8, ENC_TIME_NTP|ENC_BIG_ENDIAN); + PROTO_ITEM_SET_GENERATED(item); - proto_tree_add_item(content_tree, hf_rtcp_xr_idms_rtp_ts, tvb, offset, 4, ENC_BIG_ENDIAN); - offset+=4; - proto_tree_add_item(content_tree, hf_rtcp_xr_idms_ntp_pres_ts, tvb, offset, 4, ENC_BIG_ENDIAN); - offset+=4; + proto_tree_add_item(content_tree, hf_rtcp_xr_idms_rtp_ts, tvb, offset, 4, ENC_BIG_ENDIAN); + offset+=4; + proto_tree_add_item(content_tree, hf_rtcp_xr_idms_ntp_pres_ts, tvb, offset, 4, ENC_BIG_ENDIAN); + offset+=4; - tmp_ts = tvb_get_ntohl(tvb,offset-4); - hour = ( (int) ( tmp_ts >> 16 ) ) / 3600; - min = (( (int) ( tmp_ts >> 16 ) ) - hour * 3600) / 60; - sec = (( (int) ( tmp_ts >> 16 ) ) - hour * 3600 - min * 60); - msec = ( (int) ( tmp_ts & 0x0000FFFF ) ) / 66; + tmp_ts = tvb_get_ntohl(tvb,offset-4); + hour = ( (int) ( tmp_ts >> 16 ) ) / 3600; + min = (( (int) ( tmp_ts >> 16 ) ) - hour * 3600) / 60; + sec = (( (int) ( tmp_ts >> 16 ) ) - hour * 3600 - min * 60); + msec = ( (int) ( tmp_ts & 0x0000FFFF ) ) / 66; - item = proto_tree_add_text( content_tree, tvb, offset-4, 4, "short NTP timestamp of presentation: %d:%02d:%02d:%03d [h:m:s:ms] ", hour,min,sec,msec); - PROTO_ITEM_SET_GENERATED(item); - break; + item = proto_tree_add_text( content_tree, tvb, offset-4, 4, + "short NTP timestamp of presentation: %d:%02d:%02d:%03d [h:m:s:ms] ", + hour,min,sec,msec); + PROTO_ITEM_SET_GENERATED(item); + } + break; default: /* skip over the unknown block */ offset += content_length; break; - } + } /* switch (block_type) */ packet_len -= content_length; - } + } /* for (block_num = ...) */ return offset; } @@ -2234,15 +2242,16 @@ static int dissect_rtcp_rr( packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree, unsigned int count, unsigned int packet_length ) { - unsigned int counter = 1; - proto_tree *ssrc_tree = (proto_tree*) NULL; - proto_tree *ssrc_sub_tree = (proto_tree*) NULL; - proto_tree *high_sec_tree = (proto_tree*) NULL; - proto_item *ti = (proto_item*) NULL; - guint8 rr_flt; - int rr_offset = offset; + unsigned int counter; + proto_tree *ssrc_tree; + proto_tree *ssrc_sub_tree; + proto_tree *high_sec_tree; + proto_item *ti; + guint8 rr_flt; + int rr_offset = offset; + counter = 1; while ( counter <= count ) { guint32 lsr, dlsr; @@ -2329,9 +2338,9 @@ static int dissect_rtcp_sr( packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree, unsigned int count, unsigned int packet_length ) { - proto_item* item; - guint32 ts_msw, ts_lsw; - int sr_offset = offset; + proto_item *item; + guint32 ts_msw, ts_lsw; + int sr_offset = offset; /* NTP timestamp */ ts_msw = tvb_get_ntohl(tvb, offset); @@ -2385,14 +2394,14 @@ dissect_rtcp_sr( packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree void show_setup_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /* Conversation and current data */ - conversation_t *p_conv = NULL; - struct _rtcp_conversation_info *p_conv_data = NULL; + struct _rtcp_conversation_info *p_conv_data; /* Use existing packet data if available */ p_conv_data = p_get_proto_data(pinfo->fd, proto_rtcp); if (!p_conv_data) { + conversation_t *p_conv; /* First time, get info from conversation */ p_conv = find_conversation(pinfo->fd->num, &pinfo->net_dst, &pinfo->net_src, pinfo->ptype, @@ -2429,7 +2438,7 @@ void show_setup_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (rtcp_setup_tree) { /* Add details into subtree */ - proto_item* item = proto_tree_add_uint(rtcp_setup_tree, hf_rtcp_setup_frame, + proto_item *item = proto_tree_add_uint(rtcp_setup_tree, hf_rtcp_setup_frame, tvb, 0, 0, p_conv_data->setup_frame_number); PROTO_ITEM_SET_GENERATED(item); item = proto_tree_add_string(rtcp_setup_tree, hf_rtcp_setup_method, @@ -2443,9 +2452,9 @@ void show_setup_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Update conversation data to record time that outgoing rr/sr was sent */ static void remember_outgoing_sr(packet_info *pinfo, long lsr) { - conversation_t *p_conv = NULL; - struct _rtcp_conversation_info *p_conv_data = NULL; - struct _rtcp_conversation_info *p_packet_data = NULL; + conversation_t *p_conv; + struct _rtcp_conversation_info *p_conv_data; + struct _rtcp_conversation_info *p_packet_data; /* This information will be accessed when an incoming packet comes back to the side that sent this packet, so no use storing in the packet @@ -2459,7 +2468,7 @@ static void remember_outgoing_sr(packet_info *pinfo, long lsr) /* Look first in packet info */ p_packet_data = p_get_proto_data(pinfo->fd, proto_rtcp); if (p_packet_data && p_packet_data->last_received_set && - p_packet_data->last_received_frame_number >= pinfo->fd->num) + (p_packet_data->last_received_frame_number >= pinfo->fd->num)) { /* We already did this, OK */ return; @@ -2542,9 +2551,9 @@ static void calculate_roundtrip_delay(tvbuff_t *tvb, packet_info *pinfo, this packet time, and dlsr *****************************************************/ - conversation_t *p_conv = NULL; - struct _rtcp_conversation_info *p_conv_data = NULL; - struct _rtcp_conversation_info *p_packet_data = NULL; + conversation_t *p_conv; + struct _rtcp_conversation_info *p_conv_data; + struct _rtcp_conversation_info *p_packet_data; /*************************************************/ @@ -2641,7 +2650,7 @@ static void add_roundtrip_delay_info(tvbuff_t *tvb, packet_info *pinfo, proto_tr gint delay) { /* 'Last SR' frame used in calculation. Show this even if no delay shown */ - proto_item* item = proto_tree_add_uint(tree, + proto_item *item = proto_tree_add_uint(tree, hf_rtcp_last_sr_timestamp_frame, tvb, 0, 0, frame); PROTO_ITEM_SET_GENERATED(item); @@ -2692,17 +2701,17 @@ rtcp_packet_type_to_tree( int rtcp_packet_type) int tree; switch(rtcp_packet_type) { - case RTCP_SR: tree = ett_rtcp_sr; break; - case RTCP_RR: tree = ett_rtcp_rr; break; - case RTCP_SDES: tree = ett_rtcp_sdes; break; - case RTCP_BYE: tree = ett_rtcp_bye; break; - case RTCP_APP: tree = ett_rtcp_app; break; - case RTCP_RTPFB: tree = ett_rtcp_rtpfb; break; - case RTCP_PSFB: tree = ett_rtcp_psfb; break; - case RTCP_XR: tree = ett_rtcp_xr; break; - case RTCP_FIR: tree = ett_rtcp_fir; break; - case RTCP_NACK: tree = ett_rtcp_nack; break; - default: tree = ett_rtcp; + case RTCP_SR: tree = ett_rtcp_sr; break; + case RTCP_RR: tree = ett_rtcp_rr; break; + case RTCP_SDES: tree = ett_rtcp_sdes; break; + case RTCP_BYE: tree = ett_rtcp_bye; break; + case RTCP_APP: tree = ett_rtcp_app; break; + case RTCP_RTPFB: tree = ett_rtcp_rtpfb; break; + case RTCP_PSFB: tree = ett_rtcp_psfb; break; + case RTCP_XR: tree = ett_rtcp_xr; break; + case RTCP_FIR: tree = ett_rtcp_fir; break; + case RTCP_NACK: tree = ett_rtcp_nack; break; + default: tree = ett_rtcp; } return tree; } @@ -2710,27 +2719,18 @@ rtcp_packet_type_to_tree( int rtcp_packet_type) static void dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) { - proto_item *ti = NULL; - proto_tree *rtcp_tree = NULL; - unsigned int temp_byte = 0; - unsigned int padding_set = 0; - unsigned int elem_count = 0; - unsigned int packet_type = 0; - unsigned int offset = 0; - guint16 packet_length = 0; - guint16 total_packet_length = 0; - guint8 padding_length; - unsigned int padding_offset = 0; - guint rtcp_subtype = 0; - guint32 app_length = 0; - gboolean srtcp_encrypted = FALSE; - gboolean srtcp_now_encrypted = FALSE; - conversation_t *p_conv = NULL; - struct _rtcp_conversation_info *p_conv_data = NULL; - struct srtp_info *srtcp_info = NULL; - gboolean e_bit; - guint32 srtcp_offset = 0; - guint32 srtcp_index = 0; + proto_item *ti; + proto_tree *rtcp_tree; + guint padding_set = 0; + guint offset = 0; + guint total_packet_length = 0; + guint padding_offset = 0; + gboolean srtcp_encrypted = FALSE; + gboolean srtcp_now_encrypted = FALSE; + conversation_t *p_conv; + struct srtp_info *srtcp_info = NULL; + guint32 srtcp_offset = 0; + guint32 srtcp_index = 0; /* first see if this conversation is encrypted SRTP, and if so do not try to dissect the payload(s) */ p_conv = find_conversation(pinfo->fd->num, &pinfo->net_src, &pinfo->net_dst, @@ -2738,12 +2738,14 @@ dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) pinfo->srcport, pinfo->destport, NO_ADDR_B); if (p_conv) { + struct _rtcp_conversation_info *p_conv_data; p_conv_data = conversation_get_proto_data(p_conv, proto_rtcp); if (p_conv_data && p_conv_data->srtcp_info) { + gboolean e_bit; srtcp_info = p_conv_data->srtcp_info; /* get the offset to the start of the SRTCP fields at the end of the packet */ - srtcp_offset = tvb_length_remaining(tvb,offset) - srtcp_info->auth_tag_len - srtcp_info->mki_len - 4; + srtcp_offset = tvb_length_remaining(tvb, offset) - srtcp_info->auth_tag_len - srtcp_info->mki_len - 4; /* It has been setup as SRTCP, but skip to the SRTCP E field at the end to see if this particular packet is encrypted or not. The E bit is the MSB. */ srtcp_index = tvb_get_ntohl(tvb,srtcp_offset); @@ -2767,6 +2769,10 @@ dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) * that enables us to break from the while loop. */ while ( !srtcp_now_encrypted && tvb_bytes_exist( tvb, offset, 4) ) { + guint temp_byte; + guint elem_count; + guint packet_type; + guint packet_length; /* * First retrieve the packet_type */ @@ -2779,7 +2785,7 @@ dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) break; col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", - val_to_str(packet_type, rtcp_packet_type_vals, "Unknown")); + val_to_str_const(packet_type, rtcp_packet_type_vals, "Unknown")); /* * get the packet-length for the complete RTCP packet @@ -2789,9 +2795,9 @@ dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) ti = proto_tree_add_item(tree, proto_rtcp, tvb, offset, packet_length, ENC_NA ); proto_item_append_text(ti, " (%s)", - val_to_str(packet_type, - rtcp_packet_type_vals, - "Unknown")); + val_to_str_const(packet_type, + rtcp_packet_type_vals, + "Unknown")); rtcp_tree = proto_item_add_subtree( ti, rtcp_packet_type_to_tree(packet_type) ); @@ -2860,8 +2866,10 @@ dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) offset = dissect_rtcp_length_field(rtcp_tree, tvb, offset); offset = dissect_rtcp_bye( tvb, pinfo, offset, rtcp_tree, elem_count ); break; - case RTCP_APP: + case RTCP_APP: { /* Subtype, 5 bits */ + guint rtcp_subtype; + guint app_length; rtcp_subtype = elem_count; proto_tree_add_uint( rtcp_tree, hf_rtcp_subtype, tvb, offset, 1, elem_count ); offset++; @@ -2872,6 +2880,7 @@ dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) app_length = tvb_get_ntohs( tvb, offset ) <<2; offset = dissect_rtcp_length_field(rtcp_tree, tvb, offset); offset = dissect_rtcp_app( tvb, pinfo, offset,rtcp_tree, padding_set, packet_length - 4, rtcp_subtype, app_length); + } break; case RTCP_XR: /* Reserved, 5 bits, Ignore */ @@ -2911,6 +2920,7 @@ dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) * We only have to check for this at the end of the LAST RTCP message */ if ( padding_set ) { + guint padding_length; /* The last RTCP message in the packet has padding - find it. * * The padding count is found at an offset of padding_offset; it @@ -2946,7 +2956,7 @@ dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) } } /* offset should be total_packet_length by now... */ - else if (offset == (unsigned int)total_packet_length) + else if (offset == total_packet_length) { ti = proto_tree_add_boolean_format_value(tree, hf_rtcp_length_check, tvb, 0, 0, TRUE, "OK - %u bytes", @@ -2972,8 +2982,7 @@ dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) void proto_register_rtcp(void) { - static hf_register_info hf[] = - { + static hf_register_info hf[] = { { &hf_rtcp_version, { @@ -4930,7 +4939,7 @@ proto_register_rtcp(void) &ett_sdes, &ett_sdes_item, &ett_PoC1, - &ett_mux, + &ett_mux, &ett_rtcp_setup, &ett_rtcp_roundtrip_delay, &ett_xr_block, diff --git a/epan/dissectors/packet-rtp-midi.c b/epan/dissectors/packet-rtp-midi.c index 719e784da3..5199c79020 100644 --- a/epan/dissectors/packet-rtp-midi.c +++ b/epan/dissectors/packet-rtp-midi.c @@ -1,4 +1,4 @@ -/* packet-rtpmidi.c +/* packet-rtp-midi.c * * Routines for RFC 4695/6295 RTP-MIDI dissection * Copyright 2006-2012, Tobias Erichsen <t.erichsen@gmx.de> @@ -53,11 +53,9 @@ #endif #include <glib.h> + #include <epan/packet.h> #include <epan/prefs.h> - -#include <stdio.h> -#include <string.h> #include <epan/conversation.h> #include <epan/tap.h> @@ -2513,388 +2511,388 @@ static const true_false_string rtp_midi_sj_chapter_x_flag_l = { -static int hf_rtp_midi_bflag = -1; -static int hf_rtp_midi_jflag = -1; -static int hf_rtp_midi_zflag = -1; -static int hf_rtp_midi_pflag = -1; -static int hf_rtp_midi_shortlen = -1; -static int hf_rtp_midi_longlen = -1; - -static int hf_rtp_midi_sflag = -1; -static int hf_rtp_midi_yflag = -1; -static int hf_rtp_midi_aflag = -1; -static int hf_rtp_midi_hflag = -1; -static int hf_rtp_midi_totchan = -1; -static int hf_rtp_midi_check_seq_num = -1; - -static int hf_rtp_midi_deltatime1 = -1; -static int hf_rtp_midi_deltatime2 = -1; -static int hf_rtp_midi_deltatime3 = -1; -static int hf_rtp_midi_deltatime4 = -1; - -static int hf_rtp_midi_channel_status = -1; -static int hf_rtp_midi_common_status = -1; -static int hf_rtp_midi_channel = -1; -static int hf_rtp_midi_note = -1; -static int hf_rtp_midi_velocity = -1; -static int hf_rtp_midi_pressure = -1; -static int hf_rtp_midi_controller = -1; -static int hf_rtp_midi_controller_value = -1; -static int hf_rtp_midi_program = -1; -static int hf_rtp_midi_channel_pressure = -1; -static int hf_rtp_midi_pitch_bend = -1; -static int hf_rtp_midi_pitch_bend_truncated = -1; - -static int hf_rtp_midi_manu_short = -1; -static int hf_rtp_midi_manu_long = -1; - -static int hf_rtp_midi_sysjour_toc_s = -1; -static int hf_rtp_midi_sysjour_toc_d = -1; -static int hf_rtp_midi_sysjour_toc_v = -1; -static int hf_rtp_midi_sysjour_toc_q = -1; -static int hf_rtp_midi_sysjour_toc_f = -1; -static int hf_rtp_midi_sysjour_toc_x = -1; -static int hf_rtp_midi_sysjour_len = -1; - -static int hf_rtp_midi_chanjour_sflag = -1; -static int hf_rtp_midi_chanjour_chan = -1; -static int hf_rtp_midi_chanjour_hflag = -1; -static int hf_rtp_midi_chanjour_len = -1; -static int hf_rtp_midi_chanjour_toc_p = -1; -static int hf_rtp_midi_chanjour_toc_c = -1; -static int hf_rtp_midi_chanjour_toc_m = -1; -static int hf_rtp_midi_chanjour_toc_w = -1; -static int hf_rtp_midi_chanjour_toc_n = -1; -static int hf_rtp_midi_chanjour_toc_e = -1; -static int hf_rtp_midi_chanjour_toc_t = -1; -static int hf_rtp_midi_chanjour_toc_a = -1; - -static int hf_rtp_midi_cj_chapter_p_sflag = -1; -static int hf_rtp_midi_cj_chapter_p_program = -1; -static int hf_rtp_midi_cj_chapter_p_bflag = -1; -static int hf_rtp_midi_cj_chapter_p_bank_msb = -1; -static int hf_rtp_midi_cj_chapter_p_xflag = -1; -static int hf_rtp_midi_cj_chapter_p_bank_lsb = -1; - -static int hf_rtp_midi_cj_chapter_c_sflag = -1; -static int hf_rtp_midi_cj_chapter_c_length = -1; -static int hf_rtp_midi_cj_chapter_c_number = -1; -static int hf_rtp_midi_cj_chapter_c_aflag = -1; -static int hf_rtp_midi_cj_chapter_c_value = -1; -static int hf_rtp_midi_cj_chapter_c_tflag = -1; -static int hf_rtp_midi_cj_chapter_c_alt = -1; - -static int hf_rtp_midi_cj_chapter_m_sflag = -1; -static int hf_rtp_midi_cj_chapter_m_pflag = -1; -static int hf_rtp_midi_cj_chapter_m_eflag = -1; -static int hf_rtp_midi_cj_chapter_m_uflag = -1; -static int hf_rtp_midi_cj_chapter_m_wflag = -1; -static int hf_rtp_midi_cj_chapter_m_zflag = -1; -static int hf_rtp_midi_cj_chapter_m_length = -1; -static int hf_rtp_midi_cj_chapter_m_qflag = -1; -static int hf_rtp_midi_cj_chapter_m_pending = -1; -static int hf_rtp_midi_cj_chapter_m_log_sflag = -1; -static int hf_rtp_midi_cj_chapter_m_log_pnum_lsb = -1; -static int hf_rtp_midi_cj_chapter_m_log_qflag = -1; -static int hf_rtp_midi_cj_chapter_m_log_pnum_msb = -1; -static int hf_rtp_midi_cj_chapter_m_log_jflag = -1; -static int hf_rtp_midi_cj_chapter_m_log_kflag = -1; -static int hf_rtp_midi_cj_chapter_m_log_lflag = -1; -static int hf_rtp_midi_cj_chapter_m_log_mflag = -1; -static int hf_rtp_midi_cj_chapter_m_log_nflag = -1; -static int hf_rtp_midi_cj_chapter_m_log_tflag = -1; -static int hf_rtp_midi_cj_chapter_m_log_vflag = -1; -static int hf_rtp_midi_cj_chapter_m_log_rflag = -1; -static int hf_rtp_midi_cj_chapter_m_log_msb = -1; -static int hf_rtp_midi_cj_chapter_m_log_msb_x = -1; -static int hf_rtp_midi_cj_chapter_m_log_lsb = -1; -static int hf_rtp_midi_cj_chapter_m_log_lsb_x = -1; -static int hf_rtp_midi_cj_chapter_m_log_a_button_g = -1; -static int hf_rtp_midi_cj_chapter_m_log_a_button_x = -1; -static int hf_rtp_midi_cj_chapter_m_log_a_button = -1; -static int hf_rtp_midi_cj_chapter_m_log_c_button = -1; -static int hf_rtp_midi_cj_chapter_m_log_c_button_g = -1; -static int hf_rtp_midi_cj_chapter_m_log_c_button_r = -1; -static int hf_rtp_midi_cj_chapter_m_log_count = -1; -static int hf_rtp_midi_cj_chapter_m_log_count_x = -1; - -static int hf_rtp_midi_cj_chapter_w_sflag = -1; -static int hf_rtp_midi_cj_chapter_w_first = -1; -static int hf_rtp_midi_cj_chapter_w_rflag = -1; -static int hf_rtp_midi_cj_chapter_w_second = -1; - -static int hf_rtp_midi_cj_chapter_n_bflag = -1; -static int hf_rtp_midi_cj_chapter_n_len = -1; -static int hf_rtp_midi_cj_chapter_n_low = -1; -static int hf_rtp_midi_cj_chapter_n_high = -1; -static int hf_rtp_midi_cj_chapter_n_log_sflag = -1; -static int hf_rtp_midi_cj_chapter_n_log_notenum = -1; -static int hf_rtp_midi_cj_chapter_n_log_yflag = -1; -static int hf_rtp_midi_cj_chapter_n_log_velocity = -1; -static int hf_rtp_midi_cj_chapter_n_log_octet = -1; - -static int hf_rtp_midi_cj_chapter_e_sflag = -1; -static int hf_rtp_midi_cj_chapter_e_len = -1; -static int hf_rtp_midi_cj_chapter_e_log_sflag = -1; -static int hf_rtp_midi_cj_chapter_e_log_notenum = -1; -static int hf_rtp_midi_cj_chapter_e_log_vflag = -1; -static int hf_rtp_midi_cj_chapter_e_log_velocity = -1; -static int hf_rtp_midi_cj_chapter_e_log_count = -1; - -static int hf_rtp_midi_cj_chapter_t_sflag = -1; -static int hf_rtp_midi_cj_chapter_t_pressure = -1; - -static int hf_rtp_midi_cj_chapter_a_sflag = -1; -static int hf_rtp_midi_cj_chapter_a_len = -1; -static int hf_rtp_midi_cj_chapter_a_log_sflag = -1; -static int hf_rtp_midi_cj_chapter_a_log_notenum = -1; -static int hf_rtp_midi_cj_chapter_a_log_xflag = -1; -static int hf_rtp_midi_cj_chapter_a_log_pressure = -1; - -static int hf_rtp_midi_sj_chapter_v_sflag = -1; -static int hf_rtp_midi_sj_chapter_v_count = -1; - -static int hf_rtp_midi_sj_chapter_d_sflag = -1; -static int hf_rtp_midi_sj_chapter_d_bflag = -1; -static int hf_rtp_midi_sj_chapter_d_gflag = -1; -static int hf_rtp_midi_sj_chapter_d_hflag = -1; -static int hf_rtp_midi_sj_chapter_d_jflag = -1; -static int hf_rtp_midi_sj_chapter_d_kflag = -1; -static int hf_rtp_midi_sj_chapter_d_yflag = -1; -static int hf_rtp_midi_sj_chapter_d_zflag = -1; - -static int hf_rtp_midi_sj_chapter_d_reset_sflag = -1; -static int hf_rtp_midi_sj_chapter_d_reset_count = -1; -static int hf_rtp_midi_sj_chapter_d_tune_sflag = -1; -static int hf_rtp_midi_sj_chapter_d_tune_count = -1; -static int hf_rtp_midi_sj_chapter_d_song_sel_sflag = -1; -static int hf_rtp_midi_sj_chapter_d_song_sel_value = -1; - -static int hf_rtp_midi_sj_chapter_d_syscom_sflag = -1; -static int hf_rtp_midi_sj_chapter_d_syscom_cflag = -1; -static int hf_rtp_midi_sj_chapter_d_syscom_vflag = -1; -static int hf_rtp_midi_sj_chapter_d_syscom_lflag = -1; -static int hf_rtp_midi_sj_chapter_d_syscom_dsz = -1; -static int hf_rtp_midi_sj_chapter_d_syscom_length = -1; -static int hf_rtp_midi_sj_chapter_d_syscom_count = -1; -static int hf_rtp_midi_sj_chapter_d_syscom_value = -1; -static int hf_rtp_midi_sj_chapter_d_syscom_legal = -1; -static int hf_rtp_midi_sj_chapter_d_syscom_data = -1; - -static int hf_rtp_midi_sj_chapter_d_sysreal_sflag = -1; -static int hf_rtp_midi_sj_chapter_d_sysreal_cflag = -1; -static int hf_rtp_midi_sj_chapter_d_sysreal_lflag = -1; -static int hf_rtp_midi_sj_chapter_d_sysreal_length = -1; -static int hf_rtp_midi_sj_chapter_d_sysreal_count = -1; -static int hf_rtp_midi_sj_chapter_d_sysreal_legal = -1; -static int hf_rtp_midi_sj_chapter_d_sysreal_data = -1; - -static int hf_rtp_midi_sj_chapter_q_sflag = -1; -static int hf_rtp_midi_sj_chapter_q_nflag = -1; -static int hf_rtp_midi_sj_chapter_q_dflag = -1; -static int hf_rtp_midi_sj_chapter_q_cflag = -1; -static int hf_rtp_midi_sj_chapter_q_tflag = -1; -static int hf_rtp_midi_sj_chapter_q_top = -1; -static int hf_rtp_midi_sj_chapter_q_clock = -1; -static int hf_rtp_midi_sj_chapter_q_timetools = -1; - -static int hf_rtp_midi_sj_chapter_f_sflag = -1; -static int hf_rtp_midi_sj_chapter_f_cflag = -1; -static int hf_rtp_midi_sj_chapter_f_pflag = -1; -static int hf_rtp_midi_sj_chapter_f_qflag = -1; -static int hf_rtp_midi_sj_chapter_f_dflag = -1; -static int hf_rtp_midi_sj_chapter_f_point = -1; -static int hf_rtp_midi_sj_chapter_f_mt0 = -1; -static int hf_rtp_midi_sj_chapter_f_mt1 = -1; -static int hf_rtp_midi_sj_chapter_f_mt2 = -1; -static int hf_rtp_midi_sj_chapter_f_mt3 = -1; -static int hf_rtp_midi_sj_chapter_f_mt4 = -1; -static int hf_rtp_midi_sj_chapter_f_mt5 = -1; -static int hf_rtp_midi_sj_chapter_f_mt6 = -1; -static int hf_rtp_midi_sj_chapter_f_mt7 = -1; -static int hf_rtp_midi_sj_chapter_f_hr = -1; -static int hf_rtp_midi_sj_chapter_f_mn = -1; -static int hf_rtp_midi_sj_chapter_f_sc = -1; -static int hf_rtp_midi_sj_chapter_f_fr = -1; - -static int hf_rtp_midi_sj_chapter_x_sflag = -1; -static int hf_rtp_midi_sj_chapter_x_tflag = -1; -static int hf_rtp_midi_sj_chapter_x_cflag = -1; -static int hf_rtp_midi_sj_chapter_x_fflag = -1; -static int hf_rtp_midi_sj_chapter_x_dflag = -1; -static int hf_rtp_midi_sj_chapter_x_lflag = -1; -static int hf_rtp_midi_sj_chapter_x_sta = -1; -static int hf_rtp_midi_sj_chapter_x_tcount = -1; -static int hf_rtp_midi_sj_chapter_x_count = -1; -static int hf_rtp_midi_sj_chapter_x_first1 = -1; -static int hf_rtp_midi_sj_chapter_x_first2 = -1; -static int hf_rtp_midi_sj_chapter_x_first3 = -1; -static int hf_rtp_midi_sj_chapter_x_first4 = -1; -static int hf_rtp_midi_sj_chapter_x_data = -1; -static int hf_rtp_midi_sj_chapter_x_invalid_data = -1; - -static int hf_rtp_midi_quarter_frame_type = -1; -static int hf_rtp_midi_quarter_frame_value = -1; -static int hf_rtp_midi_spp_truncated = -1; -static int hf_rtp_midi_spp = -1; -static int hf_rtp_midi_song_select = -1; -static int hf_rtp_midi_manu_data = -1; -static int hf_rtp_midi_edu_data = -1; -static int hf_rtp_midi_unknown_data = -1; -static int hf_rtp_midi_sysex_common_non_realtime = -1; -static int hf_rtp_midi_sysex_common_realtime = -1; -static int hf_rtp_midi_sysex_common_device_id = -1; - -static int hf_rtp_midi_sysex_common_nrt_mtc = -1; -static int hf_rtp_midi_sysex_common_nrt_sd_ext = -1; -static int hf_rtp_midi_sysex_common_nrt_gi = -1; -static int hf_rtp_midi_sysex_common_nrt_fd = -1; -static int hf_rtp_midi_sysex_common_tuning = -1; -static int hf_rtp_midi_sysex_common_nrt_gm = -1; -static int hf_rtp_midi_sysex_common_nrt_dls = -1; - -static int hf_rtp_midi_sysex_common_rt_mtc = -1; -static int hf_rtp_midi_sysex_common_rt_sc = -1; -static int hf_rtp_midi_sysex_common_rt_ni = -1; -static int hf_rtp_midi_sysex_common_rt_dc = -1; -static int hf_rtp_midi_sysex_common_rt_mtc_cueing = -1; -static int hf_rtp_midi_sysex_common_rt_mmc_commands = -1; -static int hf_rtp_midi_sysex_common_rt_mmc_responses = -1; - -static int hf_rtp_midi_sysex_common_nrt_gi_device_family = -1; +static int hf_rtp_midi_bflag = -1; +static int hf_rtp_midi_jflag = -1; +static int hf_rtp_midi_zflag = -1; +static int hf_rtp_midi_pflag = -1; +static int hf_rtp_midi_shortlen = -1; +static int hf_rtp_midi_longlen = -1; + +static int hf_rtp_midi_sflag = -1; +static int hf_rtp_midi_yflag = -1; +static int hf_rtp_midi_aflag = -1; +static int hf_rtp_midi_hflag = -1; +static int hf_rtp_midi_totchan = -1; +static int hf_rtp_midi_check_seq_num = -1; + +static int hf_rtp_midi_deltatime1 = -1; +static int hf_rtp_midi_deltatime2 = -1; +static int hf_rtp_midi_deltatime3 = -1; +static int hf_rtp_midi_deltatime4 = -1; + +static int hf_rtp_midi_channel_status = -1; +static int hf_rtp_midi_common_status = -1; +static int hf_rtp_midi_channel = -1; +static int hf_rtp_midi_note = -1; +static int hf_rtp_midi_velocity = -1; +static int hf_rtp_midi_pressure = -1; +static int hf_rtp_midi_controller = -1; +static int hf_rtp_midi_controller_value = -1; +static int hf_rtp_midi_program = -1; +static int hf_rtp_midi_channel_pressure = -1; +static int hf_rtp_midi_pitch_bend = -1; +static int hf_rtp_midi_pitch_bend_truncated = -1; + +static int hf_rtp_midi_manu_short = -1; +static int hf_rtp_midi_manu_long = -1; + +static int hf_rtp_midi_sysjour_toc_s = -1; +static int hf_rtp_midi_sysjour_toc_d = -1; +static int hf_rtp_midi_sysjour_toc_v = -1; +static int hf_rtp_midi_sysjour_toc_q = -1; +static int hf_rtp_midi_sysjour_toc_f = -1; +static int hf_rtp_midi_sysjour_toc_x = -1; +static int hf_rtp_midi_sysjour_len = -1; + +static int hf_rtp_midi_chanjour_sflag = -1; +static int hf_rtp_midi_chanjour_chan = -1; +static int hf_rtp_midi_chanjour_hflag = -1; +static int hf_rtp_midi_chanjour_len = -1; +static int hf_rtp_midi_chanjour_toc_p = -1; +static int hf_rtp_midi_chanjour_toc_c = -1; +static int hf_rtp_midi_chanjour_toc_m = -1; +static int hf_rtp_midi_chanjour_toc_w = -1; +static int hf_rtp_midi_chanjour_toc_n = -1; +static int hf_rtp_midi_chanjour_toc_e = -1; +static int hf_rtp_midi_chanjour_toc_t = -1; +static int hf_rtp_midi_chanjour_toc_a = -1; + +static int hf_rtp_midi_cj_chapter_p_sflag = -1; +static int hf_rtp_midi_cj_chapter_p_program = -1; +static int hf_rtp_midi_cj_chapter_p_bflag = -1; +static int hf_rtp_midi_cj_chapter_p_bank_msb = -1; +static int hf_rtp_midi_cj_chapter_p_xflag = -1; +static int hf_rtp_midi_cj_chapter_p_bank_lsb = -1; + +static int hf_rtp_midi_cj_chapter_c_sflag = -1; +static int hf_rtp_midi_cj_chapter_c_length = -1; +static int hf_rtp_midi_cj_chapter_c_number = -1; +static int hf_rtp_midi_cj_chapter_c_aflag = -1; +static int hf_rtp_midi_cj_chapter_c_value = -1; +static int hf_rtp_midi_cj_chapter_c_tflag = -1; +static int hf_rtp_midi_cj_chapter_c_alt = -1; + +static int hf_rtp_midi_cj_chapter_m_sflag = -1; +static int hf_rtp_midi_cj_chapter_m_pflag = -1; +static int hf_rtp_midi_cj_chapter_m_eflag = -1; +static int hf_rtp_midi_cj_chapter_m_uflag = -1; +static int hf_rtp_midi_cj_chapter_m_wflag = -1; +static int hf_rtp_midi_cj_chapter_m_zflag = -1; +static int hf_rtp_midi_cj_chapter_m_length = -1; +static int hf_rtp_midi_cj_chapter_m_qflag = -1; +static int hf_rtp_midi_cj_chapter_m_pending = -1; +static int hf_rtp_midi_cj_chapter_m_log_sflag = -1; +static int hf_rtp_midi_cj_chapter_m_log_pnum_lsb = -1; +static int hf_rtp_midi_cj_chapter_m_log_qflag = -1; +static int hf_rtp_midi_cj_chapter_m_log_pnum_msb = -1; +static int hf_rtp_midi_cj_chapter_m_log_jflag = -1; +static int hf_rtp_midi_cj_chapter_m_log_kflag = -1; +static int hf_rtp_midi_cj_chapter_m_log_lflag = -1; +static int hf_rtp_midi_cj_chapter_m_log_mflag = -1; +static int hf_rtp_midi_cj_chapter_m_log_nflag = -1; +static int hf_rtp_midi_cj_chapter_m_log_tflag = -1; +static int hf_rtp_midi_cj_chapter_m_log_vflag = -1; +static int hf_rtp_midi_cj_chapter_m_log_rflag = -1; +static int hf_rtp_midi_cj_chapter_m_log_msb = -1; +static int hf_rtp_midi_cj_chapter_m_log_msb_x = -1; +static int hf_rtp_midi_cj_chapter_m_log_lsb = -1; +static int hf_rtp_midi_cj_chapter_m_log_lsb_x = -1; +static int hf_rtp_midi_cj_chapter_m_log_a_button_g = -1; +static int hf_rtp_midi_cj_chapter_m_log_a_button_x = -1; +static int hf_rtp_midi_cj_chapter_m_log_a_button = -1; +static int hf_rtp_midi_cj_chapter_m_log_c_button = -1; +static int hf_rtp_midi_cj_chapter_m_log_c_button_g = -1; +static int hf_rtp_midi_cj_chapter_m_log_c_button_r = -1; +static int hf_rtp_midi_cj_chapter_m_log_count = -1; +static int hf_rtp_midi_cj_chapter_m_log_count_x = -1; + +static int hf_rtp_midi_cj_chapter_w_sflag = -1; +static int hf_rtp_midi_cj_chapter_w_first = -1; +static int hf_rtp_midi_cj_chapter_w_rflag = -1; +static int hf_rtp_midi_cj_chapter_w_second = -1; + +static int hf_rtp_midi_cj_chapter_n_bflag = -1; +static int hf_rtp_midi_cj_chapter_n_len = -1; +static int hf_rtp_midi_cj_chapter_n_low = -1; +static int hf_rtp_midi_cj_chapter_n_high = -1; +static int hf_rtp_midi_cj_chapter_n_log_sflag = -1; +static int hf_rtp_midi_cj_chapter_n_log_notenum = -1; +static int hf_rtp_midi_cj_chapter_n_log_yflag = -1; +static int hf_rtp_midi_cj_chapter_n_log_velocity = -1; +static int hf_rtp_midi_cj_chapter_n_log_octet = -1; + +static int hf_rtp_midi_cj_chapter_e_sflag = -1; +static int hf_rtp_midi_cj_chapter_e_len = -1; +static int hf_rtp_midi_cj_chapter_e_log_sflag = -1; +static int hf_rtp_midi_cj_chapter_e_log_notenum = -1; +static int hf_rtp_midi_cj_chapter_e_log_vflag = -1; +static int hf_rtp_midi_cj_chapter_e_log_velocity = -1; +static int hf_rtp_midi_cj_chapter_e_log_count = -1; + +static int hf_rtp_midi_cj_chapter_t_sflag = -1; +static int hf_rtp_midi_cj_chapter_t_pressure = -1; + +static int hf_rtp_midi_cj_chapter_a_sflag = -1; +static int hf_rtp_midi_cj_chapter_a_len = -1; +static int hf_rtp_midi_cj_chapter_a_log_sflag = -1; +static int hf_rtp_midi_cj_chapter_a_log_notenum = -1; +static int hf_rtp_midi_cj_chapter_a_log_xflag = -1; +static int hf_rtp_midi_cj_chapter_a_log_pressure = -1; + +static int hf_rtp_midi_sj_chapter_v_sflag = -1; +static int hf_rtp_midi_sj_chapter_v_count = -1; + +static int hf_rtp_midi_sj_chapter_d_sflag = -1; +static int hf_rtp_midi_sj_chapter_d_bflag = -1; +static int hf_rtp_midi_sj_chapter_d_gflag = -1; +static int hf_rtp_midi_sj_chapter_d_hflag = -1; +static int hf_rtp_midi_sj_chapter_d_jflag = -1; +static int hf_rtp_midi_sj_chapter_d_kflag = -1; +static int hf_rtp_midi_sj_chapter_d_yflag = -1; +static int hf_rtp_midi_sj_chapter_d_zflag = -1; + +static int hf_rtp_midi_sj_chapter_d_reset_sflag = -1; +static int hf_rtp_midi_sj_chapter_d_reset_count = -1; +static int hf_rtp_midi_sj_chapter_d_tune_sflag = -1; +static int hf_rtp_midi_sj_chapter_d_tune_count = -1; +static int hf_rtp_midi_sj_chapter_d_song_sel_sflag = -1; +static int hf_rtp_midi_sj_chapter_d_song_sel_value = -1; + +static int hf_rtp_midi_sj_chapter_d_syscom_sflag = -1; +static int hf_rtp_midi_sj_chapter_d_syscom_cflag = -1; +static int hf_rtp_midi_sj_chapter_d_syscom_vflag = -1; +static int hf_rtp_midi_sj_chapter_d_syscom_lflag = -1; +static int hf_rtp_midi_sj_chapter_d_syscom_dsz = -1; +static int hf_rtp_midi_sj_chapter_d_syscom_length = -1; +static int hf_rtp_midi_sj_chapter_d_syscom_count = -1; +static int hf_rtp_midi_sj_chapter_d_syscom_value = -1; +static int hf_rtp_midi_sj_chapter_d_syscom_legal = -1; +static int hf_rtp_midi_sj_chapter_d_syscom_data = -1; + +static int hf_rtp_midi_sj_chapter_d_sysreal_sflag = -1; +static int hf_rtp_midi_sj_chapter_d_sysreal_cflag = -1; +static int hf_rtp_midi_sj_chapter_d_sysreal_lflag = -1; +static int hf_rtp_midi_sj_chapter_d_sysreal_length = -1; +static int hf_rtp_midi_sj_chapter_d_sysreal_count = -1; +static int hf_rtp_midi_sj_chapter_d_sysreal_legal = -1; +static int hf_rtp_midi_sj_chapter_d_sysreal_data = -1; + +static int hf_rtp_midi_sj_chapter_q_sflag = -1; +static int hf_rtp_midi_sj_chapter_q_nflag = -1; +static int hf_rtp_midi_sj_chapter_q_dflag = -1; +static int hf_rtp_midi_sj_chapter_q_cflag = -1; +static int hf_rtp_midi_sj_chapter_q_tflag = -1; +static int hf_rtp_midi_sj_chapter_q_top = -1; +static int hf_rtp_midi_sj_chapter_q_clock = -1; +static int hf_rtp_midi_sj_chapter_q_timetools = -1; + +static int hf_rtp_midi_sj_chapter_f_sflag = -1; +static int hf_rtp_midi_sj_chapter_f_cflag = -1; +static int hf_rtp_midi_sj_chapter_f_pflag = -1; +static int hf_rtp_midi_sj_chapter_f_qflag = -1; +static int hf_rtp_midi_sj_chapter_f_dflag = -1; +static int hf_rtp_midi_sj_chapter_f_point = -1; +static int hf_rtp_midi_sj_chapter_f_mt0 = -1; +static int hf_rtp_midi_sj_chapter_f_mt1 = -1; +static int hf_rtp_midi_sj_chapter_f_mt2 = -1; +static int hf_rtp_midi_sj_chapter_f_mt3 = -1; +static int hf_rtp_midi_sj_chapter_f_mt4 = -1; +static int hf_rtp_midi_sj_chapter_f_mt5 = -1; +static int hf_rtp_midi_sj_chapter_f_mt6 = -1; +static int hf_rtp_midi_sj_chapter_f_mt7 = -1; +static int hf_rtp_midi_sj_chapter_f_hr = -1; +static int hf_rtp_midi_sj_chapter_f_mn = -1; +static int hf_rtp_midi_sj_chapter_f_sc = -1; +static int hf_rtp_midi_sj_chapter_f_fr = -1; + +static int hf_rtp_midi_sj_chapter_x_sflag = -1; +static int hf_rtp_midi_sj_chapter_x_tflag = -1; +static int hf_rtp_midi_sj_chapter_x_cflag = -1; +static int hf_rtp_midi_sj_chapter_x_fflag = -1; +static int hf_rtp_midi_sj_chapter_x_dflag = -1; +static int hf_rtp_midi_sj_chapter_x_lflag = -1; +static int hf_rtp_midi_sj_chapter_x_sta = -1; +static int hf_rtp_midi_sj_chapter_x_tcount = -1; +static int hf_rtp_midi_sj_chapter_x_count = -1; +static int hf_rtp_midi_sj_chapter_x_first1 = -1; +static int hf_rtp_midi_sj_chapter_x_first2 = -1; +static int hf_rtp_midi_sj_chapter_x_first3 = -1; +static int hf_rtp_midi_sj_chapter_x_first4 = -1; +static int hf_rtp_midi_sj_chapter_x_data = -1; +static int hf_rtp_midi_sj_chapter_x_invalid_data = -1; + +static int hf_rtp_midi_quarter_frame_type = -1; +static int hf_rtp_midi_quarter_frame_value = -1; +static int hf_rtp_midi_spp_truncated = -1; +static int hf_rtp_midi_spp = -1; +static int hf_rtp_midi_song_select = -1; +static int hf_rtp_midi_manu_data = -1; +static int hf_rtp_midi_edu_data = -1; +static int hf_rtp_midi_unknown_data = -1; +static int hf_rtp_midi_sysex_common_non_realtime = -1; +static int hf_rtp_midi_sysex_common_realtime = -1; +static int hf_rtp_midi_sysex_common_device_id = -1; + +static int hf_rtp_midi_sysex_common_nrt_mtc = -1; +static int hf_rtp_midi_sysex_common_nrt_sd_ext = -1; +static int hf_rtp_midi_sysex_common_nrt_gi = -1; +static int hf_rtp_midi_sysex_common_nrt_fd = -1; +static int hf_rtp_midi_sysex_common_tuning = -1; +static int hf_rtp_midi_sysex_common_nrt_gm = -1; +static int hf_rtp_midi_sysex_common_nrt_dls = -1; + +static int hf_rtp_midi_sysex_common_rt_mtc = -1; +static int hf_rtp_midi_sysex_common_rt_sc = -1; +static int hf_rtp_midi_sysex_common_rt_ni = -1; +static int hf_rtp_midi_sysex_common_rt_dc = -1; +static int hf_rtp_midi_sysex_common_rt_mtc_cueing = -1; +static int hf_rtp_midi_sysex_common_rt_mmc_commands = -1; +static int hf_rtp_midi_sysex_common_rt_mmc_responses = -1; + +static int hf_rtp_midi_sysex_common_nrt_gi_device_family = -1; static int hf_rtp_midi_sysex_common_nrt_gi_device_family_member = -1; -static int hf_rtp_midi_sysex_common_nrt_gi_software_rev = -1; - -static int hf_rtp_midi_sysex_common_nrt_sd_packet_number = -1; - -static int hf_rtp_midi_sysex_common_nrt_sd_header_sn = -1; -static int hf_rtp_midi_sysex_common_nrt_sd_header_sf = -1; -static int hf_rtp_midi_sysex_common_nrt_sd_header_sp = -1; -static int hf_rtp_midi_sysex_common_nrt_sd_header_sl = -1; -static int hf_rtp_midi_sysex_common_nrt_sd_header_ls = -1; -static int hf_rtp_midi_sysex_common_nrt_sd_header_le = -1; -static int hf_rtp_midi_sysex_common_nrt_sd_header_lt = -1; - -static int hf_rtp_midi_sysex_common_nrt_sd_packet_count = -1; -static int hf_rtp_midi_sysex_common_nrt_sd_packet_check = -1; -static int hf_rtp_midi_sysex_common_nrt_sd_packet_data = -1; - -static int hf_rtp_midi_sysex_common_nrt_sd_ext_ln = -1; - -static int hf_rtp_midi_sysex_common_nrt_fd_device_id = -1; -static int hf_rtp_midi_sysex_common_nrt_fd_type = -1; -static int hf_rtp_midi_sysex_common_nrt_fd_name = -1; -static int hf_rtp_midi_sysex_common_nrt_fd_length = -1; -static int hf_rtp_midi_sysex_common_nrt_fd_packet_num = -1; -static int hf_rtp_midi_sysex_common_nrt_fd_byte_count = -1; -static int hf_rtp_midi_sysex_common_nrt_fd_packet_data = -1; -static int hf_rtp_midi_sysex_common_nrt_fd_checksum = -1; - -static int hf_rtp_midi_sysex_common_tune_program = -1; -static int hf_rtp_midi_sysex_common_tune_name = -1; -static int hf_rtp_midi_sysex_common_tune_freq = -1; -static int hf_rtp_midi_sysex_common_tune_checksum = -1; -static int hf_rtp_midi_sysex_common_tune_changes = -1; -static int hf_rtp_midi_sysex_common_tune_note = -1; - -static int hf_rtp_midi_sysex_common_rt_mtc_fm_type = -1; -static int hf_rtp_midi_sysex_common_rt_mtc_fm_hr = -1; -static int hf_rtp_midi_sysex_common_rt_mtc_fm_mn = -1; -static int hf_rtp_midi_sysex_common_rt_mtc_fm_sc = -1; -static int hf_rtp_midi_sysex_common_rt_mtc_fm_fr = -1; - -static int hf_rtp_midi_sysex_common_rt_mtc_ub_u1 = -1; -static int hf_rtp_midi_sysex_common_rt_mtc_ub_u2 = -1; -static int hf_rtp_midi_sysex_common_rt_mtc_ub_u3 = -1; -static int hf_rtp_midi_sysex_common_rt_mtc_ub_u4 = -1; -static int hf_rtp_midi_sysex_common_rt_mtc_ub_u5 = -1; -static int hf_rtp_midi_sysex_common_rt_mtc_ub_u6 = -1; -static int hf_rtp_midi_sysex_common_rt_mtc_ub_u7 = -1; -static int hf_rtp_midi_sysex_common_rt_mtc_ub_u8 = -1; -static int hf_rtp_midi_sysex_common_rt_mtc_ub_u9 = -1; - -static int hf_rtp_midi_sysex_common_nrt_mtc_type = -1; -static int hf_rtp_midi_sysex_common_nrt_mtc_hr = -1; -static int hf_rtp_midi_sysex_common_nrt_mtc_mn = -1; -static int hf_rtp_midi_sysex_common_nrt_mtc_sc = -1; -static int hf_rtp_midi_sysex_common_nrt_mtc_fr = -1; -static int hf_rtp_midi_sysex_common_nrt_mtc_ff = -1; -static int hf_rtp_midi_sysex_common_nrt_mtc_enl = -1; -static int hf_rtp_midi_sysex_common_nrt_mtc_enm = -1; -static int hf_rtp_midi_sysex_common_nrt_mtc_add = -1; - -static int hf_rtp_midi_sysex_common_rt_mtc_cue_enl = -1; -static int hf_rtp_midi_sysex_common_rt_mtc_cue_enm = -1; -static int hf_rtp_midi_sysex_common_rt_mtc_cue_add = -1; - -static int hf_rtp_midi_sysex_common_rt_ni_bar_num = -1; -static int hf_rtp_midi_sysex_common_rt_ni_bytes = -1; -static int hf_rtp_midi_sysex_common_rt_ni_numerator = -1; -static int hf_rtp_midi_sysex_common_rt_ni_denominator = -1; -static int hf_rtp_midi_sysex_common_rt_ni_midi_clocks = -1; -static int hf_rtp_midi_sysex_common_rt_ni_32nds = -1; - -static int hf_rtp_midi_sysex_common_rt_dc_volume = -1; -static int hf_rtp_midi_sysex_common_rt_dc_balance = -1; +static int hf_rtp_midi_sysex_common_nrt_gi_software_rev = -1; + +static int hf_rtp_midi_sysex_common_nrt_sd_packet_number = -1; + +static int hf_rtp_midi_sysex_common_nrt_sd_header_sn = -1; +static int hf_rtp_midi_sysex_common_nrt_sd_header_sf = -1; +static int hf_rtp_midi_sysex_common_nrt_sd_header_sp = -1; +static int hf_rtp_midi_sysex_common_nrt_sd_header_sl = -1; +static int hf_rtp_midi_sysex_common_nrt_sd_header_ls = -1; +static int hf_rtp_midi_sysex_common_nrt_sd_header_le = -1; +static int hf_rtp_midi_sysex_common_nrt_sd_header_lt = -1; + +static int hf_rtp_midi_sysex_common_nrt_sd_packet_count = -1; +static int hf_rtp_midi_sysex_common_nrt_sd_packet_check = -1; +static int hf_rtp_midi_sysex_common_nrt_sd_packet_data = -1; + +static int hf_rtp_midi_sysex_common_nrt_sd_ext_ln = -1; + +static int hf_rtp_midi_sysex_common_nrt_fd_device_id = -1; +static int hf_rtp_midi_sysex_common_nrt_fd_type = -1; +static int hf_rtp_midi_sysex_common_nrt_fd_name = -1; +static int hf_rtp_midi_sysex_common_nrt_fd_length = -1; +static int hf_rtp_midi_sysex_common_nrt_fd_packet_num = -1; +static int hf_rtp_midi_sysex_common_nrt_fd_byte_count = -1; +static int hf_rtp_midi_sysex_common_nrt_fd_packet_data = -1; +static int hf_rtp_midi_sysex_common_nrt_fd_checksum = -1; + +static int hf_rtp_midi_sysex_common_tune_program = -1; +static int hf_rtp_midi_sysex_common_tune_name = -1; +static int hf_rtp_midi_sysex_common_tune_freq = -1; +static int hf_rtp_midi_sysex_common_tune_checksum = -1; +static int hf_rtp_midi_sysex_common_tune_changes = -1; +static int hf_rtp_midi_sysex_common_tune_note = -1; + +static int hf_rtp_midi_sysex_common_rt_mtc_fm_type = -1; +static int hf_rtp_midi_sysex_common_rt_mtc_fm_hr = -1; +static int hf_rtp_midi_sysex_common_rt_mtc_fm_mn = -1; +static int hf_rtp_midi_sysex_common_rt_mtc_fm_sc = -1; +static int hf_rtp_midi_sysex_common_rt_mtc_fm_fr = -1; + +static int hf_rtp_midi_sysex_common_rt_mtc_ub_u1 = -1; +static int hf_rtp_midi_sysex_common_rt_mtc_ub_u2 = -1; +static int hf_rtp_midi_sysex_common_rt_mtc_ub_u3 = -1; +static int hf_rtp_midi_sysex_common_rt_mtc_ub_u4 = -1; +static int hf_rtp_midi_sysex_common_rt_mtc_ub_u5 = -1; +static int hf_rtp_midi_sysex_common_rt_mtc_ub_u6 = -1; +static int hf_rtp_midi_sysex_common_rt_mtc_ub_u7 = -1; +static int hf_rtp_midi_sysex_common_rt_mtc_ub_u8 = -1; +static int hf_rtp_midi_sysex_common_rt_mtc_ub_u9 = -1; + +static int hf_rtp_midi_sysex_common_nrt_mtc_type = -1; +static int hf_rtp_midi_sysex_common_nrt_mtc_hr = -1; +static int hf_rtp_midi_sysex_common_nrt_mtc_mn = -1; +static int hf_rtp_midi_sysex_common_nrt_mtc_sc = -1; +static int hf_rtp_midi_sysex_common_nrt_mtc_fr = -1; +static int hf_rtp_midi_sysex_common_nrt_mtc_ff = -1; +static int hf_rtp_midi_sysex_common_nrt_mtc_enl = -1; +static int hf_rtp_midi_sysex_common_nrt_mtc_enm = -1; +static int hf_rtp_midi_sysex_common_nrt_mtc_add = -1; + +static int hf_rtp_midi_sysex_common_rt_mtc_cue_enl = -1; +static int hf_rtp_midi_sysex_common_rt_mtc_cue_enm = -1; +static int hf_rtp_midi_sysex_common_rt_mtc_cue_add = -1; + +static int hf_rtp_midi_sysex_common_rt_ni_bar_num = -1; +static int hf_rtp_midi_sysex_common_rt_ni_bytes = -1; +static int hf_rtp_midi_sysex_common_rt_ni_numerator = -1; +static int hf_rtp_midi_sysex_common_rt_ni_denominator = -1; +static int hf_rtp_midi_sysex_common_rt_ni_midi_clocks = -1; +static int hf_rtp_midi_sysex_common_rt_ni_32nds = -1; + +static int hf_rtp_midi_sysex_common_rt_dc_volume = -1; +static int hf_rtp_midi_sysex_common_rt_dc_balance = -1; /* RTP MIDI fields defining a subtree */ -static gint ett_rtp_midi = -1; -static gint ett_rtp_midi_commands = -1; -static gint ett_rtp_midi_journal = -1; -static gint ett_rtp_midi_command = -1; -static gint ett_rtp_midi_systemjournal = -1; -static gint ett_rtp_midi_channeljournals = -1; -static gint ett_rtp_midi_systemchapters = -1; -static gint ett_rtp_midi_sj_chapter_d = -1; -static gint ett_rtp_midi_sj_chapter_d_field_b = -1; -static gint ett_rtp_midi_sj_chapter_d_field_g = -1; -static gint ett_rtp_midi_sj_chapter_d_field_h = -1; -static gint ett_rtp_midi_sj_chapter_d_field_j = -1; -static gint ett_rtp_midi_sj_chapter_d_field_k = -1; -static gint ett_rtp_midi_sj_chapter_d_field_y = -1; -static gint ett_rtp_midi_sj_chapter_d_field_z = -1; -static gint ett_rtp_midi_sj_chapter_v = -1; -static gint ett_rtp_midi_sj_chapter_q = -1; -static gint ett_rtp_midi_sj_chapter_f = -1; -static gint ett_rtp_midi_sj_chapter_f_complete = -1; -static gint ett_rtp_midi_sj_chapter_f_partial = -1; -static gint ett_rtp_midi_sj_chapter_x = -1; -static gint ett_rtp_midi_sj_chapter_x_first = -1; -static gint ett_rtp_midi_sj_chapter_x_data = -1; -static gint ett_rtp_midi_channeljournal = -1; -static gint ett_rtp_midi_channelchapters = -1; -static gint ett_rtp_midi_cj_chapter_p = -1; -static gint ett_rtp_midi_cj_chapter_c = -1; -static gint ett_rtp_midi_cj_chapter_c_loglist = -1; -static gint ett_rtp_midi_cj_chapter_c_logitem = -1; -static gint ett_rtp_midi_cj_chapter_m = -1; -static gint ett_rtp_midi_cj_chapter_m_loglist = -1; -static gint ett_rtp_midi_cj_chapter_m_logitem = -1; -static gint ett_rtp_midi_cj_chapter_m_log_msb = -1; -static gint ett_rtp_midi_cj_chapter_m_log_lsb = -1; -static gint ett_rtp_midi_cj_chapter_m_log_a_button = -1; -static gint ett_rtp_midi_cj_chapter_m_log_c_button = -1; -static gint ett_rtp_midi_cj_chapter_m_log_count = -1; -static gint ett_rtp_midi_cj_chapter_w = -1; -static gint ett_rtp_midi_cj_chapter_n = -1; -static gint ett_rtp_midi_cj_chapter_n_loglist = -1; -static gint ett_rtp_midi_cj_chapter_n_logitem = -1; -static gint ett_rtp_midi_cj_chapter_n_octets = -1; -static gint ett_rtp_midi_cj_chapter_e = -1; -static gint ett_rtp_midi_cj_chapter_e_loglist = -1; -static gint ett_rtp_midi_cj_chapter_e_logitem = -1; -static gint ett_rtp_midi_cj_chapter_t = -1; -static gint ett_rtp_midi_cj_chapter_a = -1; -static gint ett_rtp_midi_cj_chapter_a_loglist = -1; -static gint ett_rtp_midi_cj_chapter_a_logitem = -1; -static gint ett_rtp_midi_sysex_data = -1; -static gint ett_rtp_midi_sysex_edu = -1; -static gint ett_rtp_midi_sysex_manu = -1; -static gint ett_rtp_midi_sysex_common_rt = -1; -static gint ett_rtp_midi_sysex_common_nrt = -1; -static gint ett_rtp_midi_sysex_common_tune_note = -1; +static gint ett_rtp_midi = -1; +static gint ett_rtp_midi_commands = -1; +static gint ett_rtp_midi_journal = -1; +static gint ett_rtp_midi_command = -1; +static gint ett_rtp_midi_systemjournal = -1; +static gint ett_rtp_midi_channeljournals = -1; +static gint ett_rtp_midi_systemchapters = -1; +static gint ett_rtp_midi_sj_chapter_d = -1; +static gint ett_rtp_midi_sj_chapter_d_field_b = -1; +static gint ett_rtp_midi_sj_chapter_d_field_g = -1; +static gint ett_rtp_midi_sj_chapter_d_field_h = -1; +static gint ett_rtp_midi_sj_chapter_d_field_j = -1; +static gint ett_rtp_midi_sj_chapter_d_field_k = -1; +static gint ett_rtp_midi_sj_chapter_d_field_y = -1; +static gint ett_rtp_midi_sj_chapter_d_field_z = -1; +static gint ett_rtp_midi_sj_chapter_v = -1; +static gint ett_rtp_midi_sj_chapter_q = -1; +static gint ett_rtp_midi_sj_chapter_f = -1; +static gint ett_rtp_midi_sj_chapter_f_complete = -1; +static gint ett_rtp_midi_sj_chapter_f_partial = -1; +static gint ett_rtp_midi_sj_chapter_x = -1; +static gint ett_rtp_midi_sj_chapter_x_first = -1; +static gint ett_rtp_midi_sj_chapter_x_data = -1; +static gint ett_rtp_midi_channeljournal = -1; +static gint ett_rtp_midi_channelchapters = -1; +static gint ett_rtp_midi_cj_chapter_p = -1; +static gint ett_rtp_midi_cj_chapter_c = -1; +static gint ett_rtp_midi_cj_chapter_c_loglist = -1; +static gint ett_rtp_midi_cj_chapter_c_logitem = -1; +static gint ett_rtp_midi_cj_chapter_m = -1; +static gint ett_rtp_midi_cj_chapter_m_loglist = -1; +static gint ett_rtp_midi_cj_chapter_m_logitem = -1; +static gint ett_rtp_midi_cj_chapter_m_log_msb = -1; +static gint ett_rtp_midi_cj_chapter_m_log_lsb = -1; +static gint ett_rtp_midi_cj_chapter_m_log_a_button = -1; +static gint ett_rtp_midi_cj_chapter_m_log_c_button = -1; +static gint ett_rtp_midi_cj_chapter_m_log_count = -1; +static gint ett_rtp_midi_cj_chapter_w = -1; +static gint ett_rtp_midi_cj_chapter_n = -1; +static gint ett_rtp_midi_cj_chapter_n_loglist = -1; +static gint ett_rtp_midi_cj_chapter_n_logitem = -1; +static gint ett_rtp_midi_cj_chapter_n_octets = -1; +static gint ett_rtp_midi_cj_chapter_e = -1; +static gint ett_rtp_midi_cj_chapter_e_loglist = -1; +static gint ett_rtp_midi_cj_chapter_e_logitem = -1; +static gint ett_rtp_midi_cj_chapter_t = -1; +static gint ett_rtp_midi_cj_chapter_a = -1; +static gint ett_rtp_midi_cj_chapter_a_loglist = -1; +static gint ett_rtp_midi_cj_chapter_a_logitem = -1; +static gint ett_rtp_midi_sysex_data = -1; +static gint ett_rtp_midi_sysex_edu = -1; +static gint ett_rtp_midi_sysex_manu = -1; +static gint ett_rtp_midi_sysex_common_rt = -1; +static gint ett_rtp_midi_sysex_common_nrt = -1; +static gint ett_rtp_midi_sysex_common_tune_note = -1; static guint rtp_midi_payload_type_value = 0; @@ -2967,12 +2965,12 @@ decodetime(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int static int decode_note_off(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len, guint8 status, unsigned int rsoffset, gboolean using_rs ) { - guint8 note = 0; - guint8 velocity = 0; - const gchar *status_str = NULL; - const gchar *note_str = NULL; - proto_item *command_item = NULL; - proto_tree *command_tree = NULL; + guint8 note; + guint8 velocity; + const gchar *status_str; + const gchar *note_str; + proto_item *command_item; + proto_tree *command_tree; status_str = val_to_str( status >> 4, rtp_midi_channel_status, rtp_midi_unknown_value_hex ); @@ -3088,12 +3086,12 @@ decode_note_off(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned in static int decode_note_on(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len, guint8 status, unsigned int rsoffset, gboolean using_rs ) { - guint8 note = 0; - guint8 velocity = 0; - const gchar *status_str = NULL; - const gchar *note_str = NULL; - proto_item *command_item = NULL; - proto_tree *command_tree = NULL; + guint8 note; + guint8 velocity; + const gchar *status_str; + const gchar *note_str; + proto_item *command_item; + proto_tree *command_tree; status_str = val_to_str( status >> 4, rtp_midi_channel_status, rtp_midi_unknown_value_hex ); @@ -3215,12 +3213,12 @@ decode_note_on(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned int static int decode_poly_pressure(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len, guint8 status, unsigned int rsoffset, gboolean using_rs ) { - guint8 note = 0; - guint8 pressure = 0; - const gchar *status_str = NULL; - const gchar *note_str = NULL; - proto_item *command_item = NULL; - proto_tree *command_tree = NULL; + guint8 note; + guint8 pressure; + const gchar *status_str; + const gchar *note_str; + proto_item *command_item; + proto_tree *command_tree; status_str = val_to_str( status >> 4, rtp_midi_channel_status, rtp_midi_unknown_value_hex ); @@ -3336,10 +3334,10 @@ decode_poly_pressure(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsign static int decode_channel_pressure(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len, guint8 status, unsigned int rsoffset, gboolean using_rs ) { - guint8 pressure = 0; - const gchar *status_str = NULL; - proto_item *command_item = NULL; - proto_tree *command_tree = NULL; + guint8 pressure; + const gchar *status_str; + proto_item *command_item; + proto_tree *command_tree; status_str = val_to_str( status >> 4, rtp_midi_channel_status, rtp_midi_unknown_value_hex ); @@ -3412,12 +3410,12 @@ decode_channel_pressure(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uns static int decode_pitch_bend_change(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len, guint8 status, unsigned int rsoffset, gboolean using_rs ) { - guint8 octet1 = 0; - guint8 octet2 = 0; - guint8 pitch = 0; - const gchar *status_str = NULL; - proto_item *command_item = NULL; - proto_tree *command_tree = NULL; + guint8 octet1; + guint8 octet2; + guint8 pitch; + const gchar *status_str; + proto_item *command_item; + proto_tree *command_tree; status_str = val_to_str( status >> 4, rtp_midi_channel_status, rtp_midi_unknown_value_hex ); @@ -3532,10 +3530,10 @@ decode_pitch_bend_change(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree static int decode_program_change(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len, guint8 status, unsigned int rsoffset, gboolean using_rs ) { - guint8 program = 0; - const gchar *status_str = NULL; - proto_item *command_item = NULL; - proto_tree *command_tree = NULL; + guint8 program; + const gchar *status_str; + proto_item *command_item; + proto_tree *command_tree; status_str = val_to_str( status >> 4, rtp_midi_channel_status, rtp_midi_unknown_value_hex ); @@ -3610,12 +3608,12 @@ return 1; static int decode_control_change(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len, guint8 status, unsigned int rsoffset, gboolean using_rs ) { - guint8 controller = 0; - guint8 value = 0; - const gchar *status_str = NULL; - const gchar *ctrl_str = NULL; - proto_item *command_item = NULL; - proto_tree *command_tree = NULL; + guint8 controller; + guint8 value; + const gchar *status_str; + const gchar *ctrl_str; + proto_item *command_item; + proto_tree *command_tree; status_str = val_to_str( status >> 4, rtp_midi_channel_status, rtp_midi_unknown_value_hex ); @@ -3737,7 +3735,7 @@ decode_sysex_common_nrt_sd_hdr( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre /* sample number */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_sn, tvb, offset, 2, ENC_BIG_ENDIAN ); - offset += 2; + offset += 2; data_len -= 2; consumed += 2; @@ -3755,7 +3753,7 @@ decode_sysex_common_nrt_sd_hdr( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre /* sample period */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_sp, tvb, offset, 3, ENC_BIG_ENDIAN ); - offset += 3; + offset += 3; data_len -= 3; consumed += 3; @@ -3764,7 +3762,7 @@ decode_sysex_common_nrt_sd_hdr( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre /* sample length */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_sl, tvb, offset, 3, ENC_BIG_ENDIAN ); - offset += 3; + offset += 3; data_len -= 3; consumed += 3; @@ -3773,7 +3771,7 @@ decode_sysex_common_nrt_sd_hdr( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre /* loop start */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_ls, tvb, offset, 3, ENC_BIG_ENDIAN ); - offset += 3; + offset += 3; data_len -= 3; consumed += 3; @@ -3782,7 +3780,7 @@ decode_sysex_common_nrt_sd_hdr( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre /* loop end */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_le, tvb, offset, 3, ENC_BIG_ENDIAN ); - offset += 3; + offset += 3; data_len -= 3; consumed += 3; @@ -3819,7 +3817,7 @@ decode_sysex_common_nrt_sd_packet( tvbuff_t *tvb, packet_info *pinfo _U_, proto_ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_packet_data, tvb, offset, data_len - 1, ENC_NA ); - offset += ( data_len - 1 ); + offset += ( data_len - 1 ); data_len -= ( data_len - 1 ); consumed += ( data_len -1 ); } @@ -3848,9 +3846,6 @@ decode_sysex_common_nrt_sd_req( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre /* sample number */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_sn, tvb, offset, 2, ENC_BIG_ENDIAN ); - /*Fix Clang Warning - offset += 2; - data_len -= 2;*/ consumed += 2; return consumed; @@ -3862,7 +3857,7 @@ decode_sysex_common_nrt_sd_req( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre */ static unsigned int decode_sysex_common_nrt_sd_ext( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { - guint8 sub_id = 0; + guint8 sub_id; int consumed = 0; if ( data_len < 1 ) @@ -3882,7 +3877,7 @@ decode_sysex_common_nrt_sd_ext( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre /* sample number */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_sn, tvb, offset, 2, ENC_BIG_ENDIAN ); - offset += 2; + offset += 2; data_len -= 2; consumed += 2; @@ -3891,7 +3886,7 @@ decode_sysex_common_nrt_sd_ext( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre /* loop number */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_ext_ln, tvb, offset, 2, ENC_BIG_ENDIAN ); - offset += 2; + offset += 2; data_len -= 2; consumed += 2; @@ -3909,7 +3904,7 @@ decode_sysex_common_nrt_sd_ext( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre /* loop start */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_ls, tvb, offset, 3, ENC_BIG_ENDIAN ); - offset += 3; + offset += 3; data_len -= 3; consumed += 3; @@ -3918,9 +3913,6 @@ decode_sysex_common_nrt_sd_ext( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre /* loop end */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_le, tvb, offset, 3, ENC_BIG_ENDIAN ); - /*Fix Clang Warning - offset += 3; - data_len -= 3;*/ consumed += 3; } else if ( sub_id == RTP_MIDI_SYSEX_COMMON_NRT_SD_EXT_LOOP_POINTS_REQUEST ) { @@ -3930,7 +3922,7 @@ decode_sysex_common_nrt_sd_ext( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre /* sample number */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_sn, tvb, offset, 2, ENC_BIG_ENDIAN ); - offset += 2; + offset += 2; data_len -= 2; consumed += 2; @@ -3939,9 +3931,6 @@ decode_sysex_common_nrt_sd_ext( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre /* loop number */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_ext_ln, tvb, offset, 2, ENC_BIG_ENDIAN ); - /*Fix Clang Warning - offset += 2; - data_len -= 2; */ consumed += 2; } @@ -3954,8 +3943,7 @@ decode_sysex_common_nrt_sd_ext( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre */ static unsigned int decode_sysex_common_nrt_gi( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { - guint8 sub_id = 0; - guint8 manu_short = 0; + guint8 sub_id; int consumed = 0; if ( data_len < 1 ) @@ -3976,6 +3964,7 @@ decode_sysex_common_nrt_gi( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t /* nothing more to do... */ } else if ( sub_id == RTP_MIDI_SYSEX_COMMON_NRT_GI_IDENTITY_REPLY ) { + guint8 manu_short; if ( data_len < 1 ) { return consumed; @@ -3994,7 +3983,7 @@ decode_sysex_common_nrt_gi( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t return consumed; } proto_tree_add_item( tree, hf_rtp_midi_manu_long, tvb, offset, 2, ENC_BIG_ENDIAN ); - offset +=2 ; + offset += 2 ; data_len -= 2; consumed += 2; } @@ -4004,7 +3993,7 @@ decode_sysex_common_nrt_gi( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t return consumed; } proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_gi_device_family, tvb, offset, 2, ENC_BIG_ENDIAN ); - offset +=2 ; + offset += 2 ; data_len -= 2; consumed += 2; @@ -4013,7 +4002,7 @@ decode_sysex_common_nrt_gi( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t return consumed; } proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_gi_device_family_member, tvb, offset, 2, ENC_BIG_ENDIAN ); - offset +=2 ; + offset += 2 ; data_len -= 2; consumed += 2; @@ -4022,9 +4011,6 @@ decode_sysex_common_nrt_gi( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t return consumed; } proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_gi_software_rev, tvb, offset, 4, ENC_BIG_ENDIAN ); - /*Fix Clang Warning - offset +=4 ; - data_len -= 4;*/ consumed += 4; } @@ -4036,7 +4022,7 @@ decode_sysex_common_nrt_gi( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t */ static unsigned int decode_sysex_common_nrt_fd( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { - guint8 sub_id = 0; + guint8 sub_id; int consumed = 0; if ( data_len < 1 ) @@ -4065,7 +4051,7 @@ decode_sysex_common_nrt_fd( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t /* file type */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_fd_type, tvb, offset, 4, ENC_ASCII|ENC_NA ); - offset += 4; + offset += 4; data_len -= 4; consumed += 4; @@ -4074,7 +4060,7 @@ decode_sysex_common_nrt_fd( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t /* file length */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_fd_length, tvb, offset, 4, ENC_BIG_ENDIAN ); - offset += 4; + offset += 4; data_len -= 4; consumed += 4; @@ -4082,8 +4068,6 @@ decode_sysex_common_nrt_fd( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t /* file-name */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_fd_name, tvb, offset, data_len, ENC_ASCII|ENC_NA ); - /*Fix Clang Warning - offset += data_len;*/ data_len -= data_len; consumed += data_len; } @@ -4113,7 +4097,7 @@ decode_sysex_common_nrt_fd( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_fd_packet_data, tvb, offset, data_len - 1, ENC_NA ); - offset += ( data_len - 1 ); + offset += ( data_len - 1 ); data_len -= ( data_len - 1 ); consumed += ( data_len -1 ); } @@ -4143,7 +4127,7 @@ decode_sysex_common_nrt_fd( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t /* file type */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_fd_type, tvb, offset, 4, ENC_ASCII|ENC_NA ); - offset += 4; + offset += 4; data_len -= 4; consumed += 4; @@ -4151,8 +4135,6 @@ decode_sysex_common_nrt_fd( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t /* file-name */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_fd_name, tvb, offset, data_len, ENC_ASCII|ENC_NA ); - /*Fix Clang Warning - offset += data_len;*/ data_len -= data_len; consumed += data_len; } @@ -4168,12 +4150,10 @@ decode_sysex_common_nrt_fd( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t static unsigned int decode_sysex_common_tuning( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { - proto_item *tune_item = NULL; - proto_tree *tune_tree = NULL; - const gchar *note_str = NULL; - guint8 sub_id = 0; - guint8 changes = 0; - guint8 note = 0; + proto_item *tune_item; + proto_tree *tune_tree; + const gchar *note_str; + guint8 sub_id; int consumed = 0; unsigned int i; @@ -4214,7 +4194,7 @@ decode_sysex_common_tuning( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t /* file length */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_tune_name, tvb, offset, 16, ENC_ASCII|ENC_NA ); - offset += 16; + offset += 16; data_len -= 16; consumed += 16; @@ -4231,7 +4211,7 @@ decode_sysex_common_tuning( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t /* frequency */ proto_tree_add_item( tune_tree, hf_rtp_midi_sysex_common_tune_freq, tvb, offset, 3, ENC_BIG_ENDIAN ); - offset += 3; + offset += 3; data_len -= 3; consumed += 3; @@ -4247,6 +4227,7 @@ decode_sysex_common_tuning( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t consumed++; } else if ( sub_id == RTP_MIDI_SYSEX_COMMON_TUNING_NOTE_CHANGE ) { + guint8 changes; if ( data_len < 1 ) return -1; @@ -4268,6 +4249,7 @@ decode_sysex_common_tuning( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t consumed++; for ( i=0; i < changes; i++ ) { + guint8 note; if ( data_len < 4 ) return -1; @@ -4288,7 +4270,7 @@ decode_sysex_common_tuning( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t /* frequency */ proto_tree_add_item( tune_tree, hf_rtp_midi_sysex_common_tune_freq, tvb, offset, 3, ENC_BIG_ENDIAN ); - offset += 3; + offset += 3; data_len -= 3; consumed += 3; @@ -4514,8 +4496,6 @@ decode_sysex_common_nrt_mtc( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree * /* additional data */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_mtc_add, tvb, offset, data_len, ENC_NA ); - /*Fix Clang Warning - offset += data_len;*/ data_len -= data_len; consumed += data_len; } @@ -4561,8 +4541,6 @@ decode_sysex_common_rt_mtc_cue( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre /* additional data */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mtc_cue_add, tvb, offset, data_len, ENC_NA ); - /*Fix Clang Warning - offset += data_len;*/ data_len -= data_len; consumed += data_len; } @@ -4578,10 +4556,10 @@ decode_sysex_common_rt_mtc_cue( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre */ static unsigned int decode_sysex_common_nrt( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { - guint8 common_nrt = 0; - const gchar *nrt_str = NULL; - proto_item *command_item = NULL; - proto_tree *command_tree = NULL; + guint8 common_nrt; + const gchar *nrt_str; + proto_item *command_item; + proto_tree *command_tree; int consumed = 0; int ext_consumed = 0; @@ -4662,7 +4640,7 @@ decode_sysex_common_nrt( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree } /* set our pointers correct to move past already decoded data */ - offset += ext_consumed; + offset += ext_consumed; data_len -= ext_consumed; consumed += ext_consumed; @@ -4684,7 +4662,7 @@ decode_sysex_common_nrt( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree */ static unsigned int decode_sysex_common_rt_mtc( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { - guint8 sub_id = 0; + guint8 sub_id; int consumed = 0; if ( data_len < 1 ) @@ -4848,9 +4826,8 @@ decode_sysex_common_rt_sc( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr */ static unsigned int decode_sysex_common_rt_ni( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { - guint8 sub_id = 0; + guint8 sub_id; int consumed = 0; - int bytes = 0; if ( data_len < 1 ) return consumed; @@ -4869,13 +4846,11 @@ decode_sysex_common_rt_ni( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr /* bar number */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_ni_bar_num, tvb, offset, 2, ENC_BIG_ENDIAN ); - /*Fix Clang Warning - offset += 2; - data_len -= 2;*/ consumed += 2; } else if ( ( sub_id == RTP_MIDI_SYSEX_COMMON_RT_NT_TIME_SIGNATURE_IMMEDIATE ) || ( sub_id == RTP_MIDI_SYSEX_COMMON_RT_NT_TIME_SIGNATURE_DELAYED ) ) { + int bytes; if ( data_len < 1 ) return -1; @@ -4946,7 +4921,7 @@ decode_sysex_common_rt_ni( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr */ static unsigned int decode_sysex_common_rt_dc( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { - guint8 sub_id = 0; + guint8 sub_id; int consumed = 0; if ( data_len < 1 ) @@ -4966,9 +4941,6 @@ decode_sysex_common_rt_dc( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr /* volume */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_dc_volume, tvb, offset, 2, ENC_BIG_ENDIAN ); - /*Fix Clang Warning - offset += 2; - data_len -= 2;*/ consumed += 2; } else if ( sub_id == RTP_MIDI_SYSEX_COMMON_RT_DC_MASTER_BALANCE ) { @@ -4978,9 +4950,6 @@ decode_sysex_common_rt_dc( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr /* balance */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_dc_balance, tvb, offset, 2, ENC_BIG_ENDIAN ); - /*Fix Clang Warning - offset += 2; - data_len -= 2;*/ consumed += 2; } @@ -5036,10 +5005,10 @@ decode_sysex_common_rt_mmc_response( tvbuff_t *tvb, packet_info *pinfo _U_, prot */ static unsigned int decode_sysex_common_rt( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { - guint8 common_rt = 0; - const gchar *rt_str = NULL; - proto_item *command_item = NULL; - proto_tree *command_tree = NULL; + guint8 common_rt; + const gchar *rt_str; + proto_item *command_item; + proto_tree *command_tree; int consumed = 0; int ext_consumed = 0; @@ -5098,7 +5067,7 @@ decode_sysex_common_rt( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, } /* set our pointers correct to move past already decoded data */ - offset += ext_consumed; + offset += ext_consumed; data_len -= ext_consumed; consumed += ext_consumed; @@ -5118,8 +5087,8 @@ decode_sysex_common_rt( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, */ static unsigned int decode_sysex_common_educational( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { - proto_item *command_item = NULL; - proto_tree *command_tree = NULL; + proto_item *command_item; + proto_tree *command_tree; int consumed = 0; if ( data_len < 1 ) @@ -5139,8 +5108,8 @@ decode_sysex_common_educational( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr */ static unsigned int decode_sysex_common_manufacturer( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len, unsigned int manu_code _U_) { - proto_item *command_item = NULL; - proto_tree *command_tree = NULL; + proto_item *command_item; + proto_tree *command_tree; int consumed = 0; if ( data_len < 1 ) @@ -5166,20 +5135,18 @@ decode_sysex_common_manufacturer( tvbuff_t *tvb, packet_info *pinfo _U_, proto_t */ static unsigned int decode_sysex_start(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len ) { - guint8 octet = 0; - guint8 manu_short = 0; - const gchar *status_str = NULL; - proto_item *command_item = NULL; - proto_tree *command_tree = NULL; + const gchar *status_str; + proto_item *command_item; + proto_tree *command_tree; int consumed = 0; - int data_len = 0; + int data_len; int ext_consumed = 0; - guint16 manufacturer = 0; status_str = val_to_str( RTP_MIDI_STATUS_COMMON_SYSEX_END, rtp_midi_common_status, rtp_midi_unknown_value_hex ); /* we need to parse "away" data until the next command */ while ( cmd_len ) { + guint8 octet; octet = tvb_get_guint8( tvb, offset + consumed ); consumed++; @@ -5211,6 +5178,8 @@ decode_sysex_start(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsi /* lets see if we have enough data for the sysex-id */ if ( data_len > 1 ) { + guint8 manu_short; + guint16 manufacturer; manufacturer = tvb_get_guint8( tvb, offset ); proto_tree_add_item( command_tree, hf_rtp_midi_manu_short, tvb, offset, 1, ENC_BIG_ENDIAN ); manu_short = tvb_get_guint8( tvb, offset ); @@ -5232,11 +5201,11 @@ decode_sysex_start(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsi if ( data_len > 2 ) { manufacturer = tvb_get_ntohs( tvb, offset ); proto_tree_add_item( command_tree, hf_rtp_midi_manu_long, tvb, offset, 2, ENC_BIG_ENDIAN ); - offset +=2 ; - data_len -= 2; - ext_consumed = decode_sysex_common_manufacturer( tvb, pinfo, command_tree, offset, data_len, manufacturer ); + offset += 2 ; + data_len -= 2; + ext_consumed = decode_sysex_common_manufacturer( tvb, pinfo, command_tree, offset, data_len, manufacturer ); } else { - ext_consumed = -1; + ext_consumed = -1; } break; default: @@ -5251,8 +5220,6 @@ decode_sysex_start(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsi /* set our pointers correct to move past already decoded data */ offset += ext_consumed; - /*Fix Clang Warning - data_len -= ext_consumed;*/ proto_tree_add_item( command_tree, hf_rtp_midi_common_status, tvb, offset, 1, ENC_BIG_ENDIAN ); @@ -5270,10 +5237,10 @@ decode_sysex_start(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsi */ static int decode_mtc_quarter_frame(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len ) { - guint8 value = 0; - const gchar *status_str = NULL; - proto_item *command_item = NULL; - proto_tree *command_tree = NULL; + guint8 value; + const gchar *status_str; + proto_item *command_item; + proto_tree *command_tree; status_str = val_to_str( RTP_MIDI_STATUS_COMMON_MTC_QUARTER_FRAME, rtp_midi_common_status, rtp_midi_unknown_value_hex ); @@ -5315,12 +5282,12 @@ decode_mtc_quarter_frame(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree */ static int decode_song_position_pointer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len ) { - guint8 octet1 = 0; - guint8 octet2 = 0; - guint8 position = 0; - const gchar *status_str = NULL; - proto_item *command_item = NULL; - proto_tree *command_tree = NULL; + guint8 octet1; + guint8 octet2; + guint8 position; + const gchar *status_str; + proto_item *command_item; + proto_tree *command_tree; status_str = val_to_str( RTP_MIDI_STATUS_COMMON_SONG_POSITION_POINTER, rtp_midi_common_status, rtp_midi_unknown_value_hex ); @@ -5382,10 +5349,10 @@ decode_song_position_pointer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree * */ static int decode_song_select(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len ) { - guint8 song_nr = 0; - const gchar *status_str = NULL; - proto_item *command_item = NULL; - proto_tree *command_tree = NULL; + guint8 song_nr; + const gchar *status_str; + proto_item *command_item; + proto_tree *command_tree; status_str = val_to_str( RTP_MIDI_STATUS_COMMON_SONG_SELECT, rtp_midi_common_status, rtp_midi_unknown_value_hex ); @@ -5425,16 +5392,16 @@ decode_song_select(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsi */ static int decode_undefined_f4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len ) { - guint8 octet = 0; - const gchar *status_str = NULL; - proto_item *command_item = NULL; - proto_tree *command_tree = NULL; + const gchar *status_str; + proto_item *command_item; + proto_tree *command_tree; int consumed = 0; status_str = val_to_str( RTP_MIDI_STATUS_COMMON_UNDEFINED_F4, rtp_midi_common_status, rtp_midi_unknown_value_hex ); /* we need to parse "away" data until the next command */ while ( cmd_len ) { + guint8 octet; octet = tvb_get_guint8( tvb, offset + consumed ); consumed++; @@ -5464,16 +5431,16 @@ decode_undefined_f4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, uns */ static int decode_undefined_f5(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len ) { - guint8 octet = 0; - const gchar *status_str = NULL; - proto_item *command_item = NULL; - proto_tree *command_tree = NULL; + const gchar *status_str; + proto_item *command_item; + proto_tree *command_tree; int consumed = 0; status_str = val_to_str( RTP_MIDI_STATUS_COMMON_UNDEFINED_F5, rtp_midi_common_status, rtp_midi_unknown_value_hex ); /* we need to parse "away" data until the next command */ while ( cmd_len ) { + guint8 octet; octet = tvb_get_guint8( tvb, offset + consumed ); consumed++; /* Is this command done? */ @@ -5502,9 +5469,9 @@ decode_undefined_f5(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, uns */ static int decode_tune_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len _U_ ) { - const gchar *status_str = NULL; - proto_item *command_item = NULL; - proto_tree *command_tree = NULL; + const gchar *status_str; + proto_item *command_item; + proto_tree *command_tree; status_str = val_to_str( RTP_MIDI_STATUS_COMMON_TUNE_REQUEST, rtp_midi_common_status, rtp_midi_unknown_value_hex ); command_item = proto_tree_add_text(tree, tvb, offset - 1, 1, "%s", status_str ); @@ -5524,16 +5491,16 @@ decode_tune_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, uns */ static int decode_sysex_end(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len ) { - guint8 octet = 0; - const gchar *status_str = NULL; - proto_item *command_item = NULL; - proto_tree *command_tree = NULL; - int consumed = 0; + const gchar *status_str; + proto_item *command_item; + proto_tree *command_tree; + int consumed = 0; status_str = val_to_str( RTP_MIDI_STATUS_COMMON_SYSEX_END, rtp_midi_common_status, rtp_midi_unknown_value_hex ); /* we need to parse "away" data until the next command */ while ( cmd_len ) { + guint8 octet; octet = tvb_get_guint8( tvb, offset + consumed ); consumed++; @@ -5584,16 +5551,14 @@ decode_sysex_end(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsign static int decodemidi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len, guint8 *runningstatus, unsigned int *rsoffset ) { - guint8 octet = 0; - const gchar *valstr = NULL; int consumed = 0; int ext_consumed = 0; - gboolean using_rs = FALSE; - proto_item *command_item = NULL; - proto_tree *command_tree = NULL; + guint8 octet; + gboolean using_rs; -/* guint8 octet2; +#if 0 + guint8 octet2; guint8 octet3; guint8 cmd; guint8 channel; @@ -5608,8 +5573,8 @@ decodemidi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int guint8 subid1; guint8 subid2; guint8 sysexchan; - unsigned int helpoffset;*/ - + unsigned int helpoffset; +#endif /* extra sanity check */ if ( !cmd_len ) { @@ -5623,6 +5588,10 @@ decodemidi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int /* midi realtime-data -> one octet -- unlike serial-wired MIDI realtime-commands in RTP-MIDI will * not be intermingled with other MIDI-commands, so we handle this case right here and return */ if ( octet >= 0xf8 ) { + proto_item *command_item; + proto_tree *command_tree; + const gchar *valstr; + valstr = val_to_str( octet, rtp_midi_common_status, rtp_midi_unknown_value_hex ); command_item = proto_tree_add_text(tree, tvb, offset, 1, "%s", valstr ); command_tree = proto_item_add_subtree( command_item, ett_rtp_midi_command); @@ -5748,9 +5717,9 @@ decodemidi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int */ static int decode_cj_chapter_c( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { - proto_item *ti = NULL; - proto_tree *rtp_midi_cj_chapter_tree = NULL; - proto_tree *rtp_midi_loglist_tree = NULL; + proto_item *ti; + proto_tree *rtp_midi_cj_chapter_tree; + proto_tree *rtp_midi_loglist_tree; int consumed = 0; guint8 octet; int count; @@ -5818,10 +5787,10 @@ decode_cj_chapter_c( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un */ static int decode_cj_chapter_m( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { - proto_item *ti = NULL; - proto_tree *rtp_midi_cj_chapter_tree = NULL; - proto_tree *rtp_midi_loglist_tree = NULL; - proto_tree *rtp_midi_loglist_item_tree = NULL; + proto_item *ti; + proto_tree *rtp_midi_cj_chapter_tree; + proto_tree *rtp_midi_loglist_tree; + proto_tree *rtp_midi_loglist_item_tree; guint16 header; guint8 logitemheader; int length; @@ -5854,7 +5823,7 @@ decode_cj_chapter_m( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un /* done with header */ consumed += 2; - offset += 2; + offset += 2; /* do we have the pending field? */ if ( header & 0x4000 ) { @@ -6004,8 +5973,8 @@ decode_cj_chapter_m( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un proto_tree_add_item( ti, hf_rtp_midi_cj_chapter_m_log_a_button, tvb, offset, 2, ENC_BIG_ENDIAN ); consumed += 2; - offset += 2; - length -= 2; + offset += 2; + length -= 2; } /* do we have a c-button field? */ @@ -6022,8 +5991,8 @@ decode_cj_chapter_m( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un proto_tree_add_item( ti, hf_rtp_midi_cj_chapter_m_log_c_button, tvb, offset, 2, ENC_BIG_ENDIAN ); consumed += 2; - offset += 2; - length -= 2; + offset += 2; + length -= 2; } /* do we have a count field? */ @@ -6055,10 +6024,10 @@ decode_cj_chapter_m( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un */ static int decode_cj_chapter_n( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { - proto_item *ti = NULL; - proto_tree *rtp_midi_cj_chapter_tree = NULL; - proto_tree *rtp_midi_loglist_tree = NULL; - const gchar *note_str = NULL; + proto_item *ti; + proto_tree *rtp_midi_cj_chapter_tree; + proto_tree *rtp_midi_loglist_tree; + const gchar *note_str; int consumed = 0; guint16 header; guint8 note; @@ -6104,7 +6073,7 @@ decode_cj_chapter_n( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_n_low, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_n_high, tvb, offset, 2, ENC_BIG_ENDIAN ); - offset += 2; + offset += 2; consumed += 2; if ( log_count > 0 ) { @@ -6169,10 +6138,10 @@ decode_cj_chapter_n( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un */ static int decode_cj_chapter_e( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { - proto_item *ti = NULL; - proto_tree *rtp_midi_cj_chapter_tree = NULL; - proto_tree *rtp_midi_loglist_tree = NULL; - const gchar *note_str = NULL; + proto_item *ti; + proto_tree *rtp_midi_cj_chapter_tree; + proto_tree *rtp_midi_loglist_tree; + const gchar *note_str; int consumed = 0; guint8 header; guint8 note; @@ -6257,10 +6226,10 @@ decode_cj_chapter_e( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un */ static int decode_cj_chapter_a( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { - proto_item *ti = NULL; - proto_tree *rtp_midi_cj_chapter_tree = NULL; - proto_tree *rtp_midi_loglist_tree = NULL; - const gchar *note_str = NULL; + proto_item *ti; + proto_tree *rtp_midi_cj_chapter_tree; + proto_tree *rtp_midi_loglist_tree; + const gchar *note_str; int consumed = 0; guint8 header; guint8 note; @@ -6299,7 +6268,7 @@ decode_cj_chapter_a( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un for ( i = 0; i < log_count; i++ ) { - note = tvb_get_guint8( tvb, offset ) & 0x7f; + note = tvb_get_guint8( tvb, offset ) & 0x7f; pressure = tvb_get_guint8( tvb, offset + 1 ) & 0x7f; note_str = val_to_str( note, rtp_midi_note_values, rtp_midi_unknown_value_dec ); @@ -6332,10 +6301,10 @@ decode_cj_chapter_a( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un */ static int decode_channel_journal( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { - proto_item *ti = NULL; - proto_tree *rtp_midi_chanjournal_tree = NULL; - proto_tree *rtp_midi_cj_chapters_tree = NULL; - proto_tree *rtp_midi_cj_chapter_tree = NULL; + proto_item *ti; + proto_tree *rtp_midi_chanjournal_tree; + proto_tree *rtp_midi_cj_chapters_tree; + proto_tree *rtp_midi_cj_chapter_tree; guint32 chanflags; guint16 chanjourlen; int consumed = 0; @@ -6370,7 +6339,7 @@ decode_channel_journal( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, rtp_midi_cj_chapters_tree = proto_item_add_subtree( ti, ett_rtp_midi_channelchapters ); /* take care of length of header */ - offset += 3; + offset += 3; consumed += 3; /* Do we have a program change chapter? */ @@ -6391,7 +6360,7 @@ decode_channel_journal( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_p_xflag, tvb, offset + 2, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_p_bank_lsb, tvb, offset + 2, 1, ENC_BIG_ENDIAN ); - offset += 3; + offset += 3; consumed += 3; } @@ -6402,7 +6371,7 @@ decode_channel_journal( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, return ext_consumed; } consumed += ext_consumed; - offset += ext_consumed; + offset += ext_consumed; } @@ -6413,7 +6382,7 @@ decode_channel_journal( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, return ext_consumed; } consumed += ext_consumed; - offset += ext_consumed; + offset += ext_consumed; } /* Do we have a pitch-wheel chapter? */ @@ -6447,7 +6416,7 @@ decode_channel_journal( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, return ext_consumed; } consumed += ext_consumed; - offset += ext_consumed; + offset += ext_consumed; } /* Do we have a note command extras chapter? */ @@ -6457,7 +6426,7 @@ decode_channel_journal( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, return ext_consumed; } consumed += ext_consumed; - offset += ext_consumed; + offset += ext_consumed; } /* Do we have channel aftertouch chapter? */ @@ -6484,8 +6453,6 @@ decode_channel_journal( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, return ext_consumed; } consumed += ext_consumed; - /*Fix Clang Warning - offset += ext_consumed;*/ } /* Make sanity check for consumed data vs. stated length of this channels journal */ @@ -6502,8 +6469,8 @@ decode_channel_journal( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, static int decode_sj_chapter_d_f4( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { - proto_item *ti = NULL; - proto_tree *rtp_midi_field_tree = NULL; + proto_item *ti; + proto_tree *rtp_midi_field_tree; int consumed = 0; guint16 f4flags; guint16 f4length; @@ -6528,7 +6495,7 @@ decode_sj_chapter_d_f4( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_dsz, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_length, tvb, offset, 2, ENC_BIG_ENDIAN ); - offset += 2; + offset += 2; consumed += 2; f4length -= 2; @@ -6562,8 +6529,8 @@ decode_sj_chapter_d_f4( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, } } proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_value, tvb, offset, valuelen, ENC_NA ); - offset+=valuelen; - f4length-=valuelen; + offset += valuelen; + f4length -= valuelen; } if ( f4flags & RTP_MIDI_SJ_CHAPTER_D_SYSCOM_FLAG_L ) { @@ -6573,8 +6540,8 @@ decode_sj_chapter_d_f4( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, } proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_legal, tvb, offset, f4length, ENC_NA ); - offset+=f4length; - f4length-=f4length; + offset += f4length; + f4length -= f4length; } /* if we still have data, the length-field was incorrect we dump the data here and abort! */ @@ -6585,8 +6552,6 @@ decode_sj_chapter_d_f4( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, } proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_data, tvb, offset, f4length, ENC_NA ); - /*Fix Clang Warning - offset += f4length;*/ consumed += f4length; /* must be a protocol error - since we have a length, we can recover...*/ } @@ -6602,8 +6567,8 @@ decode_sj_chapter_d_f4( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, static int decode_sj_chapter_d_f5( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { - proto_item *ti = NULL; - proto_tree *rtp_midi_field_tree = NULL; + proto_item *ti; + proto_tree *rtp_midi_field_tree; int consumed = 0; guint16 f5flags; guint16 f5length; @@ -6628,7 +6593,7 @@ decode_sj_chapter_d_f5( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_dsz, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_length, tvb, offset, 2, ENC_BIG_ENDIAN ); - offset += 2; + offset += 2; consumed += 2; f5length -= 2; @@ -6662,8 +6627,8 @@ decode_sj_chapter_d_f5( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, } } proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_value, tvb, offset, valuelen, ENC_NA ); - offset+=valuelen; - f5length-=valuelen; + offset += valuelen; + f5length -= valuelen; } if ( f5flags & RTP_MIDI_SJ_CHAPTER_D_SYSCOM_FLAG_L ) { @@ -6673,8 +6638,8 @@ decode_sj_chapter_d_f5( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, } proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_legal, tvb, offset, f5length, ENC_NA ); - offset+=f5length; - f5length-=f5length; + offset += f5length; + f5length -= f5length; } /* if we still have data, we dump it here - see above! */ @@ -6685,8 +6650,6 @@ decode_sj_chapter_d_f5( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, } proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_data, tvb, offset, f5length, ENC_NA ); - /*Fix Clang Warning - offset += f5length;*/ consumed += f5length; /* must be a protocol error - since we have a length, we can recover...*/ } @@ -6700,8 +6663,8 @@ decode_sj_chapter_d_f5( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, static int decode_sj_chapter_d_f9( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { - proto_item *ti = NULL; - proto_tree *rtp_midi_field_tree = NULL; + proto_item *ti; + proto_tree *rtp_midi_field_tree; int consumed = 0; guint8 f9flags; guint8 f9length; @@ -6748,8 +6711,8 @@ decode_sj_chapter_d_f9( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, } proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_sysreal_legal, tvb, offset, f9length, ENC_NA ); - offset+=f9length; - f9length-=f9length; + offset += f9length; + f9length -= f9length; } /* if we still have data, the length-field was incorrect we dump the data here and abort! */ @@ -6761,8 +6724,6 @@ decode_sj_chapter_d_f9( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, } proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_sysreal_data, tvb, offset, f9length, ENC_NA ); - /*Fix Clang Warning - offset += f9length;*/ consumed += f9length; /* must be a protocol error - since we have a length, we can recover...*/ } @@ -6777,8 +6738,8 @@ decode_sj_chapter_d_f9( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, static int decode_sj_chapter_d_fd( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { - proto_item *ti = NULL; - proto_tree *rtp_midi_field_tree = NULL; + proto_item *ti; + proto_tree *rtp_midi_field_tree; int consumed = 0; guint8 fdflags; guint8 fdlength; @@ -6789,7 +6750,7 @@ decode_sj_chapter_d_fd( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, } /* Get flags & length */ - fdflags = tvb_get_guint8( tvb, offset ); + fdflags = tvb_get_guint8( tvb, offset ); fdlength = fdflags & RTP_MIDI_SJ_CHAPTER_D_SYSREAL_MASK_LENGTH; /* now we can display our tree, as we now have the full length */ @@ -6825,8 +6786,8 @@ decode_sj_chapter_d_fd( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, } proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_sysreal_legal, tvb, offset, fdlength, ENC_NA ); - offset+=fdlength; - fdlength-=fdlength; + offset += fdlength; + fdlength -= fdlength; } /* if we still have data, the length-field was incorrect we dump the data here and abort! */ @@ -6839,8 +6800,6 @@ decode_sj_chapter_d_fd( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_sysreal_data, tvb, offset, fdlength, ENC_NA ); - /*Fix Clang Warning - offset += fdlength;*/ consumed += fdlength; /* must be a protocol error - since we have a length, we can recover...*/ } @@ -6855,10 +6814,10 @@ decode_sj_chapter_d_fd( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, */ static int decode_sj_chapter_d( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { - proto_item *ti = NULL; - proto_item *tix = NULL; - proto_tree *rtp_midi_sj_chapter_tree = NULL; - proto_tree *rtp_midi_field_tree = NULL; + proto_item *ti; + proto_item *tix; + proto_tree *rtp_midi_sj_chapter_tree; + proto_tree *rtp_midi_field_tree; guint8 header; int consumed = 0; int ext_consumed; @@ -6949,7 +6908,7 @@ decode_sj_chapter_d( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un return ext_consumed; } consumed += ext_consumed; - offset += ext_consumed; + offset += ext_consumed; } /* do we have 0xF5 field? */ @@ -6959,7 +6918,7 @@ decode_sj_chapter_d( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un return ext_consumed; } consumed += ext_consumed; - offset += ext_consumed; + offset += ext_consumed; } /* do we have 0xF9 field? */ @@ -6969,7 +6928,7 @@ decode_sj_chapter_d( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un return ext_consumed; } consumed += ext_consumed; - offset += ext_consumed; + offset += ext_consumed; } /* do we have 0xFD field? */ @@ -6979,8 +6938,6 @@ decode_sj_chapter_d( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un return ext_consumed; } consumed += ext_consumed; - /*Fix Clang Warning - offset += ext_consumed;*/ } @@ -6994,8 +6951,8 @@ decode_sj_chapter_d( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un */ static int decode_sj_chapter_q( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { - proto_item *ti = NULL; - proto_tree *rtp_midi_sj_chapter_tree = NULL; + proto_item *ti; + proto_tree *rtp_midi_sj_chapter_tree; guint8 header; int consumed = 0; int len = 1; @@ -7034,7 +6991,7 @@ decode_sj_chapter_q( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_q_clock, tvb, offset, 3, ENC_BIG_ENDIAN ); consumed += 3; - offset += 3; + offset += 3; } else { proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_q_top, tvb, offset, 1, ENC_BIG_ENDIAN ); @@ -7051,8 +7008,6 @@ decode_sj_chapter_q( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_q_timetools, tvb, offset, 3, ENC_BIG_ENDIAN ); consumed += 3; - /*Fix Clang Warning - offset += 3;*/ } return consumed; @@ -7063,9 +7018,9 @@ decode_sj_chapter_q( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un */ static int decode_sj_chapter_f( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { - proto_item *ti = NULL; - proto_tree *rtp_midi_sj_chapter_tree = NULL; - proto_tree *rtp_midi_sj_field_tree = NULL; + proto_item *ti; + proto_tree *rtp_midi_sj_chapter_tree; + proto_tree *rtp_midi_sj_field_tree; guint8 header; int consumed = 0; int len = 1; @@ -7125,7 +7080,7 @@ decode_sj_chapter_f( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un } consumed += 4; - offset += 4; + offset += 4; } if ( header & RTP_MIDI_SJ_CHAPTER_F_FLAG_P ) { @@ -7146,8 +7101,6 @@ decode_sj_chapter_f( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un proto_tree_add_item( rtp_midi_sj_field_tree, hf_rtp_midi_sj_chapter_f_mt7, tvb, offset, 4, ENC_BIG_ENDIAN ); consumed += 4; - /*Fix Clang Warning - offset += 4;*/ } return consumed; @@ -7158,18 +7111,16 @@ decode_sj_chapter_f( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un */ static int decode_sj_chapter_x( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int max_length ) { - proto_item *ti = NULL; - proto_tree *rtp_midi_sj_chapter_tree = NULL; - proto_tree *rtp_midi_sj_data_tree = NULL; + proto_item *ti; + proto_tree *rtp_midi_sj_chapter_tree; + proto_tree *rtp_midi_sj_data_tree; guint8 header; guint8 octet; unsigned int consumed = 0; - unsigned long field = 0; - unsigned long fieldlen = 0; - unsigned long cmdlen = 0; + unsigned long cmdlen = 0; unsigned int i; - /* Can we read this chapters header? */ + /* Can we read this chapter's header? */ if ( !tvb_bytes_exist( tvb, offset, 1 ) ) { return -1; } @@ -7216,6 +7167,8 @@ decode_sj_chapter_x( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un } if ( header & RTP_MIDI_SJ_CHAPTER_X_FLAG_F ) { + unsigned long field = 0; + unsigned long fieldlen = 0; /* FIRST is "compressed" using only the necessary amount of octets, like delta-time */ for ( i=0; i < 4; i++ ) { @@ -7249,11 +7202,12 @@ decode_sj_chapter_x( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un break; } - consumed+=fieldlen; - offset+=fieldlen; + consumed += fieldlen; + offset += fieldlen; } + /* XXX: 'cmdlen' in the following is always 0 (since initialized to 0 above) ??? */ if ( header & RTP_MIDI_SJ_CHAPTER_X_FLAG_D ) { ti = proto_tree_add_text( rtp_midi_sj_chapter_tree, tvb, offset, max_length - consumed, RTP_MIDI_TREE_NAME_SJ_CHAPTER_X_DATA ); rtp_midi_sj_data_tree = proto_item_add_subtree( ti, ett_rtp_midi_sj_chapter_x_data ); @@ -7262,9 +7216,9 @@ decode_sj_chapter_x( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un if ( octet & 0x80 ) { proto_tree_add_item( rtp_midi_sj_data_tree, hf_rtp_midi_sj_chapter_x_data, tvb, offset, cmdlen, ENC_NA ); offset += cmdlen; - cmdlen = 0; + cmdlen = 0; } - consumed +=1; + consumed += 1; } /* unfinished command still to put into tree */ if ( cmdlen ) { @@ -7295,11 +7249,10 @@ decode_sj_chapter_x( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, un */ static int decode_system_journal( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { - proto_item *ti = NULL; - proto_tree *rtp_midi_sysjournal_tree = NULL; - proto_tree *rtp_midi_sj_chapters_tree = NULL; - proto_tree *rtp_midi_sj_chapter_tree = NULL; - int consumed = 0; + proto_item *ti; + proto_tree *rtp_midi_sysjournal_tree; + proto_tree *rtp_midi_sj_chapters_tree; + int consumed = 0; int ext_consumed = 0; guint16 sysjourlen; guint16 systemflags; @@ -7312,7 +7265,7 @@ decode_system_journal( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, } systemflags = tvb_get_ntohs( tvb, offset ); - sysjourlen = systemflags & RTP_MIDI_SJ_MASK_LENGTH; + sysjourlen = systemflags & RTP_MIDI_SJ_MASK_LENGTH; ti = proto_tree_add_text( tree, tvb, offset, sysjourlen, RTP_MIDI_TREE_NAME_SYSTEM_JOURNAL ); rtp_midi_sysjournal_tree = proto_item_add_subtree( ti, ett_rtp_midi_systemjournal ); @@ -7325,7 +7278,7 @@ decode_system_journal( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_tree_add_item( rtp_midi_sysjournal_tree, hf_rtp_midi_sysjour_toc_x, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sysjournal_tree, hf_rtp_midi_sysjour_len, tvb, offset, 2, ENC_BIG_ENDIAN ); - offset += 2; + offset += 2; consumed += 2; ti = proto_tree_add_text( rtp_midi_sysjournal_tree, tvb, offset, sysjourlen - 2, RTP_MIDI_TREE_NAME_SYSTEM_CHAPTERS ); @@ -7338,11 +7291,12 @@ decode_system_journal( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, return ext_consumed; } consumed += ext_consumed; - offset += ext_consumed; + offset += ext_consumed; } /* Do we have a active sensing chapter? */ if ( systemflags & RTP_MIDI_SJ_FLAG_V ) { + proto_tree *rtp_midi_sj_chapter_tree; /* Can we get the data for the Active Sense chapter? */ if ( !tvb_bytes_exist( tvb, offset, 1 ) ) { return -1; @@ -7365,7 +7319,7 @@ decode_system_journal( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, return ext_consumed; } consumed += ext_consumed; - offset += ext_consumed; + offset += ext_consumed; } /* Do we have a MTC chapter? */ @@ -7375,7 +7329,7 @@ decode_system_journal( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, return ext_consumed; } consumed += ext_consumed; - offset += ext_consumed; + offset += ext_consumed; } @@ -7391,8 +7345,6 @@ decode_system_journal( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, return ext_consumed; } consumed += ext_consumed; - /*Fix Clang Warning - offset += ext_consumed;*/ } @@ -7418,17 +7370,11 @@ decode_system_journal( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, static void dissect_rtp_midi( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree ) { - proto_item *ti = NULL; - proto_item *command_item = NULL; - proto_item *journal_item = NULL; - proto_tree *rtp_midi_tree = NULL; - proto_tree *rtp_midi_commands_tree = NULL; - proto_tree *rtp_midi_journal_tree = NULL; - proto_tree *rtp_midi_chanjournals_tree = NULL; - unsigned int offset = 0; + proto_item *ti; + proto_tree *rtp_midi_tree; + unsigned int offset = 0; guint8 flags; /* used for command-section and journal-section*/ - guint8 octet; unsigned int cmd_len; unsigned int cmd_count; guint8 runningstatus; @@ -7464,10 +7410,11 @@ dissect_rtp_midi( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree ) /* see if we have small or large len-field */ if (flags & RTP_MIDI_CS_FLAG_B) { - octet = tvb_get_guint8( tvb, offset+1 ); - cmd_len = ( cmd_len << 8 ) | octet; + guint8 octet; + octet = tvb_get_guint8( tvb, offset+1 ); + cmd_len = ( cmd_len << 8 ) | octet; proto_tree_add_item( rtp_midi_tree, hf_rtp_midi_longlen, tvb, offset, 2, ENC_BIG_ENDIAN ); - offset += 2; + offset += 2; } else { proto_tree_add_item( rtp_midi_tree, hf_rtp_midi_shortlen, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; @@ -7475,6 +7422,9 @@ dissect_rtp_midi( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree ) /* if we have a command-section -> dissect it */ if ( cmd_len ) { + proto_item *command_item; + proto_tree *rtp_midi_commands_tree; + command_item = proto_tree_add_text( rtp_midi_tree, tvb, offset, cmd_len, RTP_MIDI_TREE_NAME_COMMAND ); rtp_midi_commands_tree = proto_item_add_subtree( command_item, ett_rtp_midi_commands ); @@ -7485,10 +7435,10 @@ dissect_rtp_midi( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree ) } /* No commands decoded yet */ - cmd_count=0; + cmd_count = 0; /* RTP-MIDI-pdus always start with no running status */ - runningstatus=0; + runningstatus = 0; /* Multiple MIDI-commands might follow - the exact number can only be discovered by really decoding the commands! */ while ( cmd_len) { @@ -7497,14 +7447,14 @@ dissect_rtp_midi( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree ) if ( ( cmd_count ) || ( flags & RTP_MIDI_CS_FLAG_Z ) ) { /* Decode a delta-time - if 0 is returned something went wrong */ - consumed=decodetime( tvb, pinfo, rtp_midi_commands_tree, offset, cmd_len ); + consumed = decodetime( tvb, pinfo, rtp_midi_commands_tree, offset, cmd_len ); if ( -1 == consumed ) { THROW( ReportedBoundsError ); return; } /* seek to next command and set remaining length */ - offset += consumed; + offset += consumed; cmd_len -= consumed; } @@ -7519,7 +7469,7 @@ dissect_rtp_midi( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree ) } /* seek to next delta-time and set remaining length */ - offset += consumed; + offset += consumed; cmd_len -= consumed; /* as we have successfully decoded another command, increment count */ @@ -7533,6 +7483,8 @@ dissect_rtp_midi( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree ) /* if we have a journal-section -> dissect it */ if ( flags & RTP_MIDI_CS_FLAG_J ) { + proto_item *journal_item; + proto_tree *rtp_midi_journal_tree; journal_item = proto_tree_add_text( rtp_midi_tree, tvb, offset, -1, RTP_MIDI_TREE_NAME_JOURNAL ); rtp_midi_journal_tree = proto_item_add_subtree( journal_item, ett_rtp_midi_journal ); @@ -7572,6 +7524,7 @@ dissect_rtp_midi( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree ) /* do we have channel journal(s)? */ if ( flags & RTP_MIDI_JS_FLAG_A ) { + proto_tree *rtp_midi_chanjournals_tree; ti = proto_tree_add_text( rtp_midi_journal_tree, tvb, offset, -1, RTP_MIDI_TREE_NAME_CHANNEL_JOURNAL ); rtp_midi_chanjournals_tree = proto_item_add_subtree( ti, ett_rtp_midi_channeljournals ); diff --git a/epan/dissectors/packet-slowprotocols.c b/epan/dissectors/packet-slowprotocols.c index 8778e78774..7d47d7c0cc 100644 --- a/epan/dissectors/packet-slowprotocols.c +++ b/epan/dissectors/packet-slowprotocols.c @@ -31,8 +31,8 @@ # include "config.h" #endif -#include <string.h> #include <glib.h> + #include <epan/packet.h> #include <epan/etypes.h> #include <epan/llcsaps.h> @@ -728,7 +728,7 @@ static const value_string esmc_quality_level_opt_2_short[] = { { 0, "QL-STU" }, { 1, "QL-PRS" }, { 4, "QL-TNC" }, - { 7, "QL-ST2" }, + { 7, "QL-ST2" }, { 10, "QL-ST3" }, { 12, "QL-SMC" }, { 13, "QL-ST3E" }, diff --git a/epan/dissectors/packet-v5dl.c b/epan/dissectors/packet-v5dl.c index 4308368342..52d9abac13 100644 --- a/epan/dissectors/packet-v5dl.c +++ b/epan/dissectors/packet-v5dl.c @@ -37,7 +37,7 @@ #endif #include <glib.h> -#include <string.h> + #include <epan/packet.h> #include <epan/conversation.h> #include <epan/xdlc.h> @@ -94,14 +94,14 @@ static const value_string v5dl_direction_vals[] = { }; static const value_string v5dl_addr_vals[] = { - { 8175, "ISDN Protocol" }, - { 8176, "PSTN Protocol" }, - { 8177, "CONTROL Protocol" }, - { 8178, "BCC Protocol" }, - { 8179, "PROT Protocol" }, - { 8180, "Link Control Protocol" }, - { 8191, "VALUE RESERVED" }, - { 0, NULL } }; + { 8175, "ISDN Protocol" }, + { 8176, "PSTN Protocol" }, + { 8177, "CONTROL Protocol" }, + { 8178, "BCC Protocol" }, + { 8179, "PROT Protocol" }, + { 8180, "Link Control Protocol" }, + { 8191, "VALUE RESERVED" }, + { 0, NULL } }; /* Used only for U frames */ static const xdlc_cf_items v5dl_cf_items = { @@ -254,12 +254,18 @@ dissect_v5dl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) checksum_calculated = g_htons(checksum_calculated); /* Note: g_htons() macro may eval arg multiple times */ if (checksum == checksum_calculated) { - checksum_ti = proto_tree_add_uint_format(v5dl_tree, hf_v5dl_checksum, tvb, checksum_offset, 2, 0,"Checksum: 0x%04x [correct]", checksum); + checksum_ti = proto_tree_add_uint_format(v5dl_tree, hf_v5dl_checksum, tvb, checksum_offset, + 2, 0, + "Checksum: 0x%04x [correct]", + checksum); checksum_tree = proto_item_add_subtree(checksum_ti, ett_v5dl_checksum); proto_tree_add_boolean(checksum_tree, hf_v5dl_checksum_good, tvb, checksum_offset, 2, TRUE); proto_tree_add_boolean(checksum_tree, hf_v5dl_checksum_bad, tvb, checksum_offset, 2, FALSE); } else { - checksum_ti = proto_tree_add_uint_format(v5dl_tree, hf_v5dl_checksum, tvb, checksum_offset, 2, 0,"Checksum: 0x%04x [incorrect, should be 0x%04x]", checksum, checksum_calculated); + checksum_ti = proto_tree_add_uint_format(v5dl_tree, hf_v5dl_checksum, tvb, checksum_offset, + 2, 0, + "Checksum: 0x%04x [incorrect, should be 0x%04x]", + checksum, checksum_calculated); checksum_tree = proto_item_add_subtree(checksum_ti, ett_v5dl_checksum); proto_tree_add_boolean(checksum_tree, hf_v5dl_checksum_good, tvb, checksum_offset, 2, FALSE); proto_tree_add_boolean(checksum_tree, hf_v5dl_checksum_bad, tvb, checksum_offset, 2, TRUE); @@ -431,10 +437,7 @@ proto_register_v5dl(void) void proto_reg_handoff_v5dl(void) { - static gboolean init = FALSE; + gboolean init = FALSE; - if (!init) { - v52_handle = find_dissector("v52"); - init = TRUE; - } + v52_handle = find_dissector("v52"); } diff --git a/epan/dissectors/packet-v5ef.c b/epan/dissectors/packet-v5ef.c index 9dadc50390..1e68d0d0a7 100644 --- a/epan/dissectors/packet-v5ef.c +++ b/epan/dissectors/packet-v5ef.c @@ -36,7 +36,7 @@ #endif #include <glib.h> -#include <string.h> + #include <epan/packet.h> #include <epan/conversation.h> #include <epan/xdlc.h> @@ -80,10 +80,10 @@ static void dissect_v5ef(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree *v5ef_tree, *addr_tree; - proto_item *v5ef_ti, *addr_ti; - int direction; - int v5ef_header_len; - guint16 addr, eah, eal, efaddr; + proto_item *v5ef_ti, *addr_ti; + int direction; + int v5ef_header_len; + guint16 addr, eah, eal, efaddr; tvbuff_t *next_tvb; const char *srcname = "src"; const char *dstname = "dst"; @@ -91,14 +91,14 @@ dissect_v5ef(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_set_str(pinfo->cinfo, COL_PROTOCOL, "V5-EF"); col_clear(pinfo->cinfo, COL_INFO); - addr = tvb_get_ntohs(tvb, 0); - eah = (addr & V5EF_EAH) >> V5EF_EAH_SHIFT; - eal = (addr & V5EF_EAL) >> V5EF_EAL_SHIFT; - efaddr = (eah << 7) + eal; + addr = tvb_get_ntohs(tvb, 0); + eah = (addr & V5EF_EAH) >> V5EF_EAH_SHIFT; + eal = (addr & V5EF_EAL) >> V5EF_EAL_SHIFT; + efaddr = (eah << 7) + eal; v5ef_header_len = 2; /* addr */ - direction = pinfo->pseudo_header->isdn.uton; - if (direction==0) { + direction = pinfo->pseudo_header->isdn.uton; + if (direction==0) { srcname = "LE"; dstname = "AN"; } else if (direction > 0) { @@ -134,17 +134,19 @@ dissect_v5ef(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_uint(addr_tree, hf_v5ef_ea2, tvb, 1, 1, addr); } else { - v5ef_ti = NULL; + v5ef_ti = NULL; v5ef_tree = NULL; } if (tree) proto_item_set_len(v5ef_ti, v5ef_header_len); - next_tvb = tvb_new_subset_remaining(tvb, v5ef_header_len); + next_tvb = tvb_new_subset_remaining(tvb, v5ef_header_len); - if(efaddr>8175) call_dissector(v5dl_handle,next_tvb, pinfo, tree); - else call_dissector(lapd_handle,next_tvb, pinfo, tree); + if (efaddr>8175) + call_dissector(v5dl_handle,next_tvb, pinfo, tree); + else + call_dissector(lapd_handle,next_tvb, pinfo, tree); } void @@ -197,16 +199,11 @@ proto_register_v5ef(void) void proto_reg_handoff_v5ef(void) { - static gboolean init = FALSE; - - if (!init) { - dissector_handle_t v5ef_handle; + dissector_handle_t v5ef_handle; - v5ef_handle = find_dissector("v5ef"); - dissector_add_uint("wtap_encap", WTAP_ENCAP_V5_EF, v5ef_handle); + v5ef_handle = find_dissector("v5ef"); + dissector_add_uint("wtap_encap", WTAP_ENCAP_V5_EF, v5ef_handle); - lapd_handle = find_dissector("lapd"); - v5dl_handle = find_dissector("v5dl"); - init = TRUE; - } + lapd_handle = find_dissector("lapd"); + v5dl_handle = find_dissector("v5dl"); } diff --git a/epan/dissectors/packet-yhoo.c b/epan/dissectors/packet-yhoo.c index 35577d3a6e..45b68140ac 100644 --- a/epan/dissectors/packet-yhoo.c +++ b/epan/dissectors/packet-yhoo.c @@ -29,8 +29,8 @@ # include "config.h" #endif -#include <string.h> #include <glib.h> + #include <epan/packet.h> static int proto_yhoo = -1; @@ -52,48 +52,48 @@ static gint ett_yhoo = -1; /* This is from yahoolib.h from gtkyahoo */ /* Service constants */ -#define YAHOO_SERVICE_LOGON 1 -#define YAHOO_SERVICE_LOGOFF 2 -#define YAHOO_SERVICE_ISAWAY 3 -#define YAHOO_SERVICE_ISBACK 4 -#define YAHOO_SERVICE_IDLE 5 -#define YAHOO_SERVICE_MESSAGE 6 -#define YAHOO_SERVICE_IDACT 7 -#define YAHOO_SERVICE_IDDEACT 8 -#define YAHOO_SERVICE_MAILSTAT 9 -#define YAHOO_SERVICE_USERSTAT 10 -#define YAHOO_SERVICE_NEWMAIL 11 -#define YAHOO_SERVICE_CHATINVITE 12 -#define YAHOO_SERVICE_CALENDAR 13 -#define YAHOO_SERVICE_NEWPERSONALMAIL 14 -#define YAHOO_SERVICE_NEWCONTACT 15 -#define YAHOO_SERVICE_ADDIDENT 16 -#define YAHOO_SERVICE_ADDIGNORE 17 -#define YAHOO_SERVICE_PING 18 -#define YAHOO_SERVICE_GROUPRENAME 19 -#define YAHOO_SERVICE_SYSMESSAGE 20 -#define YAHOO_SERVICE_PASSTHROUGH2 22 -#define YAHOO_SERVICE_CONFINVITE 24 -#define YAHOO_SERVICE_CONFLOGON 25 -#define YAHOO_SERVICE_CONFDECLINE 26 -#define YAHOO_SERVICE_CONFLOGOFF 27 -#define YAHOO_SERVICE_CONFADDINVITE 28 -#define YAHOO_SERVICE_CONFMSG 29 -#define YAHOO_SERVICE_CHATLOGON 30 -#define YAHOO_SERVICE_CHATLOGOFF 31 -#define YAHOO_SERVICE_CHATMSG 32 -#define YAHOO_SERVICE_FILETRANSFER 70 -#define YAHOO_SERVICE_CHATADDINVITE 157 -#define YAHOO_SERVICE_AVATAR 188 -#define YAHOO_SERVICE_PICTURE_CHECKSUM 189 -#define YAHOO_SERVICE_PICTURE 190 -#define YAHOO_SERVICE_PICTURE_UPDATE 193 -#define YAHOO_SERVICE_PICTURE_UPLOAD 194 -#define YAHOO_SERVICE_YAHOO6_STATUS_UPDATE 198 -#define YAHOO_SERVICE_AVATAR_UPDATE 199 -#define YAHOO_SERVICE_AUDIBLE 208 -#define YAHOO_SERVICE_WEBLOGIN 550 -#define YAHOO_SERVICE_SMS_MSG 746 +#define YAHOO_SERVICE_LOGON 1 +#define YAHOO_SERVICE_LOGOFF 2 +#define YAHOO_SERVICE_ISAWAY 3 +#define YAHOO_SERVICE_ISBACK 4 +#define YAHOO_SERVICE_IDLE 5 +#define YAHOO_SERVICE_MESSAGE 6 +#define YAHOO_SERVICE_IDACT 7 +#define YAHOO_SERVICE_IDDEACT 8 +#define YAHOO_SERVICE_MAILSTAT 9 +#define YAHOO_SERVICE_USERSTAT 10 +#define YAHOO_SERVICE_NEWMAIL 11 +#define YAHOO_SERVICE_CHATINVITE 12 +#define YAHOO_SERVICE_CALENDAR 13 +#define YAHOO_SERVICE_NEWPERSONALMAIL 14 +#define YAHOO_SERVICE_NEWCONTACT 15 +#define YAHOO_SERVICE_ADDIDENT 16 +#define YAHOO_SERVICE_ADDIGNORE 17 +#define YAHOO_SERVICE_PING 18 +#define YAHOO_SERVICE_GROUPRENAME 19 +#define YAHOO_SERVICE_SYSMESSAGE 20 +#define YAHOO_SERVICE_PASSTHROUGH2 22 +#define YAHOO_SERVICE_CONFINVITE 24 +#define YAHOO_SERVICE_CONFLOGON 25 +#define YAHOO_SERVICE_CONFDECLINE 26 +#define YAHOO_SERVICE_CONFLOGOFF 27 +#define YAHOO_SERVICE_CONFADDINVITE 28 +#define YAHOO_SERVICE_CONFMSG 29 +#define YAHOO_SERVICE_CHATLOGON 30 +#define YAHOO_SERVICE_CHATLOGOFF 31 +#define YAHOO_SERVICE_CHATMSG 32 +#define YAHOO_SERVICE_FILETRANSFER 70 +#define YAHOO_SERVICE_CHATADDINVITE 157 +#define YAHOO_SERVICE_AVATAR 188 +#define YAHOO_SERVICE_PICTURE_CHECKSUM 189 +#define YAHOO_SERVICE_PICTURE 190 +#define YAHOO_SERVICE_PICTURE_UPDATE 193 +#define YAHOO_SERVICE_PICTURE_UPLOAD 194 +#define YAHOO_SERVICE_YAHOO6_STATUS_UPDATE 198 +#define YAHOO_SERVICE_AVATAR_UPDATE 199 +#define YAHOO_SERVICE_AUDIBLE 208 +#define YAHOO_SERVICE_WEBLOGIN 550 +#define YAHOO_SERVICE_SMS_MSG 746 /* Message flags */ @@ -105,69 +105,69 @@ static gint ett_yhoo = -1; struct yahoo_rawpacket { - char version[8]; /* 7 chars and trailing null */ - unsigned char len[4]; /* length - little endian */ - unsigned char service[4]; /* service - little endian */ - unsigned char connection_id[4]; /* connection number - little endian */ - unsigned char magic_id[4]; /* magic number used for http session */ + char version[8]; /* 7 chars and trailing null */ + unsigned char len[4]; /* length - little endian */ + unsigned char service[4]; /* service - little endian */ + unsigned char connection_id[4]; /* connection number - little endian */ + unsigned char magic_id[4]; /* magic number used for http session */ unsigned char unknown1[4]; unsigned char msgtype[4]; - char nick1[36]; - char nick2[36]; - char content[1]; /* was zero, had problems with aix xlc */ + char nick1[36]; + char nick2[36]; + char content[1]; /* was zero, had problems with aix xlc */ }; static const value_string yhoo_service_vals[] = { - {YAHOO_SERVICE_LOGON, "Pager Logon"}, - {YAHOO_SERVICE_LOGOFF, "Pager Logoff"}, - {YAHOO_SERVICE_ISAWAY, "Is Away"}, - {YAHOO_SERVICE_ISBACK, "Is Back"}, - {YAHOO_SERVICE_IDLE, "Idle"}, - {YAHOO_SERVICE_MESSAGE, "Message"}, - {YAHOO_SERVICE_IDACT, "Activate Identity"}, - {YAHOO_SERVICE_IDDEACT, "Deactivate Identity"}, - {YAHOO_SERVICE_MAILSTAT, "Mail Status"}, - {YAHOO_SERVICE_USERSTAT, "User Status"}, - {YAHOO_SERVICE_NEWMAIL, "New Mail"}, - {YAHOO_SERVICE_CHATINVITE, "Chat Invitation"}, - {YAHOO_SERVICE_CALENDAR, "Calendar Reminder"}, - {YAHOO_SERVICE_NEWPERSONALMAIL, "New Personals Mail"}, - {YAHOO_SERVICE_NEWCONTACT, "New Friend"}, - {YAHOO_SERVICE_GROUPRENAME, "Group Renamed"}, - {YAHOO_SERVICE_ADDIDENT, "Add Identity"}, - {YAHOO_SERVICE_ADDIGNORE, "Add Ignore"}, - {YAHOO_SERVICE_PING, "Ping"}, - {YAHOO_SERVICE_SYSMESSAGE, "System Message"}, - {YAHOO_SERVICE_CONFINVITE, "Conference Invitation"}, - {YAHOO_SERVICE_CONFLOGON, "Conference Logon"}, - {YAHOO_SERVICE_CONFDECLINE, "Conference Decline"}, - {YAHOO_SERVICE_CONFLOGOFF, "Conference Logoff"}, - {YAHOO_SERVICE_CONFMSG, "Conference Message"}, - {YAHOO_SERVICE_CONFADDINVITE, "Conference Additional Invitation"}, - {YAHOO_SERVICE_CHATLOGON, "Chat Logon"}, - {YAHOO_SERVICE_CHATLOGOFF, "Chat Logoff"}, - {YAHOO_SERVICE_CHATMSG, "Chat Message"}, - {YAHOO_SERVICE_FILETRANSFER, "File Transfer"}, - {YAHOO_SERVICE_PASSTHROUGH2, "Passthrough 2"}, - {YAHOO_SERVICE_CHATADDINVITE, "Chat add Invite"}, - {YAHOO_SERVICE_AVATAR, "Avatar"}, - {YAHOO_SERVICE_PICTURE_CHECKSUM, "Picture Checksum"}, - {YAHOO_SERVICE_PICTURE, "Picture"}, - {YAHOO_SERVICE_PICTURE_UPDATE, "Picture Update"}, - {YAHOO_SERVICE_PICTURE_UPLOAD, "Picture Upload"}, + {YAHOO_SERVICE_LOGON, "Pager Logon"}, + {YAHOO_SERVICE_LOGOFF, "Pager Logoff"}, + {YAHOO_SERVICE_ISAWAY, "Is Away"}, + {YAHOO_SERVICE_ISBACK, "Is Back"}, + {YAHOO_SERVICE_IDLE, "Idle"}, + {YAHOO_SERVICE_MESSAGE, "Message"}, + {YAHOO_SERVICE_IDACT, "Activate Identity"}, + {YAHOO_SERVICE_IDDEACT, "Deactivate Identity"}, + {YAHOO_SERVICE_MAILSTAT, "Mail Status"}, + {YAHOO_SERVICE_USERSTAT, "User Status"}, + {YAHOO_SERVICE_NEWMAIL, "New Mail"}, + {YAHOO_SERVICE_CHATINVITE, "Chat Invitation"}, + {YAHOO_SERVICE_CALENDAR, "Calendar Reminder"}, + {YAHOO_SERVICE_NEWPERSONALMAIL, "New Personals Mail"}, + {YAHOO_SERVICE_NEWCONTACT, "New Friend"}, + {YAHOO_SERVICE_GROUPRENAME, "Group Renamed"}, + {YAHOO_SERVICE_ADDIDENT, "Add Identity"}, + {YAHOO_SERVICE_ADDIGNORE, "Add Ignore"}, + {YAHOO_SERVICE_PING, "Ping"}, + {YAHOO_SERVICE_SYSMESSAGE, "System Message"}, + {YAHOO_SERVICE_CONFINVITE, "Conference Invitation"}, + {YAHOO_SERVICE_CONFLOGON, "Conference Logon"}, + {YAHOO_SERVICE_CONFDECLINE, "Conference Decline"}, + {YAHOO_SERVICE_CONFLOGOFF, "Conference Logoff"}, + {YAHOO_SERVICE_CONFMSG, "Conference Message"}, + {YAHOO_SERVICE_CONFADDINVITE, "Conference Additional Invitation"}, + {YAHOO_SERVICE_CHATLOGON, "Chat Logon"}, + {YAHOO_SERVICE_CHATLOGOFF, "Chat Logoff"}, + {YAHOO_SERVICE_CHATMSG, "Chat Message"}, + {YAHOO_SERVICE_FILETRANSFER, "File Transfer"}, + {YAHOO_SERVICE_PASSTHROUGH2, "Passthrough 2"}, + {YAHOO_SERVICE_CHATADDINVITE, "Chat add Invite"}, + {YAHOO_SERVICE_AVATAR, "Avatar"}, + {YAHOO_SERVICE_PICTURE_CHECKSUM, "Picture Checksum"}, + {YAHOO_SERVICE_PICTURE, "Picture"}, + {YAHOO_SERVICE_PICTURE_UPDATE, "Picture Update"}, + {YAHOO_SERVICE_PICTURE_UPLOAD, "Picture Upload"}, {YAHOO_SERVICE_YAHOO6_STATUS_UPDATE, "Status update"}, - {YAHOO_SERVICE_AUDIBLE, "Audible"}, - {YAHOO_SERVICE_WEBLOGIN, "Weblogin"}, - {YAHOO_SERVICE_SMS_MSG, "SMS Message"}, + {YAHOO_SERVICE_AUDIBLE, "Audible"}, + {YAHOO_SERVICE_WEBLOGIN, "Weblogin"}, + {YAHOO_SERVICE_SMS_MSG, "SMS Message"}, {0, NULL} }; static const value_string yhoo_msgtype_vals[] = { - {YAHOO_MSGTYPE_NONE, "None"}, - {YAHOO_MSGTYPE_NORMAL, "Normal"}, - {YAHOO_MSGTYPE_BOUNCE, "Bounce"}, - {YAHOO_MSGTYPE_STATUS, "Status Update"}, - {YAHOO_MSGTYPE_OFFLINE, "Request Offline"}, + {YAHOO_MSGTYPE_NONE, "None"}, + {YAHOO_MSGTYPE_NORMAL, "Normal"}, + {YAHOO_MSGTYPE_BOUNCE, "Bounce"}, + {YAHOO_MSGTYPE_STATUS, "Status Update"}, + {YAHOO_MSGTYPE_OFFLINE, "Request Offline"}, {0, NULL} }; @@ -175,7 +175,7 @@ static gboolean dissect_yhoo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree *yhoo_tree, *ti; - int offset = 0; + int offset = 0; if (pinfo->srcport != TCP_PORT_YHOO && pinfo->destport != TCP_PORT_YHOO) { /* Not the Yahoo port - not a Yahoo Messenger packet. */ |