diff options
author | Bill Meier <wmeier@newsguy.com> | 2009-01-28 21:52:57 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2009-01-28 21:52:57 +0000 |
commit | 0e1613fbe598912370b0b57b0fec0e8bbc33a04a (patch) | |
tree | d9f7c69a0c0818a539cd0a3ff9d6e7768a5f13fb /epan | |
parent | 3c11319ea43806d417003c7b2fd825e6b3759c67 (diff) |
Minor changes mostly related to proto_register & proto_reg_handoff;
- Use 'dissector standard template format'
- Remove 'once-only' ["if (!initialized) ..."] if not req'd
- Misc
Also: adjust some indentation
svn path=/trunk/; revision=27324
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-egd.c | 191 | ||||
-rw-r--r-- | epan/dissectors/packet-gsm_bssmap_le.c | 631 | ||||
-rw-r--r-- | epan/dissectors/packet-ipmi-session.c | 15 | ||||
-rw-r--r-- | epan/dissectors/packet-mp4ves.c | 458 | ||||
-rw-r--r-- | epan/dissectors/packet-ositp.c | 29 | ||||
-rw-r--r-- | epan/dissectors/packet-rtps2.c | 18 | ||||
-rw-r--r-- | epan/dissectors/packet-teamspeak2.c | 655 | ||||
-rw-r--r-- | epan/dissectors/packet-vj.c | 158 | ||||
-rw-r--r-- | epan/dissectors/packet-zrtp.c | 11 |
9 files changed, 1082 insertions, 1084 deletions
diff --git a/epan/dissectors/packet-egd.c b/epan/dissectors/packet-egd.c index aead9cb86d..ee861f171f 100644 --- a/epan/dissectors/packet-egd.c +++ b/epan/dissectors/packet-egd.c @@ -33,9 +33,6 @@ #include <string.h> #include <epan/packet.h> -/* forward reference */ -static void dissect_egd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - #define EGD_PORT 18246 /* 0x4746 */ #define EGD_ST_NONEW 0 @@ -76,7 +73,6 @@ static const value_string egd_stat_vals[] = { static int proto_egd = -1; -static dissector_handle_t egd_handle; static dissector_handle_t data_handle; static int hf_egd_ver = -1; @@ -93,100 +89,6 @@ static int hf_egd_resv = -1; static gint ett_egd = -1; static gint ett_status_item = -1; - -static hf_register_info hf[] = -{ - { &hf_egd_ver, - { "Version", "egd.ver", - FT_UINT8, BASE_DEC, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_egd_type, - { "Type", "egd.type", - FT_UINT8, BASE_DEC, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_egd_rid, - { "RequestID", "egd.rid", - FT_UINT16, BASE_DEC, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_egd_pid, - { "ProducerID", "egd.pid", - FT_IPv4, BASE_NONE, - NULL, 0x0, - "", HFILL } - }, - { &hf_egd_exid, - { "ExchangeID", "egd.exid", - FT_UINT32, BASE_HEX, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_egd_time, - { "Timestamp", "egd.time", - FT_ABSOLUTE_TIME, BASE_DEC, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_egd_notime, - { "Timestamp", "egd.time", - FT_UINT64, BASE_HEX, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_egd_stat, - { "Status", "egd.stat", - FT_UINT32, BASE_DEC, - VALS(egd_stat_vals), 0x0, - "Status", HFILL } - }, - { &hf_egd_csig, - { "ConfigSignature", "egd.csig", - FT_UINT32, BASE_DEC, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_egd_resv, - { "Reserved", "egd.rsrv", - FT_UINT32, BASE_DEC, - NULL, 0x0, - NULL, HFILL } - } -}; - -static gint *ett[] = -{ - &ett_egd, - &ett_status_item -}; - - -void proto_register_egd(void) -{ - proto_egd = proto_register_protocol ( - "Ethernet Global Data", /* name */ - "EGD", /* short name */ - "egd" /* abbrev */ - ); - proto_register_field_array(proto_egd, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); -} - - -void proto_reg_handoff_egd(void) -{ - /* find data dissector */ - data_handle = find_dissector("data"); - - egd_handle = create_dissector_handle(dissect_egd, proto_egd); - dissector_add("udp.port", EGD_PORT, egd_handle); -} - - static void dissect_egd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /* replace UDP with EGD in display */ @@ -259,3 +161,96 @@ static void dissect_egd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } } } + +void proto_register_egd(void) +{ + static hf_register_info hf[] = + { + { &hf_egd_ver, + { "Version", "egd.ver", + FT_UINT8, BASE_DEC, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_egd_type, + { "Type", "egd.type", + FT_UINT8, BASE_DEC, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_egd_rid, + { "RequestID", "egd.rid", + FT_UINT16, BASE_DEC, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_egd_pid, + { "ProducerID", "egd.pid", + FT_IPv4, BASE_NONE, + NULL, 0x0, + "", HFILL } + }, + { &hf_egd_exid, + { "ExchangeID", "egd.exid", + FT_UINT32, BASE_HEX, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_egd_time, + { "Timestamp", "egd.time", + FT_ABSOLUTE_TIME, BASE_DEC, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_egd_notime, + { "Timestamp", "egd.time", + FT_UINT64, BASE_HEX, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_egd_stat, + { "Status", "egd.stat", + FT_UINT32, BASE_DEC, + VALS(egd_stat_vals), 0x0, + "Status", HFILL } + }, + { &hf_egd_csig, + { "ConfigSignature", "egd.csig", + FT_UINT32, BASE_DEC, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_egd_resv, + { "Reserved", "egd.rsrv", + FT_UINT32, BASE_DEC, + NULL, 0x0, + NULL, HFILL } + } + }; + + static gint *ett[] = + { + &ett_egd, + &ett_status_item + }; + + proto_egd = proto_register_protocol ( + "Ethernet Global Data", /* name */ + "EGD", /* short name */ + "egd" /* abbrev */ + ); + proto_register_field_array(proto_egd, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); +} + +void proto_reg_handoff_egd(void) +{ + dissector_handle_t egd_handle; + + egd_handle = create_dissector_handle(dissect_egd, proto_egd); + dissector_add("udp.port", EGD_PORT, egd_handle); + + /* find data dissector */ + data_handle = find_dissector("data"); +} + diff --git a/epan/dissectors/packet-gsm_bssmap_le.c b/epan/dissectors/packet-gsm_bssmap_le.c index dcdfd20ec0..8b3d15b3b5 100644 --- a/epan/dissectors/packet-gsm_bssmap_le.c +++ b/epan/dissectors/packet-gsm_bssmap_le.c @@ -58,19 +58,19 @@ const value_string gsm_bssmap_le_msg_strings[] = { { 0, "Reserved" }, - { 1, "Reserved" }, - { 2, "Reserved" }, - { 3, "Reserved" }, - { 4, "Reserved" }, - { BSSMAP_LE_PERFORM_LOCATION_REQUEST, "Perform Location Request" }, - { BSSMAP_LE_PERFORM_LOCATION_RESPONSE, "Perform Location Response" }, - { BSSMAP_LE_PERFORM_LOCATION_ABORT, "Perform Location Abort" }, - { BSSMAP_LE_PERFORM_LOCATION_INFORMATION, "Perform Location Information" }, - { BSSMAP_LE_CONNECTION_ORIENTED_INFORMATION, "Connection Oriented Information" }, - { BSSMAP_LE_CONNECTIONLESS_INFORMATION, "Connectionless Information" }, - { BSSMAP_LE_RESET, "Reset" }, - { BSSMAP_LE_RESET_ACKNOWLEDGE, "Reset Acknowledge" }, - { 0, NULL } /*Null terminated list. Make sure we add this to our value/string structures. */ + { 1, "Reserved" }, + { 2, "Reserved" }, + { 3, "Reserved" }, + { 4, "Reserved" }, + { BSSMAP_LE_PERFORM_LOCATION_REQUEST, "Perform Location Request" }, + { BSSMAP_LE_PERFORM_LOCATION_RESPONSE, "Perform Location Response" }, + { BSSMAP_LE_PERFORM_LOCATION_ABORT, "Perform Location Abort" }, + { BSSMAP_LE_PERFORM_LOCATION_INFORMATION, "Perform Location Information" }, + { BSSMAP_LE_CONNECTION_ORIENTED_INFORMATION, "Connection Oriented Information" }, + { BSSMAP_LE_CONNECTIONLESS_INFORMATION, "Connectionless Information" }, + { BSSMAP_LE_RESET, "Reset" }, + { BSSMAP_LE_RESET_ACKNOWLEDGE, "Reset Acknowledge" }, + { 0, NULL } /*Null terminated list. Make sure we add this to our value/string structures. */ }; /* Information Element definitions */ @@ -106,37 +106,37 @@ const value_string gsm_bssmap_le_msg_strings[] = { #define BSSMAP_LE_IMEI 128 const value_string gsm_bssmap_le_elem_strings[] = { - { BSSMAP_LE_LCS_QOS, "LCS QoS" }, - { BSSMAP_LE_LCS_PRIORITY, "LCS Priority" }, - { BSSMAP_LE_LOCATION_TYPE, "Location Type" }, - { BSSMAP_LE_GANSS_LOCATION_TYPE, "GANSS Location Type" }, - { BSSMAP_LE_GEOGRAPHIC_LOCATION, "Geographic Location" }, - { BSSMAP_LE_POSITIONING_DATA, "Positioning Data" }, - { BSSMAP_LE_GANSS_POSITIONING_DATA, "GANSS Positioning Data" }, - { BSSMAP_LE_VELOCITY_DATA, "Velocity Data" }, - { BSSMAP_LE_LCS_CAUSE, "LCS Cause" }, - { BSSMAP_LE_LCS_CLIENT_TYPE, "LCS Client Type" }, - { BSSMAP_LE_APDU, "APDU" }, - { BSSMAP_LE_NETWORK_ELEMENT_IDENTITY, "Network Element Identity" }, - { BSSMAP_LE_REQUESTED_GPS_ASSISTANCE_DATA, "Requested GPS Assistance Data" }, - { BSSMAP_LE_REQUESTED_GANSS_ASSISTANCE_DATA, "Requested GANSS Assistance Data" }, - { BSSMAP_LE_DECIPHERING_KEYS, "Deciphering Keys" }, - { BSSMAP_LE_RETURN_ERROR_REQUEST, "Return Error Request" }, - { BSSMAP_LE_RETURN_ERROR_CAUSE, "Return Error Cause" }, - { BSSMAP_LE_SEGMENTATION, "Segmentation" }, - { BSSMAP_LE_CLASSMARK_INFORMATION_TYPE_3, "Classmark Information Type 3" }, - { BSSMAP_LE_CAUSE, "Cause" }, - { BSSMAP_LE_CELL_IDENTIFIER, "Cell Identifier" }, - { BSSMAP_LE_CHOSEN_CHANNEL, "Chosen Channel" }, - { BSSMAP_LE_IMSI, "IMSI" }, - { BSSMAP_LE_RESERVED_NOTE1, "Reserved" }, - { BSSMAP_LE_RESERVED_NOTE2, "Reserved" }, - { BSSMAP_LE_RESERVED_NOTE3, "Reserved" }, - { BSSMAP_LE_LCS_CAPABILITY, "LCS Capability" }, - { BSSMAP_LE_PACKET_MEASUREMENT_REPORT, "Packet Measurement Report" }, - { BSSMAP_LE_CELL_IDENTITY_LIST, "Cell Identity List" }, - { BSSMAP_LE_IMEI, "IMEI" }, - { 0, NULL } + { BSSMAP_LE_LCS_QOS, "LCS QoS" }, + { BSSMAP_LE_LCS_PRIORITY, "LCS Priority" }, + { BSSMAP_LE_LOCATION_TYPE, "Location Type" }, + { BSSMAP_LE_GANSS_LOCATION_TYPE, "GANSS Location Type" }, + { BSSMAP_LE_GEOGRAPHIC_LOCATION, "Geographic Location" }, + { BSSMAP_LE_POSITIONING_DATA, "Positioning Data" }, + { BSSMAP_LE_GANSS_POSITIONING_DATA, "GANSS Positioning Data" }, + { BSSMAP_LE_VELOCITY_DATA, "Velocity Data" }, + { BSSMAP_LE_LCS_CAUSE, "LCS Cause" }, + { BSSMAP_LE_LCS_CLIENT_TYPE, "LCS Client Type" }, + { BSSMAP_LE_APDU, "APDU" }, + { BSSMAP_LE_NETWORK_ELEMENT_IDENTITY, "Network Element Identity" }, + { BSSMAP_LE_REQUESTED_GPS_ASSISTANCE_DATA, "Requested GPS Assistance Data" }, + { BSSMAP_LE_REQUESTED_GANSS_ASSISTANCE_DATA, "Requested GANSS Assistance Data" }, + { BSSMAP_LE_DECIPHERING_KEYS, "Deciphering Keys" }, + { BSSMAP_LE_RETURN_ERROR_REQUEST, "Return Error Request" }, + { BSSMAP_LE_RETURN_ERROR_CAUSE, "Return Error Cause" }, + { BSSMAP_LE_SEGMENTATION, "Segmentation" }, + { BSSMAP_LE_CLASSMARK_INFORMATION_TYPE_3, "Classmark Information Type 3" }, + { BSSMAP_LE_CAUSE, "Cause" }, + { BSSMAP_LE_CELL_IDENTIFIER, "Cell Identifier" }, + { BSSMAP_LE_CHOSEN_CHANNEL, "Chosen Channel" }, + { BSSMAP_LE_IMSI, "IMSI" }, + { BSSMAP_LE_RESERVED_NOTE1, "Reserved" }, + { BSSMAP_LE_RESERVED_NOTE2, "Reserved" }, + { BSSMAP_LE_RESERVED_NOTE3, "Reserved" }, + { BSSMAP_LE_LCS_CAPABILITY, "LCS Capability" }, + { BSSMAP_LE_PACKET_MEASUREMENT_REPORT, "Packet Measurement Report" }, + { BSSMAP_LE_CELL_IDENTITY_LIST, "Cell Identity List" }, + { BSSMAP_LE_IMEI, "IMEI" }, + { 0, NULL } }; static const value_string gsm_apdu_protocol_id_strings[] = { @@ -149,39 +149,39 @@ static const value_string gsm_apdu_protocol_id_strings[] = { /* Velocity Requested definitions */ static const value_string bssmap_le_velocity_requested_vals[] = { - { 0, "do not report velocity" }, - { 1, "report velocity if available" }, - { 0, NULL} + { 0, "do not report velocity" }, + { 1, "report velocity if available" }, + { 0, NULL} }; /* Vertical Coordinate definitions */ static const value_string bssmap_le_vertical_coordinate_indicator_vals[] = { - { 0, "vertical coordinate not requested" }, - { 1, "vertical coordinate is requested" }, - { 0, NULL} + { 0, "vertical coordinate not requested" }, + { 1, "vertical coordinate is requested" }, + { 0, NULL} }; /* Horizontal Accuracy definitions */ static const value_string bssmap_le_horizontal_accuracy_indicator_vals[] = { - { 0, "horizontal accuracy is not specified" }, - { 1, "horizontal accuracy is specified" }, - { 0, NULL} + { 0, "horizontal accuracy is not specified" }, + { 1, "horizontal accuracy is specified" }, + { 0, NULL} }; /* Vertical Accuracy definitions */ static const value_string bssmap_le_vertical_accuracy_indicator_vals[] = { - { 0, "vertical accuracy is not specified" }, - { 1, "vertical accuracy is specified" }, - { 0, NULL} + { 0, "vertical accuracy is not specified" }, + { 1, "vertical accuracy is specified" }, + { 0, NULL} }; /* Response Time definitions */ static const value_string bssmap_le_response_time_definitions_vals[] = { - { 0, "Response Time is not specified" }, - { 1, "Low Delay" }, - { 2, "Delay Tolerant" }, - { 3, "reserved" }, - { 0, NULL} + { 0, "Response Time is not specified" }, + { 1, "Low Delay" }, + { 2, "Delay Tolerant" }, + { 3, "reserved" }, + { 0, NULL} }; /* Initialize the protocol and registered fields */ @@ -300,26 +300,26 @@ de_bmaple_apdu(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar static guint16 de_bmaple_decihp_keys(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { - gint bit_offset; + gint bit_offset; - /* Spare bits */ - bit_offset = (offset<<3); - proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_spare, tvb, bit_offset, 7, FALSE); - bit_offset += 7; + /* Spare bits */ + bit_offset = (offset<<3); + proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_spare, tvb, bit_offset, 7, FALSE); + bit_offset += 7; - /* Extract the Ciphering Key Flag and add to protocol tree */ - proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_ciphering_key_flag, tvb, bit_offset, 1, FALSE); - bit_offset++; - offset++; + /* Extract the Ciphering Key Flag and add to protocol tree */ + proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_ciphering_key_flag, tvb, bit_offset, 1, FALSE); + bit_offset++; + offset++; - /* Extract the Current Deciphering Key Value and add to protocol tree */ - proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_current_deciphering_key_value, tvb, bit_offset, 56, FALSE); - bit_offset += 56; - offset += 7; + /* Extract the Current Deciphering Key Value and add to protocol tree */ + proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_current_deciphering_key_value, tvb, bit_offset, 56, FALSE); + bit_offset += 56; + offset += 7; - /* Extract the Next Deciphering Key Value and add to protocol tree */ - proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_next_deciphering_key_value, tvb, bit_offset, 56, FALSE); - offset += 7; + /* Extract the Next Deciphering Key Value and add to protocol tree */ + proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_next_deciphering_key_value, tvb, bit_offset, 56, FALSE); + offset += 7; return(len); } @@ -344,36 +344,36 @@ de_bmaple_decihp_keys(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len * 10.13 LCS Cause */ static const value_string bssmap_le_lcs_cause_values[] = { - { 0, "Unspecified" }, - { 1, "System Failure" }, - { 2, "Protocol Error" }, - { 3, "Data missing in position request" }, - { 4, "Unexpected data value in position request" }, - { 5, "Position method failure" }, - { 6, "Target MS Unreachable" }, - { 7, "Location request aborted" }, - { 8, "Facility not supported" }, - { 9, "Inter-BSC Handover Ongoing" }, - { 10, "Intra-BSC Handover Complete" }, - { 11, "Congestion" }, - { 12, "Inter NSE cell change" }, - { 13, "Routing Area Update" }, - { 14, "PTMSI reallocation" }, - { 15, "Suspension of GPRS services" }, - { 0, NULL} + { 0, "Unspecified" }, + { 1, "System Failure" }, + { 2, "Protocol Error" }, + { 3, "Data missing in position request" }, + { 4, "Unexpected data value in position request" }, + { 5, "Position method failure" }, + { 6, "Target MS Unreachable" }, + { 7, "Location request aborted" }, + { 8, "Facility not supported" }, + { 9, "Inter-BSC Handover Ongoing" }, + { 10, "Intra-BSC Handover Complete" }, + { 11, "Congestion" }, + { 12, "Inter NSE cell change" }, + { 13, "Routing Area Update" }, + { 14, "PTMSI reallocation" }, + { 15, "Suspension of GPRS services" }, + { 0, NULL} }; static const value_string bssmap_le_position_method_failure_diagnostic_vals[] = { - { 0, "Congestion" }, - { 1, "insufficientResources" }, - { 2, "insufficientMeasurementData" }, - { 3, "inconsistentMeasurementData" }, - { 4, "locationProcedureNotCompleted" }, - { 5, "locationProcedureNotSupportedByTargetMS" }, - { 6, "qoSNotAttainable" }, - { 7, "positionMethodNotAvailableInNetwork" }, - { 8, "positionMethodNotAvailableInLocaitonArea" }, - { 0, NULL} + { 0, "Congestion" }, + { 1, "insufficientResources" }, + { 2, "insufficientMeasurementData" }, + { 3, "inconsistentMeasurementData" }, + { 4, "locationProcedureNotCompleted" }, + { 5, "locationProcedureNotSupportedByTargetMS" }, + { 6, "qoSNotAttainable" }, + { 7, "positionMethodNotAvailableInNetwork" }, + { 8, "positionMethodNotAvailableInLocaitonArea" }, + { 0, NULL} }; static guint16 de_bmaple_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) @@ -382,16 +382,16 @@ de_bmaple_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, curr_offset = offset; - /* cause value */ + /* cause value */ proto_tree_add_item(tree, hf_gsm_bssmap_le_lcs_cause_value, tvb, curr_offset, 1, FALSE); - curr_offset++; + curr_offset++; - if (len == 2) - { - /* Diagnostic value (note) */ + if (len == 2) + { + /* Diagnostic value (note) */ proto_tree_add_item(tree, hf_gsm_bssmap_le_diagnostic_value, tvb, curr_offset, 1, FALSE); - curr_offset++; - } + curr_offset++; + } return(curr_offset - offset); } @@ -400,39 +400,39 @@ de_bmaple_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, */ /* Client Category definitions */ static const value_string bssmap_le_client_category[] = { - { 0, "Value Added Client" }, - { 2, "PLMN Operator" }, - { 3, "Emergency Services"}, - { 4, "Lawful Intercept Services"}, - { 0, NULL} + { 0, "Value Added Client" }, + { 2, "PLMN Operator" }, + { 3, "Emergency Services"}, + { 4, "Lawful Intercept Services"}, + { 0, NULL} }; /* Client Subtype definitions */ static const value_string bssmap_le_client_subtype[] = { - { 0, "unspecified" }, - { 1, "broadcast service" }, - { 2, "O&M" }, - { 3, "anonymous statistics" }, - { 4, "Target MS service support" }, - { 0, NULL} + { 0, "unspecified" }, + { 1, "broadcast service" }, + { 2, "O&M" }, + { 3, "anonymous statistics" }, + { 4, "Target MS service support" }, + { 0, NULL} }; static guint16 de_bmaple_client(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { guint32 curr_offset; - guint8 bitCount; + guint8 bitCount; - bitCount = offset<<3; + bitCount = offset<<3; curr_offset = offset; - /* Extract the client category and add to protocol tree */ - proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_client_category, tvb, bitCount, 4, FALSE); - bitCount = bitCount + 4; + /* Extract the client category and add to protocol tree */ + proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_client_category, tvb, bitCount, 4, FALSE); + bitCount = bitCount + 4; - /* Extract the client subtype and add to protocol tree */ - proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_client_subtype, tvb, bitCount, 4, FALSE); - bitCount = bitCount + 4; + /* Extract the client subtype and add to protocol tree */ + proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_client_subtype, tvb, bitCount, 4, FALSE); + bitCount = bitCount + 4; curr_offset++; return(curr_offset - offset); @@ -447,54 +447,54 @@ de_bmaple_client(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, static guint16 de_bmaple_lcs_qos(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { - guint64 verticalCoordIndicator, velocityRequested, horizontalAccuracyIndicator, verticalAccuracyIndicator; - guint16 bitCount; - - bitCount = offset << 3; - - proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_spare, tvb, bitCount, 6, FALSE); - bitCount = bitCount + 6; - - /* Extract Velocity requested element */ - proto_tree_add_bits_ret_val(tree, hf_gsm_bssmap_le_velocity_requested, tvb, bitCount, 1, &velocityRequested, FALSE); - bitCount++; - - /* Extract vertical coordinator element */ - proto_tree_add_bits_ret_val(tree, hf_gsm_bssmap_le_vertical_coordinate_indicator, tvb, bitCount, 1, &verticalCoordIndicator, FALSE); - bitCount++; - - /* Extract horizontal accuracy element */ - proto_tree_add_bits_ret_val(tree, hf_gsm_bssmap_le_horizontal_accuracy_indicator, tvb, bitCount, 1, &horizontalAccuracyIndicator, FALSE); - bitCount++; - - if(horizontalAccuracyIndicator == 1) - { - proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_horizontal_accuracy, tvb, bitCount, 7, FALSE); - bitCount = bitCount + 7; - } - else - { - proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_spare, tvb, bitCount, 7, FALSE); - bitCount = bitCount + 7; - } - - /* Extract vertical accuracy element */ - proto_tree_add_bits_ret_val(tree, hf_gsm_bssmap_le_vertical_accuracy_indicator, tvb, bitCount, 1, &verticalAccuracyIndicator, FALSE); - bitCount++; - - if(verticalAccuracyIndicator == 1) - { - proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_vertical_accuracy, tvb, bitCount, 7, FALSE); - bitCount = bitCount + 7; - } - else - { - proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_spare, tvb, bitCount, 7, FALSE); - bitCount = bitCount + 7; - } - - proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_response_time_category, tvb, bitCount, 2, FALSE); - bitCount = bitCount + 2; + guint64 verticalCoordIndicator, velocityRequested, horizontalAccuracyIndicator, verticalAccuracyIndicator; + guint16 bitCount; + + bitCount = offset << 3; + + proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_spare, tvb, bitCount, 6, FALSE); + bitCount = bitCount + 6; + + /* Extract Velocity requested element */ + proto_tree_add_bits_ret_val(tree, hf_gsm_bssmap_le_velocity_requested, tvb, bitCount, 1, &velocityRequested, FALSE); + bitCount++; + + /* Extract vertical coordinator element */ + proto_tree_add_bits_ret_val(tree, hf_gsm_bssmap_le_vertical_coordinate_indicator, tvb, bitCount, 1, &verticalCoordIndicator, FALSE); + bitCount++; + + /* Extract horizontal accuracy element */ + proto_tree_add_bits_ret_val(tree, hf_gsm_bssmap_le_horizontal_accuracy_indicator, tvb, bitCount, 1, &horizontalAccuracyIndicator, FALSE); + bitCount++; + + if(horizontalAccuracyIndicator == 1) + { + proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_horizontal_accuracy, tvb, bitCount, 7, FALSE); + bitCount = bitCount + 7; + } + else + { + proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_spare, tvb, bitCount, 7, FALSE); + bitCount = bitCount + 7; + } + + /* Extract vertical accuracy element */ + proto_tree_add_bits_ret_val(tree, hf_gsm_bssmap_le_vertical_accuracy_indicator, tvb, bitCount, 1, &verticalAccuracyIndicator, FALSE); + bitCount++; + + if(verticalAccuracyIndicator == 1) + { + proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_vertical_accuracy, tvb, bitCount, 7, FALSE); + bitCount = bitCount + 7; + } + else + { + proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_spare, tvb, bitCount, 7, FALSE); + bitCount = bitCount + 7; + } + + proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_response_time_category, tvb, bitCount, 2, FALSE); + bitCount = bitCount + 2; return(len); } @@ -566,8 +566,8 @@ be_lcs_capability(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_ static guint16 be_packet_meas_rep(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { - /* Extract the Packet Measurement Report element and add to protocol tree */ - proto_tree_add_text(tree, tvb, offset, len, "Not decoded yet"); + /* Extract the Packet Measurement Report element and add to protocol tree */ + proto_tree_add_text(tree, tvb, offset, len, "Not decoded yet"); return len; } @@ -582,7 +582,7 @@ static guint16 be_measured_cell_identity(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { /* Extract the Measured Cell Identity List element and add to protocol tree */ - proto_tree_add_text(tree, tvb, offset, len, "Not decoded yet"); + proto_tree_add_text(tree, tvb, offset, len, "Not decoded yet"); return len; } @@ -852,141 +852,6 @@ static void (*bssmap_le_msg_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offs NULL, /* NONE */ }; -/* Register the protocol with Wireshark */ -void -proto_register_gsm_bssmap_le(void) -{ - guint i; - guint last_offset; - - /* Setup list of header fields */ - static hf_register_info hf[] = - { - { &hf_gsm_bssmap_le_msg_type, - { "BSSMAP LE Message Type", "bssmap_le.msgtype", - FT_UINT8, BASE_HEX, VALS(gsm_bssmap_le_msg_strings), 0x0, - "", HFILL } - }, - { &hf_gsm_bssmap_le_elem_id, - { "Element ID", "bssmap_le.elem_id", - FT_UINT8, BASE_DEC, NULL, 0, - "", HFILL } - }, - { &hf_gsm_bssmap_le_apdu_protocol_id, - { "Protocol ID", "bssmap_le.apdu_protocol_id", - FT_UINT8, BASE_DEC, VALS(gsm_apdu_protocol_id_strings), 0x0, - "APDU embedded protocol id", HFILL } - }, - { &hf_gsm_bssmap_le_spare, - { "Spare", "gsm_bssmap_le.spare", - FT_UINT8, BASE_HEX, NULL, 0x0, - "Spare", HFILL} - }, - { &hf_gsm_bssmap_le_ciphering_key_flag, - { "Ciphering Key Flag", "gsm_bssmap_le.decipheringKeys.flag", - FT_UINT8, BASE_DEC, NULL, 0x0, - "Ciphering Key Flag", HFILL} - }, - { &hf_gsm_bssmap_le_current_deciphering_key_value, - { "Current Deciphering Key Value", "gsm_bssmap_le.decipheringKeys.current", - FT_UINT8, BASE_DEC, NULL, 0x0, "Current Deciphering Key Value", - HFILL} - }, - { &hf_gsm_bssmap_le_next_deciphering_key_value, - { "Next Deciphering Key Value", "gsm_bssmap_le.decipheringKeys.next", - FT_UINT8, BASE_DEC, NULL, 0x0, - "Next Deciphering Key Value", HFILL} - }, - { &hf_gsm_bssmap_le_lcs_cause_value, - { "Cause Value", "gsm_bssmap_le.lcsCauseValue", - FT_UINT8, BASE_HEX, VALS(bssmap_le_lcs_cause_values), 0x0, - "Cause Value", HFILL} - }, - { &hf_gsm_bssmap_le_diagnostic_value, - { "Diagnostic Value", "gsm_bssmap_le.diagnosticValue", - FT_UINT8, BASE_HEX, VALS(bssmap_le_position_method_failure_diagnostic_vals), 0x0, - "Diagnostic Value", HFILL} - }, - { &hf_gsm_bssmap_le_client_category, - { "Client Category", "gsm_bssmap_le.lcsClientType.clientCategory", - FT_UINT8, BASE_HEX, VALS(bssmap_le_client_category), 0x0, - "Client Category", HFILL} - }, - { &hf_gsm_bssmap_le_client_subtype, - { "Client Subtype", "gsm_bssmap_le.lcsClientType.clientSubtype", - FT_UINT8, BASE_HEX, VALS(bssmap_le_client_subtype), 0x0, - "Client Subtype", HFILL} - }, - { &hf_gsm_bssmap_le_velocity_requested, - { "Velocity Requested", "gsm_bssmap_le.lcsQos.velocityRequested", - FT_UINT8, BASE_HEX, VALS(bssmap_le_velocity_requested_vals), 0x0, - "Velocity Requested", HFILL} - }, - { &hf_gsm_bssmap_le_vertical_coordinate_indicator, - { "Vertical Coordinate Indicator", "gsm_bssmap_le.lcsQos.verticalCoordinateIndicator", - FT_UINT8, BASE_HEX, VALS(bssmap_le_vertical_coordinate_indicator_vals), 0x0, - "Vertical Coordinate Indicator", HFILL} - }, - { &hf_gsm_bssmap_le_horizontal_accuracy_indicator, - { "Horizontal Accuracy Indicator", "gsm_bssmap_le.lcsQos.horizontalAccuracyIndicator", - FT_UINT8, BASE_HEX, VALS(bssmap_le_horizontal_accuracy_indicator_vals), 0x0, - "Horizontal Accuracy Indicator", HFILL} - }, - { &hf_gsm_bssmap_le_horizontal_accuracy, - { "Horizontal Accuracy", "gsm_bssmap_le.lcsQos.horizontalAccuracy", - FT_UINT8, BASE_HEX, NULL, 0x0, - "Horizontal Accuracy", HFILL} - }, - { &hf_gsm_bssmap_le_vertical_accuracy, - { "Vertical Accuracy", "gsm_bssmap_le.lcsQos.verticalAccuracy", - FT_UINT8, BASE_HEX, NULL, 0x0, - "Vertical Accuracy", HFILL} - }, - { &hf_gsm_bssmap_le_vertical_accuracy_indicator, - { "Vertical Accuracy Indicator", "gsm_bssmap_le.lcsQos.verticalAccuracyIndicator", - FT_UINT8, BASE_HEX, VALS(bssmap_le_vertical_accuracy_indicator_vals), 0x0, - "Vertical Accuracy Indicator", HFILL} - }, - { &hf_gsm_bssmap_le_response_time_category, - { "Response Time Category", "gsm_bssmap_le.lcsQos.responseTimeCategory", - FT_UINT8, BASE_HEX, VALS(bssmap_le_response_time_definitions_vals), 0x0, - "Response Time Category", HFILL} - }, - - }; - /* Setup protocol subtree array */ -#define NUM_INDIVIDUAL_ELEMS 1 - static gint *ett[NUM_INDIVIDUAL_ELEMS + NUM_GSM_BSSMAP_LE_MSG + - NUM_GSM_BSSMAP_LE_ELEM]; - - ett[0] = &ett_bssmap_le_msg; - - last_offset = NUM_INDIVIDUAL_ELEMS; - - for (i=0; i < NUM_GSM_BSSMAP_LE_MSG; i++, last_offset++) - { - ett_gsm_bssmap_le_msg[i] = -1; - ett[last_offset] = &ett_gsm_bssmap_le_msg[i]; - } - - for (i=0; i < NUM_GSM_BSSMAP_LE_ELEM; i++, last_offset++) - { - ett_gsm_bssmap_le_elem[i] = -1; - ett[last_offset] = &ett_gsm_bssmap_le_elem[i]; - } - - /* Register the protocol name and description */ - - proto_bssmap_le = - proto_register_protocol("Lb-I/F BSSMAP LE", "GSM BSSMAP LE", "gsm_bssmap_le"); - - proto_register_field_array(proto_bssmap_le, hf, array_length(hf)); - - proto_register_subtree_array(ett, array_length(ett)); - - register_dissector("gsm_bssmap_le", dissect_bssmap_le, proto_bssmap_le); -} - void dissect_bssmap_le(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { @@ -1100,6 +965,140 @@ dissect_bssmap_le(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } } +/* Register the protocol with Wireshark */ +void +proto_register_gsm_bssmap_le(void) +{ + guint i; + guint last_offset; + + /* Setup list of header fields */ + static hf_register_info hf[] = { + { &hf_gsm_bssmap_le_msg_type, + { "BSSMAP LE Message Type", "bssmap_le.msgtype", + FT_UINT8, BASE_HEX, VALS(gsm_bssmap_le_msg_strings), 0x0, + "", HFILL } + }, + { &hf_gsm_bssmap_le_elem_id, + { "Element ID", "bssmap_le.elem_id", + FT_UINT8, BASE_DEC, NULL, 0, + "", HFILL } + }, + { &hf_gsm_bssmap_le_apdu_protocol_id, + { "Protocol ID", "bssmap_le.apdu_protocol_id", + FT_UINT8, BASE_DEC, VALS(gsm_apdu_protocol_id_strings), 0x0, + "APDU embedded protocol id", HFILL } + }, + { &hf_gsm_bssmap_le_spare, + { "Spare", "gsm_bssmap_le.spare", + FT_UINT8, BASE_HEX, NULL, 0x0, + "Spare", HFILL} + }, + { &hf_gsm_bssmap_le_ciphering_key_flag, + { "Ciphering Key Flag", "gsm_bssmap_le.decipheringKeys.flag", + FT_UINT8, BASE_DEC, NULL, 0x0, + "Ciphering Key Flag", HFILL} + }, + { &hf_gsm_bssmap_le_current_deciphering_key_value, + { "Current Deciphering Key Value", "gsm_bssmap_le.decipheringKeys.current", + FT_UINT8, BASE_DEC, NULL, 0x0, "Current Deciphering Key Value", + HFILL} + }, + { &hf_gsm_bssmap_le_next_deciphering_key_value, + { "Next Deciphering Key Value", "gsm_bssmap_le.decipheringKeys.next", + FT_UINT8, BASE_DEC, NULL, 0x0, + "Next Deciphering Key Value", HFILL} + }, + { &hf_gsm_bssmap_le_lcs_cause_value, + { "Cause Value", "gsm_bssmap_le.lcsCauseValue", + FT_UINT8, BASE_HEX, VALS(bssmap_le_lcs_cause_values), 0x0, + "Cause Value", HFILL} + }, + { &hf_gsm_bssmap_le_diagnostic_value, + { "Diagnostic Value", "gsm_bssmap_le.diagnosticValue", + FT_UINT8, BASE_HEX, VALS(bssmap_le_position_method_failure_diagnostic_vals), 0x0, + "Diagnostic Value", HFILL} + }, + { &hf_gsm_bssmap_le_client_category, + { "Client Category", "gsm_bssmap_le.lcsClientType.clientCategory", + FT_UINT8, BASE_HEX, VALS(bssmap_le_client_category), 0x0, + "Client Category", HFILL} + }, + { &hf_gsm_bssmap_le_client_subtype, + { "Client Subtype", "gsm_bssmap_le.lcsClientType.clientSubtype", + FT_UINT8, BASE_HEX, VALS(bssmap_le_client_subtype), 0x0, + "Client Subtype", HFILL} + }, + { &hf_gsm_bssmap_le_velocity_requested, + { "Velocity Requested", "gsm_bssmap_le.lcsQos.velocityRequested", + FT_UINT8, BASE_HEX, VALS(bssmap_le_velocity_requested_vals), 0x0, + "Velocity Requested", HFILL} + }, + { &hf_gsm_bssmap_le_vertical_coordinate_indicator, + { "Vertical Coordinate Indicator", "gsm_bssmap_le.lcsQos.verticalCoordinateIndicator", + FT_UINT8, BASE_HEX, VALS(bssmap_le_vertical_coordinate_indicator_vals), 0x0, + "Vertical Coordinate Indicator", HFILL} + }, + { &hf_gsm_bssmap_le_horizontal_accuracy_indicator, + { "Horizontal Accuracy Indicator", "gsm_bssmap_le.lcsQos.horizontalAccuracyIndicator", + FT_UINT8, BASE_HEX, VALS(bssmap_le_horizontal_accuracy_indicator_vals), 0x0, + "Horizontal Accuracy Indicator", HFILL} + }, + { &hf_gsm_bssmap_le_horizontal_accuracy, + { "Horizontal Accuracy", "gsm_bssmap_le.lcsQos.horizontalAccuracy", + FT_UINT8, BASE_HEX, NULL, 0x0, + "Horizontal Accuracy", HFILL} + }, + { &hf_gsm_bssmap_le_vertical_accuracy, + { "Vertical Accuracy", "gsm_bssmap_le.lcsQos.verticalAccuracy", + FT_UINT8, BASE_HEX, NULL, 0x0, + "Vertical Accuracy", HFILL} + }, + { &hf_gsm_bssmap_le_vertical_accuracy_indicator, + { "Vertical Accuracy Indicator", "gsm_bssmap_le.lcsQos.verticalAccuracyIndicator", + FT_UINT8, BASE_HEX, VALS(bssmap_le_vertical_accuracy_indicator_vals), 0x0, + "Vertical Accuracy Indicator", HFILL} + }, + { &hf_gsm_bssmap_le_response_time_category, + { "Response Time Category", "gsm_bssmap_le.lcsQos.responseTimeCategory", + FT_UINT8, BASE_HEX, VALS(bssmap_le_response_time_definitions_vals), 0x0, + "Response Time Category", HFILL} + }, + + }; + /* Setup protocol subtree array */ +#define NUM_INDIVIDUAL_ELEMS 1 + static gint *ett[NUM_INDIVIDUAL_ELEMS + NUM_GSM_BSSMAP_LE_MSG + + NUM_GSM_BSSMAP_LE_ELEM]; + + ett[0] = &ett_bssmap_le_msg; + + last_offset = NUM_INDIVIDUAL_ELEMS; + + for (i=0; i < NUM_GSM_BSSMAP_LE_MSG; i++, last_offset++) + { + ett_gsm_bssmap_le_msg[i] = -1; + ett[last_offset] = &ett_gsm_bssmap_le_msg[i]; + } + + for (i=0; i < NUM_GSM_BSSMAP_LE_ELEM; i++, last_offset++) + { + ett_gsm_bssmap_le_elem[i] = -1; + ett[last_offset] = &ett_gsm_bssmap_le_elem[i]; + } + + /* Register the protocol name and description */ + + proto_bssmap_le = + proto_register_protocol("Lb-I/F BSSMAP LE", "GSM BSSMAP LE", "gsm_bssmap_le"); + + proto_register_field_array(proto_bssmap_le, hf, array_length(hf)); + + proto_register_subtree_array(ett, array_length(ett)); + + register_dissector("gsm_bssmap_le", dissect_bssmap_le, proto_bssmap_le); +} + void proto_reg_handoff_gsm_bssmap_le(void) { diff --git a/epan/dissectors/packet-ipmi-session.c b/epan/dissectors/packet-ipmi-session.c index 8b961bb8d3..8147721a09 100644 --- a/epan/dissectors/packet-ipmi-session.c +++ b/epan/dissectors/packet-ipmi-session.c @@ -318,16 +318,11 @@ proto_register_ipmi_session(void) void proto_reg_handoff_ipmi_session(void) { - static gboolean inited = FALSE; + dissector_handle_t ipmi_session_handle; - if (!inited) { - dissector_handle_t ipmi_session_handle; + ipmi_session_handle = create_dissector_handle(dissect_ipmi_session, proto_ipmi_session); + dissector_add("rmcp.class", RMCP_CLASS_IPMI, ipmi_session_handle); - ipmi_session_handle = create_dissector_handle(dissect_ipmi_session, proto_ipmi_session); - dissector_add("rmcp.class", RMCP_CLASS_IPMI, ipmi_session_handle); - - data_handle = find_dissector("data"); - ipmi_handle = find_dissector("ipmi"); - inited = TRUE; - } + data_handle = find_dissector("data"); + ipmi_handle = find_dissector("ipmi"); } diff --git a/epan/dissectors/packet-mp4ves.c b/epan/dissectors/packet-mp4ves.c index ad9fdfd61e..ba252b39bf 100644 --- a/epan/dissectors/packet-mp4ves.c +++ b/epan/dissectors/packet-mp4ves.c @@ -77,88 +77,88 @@ Table G-1 FLC table for profile_and_level_indication Profile/Level Code */ const value_string mp4ves_level_indication_vals[] = { - { 0, "Reserved" }, - { 1, "Simple Profile/Level 1" }, - { 2, "Simple Profile/Level 2" }, - { 3, "Reserved" }, - { 4, "Reserved" }, - { 5, "Reserved" }, - { 6, "Reserved" }, - { 7, "Reserved" }, - { 8, "Simple Profile/Level 0" }, - { 9, "Simple Profile/Level 0b" }, - /* Reserved 00001001 - 00010000 */ - { 0x11, "Simple Scalable Profile/Level 1" }, - { 0x12, "Simple Scalable Profile/Level 2" }, - /* Reserved 00010011 - 00100000 */ - { 0x21, "Core Profile/Level 1" }, - { 0x22, "Core Profile/Level 2" }, - /* Reserved 00100011 - 00110001 */ - { 0x32, "Main Profile/Level 2" }, - { 0x33, "Main Profile/Level 3" }, - { 0x34, "Main Profile/Level 4" }, - /* Reserved 00110101 - 01000001 */ - { 0x42, "N-bit Profile/Level 2" }, - /* Reserved 01000011 - 01010000 */ - { 0x51, "Scalable Texture Profile/Level 1" }, - /* Reserved 01010010 - 01100000 */ - { 0x61, "Simple Face Animation Profile/Level 1" }, - { 0x62, "Simple Face Animation Profile/Level 2" }, - { 0x63, "Simple FBA Profile/Level 1" }, - { 0x64, "Simple FBA Profile/Level 2" }, - /* Reserved 01100101 - 01110000 */ - { 0x71, "Basic Animated Texture Profile/Level 1" }, - { 0x72, "Basic Animated Texture Profile/Level 2" }, - /* Reserved 01110011 - 10000000 */ - { 0x81, "Hybrid Profile/Level 1" }, - { 0x82, "Hybrid Profile/Level 2" }, - /* Reserved 10000011 - 10010000 */ - { 0x91, "Advanced Real Time Simple Profile/Level 1" }, - { 0x92, "Advanced Real Time Simple Profile/Level 2" }, - { 0x93, "Advanced Real Time Simple Profile/Level 3" }, - { 0x94, "Advanced Real Time Simple Profile/Level 4" }, - /* Reserved 10010101 - 10100000 */ - { 0xa1, "Core Scalable Profile/Level 1" }, - { 0xa2, "Core Scalable Profile/Level 2" }, - { 0xa3, "Core Scalable Profile/Level 3" }, - /* Reserved 10100100 - 10110000 */ - { 0xb1, "Advanced Coding Efficiency Profile/Level 1" }, - { 0xb2, "Advanced Coding Efficiency Profile/Level 2" }, - { 0xb3, "Advanced Coding Efficiency Profile/Level 3" }, - { 0xb4, "Advanced Coding Efficiency Profile/Level 4" }, - /* Reserved 10110101 - 11000000 */ - { 0xc1, "Advanced Core Profile/Level 1" }, - { 0xc2, "Advanced Core Profile/Level 2" }, - /* Reserved 11000011 - 11010000 */ - { 0xd1, "Advanced Scalable Texture/Level 1" }, - { 0xd2, "Advanced Scalable Texture/Level 2" }, - { 0xd3, "Advanced Scalable Texture/Level 3" }, - /* Reserved 11010100 - 11100000 */ - { 0xe1, "Simple Studio Profile/Level 1" }, - { 0xe2, "Simple Studio Profile/Level 2" }, - { 0xe3, "Simple Studio Profile/Level 3" }, - { 0xe4, "Simple Studio Profile/Level 4" }, - { 0xe5, "Core Studio Profile/Level 1" }, - { 0xe6, "Core Studio Profile/Level 2" }, - { 0xe7, "Core Studio Profile/Level 3" }, - { 0xe8, "Core Studio Profile/Level 4" }, - /* Reserved 11101001 - 11101111 */ - { 0xf0, "Advanced Simple Profile/Level 0" }, - { 0xf1, "Advanced Simple Profile/Level 1" }, - { 0xf2, "Advanced Simple Profile/Level 2" }, - { 0xf3, "Advanced Simple Profile/Level 3" }, - { 0xf4, "Advanced Simple Profile/Level 4" }, - { 0xf5, "Advanced Simple Profile/Level 5" }, - /* Reserved 11110110 - 11110111 */ - { 0xf8, "Fine Granularity Scalable Profile/Level 0" }, - { 0xf9, "Fine Granularity Scalable Profile/Level 1" }, - { 0xfa, "Fine Granularity Scalable Profile/Level 2" }, - { 0xfb, "Fine Granularity Scalable Profile/Level 3" }, - { 0xfc, "Fine Granularity Scalable Profile/Level 4" }, - { 0xfd, "Fine Granularity Scalable Profile/Level 5" }, - { 0xfe, "Reserved" }, - { 0xff, "Reserved for Escape" }, - { 0, NULL }, + { 0, "Reserved" }, + { 1, "Simple Profile/Level 1" }, + { 2, "Simple Profile/Level 2" }, + { 3, "Reserved" }, + { 4, "Reserved" }, + { 5, "Reserved" }, + { 6, "Reserved" }, + { 7, "Reserved" }, + { 8, "Simple Profile/Level 0" }, + { 9, "Simple Profile/Level 0b" }, + /* Reserved 00001001 - 00010000 */ + { 0x11, "Simple Scalable Profile/Level 1" }, + { 0x12, "Simple Scalable Profile/Level 2" }, + /* Reserved 00010011 - 00100000 */ + { 0x21, "Core Profile/Level 1" }, + { 0x22, "Core Profile/Level 2" }, + /* Reserved 00100011 - 00110001 */ + { 0x32, "Main Profile/Level 2" }, + { 0x33, "Main Profile/Level 3" }, + { 0x34, "Main Profile/Level 4" }, + /* Reserved 00110101 - 01000001 */ + { 0x42, "N-bit Profile/Level 2" }, + /* Reserved 01000011 - 01010000 */ + { 0x51, "Scalable Texture Profile/Level 1" }, + /* Reserved 01010010 - 01100000 */ + { 0x61, "Simple Face Animation Profile/Level 1" }, + { 0x62, "Simple Face Animation Profile/Level 2" }, + { 0x63, "Simple FBA Profile/Level 1" }, + { 0x64, "Simple FBA Profile/Level 2" }, + /* Reserved 01100101 - 01110000 */ + { 0x71, "Basic Animated Texture Profile/Level 1" }, + { 0x72, "Basic Animated Texture Profile/Level 2" }, + /* Reserved 01110011 - 10000000 */ + { 0x81, "Hybrid Profile/Level 1" }, + { 0x82, "Hybrid Profile/Level 2" }, + /* Reserved 10000011 - 10010000 */ + { 0x91, "Advanced Real Time Simple Profile/Level 1" }, + { 0x92, "Advanced Real Time Simple Profile/Level 2" }, + { 0x93, "Advanced Real Time Simple Profile/Level 3" }, + { 0x94, "Advanced Real Time Simple Profile/Level 4" }, + /* Reserved 10010101 - 10100000 */ + { 0xa1, "Core Scalable Profile/Level 1" }, + { 0xa2, "Core Scalable Profile/Level 2" }, + { 0xa3, "Core Scalable Profile/Level 3" }, + /* Reserved 10100100 - 10110000 */ + { 0xb1, "Advanced Coding Efficiency Profile/Level 1" }, + { 0xb2, "Advanced Coding Efficiency Profile/Level 2" }, + { 0xb3, "Advanced Coding Efficiency Profile/Level 3" }, + { 0xb4, "Advanced Coding Efficiency Profile/Level 4" }, + /* Reserved 10110101 - 11000000 */ + { 0xc1, "Advanced Core Profile/Level 1" }, + { 0xc2, "Advanced Core Profile/Level 2" }, + /* Reserved 11000011 - 11010000 */ + { 0xd1, "Advanced Scalable Texture/Level 1" }, + { 0xd2, "Advanced Scalable Texture/Level 2" }, + { 0xd3, "Advanced Scalable Texture/Level 3" }, + /* Reserved 11010100 - 11100000 */ + { 0xe1, "Simple Studio Profile/Level 1" }, + { 0xe2, "Simple Studio Profile/Level 2" }, + { 0xe3, "Simple Studio Profile/Level 3" }, + { 0xe4, "Simple Studio Profile/Level 4" }, + { 0xe5, "Core Studio Profile/Level 1" }, + { 0xe6, "Core Studio Profile/Level 2" }, + { 0xe7, "Core Studio Profile/Level 3" }, + { 0xe8, "Core Studio Profile/Level 4" }, + /* Reserved 11101001 - 11101111 */ + { 0xf0, "Advanced Simple Profile/Level 0" }, + { 0xf1, "Advanced Simple Profile/Level 1" }, + { 0xf2, "Advanced Simple Profile/Level 2" }, + { 0xf3, "Advanced Simple Profile/Level 3" }, + { 0xf4, "Advanced Simple Profile/Level 4" }, + { 0xf5, "Advanced Simple Profile/Level 5" }, + /* Reserved 11110110 - 11110111 */ + { 0xf8, "Fine Granularity Scalable Profile/Level 0" }, + { 0xf9, "Fine Granularity Scalable Profile/Level 1" }, + { 0xfa, "Fine Granularity Scalable Profile/Level 2" }, + { 0xfb, "Fine Granularity Scalable Profile/Level 3" }, + { 0xfc, "Fine Granularity Scalable Profile/Level 4" }, + { 0xfd, "Fine Granularity Scalable Profile/Level 5" }, + { 0xfe, "Reserved" }, + { 0xff, "Reserved for Escape" }, + { 0, NULL }, }; static const range_string mp4ves_startcode_vals[] = { { 0x00, 0x1f, "video_object_start_code" }, @@ -790,133 +790,102 @@ dissect_mp4ves(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static int dissect_mp4ves_par_profile(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_) { - int offset = 0; - guint16 lvl; - const gchar *p = NULL; - asn1_ctx_t *actx; - - actx = get_asn1_ctx(pinfo->private_data); - DISSECTOR_ASSERT(actx); - - lvl = tvb_get_ntohs(tvb, offset); - p = match_strval(lvl, VALS(mp4ves_level_indication_vals)); - if (p) { - proto_item_append_text(actx->created_item, " - profileAndLevel %s", p); - } - offset += 2; - return offset; + int offset = 0; + guint16 lvl; + const gchar *p = NULL; + asn1_ctx_t *actx; + + actx = get_asn1_ctx(pinfo->private_data); + DISSECTOR_ASSERT(actx); + + lvl = tvb_get_ntohs(tvb, offset); + p = match_strval(lvl, VALS(mp4ves_level_indication_vals)); + if (p) { + proto_item_append_text(actx->created_item, " - profileAndLevel %s", p); + } + offset += 2; + return offset; } static int dissect_mp4ves_par_video_object_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_) { - int offset = 0; - guint16 lvl; - const gchar *p = NULL; - asn1_ctx_t *actx; - - actx = get_asn1_ctx(pinfo->private_data); - DISSECTOR_ASSERT(actx); - - lvl = tvb_get_ntohs(tvb, offset); - p = match_strval(lvl, VALS(mp4ves_video_object_type_vals)); - if (p) { - proto_item_append_text(actx->created_item, " - video_object_type %s", p); - } - offset += 2; - return offset; + int offset = 0; + guint16 lvl; + const gchar *p = NULL; + asn1_ctx_t *actx; + + actx = get_asn1_ctx(pinfo->private_data); + DISSECTOR_ASSERT(actx); + + lvl = tvb_get_ntohs(tvb, offset); + p = match_strval(lvl, VALS(mp4ves_video_object_type_vals)); + if (p) { + proto_item_append_text(actx->created_item, " - video_object_type %s", p); + } + offset += 2; + return offset; } static int dissect_mp4ves_par_decoderConfigurationInformation(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_) { - asn1_ctx_t *actx; + asn1_ctx_t *actx; - actx = get_asn1_ctx(pinfo->private_data); - DISSECTOR_ASSERT(actx); + actx = get_asn1_ctx(pinfo->private_data); + DISSECTOR_ASSERT(actx); - dissect_mp4ves_config(tvb, pinfo, tree); + dissect_mp4ves_config(tvb, pinfo, tree); - return tvb_length(tvb); + return tvb_length(tvb); } typedef struct _mp4ves_capability_t { - const gchar *id; - const gchar *name; - new_dissector_t content_pdu; + const gchar *id; + const gchar *name; + new_dissector_t content_pdu; } mp4ves_capability_t; static mp4ves_capability_t mp4ves_capability_tab[] = { - /* ITU-T H.245 capabilities ISO/IEC 14496-2(m*/ - { "GenericCapability/0.0.8.245.1.0.0/nonCollapsing/0", "profileAndLevel", dissect_mp4ves_par_profile }, - { "GenericCapability/0.0.8.245.1.0.0/nonCollapsing/1", "object", dissect_mp4ves_par_video_object_type }, - { "GenericCapability/0.0.8.245.1.0.0/nonCollapsing/2", "decoderConfigurationInformation", dissect_mp4ves_par_decoderConfigurationInformation }, - { "GenericCapability/0.0.8.245.1.0.0/nonCollapsing/3", "drawingOrder", NULL }, - { "GenericCapability/0.0.8.245.1.0.0/collapsing/4", "visualBackChannelHandle", NULL }, - { NULL, NULL, NULL }, + /* ITU-T H.245 capabilities ISO/IEC 14496-2(m*/ + { "GenericCapability/0.0.8.245.1.0.0/nonCollapsing/0", "profileAndLevel", dissect_mp4ves_par_profile }, + { "GenericCapability/0.0.8.245.1.0.0/nonCollapsing/1", "object", dissect_mp4ves_par_video_object_type }, + { "GenericCapability/0.0.8.245.1.0.0/nonCollapsing/2", "decoderConfigurationInformation", dissect_mp4ves_par_decoderConfigurationInformation }, + { "GenericCapability/0.0.8.245.1.0.0/nonCollapsing/3", "drawingOrder", NULL }, + { "GenericCapability/0.0.8.245.1.0.0/collapsing/4", "visualBackChannelHandle", NULL }, + { NULL, NULL, NULL }, }; static mp4ves_capability_t *find_cap(const gchar *id) { - mp4ves_capability_t *ftr = NULL; - mp4ves_capability_t *f; + mp4ves_capability_t *ftr = NULL; + mp4ves_capability_t *f; - for (f=mp4ves_capability_tab; f->id; f++) { - if (!strcmp(id, f->id)) { ftr = f; break; } - } - return ftr; + for (f=mp4ves_capability_tab; f->id; f++) { + if (!strcmp(id, f->id)) { ftr = f; break; } + } + return ftr; } static void dissect_mp4ves_name(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree) { - asn1_ctx_t *actx; - mp4ves_capability_t *ftr = NULL; - - actx = get_asn1_ctx(pinfo->private_data); - DISSECTOR_ASSERT(actx); - if (tree) { - ftr = find_cap(pinfo->match_string); - if (ftr) { - proto_item_append_text(actx->created_item, " - %s", ftr->name); - proto_item_append_text(proto_item_get_parent(proto_tree_get_parent(tree)), ": %s", ftr->name); - } else { - proto_item_append_text(actx->created_item, " - unknown(%s)", pinfo->match_string); - } - } -} - -void -proto_reg_handoff_mp4ves(void) -{ - static dissector_handle_t mp4ves_handle; - static guint dynamic_payload_type; - static gboolean mp4ves_prefs_initialized = FALSE; + asn1_ctx_t *actx; + mp4ves_capability_t *ftr = NULL; - if (!mp4ves_prefs_initialized) { - dissector_handle_t mp4ves_name_handle; - mp4ves_capability_t *ftr; - - mp4ves_handle = find_dissector("mp4ves"); - dissector_add_string("rtp_dyn_payload_type","MP4V-ES", mp4ves_handle); - mp4ves_prefs_initialized = TRUE; - - mp4ves_name_handle = create_dissector_handle(dissect_mp4ves_name, proto_mp4ves); - for (ftr=mp4ves_capability_tab; ftr->id; ftr++) { - if (ftr->name) - dissector_add_string("h245.gef.name", ftr->id, mp4ves_name_handle); - if (ftr->content_pdu) - dissector_add_string("h245.gef.content", ftr->id, new_create_dissector_handle(ftr->content_pdu, proto_mp4ves)); + actx = get_asn1_ctx(pinfo->private_data); + DISSECTOR_ASSERT(actx); + if (tree) { + ftr = find_cap(pinfo->match_string); + if (ftr) { + proto_item_append_text(actx->created_item, " - %s", ftr->name); + proto_item_append_text(proto_item_get_parent(proto_tree_get_parent(tree)), ": %s", ftr->name); + } else { + proto_item_append_text(actx->created_item, " - unknown(%s)", pinfo->match_string); } - }else{ - if ( dynamic_payload_type > 95 ) - dissector_delete("rtp.pt", dynamic_payload_type, mp4ves_handle); - } - dynamic_payload_type = global_dynamic_payload_type; - - if ( dynamic_payload_type > 95 ){ - dissector_add("rtp.pt", dynamic_payload_type, mp4ves_handle); } } +void +proto_reg_handoff_mp4ves(void); void proto_register_mp4ves(void) @@ -926,79 +895,79 @@ proto_register_mp4ves(void) /* Setup list of header fields See Section 1.6.1 for details*/ static hf_register_info hf[] = { { &hf_mp4ves_config, - { "Configuration", "mp4ves.configuration", - FT_BYTES, BASE_NONE, NULL, 0x0, - "Configuration", HFILL } + { "Configuration", "mp4ves.configuration", + FT_BYTES, BASE_NONE, NULL, 0x0, + "Configuration", HFILL } }, { &hf_mp4ves_start_code_prefix, - { "start code prefix", "mp4ves.start_code_prefix", - FT_UINT32, BASE_HEX, NULL, 0x0, - "start code prefix", HFILL } + { "start code prefix", "mp4ves.start_code_prefix", + FT_UINT32, BASE_HEX, NULL, 0x0, + "start code prefix", HFILL } }, { &hf_mp4ves_start_code, - { "Start code", "mp4ves.start_code", - FT_UINT8, BASE_RANGE_STRING|BASE_HEX, RVALS(&mp4ves_startcode_vals), 0x0, - "Start code", HFILL } + { "Start code", "mp4ves.start_code", + FT_UINT8, BASE_RANGE_STRING|BASE_HEX, RVALS(&mp4ves_startcode_vals), 0x0, + "Start code", HFILL } }, { &hf_mp4ves_vop_coding_type, - { "vop_coding_type", "mp4ves.vop_coding_type", - FT_UINT8, BASE_DEC, VALS(mp4ves_vop_coding_type_vals), 0x0, - "Start code", HFILL } + { "vop_coding_type", "mp4ves.vop_coding_type", + FT_UINT8, BASE_DEC, VALS(mp4ves_vop_coding_type_vals), 0x0, + "Start code", HFILL } }, {&hf_mp4ves_profile_and_level_indication, - { "profile_and_level_indication", "mp4ves.profile_and_level_indication", - FT_UINT8, BASE_DEC,VALS(mp4ves_level_indication_vals), 0x0, - "profile_and_level_indication", HFILL } + { "profile_and_level_indication", "mp4ves.profile_and_level_indication", + FT_UINT8, BASE_DEC,VALS(mp4ves_level_indication_vals), 0x0, + "profile_and_level_indication", HFILL } }, { &hf_mp4ves_is_visual_object_identifier, - { "visual_object_identifier", "mp4ves.visual_object_identifier", - FT_UINT8, BASE_DEC, NULL, 0x0, - "visual_object_identifier", HFILL } + { "visual_object_identifier", "mp4ves.visual_object_identifier", + FT_UINT8, BASE_DEC, NULL, 0x0, + "visual_object_identifier", HFILL } }, { &hf_mp4ves_visual_object_type, - { "visual_object_type", "mp4ves.visual_object_type", - FT_UINT32, BASE_DEC, VALS(mp4ves_visual_object_type_vals), 0x0, - "visual_object_type", HFILL } + { "visual_object_type", "mp4ves.visual_object_type", + FT_UINT32, BASE_DEC, VALS(mp4ves_visual_object_type_vals), 0x0, + "visual_object_type", HFILL } }, { &hf_mp4ves_video_signal_type, - { "video_signal_type", "mp4ves.video_signal_type", - FT_UINT8, BASE_DEC, NULL, 0x0, - "video_signal_type", HFILL } + { "video_signal_type", "mp4ves.video_signal_type", + FT_UINT8, BASE_DEC, NULL, 0x0, + "video_signal_type", HFILL } }, { &hf_mp4ves_stuffing, - { "Stuffing", "mp4ves.stuffing", - FT_UINT8, BASE_DEC, NULL, 0x0, - "Stuffing", HFILL } + { "Stuffing", "mp4ves.stuffing", + FT_UINT8, BASE_DEC, NULL, 0x0, + "Stuffing", HFILL } }, { &hf_mp4ves_video_object_type_indication, - { "video_object_type_indication", "mp4ves.video_object_type_indication", - FT_UINT8, BASE_DEC, VALS(mp4ves_video_object_type_indication_vals), 0x0, - "video_object_type_indication", HFILL } + { "video_object_type_indication", "mp4ves.video_object_type_indication", + FT_UINT8, BASE_DEC, VALS(mp4ves_video_object_type_indication_vals), 0x0, + "video_object_type_indication", HFILL } }, { &hf_mp4ves_random_accessible_vol, - { "random_accessible_vol", "mp4ves.random_accessible_vol", - FT_UINT8, BASE_DEC, NULL, 0x0, - "video_object_type_indication", HFILL } + { "random_accessible_vol", "mp4ves.random_accessible_vol", + FT_UINT8, BASE_DEC, NULL, 0x0, + "video_object_type_indication", HFILL } }, { &hf_mp4ves_is_object_layer_identifier, - { "is_object_layer_identifier", "mp4ves.is_object_layer_identifier", - FT_UINT8, BASE_DEC, NULL, 0x0, - "is_object_layer_identifier", HFILL } + { "is_object_layer_identifier", "mp4ves.is_object_layer_identifier", + FT_UINT8, BASE_DEC, NULL, 0x0, + "is_object_layer_identifier", HFILL } }, { &hf_mp4ves_aspect_ratio_info, - { "aspect_ratio_info", "mp4ves.aspect_ratio_info", - FT_UINT8, BASE_DEC, VALS(mp4ves_aspect_ratio_info_vals), 0x0, - "aspect_ratio_info", HFILL } + { "aspect_ratio_info", "mp4ves.aspect_ratio_info", + FT_UINT8, BASE_DEC, VALS(mp4ves_aspect_ratio_info_vals), 0x0, + "aspect_ratio_info", HFILL } }, { &hf_mp4ves_vol_control_parameters, - { "vol_control_parameters", "mp4ves.vol_control_parameters", - FT_UINT8, BASE_DEC, NULL, 0x0, - "vol_control_parameters", HFILL } + { "vol_control_parameters", "mp4ves.vol_control_parameters", + FT_UINT8, BASE_DEC, NULL, 0x0, + "vol_control_parameters", HFILL } }, { &hf_mp4ves_video_object_layer_shape, - { "video_object_layer_shape", "mp4ves.video_object_layer_shape", - FT_UINT8, BASE_DEC, VALS(mp4ves_video_object_layer_shape_vals), 0x0, - "video_object_layer_shape", HFILL } + { "video_object_layer_shape", "mp4ves.video_object_layer_shape", + FT_UINT8, BASE_DEC, VALS(mp4ves_video_object_layer_shape_vals), 0x0, + "video_object_layer_shape", HFILL } }, }; @@ -1023,10 +992,45 @@ proto_register_mp4ves(void) /* Register a configuration option for port */ mp4ves_module = prefs_register_protocol(proto_mp4ves, proto_reg_handoff_mp4ves); - prefs_register_uint_preference(mp4ves_module, "dynamic.payload.type", - "MP4V-ES dynamic payload type", - "The dynamic payload type which will be interpreted as MP4V-ES", - 10, - &global_dynamic_payload_type); + prefs_register_uint_preference(mp4ves_module, + "dynamic.payload.type", + "MP4V-ES dynamic payload type", + "The dynamic payload type which will be interpreted as MP4V-ES", + 10, + &global_dynamic_payload_type); } + +void +proto_reg_handoff_mp4ves(void) +{ + static dissector_handle_t mp4ves_handle; + static guint dynamic_payload_type; + static gboolean mp4ves_prefs_initialized = FALSE; + + if (!mp4ves_prefs_initialized) { + dissector_handle_t mp4ves_name_handle; + mp4ves_capability_t *ftr; + + mp4ves_handle = find_dissector("mp4ves"); + dissector_add_string("rtp_dyn_payload_type","MP4V-ES", mp4ves_handle); + mp4ves_prefs_initialized = TRUE; + + mp4ves_name_handle = create_dissector_handle(dissect_mp4ves_name, proto_mp4ves); + for (ftr=mp4ves_capability_tab; ftr->id; ftr++) { + if (ftr->name) + dissector_add_string("h245.gef.name", ftr->id, mp4ves_name_handle); + if (ftr->content_pdu) + dissector_add_string("h245.gef.content", ftr->id, new_create_dissector_handle(ftr->content_pdu, proto_mp4ves)); + } + }else{ + if ( dynamic_payload_type > 95 ) + dissector_delete("rtp.pt", dynamic_payload_type, mp4ves_handle); + } + dynamic_payload_type = global_dynamic_payload_type; + + if ( dynamic_payload_type > 95 ){ + dissector_add("rtp.pt", dynamic_payload_type, mp4ves_handle); + } +} + diff --git a/epan/dissectors/packet-ositp.c b/epan/dissectors/packet-ositp.c index 3d818dfeb2..7ccbfc240b 100644 --- a/epan/dissectors/packet-ositp.c +++ b/epan/dissectors/packet-ositp.c @@ -1826,7 +1826,7 @@ void proto_register_cotp(void) prefs_register_bool_preference(cotp_module, "reassemble", "Reassemble segmented COTP datagrams", "Whether segmented COTP datagrams should be reassembled." - " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.", + " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.", &cotp_reassemble); prefs_register_enum_preference(cotp_module, "tsap_display", @@ -1849,19 +1849,6 @@ void proto_register_cotp(void) register_init_routine(cotp_reassemble_init); } -void -proto_reg_handoff_cotp(void) -{ - dissector_handle_t ositp_handle; - - ositp_handle = find_dissector("ositp"); - dissector_add("ip.proto", IP_PROTO_TP, ositp_handle); - - data_handle = find_dissector("data"); - - proto_clnp = proto_get_id_by_filter_name("clnp"); -} - void proto_register_cltp(void) { static hf_register_info hf[] = { @@ -1880,3 +1867,17 @@ void proto_register_cltp(void) proto_register_field_array(proto_cltp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } + +void +proto_reg_handoff_cotp(void) +{ + dissector_handle_t ositp_handle; + + ositp_handle = find_dissector("ositp"); + dissector_add("ip.proto", IP_PROTO_TP, ositp_handle); + + data_handle = find_dissector("data"); + + proto_clnp = proto_get_id_by_filter_name("clnp"); +} + diff --git a/epan/dissectors/packet-rtps2.c b/epan/dissectors/packet-rtps2.c index f0fa12c9ec..56b8f549e1 100644 --- a/epan/dissectors/packet-rtps2.c +++ b/epan/dissectors/packet-rtps2.c @@ -830,13 +830,6 @@ static gboolean dissect_rtps(tvbuff_t *, packet_info *, proto_tree *); /* static gboolean glob_do_something = TRUE; */ static guint rtps_max_batch_samples_dissected = 16; -static void reinit_rtps(void) { - /* Do something here when global arguments are changed */ -} - - - - /* *********************************************************************** */ /* Appends a submessage description to the info summary text @@ -9250,22 +9243,13 @@ void proto_register_rtps2(void) { proto_register_subtree_array(ett, array_length(ett)); /* Registers the control in the preference panel */ - rtps_module = prefs_register_protocol(proto_rtps, reinit_rtps); -/* - prefs_register_bool_preference(rtps_module, "do_something", - "Do somethinig short description", - "Do something long and very exhaustive description " - "that can go on and on and on and on... ", - &glob_do_something); -*/ + rtps_module = prefs_register_protocol(proto_rtps, NULL); prefs_register_uint_preference(rtps_module, "max_batch_samples_dissected", "Max samples dissected for DATA_BATCH", "Specifies the maximum number of samples dissected in " "a DATA_BATCH submessage. Increasing this value may affect " "performances if the trace has a lot of big batched samples.", 10, &rtps_max_batch_samples_dissected); - - } void proto_reg_handoff_rtps2(void) { diff --git a/epan/dissectors/packet-teamspeak2.c b/epan/dissectors/packet-teamspeak2.c index c7b19f2d9c..147d75c1d7 100644 --- a/epan/dissectors/packet-teamspeak2.c +++ b/epan/dissectors/packet-teamspeak2.c @@ -266,12 +266,6 @@ static int hf_ts2_status_mute = -1; static gint ett_ts2 = -1; -static gint *ett[] = { - &ett_ts2, - &ett_msg_fragment, - &ett_msg_fragments -}; - /* Conversation Variables */ typedef struct { @@ -295,275 +289,6 @@ typedef struct gboolean outoforder; } ts2_frag; -static hf_register_info hf[] = { - { &hf_ts2_class, - { "Class", "ts2.class", - FT_UINT16, BASE_HEX, - VALS(classnames), 0x0, - NULL, HFILL } - }, - { &hf_ts2_type, - { "Type", "ts2.type", - FT_UINT16, BASE_HEX, - VALS(typenames), 0x0, - NULL, HFILL } - }, - { &hf_ts2_clientid, - { "Client id", "ts2.clientid", - FT_UINT32, BASE_DEC, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_sessionkey, - { "Session Key", "ts2.sessionkey", - FT_UINT32, BASE_HEX, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_ackto, - { "Ping Reply To", "ts2.ping_ackto", - FT_UINT32, BASE_DEC, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_crc32, - { "CRC32 Checksum", "ts2.crc32", - FT_UINT32, BASE_HEX, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_seqnum, - { "Sequence Number", "ts2.sequencenum", - FT_UINT32, BASE_DEC, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_protocol_string, - { "Protocol String", "ts2.protocolstring", - FT_UINT_STRING, BASE_NONE, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_string, - { "String", "ts2.string", - FT_STRING, BASE_NONE, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_registeredlogin, - { "Registered Login", "ts2.registeredlogin", - FT_BOOLEAN, BASE_NONE, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_name, - { "Name", "ts2.name", - FT_UINT_STRING, BASE_NONE, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_password, - { "Password", "ts2.password", - FT_UINT_STRING, BASE_NONE, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_nick, - { "Nick", "ts2.nick", - FT_UINT_STRING, BASE_NONE, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_badlogin, - { "Bad Login", "ts2.badlogin", - FT_BOOLEAN, BASE_NONE, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_unknown, - { "Unknown", "ts2.unknown", - FT_BYTES, BASE_HEX, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_channel, - { "Channel", "ts2.channel", - FT_UINT_STRING, BASE_NONE, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_subchannel, - { "Sub-Channel", "ts2.subchannel", - FT_UINT_STRING, BASE_NONE, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_channelpassword, - { "Channel Password", "ts2.channelpassword", - FT_UINT_STRING, BASE_NONE, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_emptyspace, - { "Empty Space", "ts2.emptyspace", - FT_NONE, BASE_NONE, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_fragmentnumber, - { "Fragment Number", "ts2.fragmentnumber", - FT_UINT16, BASE_DEC, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_platform_string, - { "Platform String", "ts2.platformstring", - FT_UINT_STRING, BASE_NONE, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_server_name, - { "Server Name", "ts2.servername", - FT_UINT_STRING, BASE_NONE, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_server_welcome_message, - { "Server Welcome Message", "ts2.serverwelcomemessage", - FT_UINT_STRING, BASE_NONE, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_endmarker, - { "End Marker", "ts2.endmarker", - FT_NONE, BASE_NONE, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_codec, - { "Codec", "ts2.codec", - FT_UINT16, BASE_HEX, - VALS(codecnames), 0x0, - NULL, HFILL } - }, - { &hf_ts2_channel_flags, - { "Channel Flags", "ts2.channelflags", - FT_BOOLEAN, BASE_NONE, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_channel_id, - { "Channel Id", "ts2.chanelid", - FT_UINT32, BASE_DEC, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_channel_name, - { "Channel Name", "ts2.chanelname", - FT_STRINGZ, BASE_NONE, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_channel_topic, - { "Channel Topic", "ts2.chaneltopic", - FT_STRINGZ, BASE_NONE, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_channel_description, - { "Channel Description", "ts2.chaneldescription", - FT_STRINGZ, BASE_NONE, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_player_id, - { "Player Id", "ts2.playerid", - FT_UINT32, BASE_DEC, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_player_status_flags, - { "Player Status Flags", "ts2.playerstatusflags", - FT_UINT16, BASE_DEC, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_number_of_players, - { "Number Of Players", "ts2.numberofplayers", - FT_UINT32, BASE_DEC, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_number_of_channels, - { "Number Of Channels", "ts2.numberofchannels", - FT_UINT32, BASE_DEC, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_resend_count, - { "Resend Count", "ts2.resendcount", - FT_UINT16, BASE_DEC, - NULL, 0x0, - NULL, HFILL } - }, - { &hf_ts2_status_channelcommander, - { "Channel Commander", "ts2.playerstatusflags.channelcommander", - FT_BOOLEAN, 8, - NULL, TS2_STATUS_CHANNELCOMMANDER, - NULL, HFILL } - }, - { &hf_ts2_status_blockwhispers, - { "Block Whispers", "ts2.playerstatusflags.blockwhispers", - FT_BOOLEAN, 8, - NULL, TS2_STATUS_BLOCKWHISPERS, - NULL, HFILL } - }, - { &hf_ts2_status_away, - { "Away", "ts2.playerstatusflags.away", - FT_BOOLEAN, 8, - NULL, TS2_STATUS_AWAY, - NULL, HFILL } - }, - { &hf_ts2_status_mutemicrophone, - { "Mute Microphone", "ts2.playerstatusflags.mutemicrophone", - FT_BOOLEAN, 8, - NULL, TS2_STATUS_MUTEMICROPHONE, - NULL, HFILL } - }, - { &hf_ts2_status_mute, - { "Mute", "ts2.playerstatusflags.mute", - FT_BOOLEAN, 8, - NULL, TS2_STATUS_MUTE, - NULL, HFILL } - }, - { &hf_msg_fragments, - {"Message fragments", "ts2.fragments", - FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, - { &hf_msg_fragment, - {"Message fragment", "ts2.fragment", - FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, - { &hf_msg_fragment_overlap, - {"Message fragment overlap", "ts2.fragment.overlap", - FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } }, - { &hf_msg_fragment_overlap_conflicts, - {"Message fragment overlapping with conflicting data", - "ts2.fragment.overlap.conflicts", - FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } }, - { &hf_msg_fragment_multiple_tails, - {"Message has multiple tail fragments", - "ts2.fragment.multiple_tails", - FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } }, - { &hf_msg_fragment_too_long_fragment, - {"Message fragment too long", "ts2.fragment.too_long_fragment", - FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } }, - { &hf_msg_fragment_error, - {"Message defragmentation error", "ts2.fragment.error", - FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, - { &hf_msg_reassembled_in, - {"Reassembled in", "ts2.reassembled.in", - FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } } - }; - /* the GMemChunk base structure */ static GMemChunk *conv_vals = NULL; @@ -590,46 +315,6 @@ static void ts2_add_statusflags(tvbuff_t *tvb, proto_tree *ts2_tree, guint32 off static void ts2_parse_channelchange(tvbuff_t *tvb, proto_tree *ts2_tree); static void ts2_parse_loginpart2(tvbuff_t *tvb, proto_tree *ts2_tree); -static void ts2_init(void) { - fragment_table_init(&msg_fragment_table); - reassembled_table_init(&msg_reassembled_table); - if (conv_vals) - g_mem_chunk_destroy(conv_vals); - - /* now create memory chunks */ - conv_vals = g_mem_chunk_new("ts2_conv_vals", - sizeof(ts2_conversation), - my_init_count * sizeof(ts2_conversation), - G_ALLOC_AND_FREE); -} - -/* - * proto_register_ts2() - * */ -void proto_register_ts2(void) -{ - /* Setup protocol subtree array */ - proto_ts2 = proto_register_protocol ( - "Teamspeak2 Protocol", /* name */ - "TeamSpeak2", /* short name */ - "ts2" /* abbrev */ - ); - proto_register_field_array(proto_ts2, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - - register_init_routine(ts2_init); -} - -/* - * proto_reg_handoff_ts2() - * */ -void proto_reg_handoff_ts2(void) -{ - dissector_handle_t ts2_handle; - ts2_handle = create_dissector_handle(dissect_ts2, proto_ts2); - dissector_add("udp.port", TS2_PORT, ts2_handle); -} - /* * Check if a packet is in order and if it is set its fragmentation details into the passed pointers. * Returns TRUE if the packet is fragmented. @@ -1144,3 +829,343 @@ static gboolean ts2_add_checked_crc32(proto_tree *tree, int hf_item, tvbuff_t *t return FALSE; } } + +static void ts2_init(void) { + fragment_table_init(&msg_fragment_table); + reassembled_table_init(&msg_reassembled_table); + if (conv_vals) + g_mem_chunk_destroy(conv_vals); + + /* now create memory chunks */ + conv_vals = g_mem_chunk_new("ts2_conv_vals", + sizeof(ts2_conversation), + my_init_count * sizeof(ts2_conversation), + G_ALLOC_AND_FREE); +} + +/* + * proto_register_ts2() + * */ +void proto_register_ts2(void) +{ + static hf_register_info hf[] = { + { &hf_ts2_class, + { "Class", "ts2.class", + FT_UINT16, BASE_HEX, + VALS(classnames), 0x0, + NULL, HFILL } + }, + { &hf_ts2_type, + { "Type", "ts2.type", + FT_UINT16, BASE_HEX, + VALS(typenames), 0x0, + NULL, HFILL } + }, + { &hf_ts2_clientid, + { "Client id", "ts2.clientid", + FT_UINT32, BASE_DEC, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_sessionkey, + { "Session Key", "ts2.sessionkey", + FT_UINT32, BASE_HEX, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_ackto, + { "Ping Reply To", "ts2.ping_ackto", + FT_UINT32, BASE_DEC, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_crc32, + { "CRC32 Checksum", "ts2.crc32", + FT_UINT32, BASE_HEX, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_seqnum, + { "Sequence Number", "ts2.sequencenum", + FT_UINT32, BASE_DEC, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_protocol_string, + { "Protocol String", "ts2.protocolstring", + FT_UINT_STRING, BASE_NONE, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_string, + { "String", "ts2.string", + FT_STRING, BASE_NONE, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_registeredlogin, + { "Registered Login", "ts2.registeredlogin", + FT_BOOLEAN, BASE_NONE, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_name, + { "Name", "ts2.name", + FT_UINT_STRING, BASE_NONE, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_password, + { "Password", "ts2.password", + FT_UINT_STRING, BASE_NONE, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_nick, + { "Nick", "ts2.nick", + FT_UINT_STRING, BASE_NONE, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_badlogin, + { "Bad Login", "ts2.badlogin", + FT_BOOLEAN, BASE_NONE, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_unknown, + { "Unknown", "ts2.unknown", + FT_BYTES, BASE_HEX, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_channel, + { "Channel", "ts2.channel", + FT_UINT_STRING, BASE_NONE, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_subchannel, + { "Sub-Channel", "ts2.subchannel", + FT_UINT_STRING, BASE_NONE, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_channelpassword, + { "Channel Password", "ts2.channelpassword", + FT_UINT_STRING, BASE_NONE, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_emptyspace, + { "Empty Space", "ts2.emptyspace", + FT_NONE, BASE_NONE, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_fragmentnumber, + { "Fragment Number", "ts2.fragmentnumber", + FT_UINT16, BASE_DEC, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_platform_string, + { "Platform String", "ts2.platformstring", + FT_UINT_STRING, BASE_NONE, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_server_name, + { "Server Name", "ts2.servername", + FT_UINT_STRING, BASE_NONE, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_server_welcome_message, + { "Server Welcome Message", "ts2.serverwelcomemessage", + FT_UINT_STRING, BASE_NONE, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_endmarker, + { "End Marker", "ts2.endmarker", + FT_NONE, BASE_NONE, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_codec, + { "Codec", "ts2.codec", + FT_UINT16, BASE_HEX, + VALS(codecnames), 0x0, + NULL, HFILL } + }, + { &hf_ts2_channel_flags, + { "Channel Flags", "ts2.channelflags", + FT_BOOLEAN, BASE_NONE, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_channel_id, + { "Channel Id", "ts2.chanelid", + FT_UINT32, BASE_DEC, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_channel_name, + { "Channel Name", "ts2.chanelname", + FT_STRINGZ, BASE_NONE, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_channel_topic, + { "Channel Topic", "ts2.chaneltopic", + FT_STRINGZ, BASE_NONE, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_channel_description, + { "Channel Description", "ts2.chaneldescription", + FT_STRINGZ, BASE_NONE, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_player_id, + { "Player Id", "ts2.playerid", + FT_UINT32, BASE_DEC, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_player_status_flags, + { "Player Status Flags", "ts2.playerstatusflags", + FT_UINT16, BASE_DEC, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_number_of_players, + { "Number Of Players", "ts2.numberofplayers", + FT_UINT32, BASE_DEC, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_number_of_channels, + { "Number Of Channels", "ts2.numberofchannels", + FT_UINT32, BASE_DEC, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_resend_count, + { "Resend Count", "ts2.resendcount", + FT_UINT16, BASE_DEC, + NULL, 0x0, + NULL, HFILL } + }, + { &hf_ts2_status_channelcommander, + { "Channel Commander", "ts2.playerstatusflags.channelcommander", + FT_BOOLEAN, 8, + NULL, TS2_STATUS_CHANNELCOMMANDER, + NULL, HFILL } + }, + { &hf_ts2_status_blockwhispers, + { "Block Whispers", "ts2.playerstatusflags.blockwhispers", + FT_BOOLEAN, 8, + NULL, TS2_STATUS_BLOCKWHISPERS, + NULL, HFILL } + }, + { &hf_ts2_status_away, + { "Away", "ts2.playerstatusflags.away", + FT_BOOLEAN, 8, + NULL, TS2_STATUS_AWAY, + NULL, HFILL } + }, + { &hf_ts2_status_mutemicrophone, + { "Mute Microphone", "ts2.playerstatusflags.mutemicrophone", + FT_BOOLEAN, 8, + NULL, TS2_STATUS_MUTEMICROPHONE, + NULL, HFILL } + }, + { &hf_ts2_status_mute, + { "Mute", "ts2.playerstatusflags.mute", + FT_BOOLEAN, 8, + NULL, TS2_STATUS_MUTE, + NULL, HFILL } + }, + { &hf_msg_fragments, + {"Message fragments", "ts2.fragments", + FT_NONE, BASE_NONE, + NULL, 0x00, + NULL, HFILL } + }, + { &hf_msg_fragment, + {"Message fragment", "ts2.fragment", + FT_FRAMENUM, BASE_NONE, + NULL, 0x00, + NULL, HFILL } + }, + { &hf_msg_fragment_overlap, + {"Message fragment overlap", "ts2.fragment.overlap", + FT_BOOLEAN, BASE_NONE, + NULL, 0x00, + NULL, HFILL } + }, + { &hf_msg_fragment_overlap_conflicts, + {"Message fragment overlapping with conflicting data", + "ts2.fragment.overlap.conflicts", + FT_BOOLEAN, BASE_NONE, + NULL, 0x00, + NULL, HFILL } + }, + { &hf_msg_fragment_multiple_tails, + {"Message has multiple tail fragments", + "ts2.fragment.multiple_tails", + FT_BOOLEAN, BASE_NONE, + NULL, 0x00, + NULL, HFILL } + }, + { &hf_msg_fragment_too_long_fragment, + {"Message fragment too long", "ts2.fragment.too_long_fragment", + FT_BOOLEAN, BASE_NONE, + NULL, 0x00, + NULL, HFILL } + }, + { &hf_msg_fragment_error, + {"Message defragmentation error", "ts2.fragment.error", + FT_FRAMENUM, BASE_NONE, + NULL, 0x00, + NULL, HFILL } + }, + { &hf_msg_reassembled_in, + {"Reassembled in", "ts2.reassembled.in", + FT_FRAMENUM, BASE_NONE, + NULL, 0x00, + NULL, HFILL } + } + }; + + static gint *ett[] = { + &ett_ts2, + &ett_msg_fragment, + &ett_msg_fragments + }; + + /* Setup protocol subtree array */ + proto_ts2 = proto_register_protocol ( + "Teamspeak2 Protocol", /* name */ + "TeamSpeak2", /* short name */ + "ts2" /* abbrev */ + ); + proto_register_field_array(proto_ts2, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + + register_init_routine(ts2_init); +} + +/* + * proto_reg_handoff_ts2() + * */ +void proto_reg_handoff_ts2(void) +{ + dissector_handle_t ts2_handle; + ts2_handle = create_dissector_handle(dissect_ts2, proto_ts2); + dissector_add("udp.port", TS2_PORT, ts2_handle); +} + diff --git a/epan/dissectors/packet-vj.c b/epan/dissectors/packet-vj.c index 957829af62..a029aa426d 100644 --- a/epan/dissectors/packet-vj.c +++ b/epan/dissectors/packet-vj.c @@ -201,7 +201,6 @@ static int get_signed_delta(tvbuff_t *tvb, int *offsetp, int hf, proto_tree *tree); static guint16 ip_csum(const guint8 *ptr, guint32 len); static slcompress *slhc_init(void); -static void vj_init(void); static gint vjc_process(tvbuff_t *src_tvb, packet_info *pinfo, proto_tree *tree, slcompress *comp); static gint vjc_tvb_setup(tvbuff_t *src_tvb, tvbuff_t **dst_tvb, @@ -442,84 +441,6 @@ dissect_vjc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) call_dissector(ip_handle, next_tvb, pinfo, tree); } -/* Registration functions for dissectors */ -void -proto_register_vj(void) -{ - static hf_register_info hf[] = { - { &hf_vj_change_mask, - { "Change mask", "vj.change_mask", FT_UINT8, BASE_HEX, - NULL, 0x0, "", HFILL }}, - { &hf_vj_change_mask_c, - { "Connection changed", "vj.change_mask_c", FT_BOOLEAN, 8, - NULL, NEW_C, "Connection number changed", HFILL }}, - { &hf_vj_change_mask_i, - { "IP ID change != 1", "vj.change_mask_i", FT_BOOLEAN, 8, - NULL, NEW_I, "IP ID changed by a value other than 1", HFILL }}, - { &hf_vj_change_mask_p, - { "Push bit set", "vj.change_mask_p", FT_BOOLEAN, 8, - NULL, CHANGE_PUSH_BIT, "TCP PSH flag set", HFILL }}, - { &hf_vj_change_mask_s, - { "Sequence number changed", "vj.change_mask_s", FT_BOOLEAN, 8, - NULL, NEW_S, "Sequence number changed", HFILL }}, - { &hf_vj_change_mask_a, - { "Ack number changed", "vj.change_mask_a", FT_BOOLEAN, 8, - NULL, NEW_A, "Acknowledgement sequence number changed", HFILL }}, - { &hf_vj_change_mask_w, - { "Window changed", "vj.change_mask_w", FT_BOOLEAN, 8, - NULL, NEW_W, "TCP window changed", HFILL }}, - { &hf_vj_change_mask_u, - { "Urgent pointer set", "vj.change_mask_u", FT_BOOLEAN, 8, - NULL, NEW_U, "Urgent pointer set", HFILL }}, - { &hf_vj_connection_number, - { "Connection number", "vj.connection_number", FT_UINT8, BASE_DEC, - NULL, 0x0, "Connection number", HFILL }}, - { &hf_vj_tcp_cksum, - { "TCP checksum", "vj.tcp_cksum", FT_UINT16, BASE_HEX, - NULL, 0x0, "TCP checksum", HFILL }}, - { &hf_vj_urp, - { "Urgent pointer", "vj.urp", FT_UINT16, BASE_DEC, - NULL, 0x0, "Urgent pointer", HFILL }}, - { &hf_vj_win_delta, - { "Window delta", "vj.win_delta", FT_INT16, BASE_DEC, - NULL, 0x0, "Delta for window", HFILL }}, - { &hf_vj_ack_delta, - { "Ack delta", "vj.ack_delta", FT_UINT16, BASE_DEC, - NULL, 0x0, "Delta for acknowledgment sequence number", HFILL }}, - { &hf_vj_seq_delta, - { "Sequence delta", "vj.seq_delta", FT_UINT16, BASE_DEC, - NULL, 0x0, "Delta for sequence number", HFILL }}, - { &hf_vj_ip_id_delta, - { "IP ID delta", "vj.ip_id_delta", FT_UINT16, BASE_DEC, - NULL, 0x0, "Delta for IP ID", HFILL }}, - }; - static gint *ett[] = { - &ett_vj, - &ett_vj_changes, - }; - - proto_vj = proto_register_protocol("PPP VJ Compression", "PPP VJ", "vj"); - proto_register_field_array(proto_vj, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - register_init_routine(&vj_init); -} - -void -proto_reg_handoff_vj(void) -{ - dissector_handle_t vjc_handle; - dissector_handle_t vjuc_handle; - - vjc_handle = create_dissector_handle(dissect_vjc, proto_vj); - dissector_add("ppp.protocol", PPP_VJC_COMP, vjc_handle); - - vjuc_handle = create_dissector_handle(dissect_vjuc, proto_vj); - dissector_add("ppp.protocol", PPP_VJC_UNCOMP, vjuc_handle); - - ip_handle = find_dissector("ip"); - data_handle = find_dissector("data"); -} - /* Initialization function */ static void vj_init(void) @@ -887,3 +808,82 @@ ip_csum(const guint8 * ptr, guint32 len) cksum_vec[0].len = len; return in_cksum(&cksum_vec[0], 1); } + +/* Registration functions for dissectors */ +void +proto_register_vj(void) +{ + static hf_register_info hf[] = { + { &hf_vj_change_mask, + { "Change mask", "vj.change_mask", FT_UINT8, BASE_HEX, + NULL, 0x0, "", HFILL }}, + { &hf_vj_change_mask_c, + { "Connection changed", "vj.change_mask_c", FT_BOOLEAN, 8, + NULL, NEW_C, "Connection number changed", HFILL }}, + { &hf_vj_change_mask_i, + { "IP ID change != 1", "vj.change_mask_i", FT_BOOLEAN, 8, + NULL, NEW_I, "IP ID changed by a value other than 1", HFILL }}, + { &hf_vj_change_mask_p, + { "Push bit set", "vj.change_mask_p", FT_BOOLEAN, 8, + NULL, CHANGE_PUSH_BIT, "TCP PSH flag set", HFILL }}, + { &hf_vj_change_mask_s, + { "Sequence number changed", "vj.change_mask_s", FT_BOOLEAN, 8, + NULL, NEW_S, "Sequence number changed", HFILL }}, + { &hf_vj_change_mask_a, + { "Ack number changed", "vj.change_mask_a", FT_BOOLEAN, 8, + NULL, NEW_A, "Acknowledgement sequence number changed", HFILL }}, + { &hf_vj_change_mask_w, + { "Window changed", "vj.change_mask_w", FT_BOOLEAN, 8, + NULL, NEW_W, "TCP window changed", HFILL }}, + { &hf_vj_change_mask_u, + { "Urgent pointer set", "vj.change_mask_u", FT_BOOLEAN, 8, + NULL, NEW_U, "Urgent pointer set", HFILL }}, + { &hf_vj_connection_number, + { "Connection number", "vj.connection_number", FT_UINT8, BASE_DEC, + NULL, 0x0, "Connection number", HFILL }}, + { &hf_vj_tcp_cksum, + { "TCP checksum", "vj.tcp_cksum", FT_UINT16, BASE_HEX, + NULL, 0x0, "TCP checksum", HFILL }}, + { &hf_vj_urp, + { "Urgent pointer", "vj.urp", FT_UINT16, BASE_DEC, + NULL, 0x0, "Urgent pointer", HFILL }}, + { &hf_vj_win_delta, + { "Window delta", "vj.win_delta", FT_INT16, BASE_DEC, + NULL, 0x0, "Delta for window", HFILL }}, + { &hf_vj_ack_delta, + { "Ack delta", "vj.ack_delta", FT_UINT16, BASE_DEC, + NULL, 0x0, "Delta for acknowledgment sequence number", HFILL }}, + { &hf_vj_seq_delta, + { "Sequence delta", "vj.seq_delta", FT_UINT16, BASE_DEC, + NULL, 0x0, "Delta for sequence number", HFILL }}, + { &hf_vj_ip_id_delta, + { "IP ID delta", "vj.ip_id_delta", FT_UINT16, BASE_DEC, + NULL, 0x0, "Delta for IP ID", HFILL }}, + }; + static gint *ett[] = { + &ett_vj, + &ett_vj_changes, + }; + + proto_vj = proto_register_protocol("PPP VJ Compression", "PPP VJ", "vj"); + proto_register_field_array(proto_vj, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + register_init_routine(&vj_init); +} + +void +proto_reg_handoff_vj(void) +{ + dissector_handle_t vjc_handle; + dissector_handle_t vjuc_handle; + + vjc_handle = create_dissector_handle(dissect_vjc, proto_vj); + dissector_add("ppp.protocol", PPP_VJC_COMP, vjc_handle); + + vjuc_handle = create_dissector_handle(dissect_vjuc, proto_vj); + dissector_add("ppp.protocol", PPP_VJC_UNCOMP, vjuc_handle); + + ip_handle = find_dissector("ip"); + data_handle = find_dissector("data"); +} + diff --git a/epan/dissectors/packet-zrtp.c b/epan/dissectors/packet-zrtp.c index 9cf3f863b8..79e108d330 100644 --- a/epan/dissectors/packet-zrtp.c +++ b/epan/dissectors/packet-zrtp.c @@ -1078,13 +1078,8 @@ proto_register_zrtp(void) void proto_reg_handoff_zrtp(void) { - static gboolean inited = FALSE; + dissector_handle_t zrtp_handle; - if (!inited){ - dissector_handle_t zrtp_handle; - - zrtp_handle = create_dissector_handle(dissect_zrtp, proto_zrtp); - dissector_add_handle("udp.port", zrtp_handle); - inited = TRUE; - } + zrtp_handle = find_dissector("zrtp"); + dissector_add_handle("udp.port", zrtp_handle); } |