diff options
author | wmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-02-07 18:49:29 +0000 |
---|---|---|
committer | wmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-02-07 18:49:29 +0000 |
commit | 0ca525fdc2da7f2044e52c5353c15685b16b860e (patch) | |
tree | e8dc9e8b9d2010e6afedd90ff5a865d1278e9362 | |
parent | 3edfd5a620f2f04ffd196cc8e5e37defb4662055 (diff) |
Remove unneeded #includes (stdio.h,stdlib.h);
Whitespace cleanup: trailing, indentation, "4-space tabs"
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35850 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r-- | epan/dissectors/packet-bssap.c | 248 | ||||
-rw-r--r-- | epan/dissectors/packet-dpnss.c | 2825 | ||||
-rw-r--r-- | epan/dissectors/packet-eigrp.c | 1458 | ||||
-rw-r--r-- | epan/dissectors/packet-erf.c | 326 | ||||
-rw-r--r-- | epan/dissectors/packet-icep.c | 857 | ||||
-rw-r--r-- | epan/dissectors/packet-icmpv6.c | 3318 | ||||
-rw-r--r-- | epan/dissectors/packet-kink.c | 182 | ||||
-rw-r--r-- | epan/dissectors/packet-nsip.c | 472 | ||||
-rw-r--r-- | epan/dissectors/packet-pw-atm.c | 160 | ||||
-rw-r--r-- | epan/dissectors/packet-rtps.c | 1365 | ||||
-rw-r--r-- | epan/dissectors/packet-sbus.c | 2162 | ||||
-rw-r--r-- | epan/dissectors/packet-sigcomp.c | 4649 | ||||
-rw-r--r-- | epan/dissectors/packet-sndcp.c | 474 | ||||
-rw-r--r-- | epan/dissectors/packet-sqloracle.h | 374 | ||||
-rw-r--r-- | epan/dissectors/packet-xtp.c | 214 |
15 files changed, 9551 insertions, 9533 deletions
diff --git a/epan/dissectors/packet-bssap.c b/epan/dissectors/packet-bssap.c index 96698a02cf..1a730f6670 100644 --- a/epan/dissectors/packet-bssap.c +++ b/epan/dissectors/packet-bssap.c @@ -35,7 +35,6 @@ # include "config.h" #endif -#include <stdlib.h> #include <glib.h> #ifdef HAVE_SYS_TYPES_H @@ -215,39 +214,39 @@ static const value_string bssap_plus_message_type_values[] = { -static const value_string bssap_plus_ie_id_values[] = { +static const value_string bssap_plus_ie_id_values[] = { { BSSAP_IMSI, "IMSI" }, /* 18.4.10 */ - { BSSAP_VLR_NUMBER, "VLR number" }, /* 18.4.26 */ + { BSSAP_VLR_NUMBER, "VLR number" }, /* 18.4.26 */ { BSSAP_TMSI, "TMSI" }, /* 18.4.23 */ - { BSSAP_LOC_AREA_ID, "Location area identifier" }, /* 18.4.14 */ - { BSSAP_CHANNEL_NEEDED, "Channel Needed" }, /* 18.4.2 */ - { BSSAP_EMLPP_PRIORITY, "eMLPP Priority" }, /* 18.4.4 */ - { BSSAP_TMSI_STATUS, "TMSI status" }, /* 18.4.24 */ - { BSSAP_GS_CAUSE, "Gs cause" }, /* 18.4.7 */ - { BSSAP_SGSN_NUMBER, "SGSN number" }, /* 18.4.22 */ - { BSSAP_GPRS_LOC_UPD_TYPE, "GPRS location update type" }, /* 18.4.6 */ - { BSSAP_GLOBAL_CN_ID, "Global CN-Id" }, /* 18.4.27 */ - { 0x0c, "Unassigned: treated as an unknown IEI." }, /* 18 and 16 */ - { BSSAP_MOBILE_STN_CLS_MRK1, "Mobile station classmark 1" }, /* 18.4.18 */ - { BSSAP_MOBILE_ID, "Mobile identity" }, /* 18.4.17 */ - { BSSAP_REJECT_CAUSE, "Reject cause" }, /* 18.4.21 */ - { BSSAP_IMSI_DET_FROM_GPRS_SERV_TYPE, "IMSI detach from GPRS service type" }, /* 18.4.11 */ - { BSSAP_IMSI_DET_FROM_NON_GPRS_SERV_TYPE, "IMSI detach from non-GPRS service type" }, /* 18.4.12 */ + { BSSAP_LOC_AREA_ID, "Location area identifier" }, /* 18.4.14 */ + { BSSAP_CHANNEL_NEEDED, "Channel Needed" }, /* 18.4.2 */ + { BSSAP_EMLPP_PRIORITY, "eMLPP Priority" }, /* 18.4.4 */ + { BSSAP_TMSI_STATUS, "TMSI status" }, /* 18.4.24 */ + { BSSAP_GS_CAUSE, "Gs cause" }, /* 18.4.7 */ + { BSSAP_SGSN_NUMBER, "SGSN number" }, /* 18.4.22 */ + { BSSAP_GPRS_LOC_UPD_TYPE, "GPRS location update type" }, /* 18.4.6 */ + { BSSAP_GLOBAL_CN_ID, "Global CN-Id" }, /* 18.4.27 */ + { 0x0c, "Unassigned: treated as an unknown IEI." }, /* 18 and 16 */ + { BSSAP_MOBILE_STN_CLS_MRK1, "Mobile station classmark 1" }, /* 18.4.18 */ + { BSSAP_MOBILE_ID, "Mobile identity" }, /* 18.4.17 */ + { BSSAP_REJECT_CAUSE, "Reject cause" }, /* 18.4.21 */ + { BSSAP_IMSI_DET_FROM_GPRS_SERV_TYPE, "IMSI detach from GPRS service type" }, /* 18.4.11 */ + { BSSAP_IMSI_DET_FROM_NON_GPRS_SERV_TYPE, "IMSI detach from non-GPRS service type" }, /* 18.4.12 */ { BSSAP_INFO_REQ, "Information requested" }, /* 18.4.13 */ { BSSAP_PTMSI, "PTMSI" }, /* 18.4.20 */ { BSSAP_IMEI, "IMEI" }, /* 18.4.8 */ { BSSAP_IMEISV, "IMEISV" }, /* 18.4.9 */ - { 0x16, "Unassigned: treated as an unknown IEI." }, /* 18 and 16 */ - { BSSAP_MM_INFORMATION, "MM information" }, /* 18.4.16 */ - { BSSAP_CELL_GBL_ID, "Cell Global Identity" }, /* 18.4.1 */ - { BSSAP_LOC_INF_AGE, "Location information age" }, /* 18.4.15 */ - { BSSAP_MOBILE_STN_STATE, "Mobile station state" }, /* 18.4.19 */ - { BSSAP_ERRONEOUS_MSG, "Erroneous message" }, /* 18.4.5 */ - { BSSAP_DLINK_TNL_PLD_CTR_AND_INF, "Downlink Tunnel Payload Control and Info" }, /* 18.4.3 */ - { BSSAP_ULINK_TNL_PLD_CTR_AND_INF, "Uplink Tunnel Payload Control and Info" }, /* 18.4.25 */ - { BSSAP_SERVICE_AREA_ID, "Service Area Identification" }, /* 18.4.21b */ - { 0, NULL } -}; + { 0x16, "Unassigned: treated as an unknown IEI." }, /* 18 and 16 */ + { BSSAP_MM_INFORMATION, "MM information" }, /* 18.4.16 */ + { BSSAP_CELL_GBL_ID, "Cell Global Identity" }, /* 18.4.1 */ + { BSSAP_LOC_INF_AGE, "Location information age" }, /* 18.4.15 */ + { BSSAP_MOBILE_STN_STATE, "Mobile station state" }, /* 18.4.19 */ + { BSSAP_ERRONEOUS_MSG, "Erroneous message" }, /* 18.4.5 */ + { BSSAP_DLINK_TNL_PLD_CTR_AND_INF, "Downlink Tunnel Payload Control and Info" }, /* 18.4.3 */ + { BSSAP_ULINK_TNL_PLD_CTR_AND_INF, "Uplink Tunnel Payload Control and Info" }, /* 18.4.25 */ + { BSSAP_SERVICE_AREA_ID, "Service Area Identification" }, /* 18.4.21b */ + { 0, NULL } +}; /* Initialize the protocol and registered fields */ static int proto_bssap = -1; @@ -286,7 +285,7 @@ static int hf_bssap_global_cn_id_ie = -1; static int hf_bssap_plus_ie_data = -1; static int hf_bssap_extension = -1; -static int hf_bssap_type_of_number = -1; +static int hf_bssap_type_of_number = -1; static int hf_bssap_numbering_plan_id = -1; static int hf_bssap_sgsn_number = -1; static int hf_bssap_vlr_number = -1; @@ -608,7 +607,7 @@ dissect_bssap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_set_str(pinfo->cinfo, COL_PROTOCOL, ((bssap_or_bsap_global == BSSAP) ? "BSSAP" : "BSAP")); } - if ( pinfo->sccp_info && pinfo->sccp_info->data.co.assoc ) + if ( pinfo->sccp_info && pinfo->sccp_info->data.co.assoc ) pinfo->sccp_info->data.co.assoc->payload = SCCP_PLOAD_BSSAP; /* @@ -625,7 +624,7 @@ dissect_bssap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } -/* +/* * BSSAP+ Routines */ @@ -644,7 +643,7 @@ static dgt_set_t Dgt1_9_bcd = { '0','1','2','3','4','5','6','7','8','9','?','?','?','?','?' } }; -/* Assumes the rest of the tvb contains the digits to be turned into a string +/* Assumes the rest of the tvb contains the digits to be turned into a string */ static const char* unpack_digits(tvbuff_t *tvb, int offset,dgt_set_t *dgt,gboolean skip_first){ @@ -663,7 +662,7 @@ unpack_digits(tvbuff_t *tvb, int offset,dgt_set_t *dgt,gboolean skip_first){ octet = tvb_get_guint8(tvb,offset); if (!skip_first){ - digit_str[i] = dgt->out[octet & 0x0f]; + digit_str[i] = dgt->out[octet & 0x0f]; i++; } skip_first = FALSE; @@ -676,7 +675,7 @@ unpack_digits(tvbuff_t *tvb, int offset,dgt_set_t *dgt,gboolean skip_first){ if (octet == 0x0f) /* odd number bytes - hit filler */ break; - digit_str[i] = dgt->out[octet & 0x0f]; + digit_str[i] = dgt->out[octet & 0x0f]; i++; offset++; @@ -693,7 +692,8 @@ check_ie(tvbuff_t *tvb, proto_tree *tree, int *offset, guint8 expected_ie){ ie_type = tvb_get_guint8(tvb,*offset); if (ie_type != expected_ie){ proto_tree_add_text(tree, tvb, *offset, 1, "Mandatory IE %s expected but IE %s Found", - val_to_str(expected_ie,bssap_plus_ie_id_values,"Unknown %u"), val_to_str(ie_type,bssap_plus_ie_id_values,"Unknown %u")); + val_to_str(expected_ie,bssap_plus_ie_id_values,"Unknown %u"), + val_to_str(ie_type,bssap_plus_ie_id_values,"Unknown %u")); (*offset)++; ie_len = tvb_get_guint8(tvb,*offset); *offset = *offset + ie_len; @@ -725,7 +725,7 @@ dissect_bssap_cell_global_id(tvbuff_t *tvb, proto_tree *tree, int offset) proto_item *cgi_item = NULL; proto_tree *cgi_tree = NULL; guint8 ie_len; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_cell_global_id_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_cell_global_id); @@ -764,7 +764,7 @@ dissect_bssap_channel_needed(tvbuff_t *tvb, proto_tree *tree, int offset) proto_item *item = NULL; proto_tree *ie_tree = NULL; guint8 ie_len; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_channel_needed_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_channel_needed); @@ -793,7 +793,7 @@ dissect_bssap_dlink_tunnel_payload_control_and_info(tvbuff_t *tvb, packet_info * guint8 ie_len; guint8 octet; guint8 prot_disc; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_dlink_tnl_pld_cntrl_amd_inf_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_dlink_tnl_pld_cntrl_amd_inf); @@ -817,7 +817,7 @@ dissect_bssap_dlink_tunnel_payload_control_and_info(tvbuff_t *tvb, packet_info * */ proto_tree_add_item(ie_tree, hf_bssap_e_bit, tvb, offset, 1, FALSE); - /* octet 3 bit 2 - 1 + /* octet 3 bit 2 - 1 * Tunnel Priority: Indicates the priority of the Tunnel Payload. For coding, see Table 20.1: Association * between Tunnel Priority and LLC SAPs. */ @@ -837,16 +837,16 @@ dissect_bssap_dlink_tunnel_payload_control_and_info(tvbuff_t *tvb, packet_info * /* 18.4.4 eMLPP Priority */ /* Call priority */ -static const value_string bssap_call_priority_values[] = { +static const value_string bssap_call_priority_values[] = { { 0x00, "No priority applied" }, - { 0x01, "Call priority level 4" }, - { 0x02, "Call priority level 3" }, - { 0x03, "Call priority level 2" }, - { 0x04, "Call priority level 1" }, - { 0x05, "Call priority level 0" }, - { 0x06, "Call priority level B" }, - { 0x07, "Call priority level A" }, - { 0, NULL } + { 0x01, "Call priority level 4" }, + { 0x02, "Call priority level 3" }, + { 0x03, "Call priority level 2" }, + { 0x04, "Call priority level 1" }, + { 0x05, "Call priority level 0" }, + { 0x06, "Call priority level B" }, + { 0x07, "Call priority level A" }, + { 0, NULL } }; static int dissect_bssap_emlpp_priority(tvbuff_t *tvb, proto_tree *tree, int offset) @@ -854,7 +854,7 @@ dissect_bssap_emlpp_priority(tvbuff_t *tvb, proto_tree *tree, int offset) proto_item *item = NULL; proto_tree *ie_tree = NULL; guint8 ie_len; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_emlpp_prio_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_emlpp_prio); @@ -867,7 +867,7 @@ dissect_bssap_emlpp_priority(tvbuff_t *tvb, proto_tree *tree, int offset) the eMLPP-Priority IE defined in 3GPP TS 48.008 (not including 3GPP TS 48.008 IEI and 3GPP TS 48.008 length indicator). 3.2.2.56 eMLPP Priority - The call priority field (bit 3 to 1 of octet 2) is coded in the same way + The call priority field (bit 3 to 1 of octet 2) is coded in the same way as the call priority field (bit 3 to 1 of octet 5) in the Descriptive group or broadcast call reference information element as defined in 3GPP TS 24.008. */ @@ -885,7 +885,7 @@ dissect_bssap_gprs_erroneous_msg(tvbuff_t *tvb, proto_tree *tree, int offset) proto_item *item = NULL; proto_tree *ie_tree = NULL; guint8 ie_len; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_gprs_erroneous_msg_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_erroneous_msg); @@ -903,12 +903,12 @@ dissect_bssap_gprs_erroneous_msg(tvbuff_t *tvb, proto_tree *tree, int offset) } -static const value_string bssap_plus_GPRS_loc_upd_type_values[] = { +static const value_string bssap_plus_GPRS_loc_upd_type_values[] = { { 0x00, "Shall not be sent in this version of the protocol. If received, shall be treated as '00000010'." }, - { 0x01, "IMSI attach" }, - { 0x02, "Normal location update" }, - { 0, NULL } -}; + { 0x01, "IMSI attach" }, + { 0x02, "Normal location update" }, + { 0, NULL } +}; /* 18.4.6 GPRS location update type */ static int dissect_bssap_gprs_location_update_type(tvbuff_t *tvb, proto_tree *tree, int offset) @@ -916,7 +916,7 @@ dissect_bssap_gprs_location_update_type(tvbuff_t *tvb, proto_tree *tree, int off proto_item *item = NULL; proto_tree *ie_tree = NULL; guint8 ie_len; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_gprs_loc_upd_type_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_gprs_loc_upd); @@ -925,15 +925,15 @@ dissect_bssap_gprs_location_update_type(tvbuff_t *tvb, proto_tree *tree, int off offset++; proto_tree_add_item(ie_tree, hf_bssap_plus_ie_len, tvb, offset, 1, FALSE); offset++; - + /* GPRS location update type value (octet 3) */ proto_tree_add_item(ie_tree, hf_bssap_gprs_loc_upd_type, tvb, offset, ie_len, FALSE); - + return offset + ie_len; } /* Gs Cause value (octet 3) */ -static const value_string bssap_Gs_cause_values[] = { +static const value_string bssap_Gs_cause_values[] = { { 0x00, "Normal, unspecified in this version of the protocol." }, { 0x01, "IMSI detached for GPRS services" }, @@ -951,8 +951,8 @@ static const value_string bssap_Gs_cause_values[] = { { 0x0d, "Address error" }, { 0x0e, "TOM functionality not supported" }, { 0x0f, "Ciphering request cannot be accommodated" }, - { 0, NULL } -}; + { 0, NULL } +}; /* 18.4.7 Gs cause */ static int @@ -961,7 +961,7 @@ dissect_bssap_Gs_cause(tvbuff_t *tvb, proto_tree *tree, int offset) proto_item *item = NULL; proto_tree *ie_tree = NULL; guint8 ie_len; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_Gs_cause_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bassp_Gs_cause); @@ -1014,7 +1014,7 @@ dissect_bssap_imesiv(tvbuff_t *tvb, proto_tree *tree, int offset) guint8 ie_len; tvbuff_t *ie_tvb; const char *digit_str; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_imesiv_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bassp_imesiv); @@ -1033,8 +1033,8 @@ dissect_bssap_imesiv(tvbuff_t *tvb, proto_tree *tree, int offset) return offset + ie_len; } -/* 18.4.10 IMSI - * The IMSI is coded as a sequence of BCD digits, compressed two into each octet. +/* 18.4.10 IMSI + * The IMSI is coded as a sequence of BCD digits, compressed two into each octet. * This is a variable length element, and includes a length indicator. * The IMSI is defined in 3GPP TS 23.003. It shall not exceed 15 digits (see 3GPP TS 23.003). */ @@ -1048,7 +1048,7 @@ dissect_bssap_imsi(tvbuff_t *tvb, proto_tree *tree, int offset) guint8 ie_len; tvbuff_t *ie_tvb; const char *digit_str; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_imsi_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_imsi); @@ -1060,17 +1060,17 @@ dissect_bssap_imsi(tvbuff_t *tvb, proto_tree *tree, int offset) ie_tvb = tvb_new_subset(tvb, offset, ie_len,ie_len); digit_str = unpack_digits(ie_tvb, 0, &Dgt1_9_bcd, TRUE); proto_tree_add_string(ie_tree, hf_bssap_imsi, ie_tvb, 0, -1, digit_str); - + return offset + ie_len; } -static const value_string bssap_imsi_det_from_gprs_serv_type_values[] _U_ = { +static const value_string bssap_imsi_det_from_gprs_serv_type_values[] _U_ = { { 0x00, "Interpreted as reserved in this version of the protocol" }, - { 0x01, "Network initiated IMSI detach from GPRS service" }, + { 0x01, "Network initiated IMSI detach from GPRS service" }, { 0x02, "MS initiated IMSI detach from GPRS service" }, { 0x03, "GPRS services not allowed" }, - { 0, NULL } -}; + { 0, NULL } +}; /* 18.4.11 IMSI detach from GPRS service type */ static int @@ -1079,7 +1079,7 @@ dissect_bssap_imsi_det_from_gprs_serv_type(tvbuff_t *tvb, proto_tree *tree, int proto_item *item = NULL; proto_tree *ie_tree = NULL; guint8 ie_len; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_imsi_det_from_gprs_serv_type_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_imsi_det_from_gprs_serv_type); @@ -1102,7 +1102,7 @@ dissect_bssap_imsi_det_from_non_gprs_serv_type(tvbuff_t *tvb, proto_tree *tree, proto_item *item = NULL; proto_tree *ie_tree = NULL; guint8 ie_len; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_imsi_det_from_non_gprs_serv_type_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_imsi_det_from_non_gprs_serv_type); @@ -1117,9 +1117,9 @@ dissect_bssap_imsi_det_from_non_gprs_serv_type(tvbuff_t *tvb, proto_tree *tree, return offset + ie_len; } -static const value_string bssap_info_req_values[] = { +static const value_string bssap_info_req_values[] = { { 0x00, "Interpreted as Not supported in this version of the protocol." }, - { 0x01, "PTMSI" }, + { 0x01, "PTMSI" }, { 0x02, "IMEI" }, { 0x03, "IMEISV" }, { 0x04, "PTMSI and IMEI" }, @@ -1128,8 +1128,8 @@ static const value_string bssap_info_req_values[] = { { 0x07, "PTMSI, IMEI, and IMEISV" }, { 0x08, "Mobile location information" }, { 0x09, "TMSI" }, - { 0, NULL } -}; + { 0, NULL } +}; /* 18.4.13 Information requested */ static int dissect_bssap_info_req(tvbuff_t *tvb, proto_tree *tree, int offset) @@ -1137,7 +1137,7 @@ dissect_bssap_info_req(tvbuff_t *tvb, proto_tree *tree, int offset) proto_item *item = NULL; proto_tree *ie_tree = NULL; guint8 ie_len; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_info_req_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_info_req); @@ -1160,7 +1160,7 @@ dissect_bssap_loc_area_id(tvbuff_t *tvb, proto_tree *tree, int offset) proto_item *item = NULL; proto_tree *ie_tree = NULL; guint8 ie_len; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_loc_area_id_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_loc_area_id); @@ -1186,7 +1186,7 @@ dissect_bssap_location_information_age(tvbuff_t *tvb, proto_tree *tree, int offs proto_item *item = NULL; proto_tree *ie_tree = NULL; guint8 ie_len; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_loc_inf_age_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_loc_inf_age); @@ -1219,7 +1219,7 @@ dissect_bssap_MM_information(tvbuff_t *tvb, proto_tree *tree, int offset) proto_item *item = NULL; proto_tree *ie_tree = NULL; guint8 ie_len; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_mm_information_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_mm_information); @@ -1235,7 +1235,7 @@ dissect_bssap_MM_information(tvbuff_t *tvb, proto_tree *tree, int offset) * indicatior of the other information elements. */ dtap_mm_mm_info(tvb, ie_tree, offset, ie_len); - + return offset + ie_len; @@ -1247,7 +1247,7 @@ dissect_bssap_mobile_id(tvbuff_t *tvb, proto_tree *tree, int offset) proto_item *item = NULL; proto_tree *ie_tree = NULL; guint ie_len; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_mobile_id_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_mobile_id); @@ -1273,7 +1273,7 @@ dissect_bssap_mobile_stn_cls_mrk1(tvbuff_t *tvb, proto_tree *tree, int offset) proto_item *item = NULL; proto_tree *ie_tree = NULL; guint8 ie_len; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_mobile_stn_cls_mrk1_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_mobile_stn_cls_mrk1); @@ -1292,9 +1292,9 @@ dissect_bssap_mobile_stn_cls_mrk1(tvbuff_t *tvb, proto_tree *tree, int offset) } /* 18.4.19 Mobile station state */ -static const value_string bssap_mobile_station_state_values[] = { +static const value_string bssap_mobile_station_state_values[] = { { 0x00, "IDLE or PMM-DETACHED" }, - { 0x01, "STANDBY or PMM-IDLE, 0 PDP contexts active" }, + { 0x01, "STANDBY or PMM-IDLE, 0 PDP contexts active" }, { 0x02, "STANDBY or PMM-IDLE, 1 or more PDP contexts active" }, { 0x03, "SUSPENDED, 0 PDP contexts active" }, { 0x04, "SUSPENDED, 1 or more PDP contexts active" }, @@ -1302,7 +1302,7 @@ static const value_string bssap_mobile_station_state_values[] = { { 0x06, "READY or PMM-CONNECTED, 1 or more PDP contexts active" }, { 0x07, "IMSI unknown" }, { 0x08, "Information requested not supported" }, - { 0, NULL } + { 0, NULL } }; static int dissect_bssap_mobile_station_state(tvbuff_t *tvb, proto_tree *tree, int offset) @@ -1310,7 +1310,7 @@ dissect_bssap_mobile_station_state(tvbuff_t *tvb, proto_tree *tree, int offset) proto_item *item = NULL; proto_tree *ie_tree = NULL; guint8 ie_len; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_mobile_station_state_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_mobile_station_state); @@ -1332,7 +1332,7 @@ dissect_bssap_ptmsi(tvbuff_t *tvb, proto_tree *tree, int offset) proto_item *item = NULL; proto_tree *ie_tree = NULL; guint8 ie_len; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_ptmsi_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_ptmsi); @@ -1356,7 +1356,7 @@ dissect_bssap_reject_cause(tvbuff_t *tvb, proto_tree *tree, int offset) proto_item *item = NULL; proto_tree *ie_tree = NULL; guint8 ie_len; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_reject_cause_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_reject_cause); @@ -1382,7 +1382,7 @@ dissect_bssap_service_area_id(tvbuff_t *tvb, proto_tree *tree, int offset) proto_item *item = NULL; proto_tree *ie_tree = NULL; guint8 ie_len; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_service_area_id_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_service_area_id); @@ -1416,7 +1416,7 @@ dissect_bssap_sgsn_number(tvbuff_t *tvb, proto_tree *tree, int offset) guint8 ie_len; tvbuff_t *number_tvb; const char *digit_str; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_sgsn_nr_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_sgsn_nr); @@ -1425,10 +1425,10 @@ dissect_bssap_sgsn_number(tvbuff_t *tvb, proto_tree *tree, int offset) offset++; proto_tree_add_item(ie_tree, hf_bssap_plus_ie_len, tvb, offset, 1, FALSE); offset++; - /* The SGSN number is coded as a sequence of TBCD digits (as specified in 3GPP TS 29.002), + /* The SGSN number is coded as a sequence of TBCD digits (as specified in 3GPP TS 29.002), * compressed two into each octet. The Number is in international E.164 format as indicated by Octet 3 - * which coding is specified in 3GPP TS 29.002. This is a variable length information element, - * and includes a length indicator. The value part of the SGSN number information element + * which coding is specified in 3GPP TS 29.002. This is a variable length information element, + * and includes a length indicator. The value part of the SGSN number information element * (not including IEI, Length indicator and Octet 3) shall not exceed 15 digits. */ proto_tree_add_item(ie_tree, hf_bssap_extension, tvb, offset, 1, FALSE); @@ -1450,7 +1450,7 @@ dissect_bssap_tmsi(tvbuff_t *tvb, proto_tree *tree, int offset) proto_item *item = NULL; proto_tree *ie_tree = NULL; guint8 ie_len; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_tmsi_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_tmsi); @@ -1459,7 +1459,7 @@ dissect_bssap_tmsi(tvbuff_t *tvb, proto_tree *tree, int offset) offset++; proto_tree_add_item(ie_tree, hf_bssap_plus_ie_len, tvb, offset, 1, FALSE); offset++; - /* The TMSI consists of 4 octets. It can be coded using a full hexadecimal representation + /* The TMSI consists of 4 octets. It can be coded using a full hexadecimal representation * (see 3GPP TS 23.003). */ proto_tree_add_item(ie_tree, hf_bssap_tmsi, tvb, offset, ie_len, FALSE); @@ -1480,7 +1480,7 @@ dissect_bssap_tmsi_status(tvbuff_t *tvb, proto_tree *tree, int offset) proto_item *item = NULL; proto_tree *ie_tree = NULL; guint8 ie_len; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_tmsi_status_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_tmsi_status); @@ -1502,12 +1502,12 @@ static const true_false_string bssap_E_flag = { "SGSN did not receive the payload in ciphered form" }; /* 3GPP TS 44.064 B.1.1 TOM Protocol Discriminator */ -static const value_string bssap_tom_prot_disc_values[] = { +static const value_string bssap_tom_prot_disc_values[] = { { 0x00, "Not specified" }, - { 0x01, "TIA/EIA-136" }, + { 0x01, "TIA/EIA-136" }, { 0x02, "RRLP" }, { 0x03, "Reserved for extension" }, - { 0, NULL } + { 0, NULL } }; static int dissect_bssap_ulink_tunnel_payload_control_and_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) @@ -1518,7 +1518,7 @@ dissect_bssap_ulink_tunnel_payload_control_and_info(tvbuff_t *tvb, packet_info * guint8 ie_len; guint8 octet; guint8 prot_disc; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_ulink_tnl_pld_cntrl_amd_inf_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_ulink_tnl_pld_cntrl_amd_inf); @@ -1528,7 +1528,7 @@ dissect_bssap_ulink_tunnel_payload_control_and_info(tvbuff_t *tvb, packet_info * proto_tree_add_item(ie_tree, hf_bssap_plus_ie_len, tvb, offset, 1, FALSE); offset++; /* octet 3 bit 8 Spare */ - /* octet 3 bit 7 - 4 + /* octet 3 bit 7 - 4 * TOM Protocol Discriminator: Identifies the protocol using tunnelling of non-GSM signalling. * For coding, see 3GPP TS 44.064. */ @@ -1541,7 +1541,7 @@ dissect_bssap_ulink_tunnel_payload_control_and_info(tvbuff_t *tvb, packet_info * */ proto_tree_add_item(ie_tree, hf_bssap_e_bit, tvb, offset, 1, FALSE); - /* octet 3 bit 2 - 1 + /* octet 3 bit 2 - 1 * Tunnel Priority: Indicates the priority of the Tunnel Payload. For coding, see Table 20.1: Association * between Tunnel Priority and LLC SAPs. */ @@ -1567,7 +1567,7 @@ dissect_bssap_vlr_number(tvbuff_t *tvb, proto_tree *tree, int offset) guint8 ie_len; tvbuff_t *number_tvb; const char *digit_str; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_vlr_number_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_vlr_number); @@ -1576,7 +1576,7 @@ dissect_bssap_vlr_number(tvbuff_t *tvb, proto_tree *tree, int offset) offset++; proto_tree_add_item(ie_tree, hf_bssap_plus_ie_len, tvb, offset, 1, FALSE); offset++; - /* The VLR number is coded as a sequence of TBCD digits (as specified in 3GPP TS 29.002), + /* The VLR number is coded as a sequence of TBCD digits (as specified in 3GPP TS 29.002), * compressed two into each octet. The Number is in international E.164 format as indicated by Octet 3 * which coding is specified in 3GPP TS 29.002. This is a variable length information element, * and includes a length indicator. The value part of the VLR number information element @@ -1605,7 +1605,7 @@ dissect_bssap_global_cn_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *global_cn_id_item = NULL; proto_tree *global_cn_id_tree = NULL; guint8 ie_len; - + ie_len = tvb_get_guint8(tvb,offset+1); item = proto_tree_add_item(tree, hf_bssap_global_cn_id_ie, tvb, offset, ie_len+2, FALSE); ie_tree = proto_item_add_subtree(item, ett_bssap_global_cn); @@ -1614,7 +1614,7 @@ dissect_bssap_global_cn_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, offset++; proto_tree_add_item(ie_tree, hf_bssap_plus_ie_len, tvb, offset, 1, FALSE); offset++; - /* The Global CN-Id consists of a PLMN-Id and a CN-Id, see 3GPP TS 23.003. + /* The Global CN-Id consists of a PLMN-Id and a CN-Id, see 3GPP TS 23.003. * The PLMN-Id consists of MCC and MNC coded according to Location Area Identification * in 3GPP TS 24.008. The CN-Id is an integer defined by O&M. * The least significant bit of the CN-Id field is bit 1 of octet 7 and @@ -1650,14 +1650,14 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr * Make entry in the Protocol column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "BSSAP+"); - + if (pinfo->sccp_info && pinfo->sccp_info->data.co.assoc) pinfo->sccp_info->data.co.assoc->payload = SCCP_PLOAD_BSSAP; - + /* create the BSSAP+ protocol tree */ bssap_item = proto_tree_add_item(tree, proto_bssap, tvb, 0, -1, FALSE); bssap_tree = proto_item_add_subtree(bssap_item, ett_bssap); - + message_type = tvb_get_guint8(tvb,offset); proto_tree_add_item(bssap_tree, hf_bssap_plus_message_type, tvb, offset, 1,FALSE); offset++; @@ -1672,10 +1672,10 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr if ( check_ie(tvb, tree, &offset, BSSAP_IMSI)) offset = dissect_bssap_imsi(tvb, bssap_tree, offset); - /* VLR number VLR number 18.4.26 M TLV 5-11 */ + /* VLR number VLR number 18.4.26 M TLV 5-11 */ if ( check_ie(tvb, tree, &offset, BSSAP_VLR_NUMBER)) offset = dissect_bssap_vlr_number(tvb, bssap_tree, offset); - + /* End of mandatory elements */ if (tvb_length_remaining(tvb,offset) == 0) return; @@ -1733,7 +1733,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr if ( check_ie(tvb, tree, &offset, BSSAP_VLR_NUMBER)) offset = dissect_bssap_vlr_number(tvb, bssap_tree, offset); - /* Downlink Tunnel Payload Control and Info 18.4.3 M TLV 3-223 */ + /* Downlink Tunnel Payload Control and Info 18.4.3 M TLV 3-223 */ if ( check_ie(tvb, tree, &offset, BSSAP_DLINK_TNL_PLD_CTR_AND_INF)) offset = dissect_bssap_dlink_tunnel_payload_control_and_info(tvb, pinfo, bssap_tree, offset); @@ -1770,19 +1770,19 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr /* New Cell global identity Cell global identity 18.4.1 M TLV 10 */ if ( check_ie(tvb, tree, &offset, BSSAP_CELL_GBL_ID)) offset = dissect_bssap_cell_global_id(tvb, bssap_tree, offset); - + /* Mobile station classmark Mobile station classmark 1 18.4.18 M TLV 3 */ if ( check_ie(tvb, tree, &offset, BSSAP_MOBILE_STN_CLS_MRK1)) offset = dissect_bssap_mobile_stn_cls_mrk1(tvb, bssap_tree, offset); if (tvb_length_remaining(tvb,offset) == 0) return; - + /* Old location area identifier Location area identifier 18.4.14 O TLV 7 */ if ( check_optional_ie(tvb, offset, BSSAP_LOC_AREA_ID)) offset = dissect_bssap_loc_area_id(tvb, bssap_tree, offset); if (tvb_length_remaining(tvb,offset) == 0) return; - + /* TMSI status TMSI status 18.4.24 O TLV 3 */ if ( check_optional_ie(tvb, offset, BSSAP_TMSI_STATUS)) offset = dissect_bssap_tmsi_status(tvb, bssap_tree, offset); @@ -1814,7 +1814,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr if (tvb_length_remaining(tvb,offset) == 0) return; - /* New TMSI, or IMSI Mobile identity 18.4.17 O TLV 6-10 */ + /* New TMSI, or IMSI Mobile identity 18.4.17 O TLV 6-10 */ if ( check_optional_ie(tvb, offset, BSSAP_MOBILE_ID)) offset = dissect_bssap_mobile_id(tvb, bssap_tree, offset); if (tvb_length_remaining(tvb,offset) == 0) @@ -1955,7 +1955,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr if ( check_ie(tvb, tree, &offset, BSSAP_SGSN_NUMBER)) offset = dissect_bssap_sgsn_number(tvb, bssap_tree, offset); - /* Detach type IMSI detach from non-GPRS service type 18.4.11 M TLV 3 */ + /* Detach type IMSI detach from non-GPRS service type 18.4.11 M TLV 3 */ if ( check_ie(tvb, tree, &offset, BSSAP_IMSI_DET_FROM_NON_GPRS_SERV_TYPE)) offset = dissect_bssap_imsi_det_from_non_gprs_serv_type(tvb, bssap_tree, offset); @@ -2164,7 +2164,7 @@ dissect_bssap_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { case 0x00: if (tvb_get_guint8(tvb, 1) != (tvb_length(tvb) - 2)) { return(FALSE); } - if (tvb_get_guint8(tvb, 2) == 0x40 && tvb_get_guint8(tvb, 3) != 0x01) { + if (tvb_get_guint8(tvb, 2) == 0x40 && tvb_get_guint8(tvb, 3) != 0x01) { return(FALSE); } break; @@ -2353,11 +2353,11 @@ proto_register_bssap(void) { &hf_bssap_sgsn_nr_ie, { "SGSN number IE", "bssap.imsi_ie", FT_NONE, BASE_NONE, NULL, 0, - NULL, HFILL }}, + NULL, HFILL }}, { &hf_bssap_tmsi_ie, { "TMSI IE", "bssap.tmsi_ie", FT_NONE, BASE_NONE, NULL, 0, - NULL, HFILL }}, + NULL, HFILL }}, { &hf_bssap_tmsi_status_ie, { "TMSI status IE", "bssap.tmsi_status_ie", FT_NONE, BASE_NONE, NULL, 0, @@ -2563,7 +2563,7 @@ proto_reg_handoff_bssap(void) rrlp_handle = find_dissector("rrlp"); initialized = TRUE; } else { - dissector_delete_uint("sccp.ssn", old_bssap_ssn, bssap_plus_handle); + dissector_delete_uint("sccp.ssn", old_bssap_ssn, bssap_plus_handle); } dissector_add_uint("sccp.ssn", global_bssap_ssn, bssap_plus_handle); diff --git a/epan/dissectors/packet-dpnss.c b/epan/dissectors/packet-dpnss.c index d1f443ff8c..6bea57d168 100644 --- a/epan/dissectors/packet-dpnss.c +++ b/epan/dissectors/packet-dpnss.c @@ -1,7 +1,7 @@ /* packet-dpnss_dass2.c * Routines for DPNNS/DASS2 dissection * Copyright 2007, Anders Broman <anders.broman[at]ericsson.com> - * + * * Supplementary string parameter table and testing by Tomas Muehlhoff. * * $Id$ @@ -9,17 +9,17 @@ * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -33,168 +33,166 @@ # include "config.h" #endif -#include <stdlib.h> - #include <glib.h> #include <epan/packet.h> #include <epan/proto.h> /* Initialize the protocol and registered fields */ -static int proto_dpnss = -1; -static int hf_dpnss_msg_grp_id = -1; -static int hf_dpnss_cc_msg_type = -1; -static int hf_dpnss_e2e_msg_type = -1; -static int hf_dpnss_LbL_msg_type = -1; -static int hf_dpnss_ext_bit = -1; -static int hf_dpnss_ext_bit_notall = -1; -static int hf_dpnss_sic_type = -1; -static int hf_dpnss_sic_details_for_speech = -1; -static int hf_dpnss_sic_details_for_data1 = -1; -static int hf_dpnss_sic_details_for_data2 = -1; -static int hf_dpnss_dest_addr = -1; -static int hf_dpnss_sic_oct2_data_type = -1; -static int hf_dpnss_sic_oct2_duplex = -1; +static int proto_dpnss = -1; +static int hf_dpnss_msg_grp_id = -1; +static int hf_dpnss_cc_msg_type = -1; +static int hf_dpnss_e2e_msg_type = -1; +static int hf_dpnss_LbL_msg_type = -1; +static int hf_dpnss_ext_bit = -1; +static int hf_dpnss_ext_bit_notall = -1; +static int hf_dpnss_sic_type = -1; +static int hf_dpnss_sic_details_for_speech = -1; +static int hf_dpnss_sic_details_for_data1 = -1; +static int hf_dpnss_sic_details_for_data2 = -1; +static int hf_dpnss_dest_addr = -1; +static int hf_dpnss_sic_oct2_data_type = -1; +static int hf_dpnss_sic_oct2_duplex = -1; static int hf_dpnss_sic_oct2_sync_data_format = -1; static int hf_dpnss_sic_oct2_sync_byte_timing = -1; -static int hf_dpnss_sic_oct2_net_ind_clk = -1; -static int hf_dpnss_sic_oct2_async_data = -1; +static int hf_dpnss_sic_oct2_net_ind_clk = -1; +static int hf_dpnss_sic_oct2_async_data = -1; static int hf_dpnss_sic_oct2_async_flow_ctrl = -1; -static int hf_dpnss_clearing_cause = -1; -static int hf_dpnss_rejection_cause = -1; -static int hf_dpnss_man_code = -1; -static int hf_dpnss_subcode = -1; -static int hf_dpnss_maintenance_action = -1; +static int hf_dpnss_clearing_cause = -1; +static int hf_dpnss_rejection_cause = -1; +static int hf_dpnss_man_code = -1; +static int hf_dpnss_subcode = -1; +static int hf_dpnss_maintenance_action = -1; /* parameters */ -static int hf_dpnss_a_b_party_addr = -1; -static int hf_dpnss_call_idx = -1; - -#define DPNNS_MESSAGE_GROUP_CC 0 -#define DPNNS_MESSAGE_GROUP_E2E 2 -#define DPNNS_MESSAGE_GROUP_LbL 4 - -#define DPNSS_CC_MSG_ISRM_C 0 -#define DPNSS_CC_MSG_ISRM_I 1 -#define DPNSS_CC_MSG_RM_C 2 -#define DPNSS_CC_MSG_RM_I 3 -#define DPNSS_CC_MSG_CS 4 -#define DPNSS_CC_MSG_CCM 5 -#define DPNSS_CC_MSG_NIM 6 -#define DPNSS_CC_MSG_CA 7 -#define DPNSS_CC_MSG_CRM 8 -#define DPNSS_CC_MSG_NAM 9 -#define DPNSS_CC_MSG_RRM 10 -#define DPNSS_CC_MSG_SSRM_I 11 -#define DPNSS_CC_MSG_SSRM_C 12 +static int hf_dpnss_a_b_party_addr = -1; +static int hf_dpnss_call_idx = -1; + +#define DPNNS_MESSAGE_GROUP_CC 0 +#define DPNNS_MESSAGE_GROUP_E2E 2 +#define DPNNS_MESSAGE_GROUP_LbL 4 + +#define DPNSS_CC_MSG_ISRM_C 0 +#define DPNSS_CC_MSG_ISRM_I 1 +#define DPNSS_CC_MSG_RM_C 2 +#define DPNSS_CC_MSG_RM_I 3 +#define DPNSS_CC_MSG_CS 4 +#define DPNSS_CC_MSG_CCM 5 +#define DPNSS_CC_MSG_NIM 6 +#define DPNSS_CC_MSG_CA 7 +#define DPNSS_CC_MSG_CRM 8 +#define DPNSS_CC_MSG_NAM 9 +#define DPNSS_CC_MSG_RRM 10 +#define DPNSS_CC_MSG_SSRM_I 11 +#define DPNSS_CC_MSG_SSRM_C 12 /* Initialize the subtree pointers */ -static int ett_dpnss = -1; -static int ett_dpnss_sel_field = -1; -static int ett_dpnss_sic_field = -1; -static int ett_dpnss_ind_field = -1; -static int ett_dpnss_sup_str = -1; +static int ett_dpnss = -1; +static int ett_dpnss_sel_field = -1; +static int ett_dpnss_sic_field = -1; +static int ett_dpnss_ind_field = -1; +static int ett_dpnss_sup_str = -1; static const value_string dpnss_msg_grp_id_vals[] = { - {0, "Call Control Message Group"}, - {2, "End-to-End Message Group"}, - {4, "Link-by-Link Message Group"}, - {0, NULL } + {0, "Call Control Message Group"}, + {2, "End-to-End Message Group"}, + {4, "Link-by-Link Message Group"}, + {0, NULL } }; static const value_string dpnss_cc_msg_type_vals[] = { - {DPNSS_CC_MSG_ISRM_C, "INITIAL SERVICE REQUEST Message (COMPLETE) - ISRM(C)"}, - {DPNSS_CC_MSG_ISRM_I, "INITIAL SERVICE REQUEST Message (INCOMPLETE) - ISRM(I)"}, - {DPNSS_CC_MSG_RM_C, "RECALL Message (COMPLETE) - RM(C)"}, - {DPNSS_CC_MSG_RM_I, "RECALL Message (INCOMPLETE) - RM(I)"}, - {DPNSS_CC_MSG_CS, "CHANNEL SEIZED - CS"}, - {DPNSS_CC_MSG_CCM, "CALL CONNECTED Message - CCM"}, - {DPNSS_CC_MSG_NIM, "NETWORK INDICATION Message - NIM"}, - {DPNSS_CC_MSG_CA, "CALL ARRIVAL Message - CA"}, - {DPNSS_CC_MSG_CRM, "CLEAR REQUEST Message - CRM/CLEAR INDICATION Message - CIM"}, /* Humm chek 2.1.7/2.1.8 - depends on dir? */ - {DPNSS_CC_MSG_NAM, "NUMBER ACKNOWLEDGE Message - NAM"}, - {DPNSS_CC_MSG_RRM, "RECALL REJECTION Message - RRM"}, - {DPNSS_CC_MSG_SSRM_I, "SUBSEQUENT SERVICE REQUEST Message (INCOMPLETE) - SSRM(I)"}, - {DPNSS_CC_MSG_SSRM_C, "SUBSEQUENT SERVICE REQUEST Message (COMPLETE) - SSRM(C)"}, - { 0, NULL } + {DPNSS_CC_MSG_ISRM_C, "INITIAL SERVICE REQUEST Message (COMPLETE) - ISRM(C)"}, + {DPNSS_CC_MSG_ISRM_I, "INITIAL SERVICE REQUEST Message (INCOMPLETE) - ISRM(I)"}, + {DPNSS_CC_MSG_RM_C, "RECALL Message (COMPLETE) - RM(C)"}, + {DPNSS_CC_MSG_RM_I, "RECALL Message (INCOMPLETE) - RM(I)"}, + {DPNSS_CC_MSG_CS, "CHANNEL SEIZED - CS"}, + {DPNSS_CC_MSG_CCM, "CALL CONNECTED Message - CCM"}, + {DPNSS_CC_MSG_NIM, "NETWORK INDICATION Message - NIM"}, + {DPNSS_CC_MSG_CA, "CALL ARRIVAL Message - CA"}, + {DPNSS_CC_MSG_CRM, "CLEAR REQUEST Message - CRM/CLEAR INDICATION Message - CIM"}, /* Humm chek 2.1.7/2.1.8 - depends on dir? */ + {DPNSS_CC_MSG_NAM, "NUMBER ACKNOWLEDGE Message - NAM"}, + {DPNSS_CC_MSG_RRM, "RECALL REJECTION Message - RRM"}, + {DPNSS_CC_MSG_SSRM_I, "SUBSEQUENT SERVICE REQUEST Message (INCOMPLETE) - SSRM(I)"}, + {DPNSS_CC_MSG_SSRM_C, "SUBSEQUENT SERVICE REQUEST Message (COMPLETE) - SSRM(C)"}, + { 0, NULL } }; static const value_string dpnss_cc_msg_short_type_vals[] = { - {DPNSS_CC_MSG_ISRM_C, "ISRM(C)"}, - {DPNSS_CC_MSG_ISRM_I, "ISRM(I)"}, - {DPNSS_CC_MSG_RM_C, "RM(C)"}, - {DPNSS_CC_MSG_RM_I, "RM(I)"}, - {DPNSS_CC_MSG_CS, "CS"}, - {DPNSS_CC_MSG_CCM, "CCM"}, - {DPNSS_CC_MSG_CA, "CA"}, - {DPNSS_CC_MSG_NIM, "NIM"}, - {DPNSS_CC_MSG_CRM, "CRM/CIM"}, /* Humm chek 2.1.7/2.1.8 - depends on dir? */ - {DPNSS_CC_MSG_NAM, "NAM"}, - {DPNSS_CC_MSG_RRM, "RRM"}, - {DPNSS_CC_MSG_SSRM_I, "SSRM(I)"}, - {DPNSS_CC_MSG_SSRM_C, "SSRM(C)"}, - {0, NULL } + {DPNSS_CC_MSG_ISRM_C, "ISRM(C)"}, + {DPNSS_CC_MSG_ISRM_I, "ISRM(I)"}, + {DPNSS_CC_MSG_RM_C, "RM(C)"}, + {DPNSS_CC_MSG_RM_I, "RM(I)"}, + {DPNSS_CC_MSG_CS, "CS"}, + {DPNSS_CC_MSG_CCM, "CCM"}, + {DPNSS_CC_MSG_CA, "CA"}, + {DPNSS_CC_MSG_NIM, "NIM"}, + {DPNSS_CC_MSG_CRM, "CRM/CIM"}, /* Humm chek 2.1.7/2.1.8 - depends on dir? */ + {DPNSS_CC_MSG_NAM, "NAM"}, + {DPNSS_CC_MSG_RRM, "RRM"}, + {DPNSS_CC_MSG_SSRM_I, "SSRM(I)"}, + {DPNSS_CC_MSG_SSRM_C, "SSRM(C)"}, + {0, NULL } }; -#define DPNSS_E2E_MSG_EEM_C 2 -#define DPNSS_E2E_MSG_EEM_I 3 -#define DPNSS_E2E_MSG_SCRM 4 -#define DPNSS_E2E_MSG_SCIM 5 -#define DPNSS_E2E_MSG_ERM_C 6 -#define DPNSS_E2E_MSG_ERM_I 7 -#define DPNSS_E2E_MSG_NSIM 8 +#define DPNSS_E2E_MSG_EEM_C 2 +#define DPNSS_E2E_MSG_EEM_I 3 +#define DPNSS_E2E_MSG_SCRM 4 +#define DPNSS_E2E_MSG_SCIM 5 +#define DPNSS_E2E_MSG_ERM_C 6 +#define DPNSS_E2E_MSG_ERM_I 7 +#define DPNSS_E2E_MSG_NSIM 8 /* 2.2 END-TO-END MESSAGE GROUP */ static const value_string dpnss_e2e_msg_type_vals[] = { - {2, "END-to-END Message (COMPLETE) - EEM(C)"}, - {3, "END-to-END Message (INCOMPLETE) - EEM(I)"}, - {4, "SINGLE-CHANNEL CLEAR REQUEST Message - SCRM"}, - {5, "SINGLE-CHANNEL CLEAR INDICATION Message - SCIM"}, - {6, "END-to-END RECALL Message (COMPLETE) - ERM(C)"}, - {7, "END-to-END RECALL Message (INCOMPLETE) - ERM(I)"}, - {8, "NON SPECIFIED INFORMATION Message - NSIM"}, - { 0, NULL } + {2, "END-to-END Message (COMPLETE) - EEM(C)"}, + {3, "END-to-END Message (INCOMPLETE) - EEM(I)"}, + {4, "SINGLE-CHANNEL CLEAR REQUEST Message - SCRM"}, + {5, "SINGLE-CHANNEL CLEAR INDICATION Message - SCIM"}, + {6, "END-to-END RECALL Message (COMPLETE) - ERM(C)"}, + {7, "END-to-END RECALL Message (INCOMPLETE) - ERM(I)"}, + {8, "NON SPECIFIED INFORMATION Message - NSIM"}, + { 0, NULL } }; static const value_string dpnss_e2e_msg_short_type_vals[] = { - {2, "EEM(C)"}, - {3, "EEM(I)"}, - {4, "SCRM"}, - {5, "SCIM"}, - {6, "ERM(C)"}, - {7, "ERM(I)"}, - {8, "NSIM"}, - { 0, NULL } + {2, "EEM(C)"}, + {3, "EEM(I)"}, + {4, "SCRM"}, + {5, "SCIM"}, + {6, "ERM(C)"}, + {7, "ERM(I)"}, + {8, "NSIM"}, + { 0, NULL } }; -#define DPNSS_LbL_MSG_LLM_C 0 -#define DPNSS_LbL_MSG_LLM_I 1 -#define DPNSS_LbL_MSG_LLRM 2 -#define DPNSS_LbL_MSG_SM 4 -#define DPNSS_LbL_MSG_LMM 5 -#define DPNSS_LbL_MSG_LMRM 6 +#define DPNSS_LbL_MSG_LLM_C 0 +#define DPNSS_LbL_MSG_LLM_I 1 +#define DPNSS_LbL_MSG_LLRM 2 +#define DPNSS_LbL_MSG_SM 4 +#define DPNSS_LbL_MSG_LMM 5 +#define DPNSS_LbL_MSG_LMRM 6 /* 2.3 LINK-BY-LINK MESSAGE GROUP */ static const value_string dpnss_LbL_msg_type_vals[] = { - {0, "LINK-by-LINK Message (COMPLETE) - LLM(C)"}, - {1, "LINK-by-LINK Message (INCOMPLETE) - LLM(I)"}, - {2, "LINK-by-LINK REJECT Message - LLRM"}, - {4, "SWAP Message - SM"}, - {5, "LINK MAINTENANCE Message - LMM"}, - {6, "LINK MAINTENANCE REJECT Message - LMRM"}, - { 0, NULL } + {0, "LINK-by-LINK Message (COMPLETE) - LLM(C)"}, + {1, "LINK-by-LINK Message (INCOMPLETE) - LLM(I)"}, + {2, "LINK-by-LINK REJECT Message - LLRM"}, + {4, "SWAP Message - SM"}, + {5, "LINK MAINTENANCE Message - LMM"}, + {6, "LINK MAINTENANCE REJECT Message - LMRM"}, + { 0, NULL } }; static const value_string dpnss_LbL_msg_short_type_vals[] = { - {0, "LLM(C)"}, - {1, "LLM(I)"}, - {2, "LLRM"}, - {4, "SM"}, - {5, "LMM"}, - {6, "LMRM"}, - { 0, NULL } + {0, "LLM(C)"}, + {1, "LLM(I)"}, + {2, "LLRM"}, + {4, "SM"}, + {5, "LMM"}, + {6, "LMRM"}, + { 0, NULL } }; static const true_false_string dpnss_ext_bit_vals = { @@ -208,88 +206,88 @@ static const true_false_string dpnss_ext_bit_no_ext_vals = { }; /* SECTION 4 ANNEX 1 */ static const value_string dpnss_sic_type_type_vals[] = { - {0, "invalid"}, - {1, "speech"}, - {2, "data"}, - {3, "data"}, - {4, "interworking with DASS 2 - treat as data"}, - {5, "interworking with DASS 2 - treat as data"}, - {6, "interworking with DASS 2 - treat as data"}, - {7, "interworking with DASS 2 - treat as data"}, - { 0, NULL } + {0, "invalid"}, + {1, "speech"}, + {2, "data"}, + {3, "data"}, + {4, "interworking with DASS 2 - treat as data"}, + {5, "interworking with DASS 2 - treat as data"}, + {6, "interworking with DASS 2 - treat as data"}, + {7, "interworking with DASS 2 - treat as data"}, + { 0, NULL } }; static const value_string dpnss_sic_details_for_speech_vals[] = { - {0, "64 kbit/s PCM G.711 A-Law or analogue"}, - {1, "32 kbit/s ADPCM G.721"}, - {2, "64 kbit/s PCM G.711 u-Law or analogue"}, - {3, "Invalid"}, - {4, "Invalid"}, - {5, "Invalid"}, - {6, "Invalid"}, - {7, "Invalid"}, - {8, "Invalid"}, - {9, "Invalid"}, - {10, "Invalid"}, - {11, "Invalid"}, - {12, "Invalid"}, - {13, "Invalid"}, - {14, "Invalid"}, - {15, "Invalid"}, - { 0, NULL } + {0, "64 kbit/s PCM G.711 A-Law or analogue"}, + {1, "32 kbit/s ADPCM G.721"}, + {2, "64 kbit/s PCM G.711 u-Law or analogue"}, + {3, "Invalid"}, + {4, "Invalid"}, + {5, "Invalid"}, + {6, "Invalid"}, + {7, "Invalid"}, + {8, "Invalid"}, + {9, "Invalid"}, + {10, "Invalid"}, + {11, "Invalid"}, + {12, "Invalid"}, + {13, "Invalid"}, + {14, "Invalid"}, + {15, "Invalid"}, + { 0, NULL } }; static const value_string dpnss_sic_details_for_data_rates1_vals[] = { - {0, "64000 bit/s"}, - {1, "56000 bit/s"}, - {2, "48000 bit/s"}, - {3, "32000 bit/s"}, - {4, "19200 bit/s"}, - {5, "16000 bit/s"}, - {6, "14400 bit/s"}, - {7, "12000 bit/s"}, - {8, "9600 bit/s"}, - {9, "8000 bit/s"}, - {10, "7200 bit/s"}, - {11, "4800 bit/s"}, - {12, "3600 bit/s"}, - {13, "2400 bit/s"}, - {14, "1200 bit/s"}, - {15, "600 bit/s"}, - { 0, NULL } + {0, "64000 bit/s"}, + {1, "56000 bit/s"}, + {2, "48000 bit/s"}, + {3, "32000 bit/s"}, + {4, "19200 bit/s"}, + {5, "16000 bit/s"}, + {6, "14400 bit/s"}, + {7, "12000 bit/s"}, + {8, "9600 bit/s"}, + {9, "8000 bit/s"}, + {10, "7200 bit/s"}, + {11, "4800 bit/s"}, + {12, "3600 bit/s"}, + {13, "2400 bit/s"}, + {14, "1200 bit/s"}, + {15, "600 bit/s"}, + { 0, NULL } }; static const value_string dpnss_sic_details_for_data_rates2_vals[] = { - {0, "300 bit/s"}, - {1, "200 bit/s"}, - {2, "150 bit/s"}, - {3, "134.5 bit/s"}, - {4, "110 bit/s"}, - {5, "100 bit/s"}, - {6, "75 bit/s"}, - {7, "50 bit/s"}, - {8, "75/1200 bit/s"}, - {9, "1200/75 bit/s"}, - {10, "invalid"}, - {11, "invalid"}, - {12, "invalid"}, - {13, "invalid"}, - {14, "invalid"}, - {15, "invalid"}, - { 0, NULL } + {0, "300 bit/s"}, + {1, "200 bit/s"}, + {2, "150 bit/s"}, + {3, "134.5 bit/s"}, + {4, "110 bit/s"}, + {5, "100 bit/s"}, + {6, "75 bit/s"}, + {7, "50 bit/s"}, + {8, "75/1200 bit/s"}, + {9, "1200/75 bit/s"}, + {10, "invalid"}, + {11, "invalid"}, + {12, "invalid"}, + {13, "invalid"}, + {14, "invalid"}, + {15, "invalid"}, + { 0, NULL } }; /* Octet 2 */ static const value_string dpnss_sic_oct2_data_type_vals[] = { - {0, "Invalid"}, - {1, "Invalid"}, - {2, "Invalid"}, - {3, "Synchronous"}, - {4, "Synchronous"}, - {5, "Asynchronous"}, - {6, "Asynchronous"}, - {7, "Asynchronous"}, - { 0, NULL } + {0, "Invalid"}, + {1, "Invalid"}, + {2, "Invalid"}, + {3, "Synchronous"}, + {4, "Synchronous"}, + {5, "Asynchronous"}, + {6, "Asynchronous"}, + {7, "Asynchronous"}, + { 0, NULL } }; static const true_false_string dpnss_duplex_vals = { @@ -313,735 +311,735 @@ static const true_false_string dpnss_provided_vals = { }; static const value_string dpnss_sic_oct2_async_data_type_vals[] = { - {0, "Unspecified"}, - {1, "5 data bits"}, - {2, "7 data bits"}, - {3, "8 data bits"}, - { 0, NULL } + {0, "Unspecified"}, + {1, "5 data bits"}, + {2, "7 data bits"}, + {3, "8 data bits"}, + { 0, NULL } }; static const true_false_string dpnss_flow_control_vals = { "TA has ESRA capability", "TA does not have ESRA capability" }; -/* SECTION 4 Global Issue 7 - * ANNEX 3 CLEARING/REJECTION CAUSE CODES +/* SECTION 4 Global Issue 7 + * ANNEX 3 CLEARING/REJECTION CAUSE CODES */ static const value_string dpnss_clearing_cause_code_vals[] = { - {0x29, "Access Barred"}, - {0x14, "Acknowledgement"}, - {0x01, "Address Incomplete"}, - {0x08, "Busy"}, - {0x23, "Channel Out of Service"}, - {0x2d, "DTE Controlled Not Ready"}, - {0x07, "Congestion"}, - {0x30, "Call Termination"}, - {0x18, "Facility Not Registered"}, - {0x0a, "Incoming Calls Barred"}, - {0x13, "Service Incompatible"}, - {0x1a, "Message Not Understood"}, - {0x1e, "Network Address Extension-Error"}, - {0x02, "Network Termination"}, - {0x00, "Number Unobtainable"}, - {0x24, "Priority Forced Release"}, - {0x19, "Reject"}, - {0x1c, "Route Out of Service"}, - {0x04, "Subscriber Incompatible"}, - {0x15, "Signal Not Understood"}, - {0x16, "Signal Not Valid"}, - {0x09, "Subscriber Out of Service"}, - {0x1b, "Signalling System Incompatible"}, - {0x17, "Service Temporarily Unavailable"}, - {0x03, "Service Unavailable"}, - {0x1d, "Transferred"}, - {0x2e, "DTE Uncontrolled Not Ready"}, - { 0, NULL } + {0x29, "Access Barred"}, + {0x14, "Acknowledgement"}, + {0x01, "Address Incomplete"}, + {0x08, "Busy"}, + {0x23, "Channel Out of Service"}, + {0x2d, "DTE Controlled Not Ready"}, + {0x07, "Congestion"}, + {0x30, "Call Termination"}, + {0x18, "Facility Not Registered"}, + {0x0a, "Incoming Calls Barred"}, + {0x13, "Service Incompatible"}, + {0x1a, "Message Not Understood"}, + {0x1e, "Network Address Extension-Error"}, + {0x02, "Network Termination"}, + {0x00, "Number Unobtainable"}, + {0x24, "Priority Forced Release"}, + {0x19, "Reject"}, + {0x1c, "Route Out of Service"}, + {0x04, "Subscriber Incompatible"}, + {0x15, "Signal Not Understood"}, + {0x16, "Signal Not Valid"}, + {0x09, "Subscriber Out of Service"}, + {0x1b, "Signalling System Incompatible"}, + {0x17, "Service Temporarily Unavailable"}, + {0x03, "Service Unavailable"}, + {0x1d, "Transferred"}, + {0x2e, "DTE Uncontrolled Not Ready"}, + { 0, NULL } }; /* ANNEX 6 : MAINTENANCE ACTIONS (p235) */ static const value_string dpnss_maintenance_actions_vals[] = { - {0x1, "BBC - Back-Busy Control"}, - {0x2, "LBC - Loop-Back Control"}, - {0x3, "LBA - Loop-Back Abort"}, - {0x4, "TCS-R - Traffic Channel Status Request"}, - {0x5, "ACK - Acknowledge"}, - {0x6, "NTC - Non-Looped-Back Test Control"}, - { 0, NULL } + {0x1, "BBC - Back-Busy Control"}, + {0x2, "LBC - Loop-Back Control"}, + {0x3, "LBA - Loop-Back Abort"}, + {0x4, "TCS-R - Traffic Channel Status Request"}, + {0x5, "ACK - Acknowledge"}, + {0x6, "NTC - Non-Looped-Back Test Control"}, + { 0, NULL } }; /* ANNEX 7 : CODING OF USAGE IDENTIFIERS */ static const value_string dpnss_man_code_vals[] = { - {0x0, "Reserved"}, - {0x1, "BT"}, - {0x2, "Ericsson"}, - {0x3, "Lucent"}, - {0x4, "Philips"}, - {0x5, "Siemens"}, - {0x6, "Westell"}, - {0x7, "Mitel"}, - { 0, NULL } + {0x0, "Reserved"}, + {0x1, "BT"}, + {0x2, "Ericsson"}, + {0x3, "Lucent"}, + {0x4, "Philips"}, + {0x5, "Siemens"}, + {0x6, "Westell"}, + {0x7, "Mitel"}, + { 0, NULL } }; -#define DPNSS_NONE 0 -#define DPNSS_SERV_MAR 1 -#define DPNSS_STATUS 2 -#define DPNSS_ROUTE_RES_CLASS 3 -#define DPNSS_CBR_GRP 4 -#define DPNSS_FAC_LST_CODE 5 -#define DPNSS_NO_OF_FUR_TRANS 6 -#define DPNSS_NO_OF_FUR_ALT_R 7 -#define DPNSS_INT_CAP_LEV 8 -#define DPNSS_NESTING_LEVEL 9 -#define DPNSS_C_PARTY_ADDR 10 -#define DPNSS_B_PARTY_ADDR 11 -#define DPNSS_SIC 12 -#define DPNSS_A_B_PARTY_ADDR 13 -#define DPNSS_DIVERSION_TYPE 14 -#define DPNSS_NSI_IDENTIFIER 15 -#define DPNSS_USER_DEFINED 16 -#define DPNSS_TEXT 17 -#define DPNSS_CALL_INDEX 18 -#define DPNSS_PASSWORD 19 -#define DPNSS_CALL_DIR 20 -#define DPNSS_DPNSS_ISDN_TYPE 21 -#define DPNSS_HC_CLC 22 -#define DPNSS_ENHANCED_STR_ID 23 -#define DPNSS_STRING_ID 24 -#define DPNSS_STRING_ID_LIST 25 -#define DPNSS_TEXT_TYPE 26 -#define DPNSS_CHANNEL_STATUS 27 -#define DPNSS_CHANNEL_NUMBER 28 -#define DPNSS_BPL 29 -#define DPNSS_BCL 30 -#define DPNSS_DEVICE_INDEX 31 -#define DPNSS_CR_NO 32 -#define DPNSS_CALL_ID_LENGTH 33 -#define DPNSS_STATE_OF_DEST 34 -#define DPNSS_STATE_OF_DEST_QUAL 35 -#define DPNSS_REASON_FOR_REDIR 36 -#define DPNSS_CLEARING_CAUSE 37 -#define DPNSS_RECONT_ADDR 38 -#define DPNSS_STATE_OF_OPERATOR 39 -#define DPNSS_NIGHT_SERVICE 40 -#define DPNSS_PBX_FLAG 41 -#define DPNSS_NUMBER_OF_CALLS 42 -#define DPNSS_NUMBER_OF_SERVERS 43 -#define DPNSS_PRIORITY_LEVEL 44 -#define DPNSS_LOCATION 45 -#define DPNSS_SUBADDRESS 46 -#define DPNSS_ALARM_LEVEL 47 -#define DPNSS_STAFF_PRESENT 48 -#define DPNSS_TIME_AND_DATE 49 -#define DPNSS_SERVICES 50 -#define DPNSS_PBX_REFERENCE 51 -#define DPNSS_TRUNK_GROUP_REF_NUMBER 52 -#define DPNSS_TRUNK_MEMBER_REF_NUMBER 53 -#define DPNSS_CONF_PARTY_INDEX 54 -#define DPNSS_CONF_PARTY_DET 55 -#define DPNSS_ACCOUNT_CODE 56 -#define DPNSS_CONF_BRIDGE_ADDR 57 -#define DPNSS_COST_QUALIFIER 58 -#define DPNSS_CURRENCY_INDICATION 59 -#define DPNSS_CURRENCY_UNITS 60 -#define DPNSS_TIME_INTERVAL 61 -#define DPNSS_UNITS 62 -#define DPNSS_REMOTE_ADDRESS 63 -#define DPNSS_TEST_INDEX 64 -#define DPNSS_TEST_RESULT 65 -#define DPNSS_TYPE_OF_ASSISTANCE 66 -#define DPNSS_REST_DOMAIN 67 -#define DPNSS_GRP_PICK_UP_CODE 68 -#define DPNSS_PICK_UP_CALL_TYPE 69 -#define DPNSS_MALICIOUS_CALL_REF 70 -#define DPNSS_TIMER_VALUE 71 -#define DPNSS_BEARER_CAP 72 -#define DPNSS_ISDN_NUM_ATTR 73 -#define DPNSS_ISDN_DPNSS_SUBADDRESS 74 -#define DPNSS_ISDN_NUMBER_DIGITS 75 -#define DPNSS_HIGH_LAYER_COMP 76 -#define DPNSS_LOW_LAYER_COMP 77 -#define DPNSS_PROGRESS_INDICATOR 78 -#define DPNSS_VPN_ACCESS_REF_NUM 79 -#define DPNSS_INDEX_NUMBER 80 -#define DPNSS_RESTRICTION_INDICATOR 81 -#define DPNSS_CAUSE 82 +#define DPNSS_NONE 0 +#define DPNSS_SERV_MAR 1 +#define DPNSS_STATUS 2 +#define DPNSS_ROUTE_RES_CLASS 3 +#define DPNSS_CBR_GRP 4 +#define DPNSS_FAC_LST_CODE 5 +#define DPNSS_NO_OF_FUR_TRANS 6 +#define DPNSS_NO_OF_FUR_ALT_R 7 +#define DPNSS_INT_CAP_LEV 8 +#define DPNSS_NESTING_LEVEL 9 +#define DPNSS_C_PARTY_ADDR 10 +#define DPNSS_B_PARTY_ADDR 11 +#define DPNSS_SIC 12 +#define DPNSS_A_B_PARTY_ADDR 13 +#define DPNSS_DIVERSION_TYPE 14 +#define DPNSS_NSI_IDENTIFIER 15 +#define DPNSS_USER_DEFINED 16 +#define DPNSS_TEXT 17 +#define DPNSS_CALL_INDEX 18 +#define DPNSS_PASSWORD 19 +#define DPNSS_CALL_DIR 20 +#define DPNSS_DPNSS_ISDN_TYPE 21 +#define DPNSS_HC_CLC 22 +#define DPNSS_ENHANCED_STR_ID 23 +#define DPNSS_STRING_ID 24 +#define DPNSS_STRING_ID_LIST 25 +#define DPNSS_TEXT_TYPE 26 +#define DPNSS_CHANNEL_STATUS 27 +#define DPNSS_CHANNEL_NUMBER 28 +#define DPNSS_BPL 29 +#define DPNSS_BCL 30 +#define DPNSS_DEVICE_INDEX 31 +#define DPNSS_CR_NO 32 +#define DPNSS_CALL_ID_LENGTH 33 +#define DPNSS_STATE_OF_DEST 34 +#define DPNSS_STATE_OF_DEST_QUAL 35 +#define DPNSS_REASON_FOR_REDIR 36 +#define DPNSS_CLEARING_CAUSE 37 +#define DPNSS_RECONT_ADDR 38 +#define DPNSS_STATE_OF_OPERATOR 39 +#define DPNSS_NIGHT_SERVICE 40 +#define DPNSS_PBX_FLAG 41 +#define DPNSS_NUMBER_OF_CALLS 42 +#define DPNSS_NUMBER_OF_SERVERS 43 +#define DPNSS_PRIORITY_LEVEL 44 +#define DPNSS_LOCATION 45 +#define DPNSS_SUBADDRESS 46 +#define DPNSS_ALARM_LEVEL 47 +#define DPNSS_STAFF_PRESENT 48 +#define DPNSS_TIME_AND_DATE 49 +#define DPNSS_SERVICES 50 +#define DPNSS_PBX_REFERENCE 51 +#define DPNSS_TRUNK_GROUP_REF_NUMBER 52 +#define DPNSS_TRUNK_MEMBER_REF_NUMBER 53 +#define DPNSS_CONF_PARTY_INDEX 54 +#define DPNSS_CONF_PARTY_DET 55 +#define DPNSS_ACCOUNT_CODE 56 +#define DPNSS_CONF_BRIDGE_ADDR 57 +#define DPNSS_COST_QUALIFIER 58 +#define DPNSS_CURRENCY_INDICATION 59 +#define DPNSS_CURRENCY_UNITS 60 +#define DPNSS_TIME_INTERVAL 61 +#define DPNSS_UNITS 62 +#define DPNSS_REMOTE_ADDRESS 63 +#define DPNSS_TEST_INDEX 64 +#define DPNSS_TEST_RESULT 65 +#define DPNSS_TYPE_OF_ASSISTANCE 66 +#define DPNSS_REST_DOMAIN 67 +#define DPNSS_GRP_PICK_UP_CODE 68 +#define DPNSS_PICK_UP_CALL_TYPE 69 +#define DPNSS_MALICIOUS_CALL_REF 70 +#define DPNSS_TIMER_VALUE 71 +#define DPNSS_BEARER_CAP 72 +#define DPNSS_ISDN_NUM_ATTR 73 +#define DPNSS_ISDN_DPNSS_SUBADDRESS 74 +#define DPNSS_ISDN_NUMBER_DIGITS 75 +#define DPNSS_HIGH_LAYER_COMP 76 +#define DPNSS_LOW_LAYER_COMP 77 +#define DPNSS_PROGRESS_INDICATOR 78 +#define DPNSS_VPN_ACCESS_REF_NUM 79 +#define DPNSS_INDEX_NUMBER 80 +#define DPNSS_RESTRICTION_INDICATOR 81 +#define DPNSS_CAUSE 82 typedef struct { - gint id_code_no; - const char *compact_name; - const char *name; - gint par1_num; - gint par2_num; - gint par3_num; - gint par4_num; + gint id_code_no; + const char *compact_name; + const char *name; + gint par1_num; + gint par2_num; + gint par3_num; + gint par4_num; } dpnns_sup_serv_set_t; static const dpnns_sup_serv_set_t dpnns_sup_serv_set[] = { - {0, "NOT USED", "NOT USED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {1, "CLC-ORD", "CALLING/CALLED LINE CATEGORY ORDINARY", DPNSS_SERV_MAR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {2, "CLC-DEC", "CALLING/CALLED LINE CATEGORY DECADIC", DPNSS_STATUS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {3, "CLC-ISDN", "CALLING/CALLED LINE CATEGORY-PUBLIC ISDN", DPNSS_STATUS, DPNSS_DPNSS_ISDN_TYPE, DPNSS_NONE, DPNSS_NONE }, - {4, "CLC-PSTN", "CALLING/CALLED LINE CATEGORY-PSTN", DPNSS_STATUS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {5, "CLC-MF5", "CALLING/CALLED LINE CATEGORY-SSMF5", DPNSS_STATUS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {6, "CLC-OP", "CALLING/CALLED LINE CATEGORY-OPERATOR", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {7, "CLC-NET", "CALLING/CALLED LINE CATEGORY-NETWORK", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {8, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {9, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {10, "CBWF-R", "CALL BACK WHEN FREE-REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {11, "CBWF-FN", "CALL BACK WHEN FREE-FREE NOTIFICATION", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {12, "CBWF-CSUI", "CALL BACK WHEN FREE-CALL SET-UP(IMMEDIATE)", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {13, "CBWF-C", "CALL BACK WHEN FREE-CANCEL", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {14, "RO", "RING OUT", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {15, "CBC", "CALL BACK COMPLETE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {16, "CBWF-CSUD", "CALL BACK WHEN FREE -CALL SET-UP(DELAYED)", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {17, "CBWNU-R", "CALL BACK WHEN NEXT USEDREQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {18, "COS", "CLASS OF SERVICE", DPNSS_ROUTE_RES_CLASS, DPNSS_CBR_GRP, DPNSS_FAC_LST_CODE, DPNSS_NONE}, - {19, "LA", "LOOP AVOIDANCE", DPNSS_NO_OF_FUR_TRANS, DPNSS_NO_OF_FUR_ALT_R, DPNSS_NONE, DPNSS_NONE }, - {20, "EI-PVR", "EXECUTIVE INTRUSION-PRIOR VALIDATION", DPNSS_INT_CAP_LEV, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {21, "EI-R", "EXECUTIVE INTRUSION-REQUEST", DPNSS_INT_CAP_LEV, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {22, "IPL-R", "INTRUSION PROTECTION LEVEL-REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {23, "IPL", "INTRUSION PROTECTION LEVEL", DPNSS_INT_CAP_LEV, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {24, "EI-C", "EXECUTIVE INTRUSION-CONVERT", DPNSS_INT_CAP_LEV, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {25, "EI-I", "EXECUTIVE INTRUSION-INTRUDED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {26, "CW", "CALL WAITING", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {27, "CO", "CALL OFFER", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {28, "SN-REQ", "SEND NEXT-REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {29, "HGF", "HUNT GROUP FORWARDED", DPNSS_NESTING_LEVEL, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {30, "DIV-V", "DIVERSION-VALIDATION", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {31, "DIV-FM", "DIVERSION-FOLLOW ME", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {32, "DIV-BY", "DIVERSION-BY PASS", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {33, "DIV-CI", "DIVERSION CANCEL-IMMEDIATE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {34, "DIV-CR", "DIVERSION CANCEL-ON NO REPLY", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {35, "DIV-CB", "DIVERSION CANCEL-ON BUSY", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {36, "DIV-CA", "DIVERSION CANCEL-ALL", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {37, "DVG-I", "DIVERTING IMMEDIATE", DPNSS_B_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {38, "DVG-B", "DIVERTING ON BUSY", DPNSS_B_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {39, "DVG-R", "DIVERTING ON NO REPLY", DPNSS_B_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {40, "DVT-I", "DIVERT IMMEDIATE", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {41, "DVT-B", "DIVERT ON BUSY", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {42, "DVD-I", "DIVERTED IMMEDIATE", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {43, "DVD-B", "DIVERTED ON BUSY", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {44, "DVD-R", "DIVERTED ON NO REPLY", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {45, "DVT-R", "DIVERT ON NO REPLY", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {46, "SIC", "SERVICE INDICATOR CODE", DPNSS_SIC, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {47, "BSS-M", "BEARER SERVICE SELECTION-MANDATORY", DPNSS_SIC, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {48, "BSS-P", "BEARER SERVICE SELECTION-PREFERRED", DPNSS_SIC, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {49, "BSS-N", "BEARER SERVICE SELECTION-NOTIFICATION", DPNSS_SIC, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {50, "OLI/CLI", "ORIGINATING LINE IDENTITY/CALLED LINE IDENTITY", DPNSS_A_B_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {51, "RTI", "ROUTING INFORMATION, ROUTING INFORMATION", DPNSS_DPNSS_ISDN_TYPE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {52, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {53, "DVD-E", "DIVERTED-EXTERNALLY", DPNSS_DIVERSION_TYPE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {54, "REJ", "REJECT", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {55, "ACK", "ACKNOWLEDGE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {56, "SN", "SEND NEXT", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {57, "D-SIC", "DASS 2-SERVICE INDICATOR CODE", DPNSS_SIC, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {58, "NSI", "NON-SPECIFIED INFORMATION", DPNSS_NSI_IDENTIFIER, DPNSS_USER_DEFINED, DPNSS_USER_DEFINED, DPNSS_NONE }, - {59, "OCP", "ORIGINALLY CALLED PARTY", DPNSS_B_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {60, "HOLD-REQ", "HOLD REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {61, "RECON", "RECONNECTED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {62, "HDG", "HOLDING", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {63, "CD-Q", "CALL DISTRIBUTION-QUEUE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {64, "TEXT-M", "TEXT MESSAGE", DPNSS_TEXT, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {65, "SOD-B", "STATE OF DESTINATION-BUSY", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {66, "SOD-F", "STATE OF DESTINATION-FREE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {67, "CD-DNQ", "CALL DISTRIBUTION-DO NOT QUEUE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {68, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {69, "CD-LINK", "CALL DISTRIBUTION-LINKED", DPNSS_CALL_INDEX, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {70, "DIV-RSI", "DIVERSION-REMOTE SET IMMEDIATE", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {71, "DIV-RSB", "DIVERSION-REMOTE SET ON BUSY", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {72, "DIV-RSR", "DIVERSION-REMOTE SET ON NO REPLY", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {73, "DIV-RCI", "DIVERSION-REMOTE CANCEL IMMEDIATE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {74, "DIV-RCB", "DIVERSION-REMOTE CANCEL ON BUSY", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {75, "DIV-RCR", "DIVERSION-REMOTE CANCEL ON NO REPLY", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {76, "DIV-RCA", "DIVERSION-REMOTE CANCEL ALL", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {77, "PASSW", "PASSWORD", DPNSS_PASSWORD, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {78, "SPL", "SPLIT", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {79, "TWP", "TWO PARTY", DPNSS_CALL_DIR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {80, "ENQ", "ENQUIRY CALL", DPNSS_HC_CLC, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {81, "SCE", "SINGLE CHANNEL ENQUIRY", DPNSS_HC_CLC, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {82, "TRFD", "TRANSFERRED", DPNSS_CALL_DIR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {83, "SHTL", "SHUTTLE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {84, "COC", "CONNECTED CALL", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {85, "TRFR", "TRANSFER", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {86, "CD-FN", "CALL DISTRIBUTION-FREE NOTIFY", DPNSS_CALL_INDEX, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {87, "ICC", "INTERCOM CALL", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {88, "AD-RQ", "ADD-ON REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {89, "AD-V", "ADD-ON VALIDATION", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {90, "AD-O", "ADDED-ON", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {91, "ENH", "ENHANCED SSMF5", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {92, "BAS", "BASIC SSMF5", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {93, "CD-UNLINK", "CALL DISTRIBUTION-UNLINKED", DPNSS_CALL_INDEX, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {94, "SNU", "SIGNAL NOT UNDERSTOOD", DPNSS_ENHANCED_STR_ID, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {95, "SU", "SERVICE UNAVAILABLE", DPNSS_STRING_ID, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {96, "RR-SNU", "RECALL REJECTED SIGNAL NOT UNDERSTOOD", DPNSS_ENHANCED_STR_ID, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {97, "CD-CSU", "CALL DISTRIBUTION-CALL SET UP", DPNSS_CALL_INDEX, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {98, "IG-SNU", "IGNORED-SIGNAL NOT UNDERSTOOD", DPNSS_STRING_ID_LIST, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {99, "IG-SU", "IGNORED-SERVICE UNAVAILABLE", DPNSS_STRING_ID_LIST, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {100, "TEXT", "TEXTUAL DISPLAY", DPNSS_TEXT, DPNSS_TEXT_TYPE, DPNSS_NONE, DPNSS_NONE }, - {101, "SIM-A", "SIMULATED ANSWER", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {102, "ACT", "ACTIVATE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {103, "DEACT", "DEACTIVATE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {104, "TCS", "TRAFFIC-CHANNEL STATUS", DPNSS_CHANNEL_STATUS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {105, "CHID", "CHANNEL IDENTITY", DPNSS_CHANNEL_NUMBER, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {106, "FR-R", "FORCED RELEASE-REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {107, "PB-P", "PRIORITY BREAKDOWN-PROTECTION", DPNSS_BPL, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {108, "PB-R", "PRIORITY BREAKDOWN-REQUEST", DPNSS_BCL, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {109, "DI", "DEVICE IDENTITY", DPNSS_DEVICE_INDEX, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {110, "ROP-R", "ROUTE OPTIMISATION-REQUEST", DPNSS_CR_NO, DPNSS_CALL_ID_LENGTH, DPNSS_NONE, DPNSS_NONE }, - {111, "ROP-CSU", "ROUTE OPTIMISATION-CALL SET UP", DPNSS_CALL_ID_LENGTH, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {112, "ROP-CON", "ROUTE OPTIMISATION-CONNECTED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {113, "DND", "DO NOT DISTURB", DPNSS_STATE_OF_DEST, DPNSS_STATE_OF_DEST_QUAL, DPNSS_NONE, DPNSS_NONE }, - {114, "DND-O", "DO NOT DISTURB-OVERRIDE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {115, "DND-S", "DO NOT DISTURB-SET", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {116, "DND-C", "DO NOT DISTURB-CLEAR", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {117, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {118, "EST", "EXTENSION STATUS CALL", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {119, "CDIV", "CONTROLLED DIVERSION", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {120, "RDG", "REDIRECTING", DPNSS_REASON_FOR_REDIR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {121, "RCF", "REDIRECTING ON CALL FAILURE", DPNSS_CLEARING_CAUSE, DPNSS_B_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE }, - {122, "TOV-R", "TAKEOVER REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {123, "TOV-V", "TAKEOVER VALIDATION", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {124, "SER-R", "SERIES CALL REQUEST", DPNSS_RECONT_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {125, "SER-C", "SERIES CALL-CANCEL", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {126, "SER-E", "SERIES CALL-ESTABLISHMENT", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {127, "NS-N, NIGHT","SERVICE-NOTIFICATION", DPNSS_STATE_OF_OPERATOR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {128, "NS-DVT", "NIGHT SERVICE-DIVERT", DPNSS_NIGHT_SERVICE, DPNSS_PBX_FLAG, DPNSS_NONE, DPNSS_NONE }, - {129, "NS-DVG", "DPNSS_NIGHT_SERVICE-DIVERTING", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {130, "NS-DVD", "DPNSS_NIGHT_SERVICE-DIVERTED", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {131, "NS-RDVT", "DPNSS_NIGHT_SERVICE-REDIVERT", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {132, "NS-RDVG", "DPNSS_NIGHT_SERVICE-REDIVERTING", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {133, "NS-RDVD", "DPNSS_NIGHT_SERVICE-REDIVERTED", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {134, "NS-DA", "DPNSS_NIGHT_SERVICE-DEACTIVATED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {135, "Q-INFO", "QUEUE INFORMATION", DPNSS_NUMBER_OF_CALLS, DPNSS_NUMBER_OF_SERVERS, DPNSS_NONE, DPNSS_NONE }, - {136, "Q-PRIO", "QUEUE PRIORITY", DPNSS_PRIORITY_LEVEL, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {137, "SW-V", "SWAP - VALIDATION", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {138, "SW-R", "SWAP - REJECTED", DPNSS_LOCATION, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {139, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {140, "A2", "SSMF5 SIGNAL 'A-2'", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {141, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {142, "A5", "SSMF5 SIGNAL 'A-5'", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {143, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {144, "A8", "SSMF5 SIGNAL 'A-8'", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {145, "A10", "SSMF5 SIGNAL 'A-10'", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {146, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {147, "A13", "SSMF5 SIGNAL 'A-13'", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {148, "A14", "SSMF5 SIGNAL 'A-14'", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {149, "A12", "SSMF5 SIGNAL 'A-12'", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {150, "A7", "SSMF5 SIGNAL 'A-7'", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {151, "CBWF-CLB", "CALL BACK WHEN FREE-CALL BACK", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {152, "DVT", "DIVERT", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {153, "SOD-I", "DPNSS_STATE_OF_DEST-INDETERMINABLE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {154, "DVG", "DIVERTING", DPNSS_B_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {155, "SOD-REQ", "REQUEST DPNSS_STATE_OF_DEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {156, "CBWF-CB", "CALL BACK WHEN FREE-CALL BACK REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {157, "NAE-DC", "NETWORK ADDRESS EXTENSION", DPNSS_SUBADDRESS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {158, "SFI", "SUPPLEMENTARY FACILITIES INHIBITED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {159, "NAE-DI", "NETWORK ADDRESS EXTENSION-DESTINATION INCOMPLETE", DPNSS_SUBADDRESS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {160, "DRS", "DIRECT ROUTE SELECT", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {161, "AS", "ALARM STATUS", DPNSS_ALARM_LEVEL, DPNSS_STAFF_PRESENT, DPNSS_NONE, DPNSS_NONE }, - {162, "AS-R", "ALARM STATUS-REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {163, "TAD-R", "TIME AND DATE-REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {164, "TAD", "TIME AND DATE", DPNSS_TIME_AND_DATE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {165, "SATB", "SATELLITE BARRED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {166, "SERV", "SERVICE INFORMATION", DPNSS_SERVICES, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {167, "TID", "TRUNK IDENTITY", DPNSS_PBX_REFERENCE, DPNSS_TRUNK_GROUP_REF_NUMBER, DPNSS_TRUNK_MEMBER_REF_NUMBER, DPNSS_NONE}, - {168, "PARK", "PARK REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {169, "PKD", "PARKED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {170, "AC-NAO", "ADD-ON CONFERENCE-NO ADD ON CURRENTLY AVAILABLE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {171, "CBM-R", "CALL BACK MESSAGING-REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {172, "CBM-C", "CALL BACK MESSAGING-CANCEL", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {173, "NAE-CC", "NETWORK ADDRESS EXTENSION-CALLING/CALLED IDENTITY COMPLETE", DPNSS_SUBADDRESS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {174, "NAE-CI", "NETWORK ADDRESS EXTENSION-CALLING/CALLED IDENTITY INCOMPLETE", DPNSS_SUBADDRESS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {175, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {176, "AC-CDC", "ADD-ON CONFERENCE-CLEARDOWN CONFERENCE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {177, "AC-PI", "ADD-ON CONFERENCE-PARTY INDEX", DPNSS_CONF_PARTY_INDEX, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {178, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {179, "AC-DR", "ADD-ON CONFERENCE - DETAILS REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {180, "AC-PD", "ADD-ON CONFERENCE - PARTY", DPNSS_CONF_PARTY_DET, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {181, "AC-CBI", "ADD-ON CONFERENCE - CONFERENCE BRIDGE IDENTITY", DPNSS_CONF_BRIDGE_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {182, "CH-AC", "CHARGE REPORTING ACCOUNT CODE", DPNSS_ACCOUNT_CODE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {183, "CH-ACR", "CHARGE REPORTING ACCOUNT CODE REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {184, "CH-ACT", "CHARGE REPORTING - ACTIVE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {185, "CH-CLR", "CHARGE REPORTING - CLEAR", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {186, "CH-CR", "CHARGE REPORTING - COST REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {187, "CH-CST", "CHARGE REPORTING - COST, CURRENCY UNITS", DPNSS_COST_QUALIFIER, DPNSS_CURRENCY_INDICATION, DPNSS_NONE, DPNSS_NONE }, - {188, "CH-TR", "CHARGE REPORTING - TIME RATE", DPNSS_CURRENCY_UNITS, DPNSS_TIME_INTERVAL, DPNSS_COST_QUALIFIER, DPNSS_CURRENCY_INDICATION}, - {189, "CH-UR", "CHARGE REPORTING - UNIT", DPNSS_CURRENCY_UNITS, DPNSS_COST_QUALIFIER, DPNSS_CURRENCY_INDICATION, DPNSS_NONE}, - {190, "CH-UU", "CHARGE REPORTING - UNITS USED", DPNSS_UNITS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {191, "OPD", "OUTPUT DIGITS", DPNSS_REMOTE_ADDRESS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {192, "OPD-R", "OUTPUT DIGITS - REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {193, "IRD", "INTERNAL REROUTING DISABLED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {194, "ERD", "EXTERNAL REROUTING DISABLED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {195, "NLT-PT", "NON-LOOPED BACK TEST-PERFORM TEST", DPNSS_TEST_INDEX, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {196, "NLT-RQ", "NON-LOOPED BACK TEST-TEST REQUEST", DPNSS_TEST_INDEX, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {197, "NLT-SC", "NON-LOOPED BACK TEST-SEQUENCE COMPLETE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {198, "NLT-RES", "NON-LOOPED BACK TEST-RESULT", DPNSS_TEST_RESULT, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {199, "AUTO-A", "AUTOANSWER", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {200, "HF-A", "HANDS-FREE - ACTIVATED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {201, "HF-D", "HANDS-FREE - DEACTIVATED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {202, "EI-W", "EXECUTIVE INTRUSION-WITHDRAW", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {203, "DVT-RD", "DIVERT-REDIRECTION", DPNSS_REASON_FOR_REDIR, DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE }, - {204, "DVT-CF", "DIVERT-CALL FAILURE", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {205, "ASST-INFO", "ASSISTANCE-INFORMATION", DPNSS_TYPE_OF_ASSISTANCE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {206, "RED-BY", "REDIRECTION-BYPASS", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {207, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {208, "VIC", "VPN INITIATED CLEAR", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {209, "NPR-A", "NUMBER PRESENTATION RESTRICTION-A PARTY", DPNSS_REST_DOMAIN, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {210, "NPR-B", "NUMBER PRESENTATION RESTRICTION-B PARTY", DPNSS_REST_DOMAIN, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {211, "ARC", "AUXILIARY DPNSS_ROUTE_RES_CLASS", DPNSS_ROUTE_RES_CLASS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {212, "WOB", "WAIT ON BUSY", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {213, "GPU-R", "GROUP PICK-UP REQUEST", DPNSS_GRP_PICK_UP_CODE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {214, "PU-DVT", "PICK-UP DIVERT", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {215, "PU-DVG", "PICK-UP DIVERTING", DPNSS_TIME_INTERVAL, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {216, "DPU-R", "DIRECTED PICK-UP REQUEST", DPNSS_PICK_UP_CALL_TYPE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {217, "RCC-CA", "ROUTE CAPACITY CONTROL-CAPACITY AVAILABLE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {218, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {219, "RCC-OI", "ROUTE CAPACITY CONTROL-OVERRIDE INVOKED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {220, "PU-DVD", "PICK-UP DIVERTED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {221, "NPR-O", "NUMBER PRESENTATION RESTRICTION - OTHER PARTY", DPNSS_REST_DOMAIN, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {222, "MCI", "MALICIOUS CALL INDICATION", DPNSS_MALICIOUS_CALL_REF, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {223, "NSL", "NETWORK SIGNALLING LIMIT", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {224, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {225, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {226, "TCOS", "TRAVELLING CLASS OF SERVICE", DPNSS_ROUTE_RES_CLASS, DPNSS_CBR_GRP, DPNSS_FAC_LST_CODE, DPNSS_NONE}, - {227, "TCOS-R", "TRAVELLING CLASS OF SERVICE-REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {228, "DIV-RSC", "DIVERSION-REMOTE SET COMBINED", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {229, "DIV-RCC", "DIVERSION-REMOTE CANCEL COMBINED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {230, "RDC", "REDIRECTION CONTROL", DPNSS_TIMER_VALUE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {231, "CAUSE", "DPNSS_CLEARING_CAUSE", DPNSS_CLEARING_CAUSE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {232, "CP", "CALL PROCEEDING", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {233, "I-BC", "ISDN-BEARER CAPABILITY", DPNSS_BEARER_CAP, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {234, "I-CC", "ISDN-DPNSS_CLEARING_CAUSE", DPNSS_CAUSE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {235, "I-CPN", "ISDN-CALLING PARTY/CONNECTED NUMBER", DPNSS_ISDN_NUM_ATTR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {236, "I-CSA", "ISDN-CALLING PARTY/CONNECTED DPNSS_SUBADDRESS", DPNSS_ISDN_DPNSS_SUBADDRESS, DPNSS_ISDN_NUMBER_DIGITS, DPNSS_NONE, DPNSS_NONE }, - {237, "I-DSA", "ISDN-DESTINATION (CALLED PARTY) DPNSS_SUBADDRESS", DPNSS_ISDN_DPNSS_SUBADDRESS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {238, "I-HLC", "ISDN-HIGH LAYER COMPATIBILITY", DPNSS_HIGH_LAYER_COMP, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {239, "I-LLC", "ISDN-LOW LAYER COMPATIBILITY", DPNSS_LOW_LAYER_COMP, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {240, "I-PROG", "ISDN-PROGRESS", DPNSS_PROGRESS_INDICATOR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {241, "IPN", "INTERWORKING VIA A PRIVATE ISDN", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {242, "SAVE", "SAVE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {243, "V-NID", "VPN-NODAL IDENTITY", DPNSS_VPN_ACCESS_REF_NUM, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {244, "M-INDEX", "MESSAGE INDEX", DPNSS_INDEX_NUMBER, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {245, "CBM-CSU", "CALL BACK MESSAGING CALL SET-UP", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {246, "INT-A", "INTERIM ANSWER", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {247, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {248, "DVL", "DIVERSION - LAST CONTROLLING EXTENSION IDENTITY", DPNSS_B_PARTY_ADDR, DPNSS_DIVERSION_TYPE, DPNSS_RESTRICTION_INDICATOR, DPNSS_NONE}, - {249, "ROP-INV", "ROUTE OPTIMISATION INVITE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {250, "ROP-INVA", "ROUTE OPTIMISATION INVITE WITH ACKNOWLEDGEMENT", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {251, "PCLG-P", "PUBLIC CALLING PARTY NUMBER-PROVIDED", DPNSS_ISDN_NUM_ATTR, DPNSS_ISDN_NUMBER_DIGITS, DPNSS_NONE, DPNSS_NONE }, - {252, "PCLG-D", "PUBLIC CALLING PARTY NUMBER-DEFAULT", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, - {253, "PCON-P", "PUBLIC CONNECTED NUMBER-PROVIDED", DPNSS_ISDN_NUM_ATTR, DPNSS_ISDN_NUMBER_DIGITS, DPNSS_NONE, DPNSS_NONE }, - {254, "PCON-D", "PUBLIC CONNECTED NUMBER-DEFAULT", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {0, "NOT USED", "NOT USED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {1, "CLC-ORD", "CALLING/CALLED LINE CATEGORY ORDINARY", DPNSS_SERV_MAR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {2, "CLC-DEC", "CALLING/CALLED LINE CATEGORY DECADIC", DPNSS_STATUS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {3, "CLC-ISDN", "CALLING/CALLED LINE CATEGORY-PUBLIC ISDN", DPNSS_STATUS, DPNSS_DPNSS_ISDN_TYPE, DPNSS_NONE, DPNSS_NONE }, + {4, "CLC-PSTN", "CALLING/CALLED LINE CATEGORY-PSTN", DPNSS_STATUS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {5, "CLC-MF5", "CALLING/CALLED LINE CATEGORY-SSMF5", DPNSS_STATUS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {6, "CLC-OP", "CALLING/CALLED LINE CATEGORY-OPERATOR", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {7, "CLC-NET", "CALLING/CALLED LINE CATEGORY-NETWORK", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {8, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {9, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {10, "CBWF-R", "CALL BACK WHEN FREE-REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {11, "CBWF-FN", "CALL BACK WHEN FREE-FREE NOTIFICATION", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {12, "CBWF-CSUI", "CALL BACK WHEN FREE-CALL SET-UP(IMMEDIATE)", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {13, "CBWF-C", "CALL BACK WHEN FREE-CANCEL", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {14, "RO", "RING OUT", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {15, "CBC", "CALL BACK COMPLETE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {16, "CBWF-CSUD", "CALL BACK WHEN FREE -CALL SET-UP(DELAYED)", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {17, "CBWNU-R", "CALL BACK WHEN NEXT USEDREQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {18, "COS", "CLASS OF SERVICE", DPNSS_ROUTE_RES_CLASS, DPNSS_CBR_GRP, DPNSS_FAC_LST_CODE, DPNSS_NONE}, + {19, "LA", "LOOP AVOIDANCE", DPNSS_NO_OF_FUR_TRANS, DPNSS_NO_OF_FUR_ALT_R, DPNSS_NONE, DPNSS_NONE }, + {20, "EI-PVR", "EXECUTIVE INTRUSION-PRIOR VALIDATION", DPNSS_INT_CAP_LEV, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {21, "EI-R", "EXECUTIVE INTRUSION-REQUEST", DPNSS_INT_CAP_LEV, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {22, "IPL-R", "INTRUSION PROTECTION LEVEL-REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {23, "IPL", "INTRUSION PROTECTION LEVEL", DPNSS_INT_CAP_LEV, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {24, "EI-C", "EXECUTIVE INTRUSION-CONVERT", DPNSS_INT_CAP_LEV, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {25, "EI-I", "EXECUTIVE INTRUSION-INTRUDED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {26, "CW", "CALL WAITING", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {27, "CO", "CALL OFFER", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {28, "SN-REQ", "SEND NEXT-REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {29, "HGF", "HUNT GROUP FORWARDED", DPNSS_NESTING_LEVEL, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {30, "DIV-V", "DIVERSION-VALIDATION", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {31, "DIV-FM", "DIVERSION-FOLLOW ME", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {32, "DIV-BY", "DIVERSION-BY PASS", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {33, "DIV-CI", "DIVERSION CANCEL-IMMEDIATE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {34, "DIV-CR", "DIVERSION CANCEL-ON NO REPLY", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {35, "DIV-CB", "DIVERSION CANCEL-ON BUSY", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {36, "DIV-CA", "DIVERSION CANCEL-ALL", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {37, "DVG-I", "DIVERTING IMMEDIATE", DPNSS_B_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {38, "DVG-B", "DIVERTING ON BUSY", DPNSS_B_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {39, "DVG-R", "DIVERTING ON NO REPLY", DPNSS_B_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {40, "DVT-I", "DIVERT IMMEDIATE", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {41, "DVT-B", "DIVERT ON BUSY", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {42, "DVD-I", "DIVERTED IMMEDIATE", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {43, "DVD-B", "DIVERTED ON BUSY", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {44, "DVD-R", "DIVERTED ON NO REPLY", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {45, "DVT-R", "DIVERT ON NO REPLY", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {46, "SIC", "SERVICE INDICATOR CODE", DPNSS_SIC, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {47, "BSS-M", "BEARER SERVICE SELECTION-MANDATORY", DPNSS_SIC, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {48, "BSS-P", "BEARER SERVICE SELECTION-PREFERRED", DPNSS_SIC, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {49, "BSS-N", "BEARER SERVICE SELECTION-NOTIFICATION", DPNSS_SIC, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {50, "OLI/CLI", "ORIGINATING LINE IDENTITY/CALLED LINE IDENTITY", DPNSS_A_B_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {51, "RTI", "ROUTING INFORMATION, ROUTING INFORMATION", DPNSS_DPNSS_ISDN_TYPE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {52, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {53, "DVD-E", "DIVERTED-EXTERNALLY", DPNSS_DIVERSION_TYPE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {54, "REJ", "REJECT", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {55, "ACK", "ACKNOWLEDGE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {56, "SN", "SEND NEXT", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {57, "D-SIC", "DASS 2-SERVICE INDICATOR CODE", DPNSS_SIC, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {58, "NSI", "NON-SPECIFIED INFORMATION", DPNSS_NSI_IDENTIFIER, DPNSS_USER_DEFINED, DPNSS_USER_DEFINED, DPNSS_NONE }, + {59, "OCP", "ORIGINALLY CALLED PARTY", DPNSS_B_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {60, "HOLD-REQ", "HOLD REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {61, "RECON", "RECONNECTED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {62, "HDG", "HOLDING", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {63, "CD-Q", "CALL DISTRIBUTION-QUEUE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {64, "TEXT-M", "TEXT MESSAGE", DPNSS_TEXT, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {65, "SOD-B", "STATE OF DESTINATION-BUSY", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {66, "SOD-F", "STATE OF DESTINATION-FREE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {67, "CD-DNQ", "CALL DISTRIBUTION-DO NOT QUEUE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {68, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {69, "CD-LINK", "CALL DISTRIBUTION-LINKED", DPNSS_CALL_INDEX, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {70, "DIV-RSI", "DIVERSION-REMOTE SET IMMEDIATE", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {71, "DIV-RSB", "DIVERSION-REMOTE SET ON BUSY", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {72, "DIV-RSR", "DIVERSION-REMOTE SET ON NO REPLY", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {73, "DIV-RCI", "DIVERSION-REMOTE CANCEL IMMEDIATE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {74, "DIV-RCB", "DIVERSION-REMOTE CANCEL ON BUSY", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {75, "DIV-RCR", "DIVERSION-REMOTE CANCEL ON NO REPLY", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {76, "DIV-RCA", "DIVERSION-REMOTE CANCEL ALL", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {77, "PASSW", "PASSWORD", DPNSS_PASSWORD, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {78, "SPL", "SPLIT", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {79, "TWP", "TWO PARTY", DPNSS_CALL_DIR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {80, "ENQ", "ENQUIRY CALL", DPNSS_HC_CLC, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {81, "SCE", "SINGLE CHANNEL ENQUIRY", DPNSS_HC_CLC, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {82, "TRFD", "TRANSFERRED", DPNSS_CALL_DIR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {83, "SHTL", "SHUTTLE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {84, "COC", "CONNECTED CALL", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {85, "TRFR", "TRANSFER", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {86, "CD-FN", "CALL DISTRIBUTION-FREE NOTIFY", DPNSS_CALL_INDEX, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {87, "ICC", "INTERCOM CALL", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {88, "AD-RQ", "ADD-ON REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {89, "AD-V", "ADD-ON VALIDATION", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {90, "AD-O", "ADDED-ON", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {91, "ENH", "ENHANCED SSMF5", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {92, "BAS", "BASIC SSMF5", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {93, "CD-UNLINK", "CALL DISTRIBUTION-UNLINKED", DPNSS_CALL_INDEX, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {94, "SNU", "SIGNAL NOT UNDERSTOOD", DPNSS_ENHANCED_STR_ID, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {95, "SU", "SERVICE UNAVAILABLE", DPNSS_STRING_ID, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {96, "RR-SNU", "RECALL REJECTED SIGNAL NOT UNDERSTOOD", DPNSS_ENHANCED_STR_ID, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {97, "CD-CSU", "CALL DISTRIBUTION-CALL SET UP", DPNSS_CALL_INDEX, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {98, "IG-SNU", "IGNORED-SIGNAL NOT UNDERSTOOD", DPNSS_STRING_ID_LIST, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {99, "IG-SU", "IGNORED-SERVICE UNAVAILABLE", DPNSS_STRING_ID_LIST, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {100, "TEXT", "TEXTUAL DISPLAY", DPNSS_TEXT, DPNSS_TEXT_TYPE, DPNSS_NONE, DPNSS_NONE }, + {101, "SIM-A", "SIMULATED ANSWER", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {102, "ACT", "ACTIVATE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {103, "DEACT", "DEACTIVATE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {104, "TCS", "TRAFFIC-CHANNEL STATUS", DPNSS_CHANNEL_STATUS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {105, "CHID", "CHANNEL IDENTITY", DPNSS_CHANNEL_NUMBER, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {106, "FR-R", "FORCED RELEASE-REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {107, "PB-P", "PRIORITY BREAKDOWN-PROTECTION", DPNSS_BPL, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {108, "PB-R", "PRIORITY BREAKDOWN-REQUEST", DPNSS_BCL, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {109, "DI", "DEVICE IDENTITY", DPNSS_DEVICE_INDEX, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {110, "ROP-R", "ROUTE OPTIMISATION-REQUEST", DPNSS_CR_NO, DPNSS_CALL_ID_LENGTH, DPNSS_NONE, DPNSS_NONE }, + {111, "ROP-CSU", "ROUTE OPTIMISATION-CALL SET UP", DPNSS_CALL_ID_LENGTH, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {112, "ROP-CON", "ROUTE OPTIMISATION-CONNECTED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {113, "DND", "DO NOT DISTURB", DPNSS_STATE_OF_DEST, DPNSS_STATE_OF_DEST_QUAL, DPNSS_NONE, DPNSS_NONE }, + {114, "DND-O", "DO NOT DISTURB-OVERRIDE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {115, "DND-S", "DO NOT DISTURB-SET", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {116, "DND-C", "DO NOT DISTURB-CLEAR", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {117, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {118, "EST", "EXTENSION STATUS CALL", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {119, "CDIV", "CONTROLLED DIVERSION", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {120, "RDG", "REDIRECTING", DPNSS_REASON_FOR_REDIR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {121, "RCF", "REDIRECTING ON CALL FAILURE", DPNSS_CLEARING_CAUSE, DPNSS_B_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE }, + {122, "TOV-R", "TAKEOVER REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {123, "TOV-V", "TAKEOVER VALIDATION", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {124, "SER-R", "SERIES CALL REQUEST", DPNSS_RECONT_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {125, "SER-C", "SERIES CALL-CANCEL", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {126, "SER-E", "SERIES CALL-ESTABLISHMENT", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {127, "NS-N, NIGHT","SERVICE-NOTIFICATION", DPNSS_STATE_OF_OPERATOR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {128, "NS-DVT", "NIGHT SERVICE-DIVERT", DPNSS_NIGHT_SERVICE, DPNSS_PBX_FLAG, DPNSS_NONE, DPNSS_NONE }, + {129, "NS-DVG", "DPNSS_NIGHT_SERVICE-DIVERTING", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {130, "NS-DVD", "DPNSS_NIGHT_SERVICE-DIVERTED", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {131, "NS-RDVT", "DPNSS_NIGHT_SERVICE-REDIVERT", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {132, "NS-RDVG", "DPNSS_NIGHT_SERVICE-REDIVERTING", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {133, "NS-RDVD", "DPNSS_NIGHT_SERVICE-REDIVERTED", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {134, "NS-DA", "DPNSS_NIGHT_SERVICE-DEACTIVATED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {135, "Q-INFO", "QUEUE INFORMATION", DPNSS_NUMBER_OF_CALLS, DPNSS_NUMBER_OF_SERVERS, DPNSS_NONE, DPNSS_NONE }, + {136, "Q-PRIO", "QUEUE PRIORITY", DPNSS_PRIORITY_LEVEL, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {137, "SW-V", "SWAP - VALIDATION", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {138, "SW-R", "SWAP - REJECTED", DPNSS_LOCATION, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {139, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {140, "A2", "SSMF5 SIGNAL 'A-2'", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {141, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {142, "A5", "SSMF5 SIGNAL 'A-5'", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {143, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {144, "A8", "SSMF5 SIGNAL 'A-8'", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {145, "A10", "SSMF5 SIGNAL 'A-10'", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {146, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {147, "A13", "SSMF5 SIGNAL 'A-13'", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {148, "A14", "SSMF5 SIGNAL 'A-14'", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {149, "A12", "SSMF5 SIGNAL 'A-12'", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {150, "A7", "SSMF5 SIGNAL 'A-7'", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {151, "CBWF-CLB", "CALL BACK WHEN FREE-CALL BACK", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {152, "DVT", "DIVERT", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {153, "SOD-I", "DPNSS_STATE_OF_DEST-INDETERMINABLE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {154, "DVG", "DIVERTING", DPNSS_B_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {155, "SOD-REQ", "REQUEST DPNSS_STATE_OF_DEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {156, "CBWF-CB", "CALL BACK WHEN FREE-CALL BACK REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {157, "NAE-DC", "NETWORK ADDRESS EXTENSION", DPNSS_SUBADDRESS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {158, "SFI", "SUPPLEMENTARY FACILITIES INHIBITED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {159, "NAE-DI", "NETWORK ADDRESS EXTENSION-DESTINATION INCOMPLETE", DPNSS_SUBADDRESS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {160, "DRS", "DIRECT ROUTE SELECT", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {161, "AS", "ALARM STATUS", DPNSS_ALARM_LEVEL, DPNSS_STAFF_PRESENT, DPNSS_NONE, DPNSS_NONE }, + {162, "AS-R", "ALARM STATUS-REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {163, "TAD-R", "TIME AND DATE-REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {164, "TAD", "TIME AND DATE", DPNSS_TIME_AND_DATE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {165, "SATB", "SATELLITE BARRED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {166, "SERV", "SERVICE INFORMATION", DPNSS_SERVICES, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {167, "TID", "TRUNK IDENTITY", DPNSS_PBX_REFERENCE, DPNSS_TRUNK_GROUP_REF_NUMBER, DPNSS_TRUNK_MEMBER_REF_NUMBER, DPNSS_NONE}, + {168, "PARK", "PARK REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {169, "PKD", "PARKED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {170, "AC-NAO", "ADD-ON CONFERENCE-NO ADD ON CURRENTLY AVAILABLE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {171, "CBM-R", "CALL BACK MESSAGING-REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {172, "CBM-C", "CALL BACK MESSAGING-CANCEL", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {173, "NAE-CC", "NETWORK ADDRESS EXTENSION-CALLING/CALLED IDENTITY COMPLETE", DPNSS_SUBADDRESS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {174, "NAE-CI", "NETWORK ADDRESS EXTENSION-CALLING/CALLED IDENTITY INCOMPLETE", DPNSS_SUBADDRESS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {175, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {176, "AC-CDC", "ADD-ON CONFERENCE-CLEARDOWN CONFERENCE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {177, "AC-PI", "ADD-ON CONFERENCE-PARTY INDEX", DPNSS_CONF_PARTY_INDEX, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {178, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {179, "AC-DR", "ADD-ON CONFERENCE - DETAILS REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {180, "AC-PD", "ADD-ON CONFERENCE - PARTY", DPNSS_CONF_PARTY_DET, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {181, "AC-CBI", "ADD-ON CONFERENCE - CONFERENCE BRIDGE IDENTITY", DPNSS_CONF_BRIDGE_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {182, "CH-AC", "CHARGE REPORTING ACCOUNT CODE", DPNSS_ACCOUNT_CODE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {183, "CH-ACR", "CHARGE REPORTING ACCOUNT CODE REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {184, "CH-ACT", "CHARGE REPORTING - ACTIVE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {185, "CH-CLR", "CHARGE REPORTING - CLEAR", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {186, "CH-CR", "CHARGE REPORTING - COST REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {187, "CH-CST", "CHARGE REPORTING - COST, CURRENCY UNITS", DPNSS_COST_QUALIFIER, DPNSS_CURRENCY_INDICATION, DPNSS_NONE, DPNSS_NONE }, + {188, "CH-TR", "CHARGE REPORTING - TIME RATE", DPNSS_CURRENCY_UNITS, DPNSS_TIME_INTERVAL, DPNSS_COST_QUALIFIER, DPNSS_CURRENCY_INDICATION}, + {189, "CH-UR", "CHARGE REPORTING - UNIT", DPNSS_CURRENCY_UNITS, DPNSS_COST_QUALIFIER, DPNSS_CURRENCY_INDICATION, DPNSS_NONE}, + {190, "CH-UU", "CHARGE REPORTING - UNITS USED", DPNSS_UNITS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {191, "OPD", "OUTPUT DIGITS", DPNSS_REMOTE_ADDRESS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {192, "OPD-R", "OUTPUT DIGITS - REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {193, "IRD", "INTERNAL REROUTING DISABLED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {194, "ERD", "EXTERNAL REROUTING DISABLED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {195, "NLT-PT", "NON-LOOPED BACK TEST-PERFORM TEST", DPNSS_TEST_INDEX, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {196, "NLT-RQ", "NON-LOOPED BACK TEST-TEST REQUEST", DPNSS_TEST_INDEX, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {197, "NLT-SC", "NON-LOOPED BACK TEST-SEQUENCE COMPLETE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {198, "NLT-RES", "NON-LOOPED BACK TEST-RESULT", DPNSS_TEST_RESULT, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {199, "AUTO-A", "AUTOANSWER", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {200, "HF-A", "HANDS-FREE - ACTIVATED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {201, "HF-D", "HANDS-FREE - DEACTIVATED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {202, "EI-W", "EXECUTIVE INTRUSION-WITHDRAW", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {203, "DVT-RD", "DIVERT-REDIRECTION", DPNSS_REASON_FOR_REDIR, DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE }, + {204, "DVT-CF", "DIVERT-CALL FAILURE", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {205, "ASST-INFO", "ASSISTANCE-INFORMATION", DPNSS_TYPE_OF_ASSISTANCE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {206, "RED-BY", "REDIRECTION-BYPASS", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {207, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {208, "VIC", "VPN INITIATED CLEAR", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {209, "NPR-A", "NUMBER PRESENTATION RESTRICTION-A PARTY", DPNSS_REST_DOMAIN, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {210, "NPR-B", "NUMBER PRESENTATION RESTRICTION-B PARTY", DPNSS_REST_DOMAIN, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {211, "ARC", "AUXILIARY DPNSS_ROUTE_RES_CLASS", DPNSS_ROUTE_RES_CLASS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {212, "WOB", "WAIT ON BUSY", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {213, "GPU-R", "GROUP PICK-UP REQUEST", DPNSS_GRP_PICK_UP_CODE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {214, "PU-DVT", "PICK-UP DIVERT", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {215, "PU-DVG", "PICK-UP DIVERTING", DPNSS_TIME_INTERVAL, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {216, "DPU-R", "DIRECTED PICK-UP REQUEST", DPNSS_PICK_UP_CALL_TYPE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {217, "RCC-CA", "ROUTE CAPACITY CONTROL-CAPACITY AVAILABLE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {218, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {219, "RCC-OI", "ROUTE CAPACITY CONTROL-OVERRIDE INVOKED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {220, "PU-DVD", "PICK-UP DIVERTED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {221, "NPR-O", "NUMBER PRESENTATION RESTRICTION - OTHER PARTY", DPNSS_REST_DOMAIN, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {222, "MCI", "MALICIOUS CALL INDICATION", DPNSS_MALICIOUS_CALL_REF, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {223, "NSL", "NETWORK SIGNALLING LIMIT", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {224, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {225, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {226, "TCOS", "TRAVELLING CLASS OF SERVICE", DPNSS_ROUTE_RES_CLASS, DPNSS_CBR_GRP, DPNSS_FAC_LST_CODE, DPNSS_NONE}, + {227, "TCOS-R", "TRAVELLING CLASS OF SERVICE-REQUEST", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {228, "DIV-RSC", "DIVERSION-REMOTE SET COMBINED", DPNSS_C_PARTY_ADDR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {229, "DIV-RCC", "DIVERSION-REMOTE CANCEL COMBINED", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {230, "RDC", "REDIRECTION CONTROL", DPNSS_TIMER_VALUE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {231, "CAUSE", "DPNSS_CLEARING_CAUSE", DPNSS_CLEARING_CAUSE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {232, "CP", "CALL PROCEEDING", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {233, "I-BC", "ISDN-BEARER CAPABILITY", DPNSS_BEARER_CAP, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {234, "I-CC", "ISDN-DPNSS_CLEARING_CAUSE", DPNSS_CAUSE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {235, "I-CPN", "ISDN-CALLING PARTY/CONNECTED NUMBER", DPNSS_ISDN_NUM_ATTR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {236, "I-CSA", "ISDN-CALLING PARTY/CONNECTED DPNSS_SUBADDRESS", DPNSS_ISDN_DPNSS_SUBADDRESS, DPNSS_ISDN_NUMBER_DIGITS, DPNSS_NONE, DPNSS_NONE }, + {237, "I-DSA", "ISDN-DESTINATION (CALLED PARTY) DPNSS_SUBADDRESS", DPNSS_ISDN_DPNSS_SUBADDRESS, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {238, "I-HLC", "ISDN-HIGH LAYER COMPATIBILITY", DPNSS_HIGH_LAYER_COMP, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {239, "I-LLC", "ISDN-LOW LAYER COMPATIBILITY", DPNSS_LOW_LAYER_COMP, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {240, "I-PROG", "ISDN-PROGRESS", DPNSS_PROGRESS_INDICATOR, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {241, "IPN", "INTERWORKING VIA A PRIVATE ISDN", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {242, "SAVE", "SAVE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {243, "V-NID", "VPN-NODAL IDENTITY", DPNSS_VPN_ACCESS_REF_NUM, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {244, "M-INDEX", "MESSAGE INDEX", DPNSS_INDEX_NUMBER, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {245, "CBM-CSU", "CALL BACK MESSAGING CALL SET-UP", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {246, "INT-A", "INTERIM ANSWER", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {247, "undefined", "undefined", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {248, "DVL", "DIVERSION - LAST CONTROLLING EXTENSION IDENTITY", DPNSS_B_PARTY_ADDR, DPNSS_DIVERSION_TYPE, DPNSS_RESTRICTION_INDICATOR, DPNSS_NONE}, + {249, "ROP-INV", "ROUTE OPTIMISATION INVITE", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {250, "ROP-INVA", "ROUTE OPTIMISATION INVITE WITH ACKNOWLEDGEMENT", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {251, "PCLG-P", "PUBLIC CALLING PARTY NUMBER-PROVIDED", DPNSS_ISDN_NUM_ATTR, DPNSS_ISDN_NUMBER_DIGITS, DPNSS_NONE, DPNSS_NONE }, + {252, "PCLG-D", "PUBLIC CALLING PARTY NUMBER-DEFAULT", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, + {253, "PCON-P", "PUBLIC CONNECTED NUMBER-PROVIDED", DPNSS_ISDN_NUM_ATTR, DPNSS_ISDN_NUMBER_DIGITS, DPNSS_NONE, DPNSS_NONE }, + {254, "PCON-D", "PUBLIC CONNECTED NUMBER-DEFAULT", DPNSS_NONE, DPNSS_NONE, DPNSS_NONE, DPNSS_NONE }, }; static int dissect_dpnss_sic(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset) { - guint8 octet, type_of_data; - - octet = tvb_get_guint8(tvb,offset); - type_of_data = (octet & 0x70)>>4; - proto_tree_add_item(tree, hf_dpnss_ext_bit, tvb, offset, 1, FALSE); - proto_tree_add_item(tree, hf_dpnss_sic_type, tvb, offset, 1, FALSE); - switch(type_of_data){ - case 1: - /* Type of Data (001) : Details for Speech */ - proto_tree_add_item(tree, hf_dpnss_sic_details_for_speech, tvb, offset, 1, FALSE); - break; - case 2: - /* Type of Data (010) : Data Rates */ - proto_tree_add_item(tree, hf_dpnss_sic_details_for_data1, tvb, offset, 1, FALSE); - break; - case 3: - /* Type of Data (011) : Data Rates */ - proto_tree_add_item(tree, hf_dpnss_sic_details_for_data2, tvb, offset, 1, FALSE); - break; - default: - /* Illegal */ - break; - } - offset++; - if((octet&0x80)==0x80){ - /* Extension bit set - * Synch/Asynchronous Information - */ - octet = tvb_get_guint8(tvb,offset); - type_of_data = octet&0x3; - proto_tree_add_item(tree, hf_dpnss_ext_bit_notall, tvb, offset, 1, FALSE); - switch(type_of_data){ - case 3: - /* Synchronous */ - case 4: - /* Synchronous */ - proto_tree_add_item(tree, hf_dpnss_sic_oct2_net_ind_clk, tvb, offset, 1, FALSE); - proto_tree_add_item(tree, hf_dpnss_sic_oct2_sync_data_format, tvb, offset, 1, FALSE); - proto_tree_add_item(tree, hf_dpnss_sic_oct2_sync_byte_timing, tvb, offset, 1, FALSE); - break; - case 5: - /* Asynchronous */ - case 6: - /* Asynchronous */ - case 7: - /* Asynchronous */ - proto_tree_add_item(tree, hf_dpnss_sic_oct2_async_flow_ctrl, tvb, offset, 1, FALSE); - proto_tree_add_item(tree, hf_dpnss_sic_oct2_async_data, tvb, offset, 1, FALSE); - break; - default: - break; - } - proto_tree_add_item(tree, hf_dpnss_sic_oct2_duplex, tvb, offset, 1, FALSE); - proto_tree_add_item(tree, hf_dpnss_sic_oct2_data_type, tvb, offset, 1, FALSE); - offset++; - } - return offset; + guint8 octet, type_of_data; + + octet = tvb_get_guint8(tvb,offset); + type_of_data = (octet & 0x70)>>4; + proto_tree_add_item(tree, hf_dpnss_ext_bit, tvb, offset, 1, FALSE); + proto_tree_add_item(tree, hf_dpnss_sic_type, tvb, offset, 1, FALSE); + switch(type_of_data){ + case 1: + /* Type of Data (001) : Details for Speech */ + proto_tree_add_item(tree, hf_dpnss_sic_details_for_speech, tvb, offset, 1, FALSE); + break; + case 2: + /* Type of Data (010) : Data Rates */ + proto_tree_add_item(tree, hf_dpnss_sic_details_for_data1, tvb, offset, 1, FALSE); + break; + case 3: + /* Type of Data (011) : Data Rates */ + proto_tree_add_item(tree, hf_dpnss_sic_details_for_data2, tvb, offset, 1, FALSE); + break; + default: + /* Illegal */ + break; + } + offset++; + if((octet&0x80)==0x80){ + /* Extension bit set + * Synch/Asynchronous Information + */ + octet = tvb_get_guint8(tvb,offset); + type_of_data = octet&0x3; + proto_tree_add_item(tree, hf_dpnss_ext_bit_notall, tvb, offset, 1, FALSE); + switch(type_of_data){ + case 3: + /* Synchronous */ + case 4: + /* Synchronous */ + proto_tree_add_item(tree, hf_dpnss_sic_oct2_net_ind_clk, tvb, offset, 1, FALSE); + proto_tree_add_item(tree, hf_dpnss_sic_oct2_sync_data_format, tvb, offset, 1, FALSE); + proto_tree_add_item(tree, hf_dpnss_sic_oct2_sync_byte_timing, tvb, offset, 1, FALSE); + break; + case 5: + /* Asynchronous */ + case 6: + /* Asynchronous */ + case 7: + /* Asynchronous */ + proto_tree_add_item(tree, hf_dpnss_sic_oct2_async_flow_ctrl, tvb, offset, 1, FALSE); + proto_tree_add_item(tree, hf_dpnss_sic_oct2_async_data, tvb, offset, 1, FALSE); + break; + default: + break; + } + proto_tree_add_item(tree, hf_dpnss_sic_oct2_duplex, tvb, offset, 1, FALSE); + proto_tree_add_item(tree, hf_dpnss_sic_oct2_data_type, tvb, offset, 1, FALSE); + offset++; + } + return offset; } /* static const value_string dpnss_serv_mark_vals[] = { - { 1, "PSTN BARRED"}, - { 2, "EMERGENCY TELEPHONE"}, - { 3, "HUNT GROUP"}, - { 4, "DISTRIBUTED GROUP"}, - { 5, "UNABLE TO INITIATE CLEARING AFTER ANSWER"}, - { 6, "RING GROUP"}, - { 0, NULL } + { 1, "PSTN BARRED"}, + { 2, "EMERGENCY TELEPHONE"}, + { 3, "HUNT GROUP"}, + { 4, "DISTRIBUTED GROUP"}, + { 5, "UNABLE TO INITIATE CLEARING AFTER ANSWER"}, + { 6, "RING GROUP"}, + { 0, NULL } }; */ -/* Supplementary Information parameters +/* Supplementary Information parameters * TODO Add decoding of parameters where needed. */ static const value_string dpnss_sup_serv_par_str_vals[] = { - { DPNSS_NONE, "None"}, - { DPNSS_SERV_MAR, "Servive Marking"}, - { DPNSS_STATUS, "Status"}, - { DPNSS_ROUTE_RES_CLASS, "Route Restriction Class"}, - { DPNSS_CBR_GRP, "Call Barring Group"}, - { DPNSS_FAC_LST_CODE, "Facility list code"}, - { DPNSS_NO_OF_FUR_TRANS, "Number of Further Transits"}, - { DPNSS_NO_OF_FUR_ALT_R, "Number of Further Alternative routes"}, - { DPNSS_INT_CAP_LEV, "Intrusion Capability level"}, - { DPNSS_NESTING_LEVEL, "Nesting level"}, - { DPNSS_C_PARTY_ADDR, "C Party Address"}, - { DPNSS_B_PARTY_ADDR, "B Party Address"}, - { DPNSS_SIC, "SIC"}, - { DPNSS_A_B_PARTY_ADDR, "A/B Party Address"}, - { DPNSS_DIVERSION_TYPE, "Diversion Type"}, - { DPNSS_NSI_IDENTIFIER, "NSI Identifier"}, - { DPNSS_USER_DEFINED, "User Defined"}, - { DPNSS_TEXT, "Text"}, - { DPNSS_CALL_INDEX, "Call Index"}, - { DPNSS_PASSWORD, "Password"}, - { DPNSS_CALL_DIR, "Call Direction"}, - { DPNSS_DPNSS_ISDN_TYPE, "DPNNS ISDN Type"}, - { DPNSS_HC_CLC, "HC CLC"}, - { DPNSS_ENHANCED_STR_ID, "Enhanced String Identity"}, - { DPNSS_STRING_ID, "String Identity"}, - { DPNSS_STRING_ID_LIST, "String Identity List"}, - { DPNSS_TEXT_TYPE, "Text Type"}, - { DPNSS_CHANNEL_STATUS, "Channel Status"}, - { DPNSS_CHANNEL_NUMBER, "Channel Number"}, - { DPNSS_BPL, "BPL"}, - { DPNSS_BCL, "BCL"}, - { DPNSS_DEVICE_INDEX, "Device Index"}, - { DPNSS_CR_NO, "Call Reference Number"}, - { DPNSS_CALL_ID_LENGTH, "Call Identity Length"}, - { DPNSS_STATE_OF_DEST, "State of Destination"}, - { DPNSS_STATE_OF_DEST_QUAL, "State of Destination Qualifier"}, - { DPNSS_REASON_FOR_REDIR, "Reason For Redirection"}, - { DPNSS_CLEARING_CAUSE, "Clearing Cause"}, - { DPNSS_RECONT_ADDR, "Reconnect Address"}, - { DPNSS_STATE_OF_OPERATOR, "State of Operator"}, - { DPNSS_NIGHT_SERVICE, "Night Service"}, - { DPNSS_PBX_FLAG, "PBX flag"}, - { DPNSS_NUMBER_OF_CALLS, "Number of Calls"}, - { DPNSS_NUMBER_OF_SERVERS, "Number of Servers"}, - { DPNSS_PRIORITY_LEVEL, "Priority Level"}, - { DPNSS_LOCATION, "Location"}, - { DPNSS_SUBADDRESS, "Subaddress"}, - { DPNSS_ALARM_LEVEL, "Alarm Level"}, - { DPNSS_STAFF_PRESENT, "Staff Present"}, - { DPNSS_TIME_AND_DATE, "Time and Date"}, - { DPNSS_SERVICES, "Services"}, - { DPNSS_PBX_REFERENCE, "PBX Reference"}, - { DPNSS_TRUNK_GROUP_REF_NUMBER, "Trunk Group reference Number"}, - { DPNSS_TRUNK_MEMBER_REF_NUMBER,"Trunk Member Reference Number"}, - { DPNSS_CONF_PARTY_INDEX, "Conference Party Index"}, - { DPNSS_CONF_PARTY_DET, "Conference Party Details"}, - { DPNSS_ACCOUNT_CODE, "Account code"}, - { DPNSS_CONF_BRIDGE_ADDR, "Conference Bridge Address"}, - { DPNSS_COST_QUALIFIER, "Cost Qualifier"}, - { DPNSS_CURRENCY_INDICATION, "Currency Indication"}, - { DPNSS_CURRENCY_UNITS, "Currency Units"}, - { DPNSS_TIME_INTERVAL, "Time Interval"}, - { DPNSS_UNITS, "Units"}, - { DPNSS_REMOTE_ADDRESS, "Remote Address"}, - { DPNSS_TEST_INDEX, "Test Index"}, - { DPNSS_TEST_RESULT, "Test Result"}, - { DPNSS_TYPE_OF_ASSISTANCE, "Type of assistance"}, - { DPNSS_REST_DOMAIN, "Restriction Domain"}, - { DPNSS_GRP_PICK_UP_CODE, "Group Pick-Up Code"}, - { DPNSS_PICK_UP_CALL_TYPE, "Pick-Up call type"}, - { DPNSS_MALICIOUS_CALL_REF, "Malicious call reference"}, - { DPNSS_TIMER_VALUE, "Timer Value"}, - { DPNSS_BEARER_CAP, "Bearer capability"}, - { DPNSS_ISDN_NUM_ATTR, "ISDM number attribute"}, - { DPNSS_ISDN_DPNSS_SUBADDRESS, "ISDN DPNNS Subaddress"}, - { DPNSS_ISDN_NUMBER_DIGITS, "ISDN Number Digits"}, - { DPNSS_HIGH_LAYER_COMP, "High Layer Compatibility"}, - { DPNSS_LOW_LAYER_COMP, "Low layer Compatibility"}, - { DPNSS_PROGRESS_INDICATOR, "Progress Indicator"}, - { DPNSS_VPN_ACCESS_REF_NUM, "VPN Access reference Number"}, - { DPNSS_INDEX_NUMBER, "Index Number"}, - { DPNSS_RESTRICTION_INDICATOR, "Restriction Indicator"}, - { DPNSS_CAUSE, "Cause"}, - { 0, NULL } + { DPNSS_NONE, "None"}, + { DPNSS_SERV_MAR, "Servive Marking"}, + { DPNSS_STATUS, "Status"}, + { DPNSS_ROUTE_RES_CLASS, "Route Restriction Class"}, + { DPNSS_CBR_GRP, "Call Barring Group"}, + { DPNSS_FAC_LST_CODE, "Facility list code"}, + { DPNSS_NO_OF_FUR_TRANS, "Number of Further Transits"}, + { DPNSS_NO_OF_FUR_ALT_R, "Number of Further Alternative routes"}, + { DPNSS_INT_CAP_LEV, "Intrusion Capability level"}, + { DPNSS_NESTING_LEVEL, "Nesting level"}, + { DPNSS_C_PARTY_ADDR, "C Party Address"}, + { DPNSS_B_PARTY_ADDR, "B Party Address"}, + { DPNSS_SIC, "SIC"}, + { DPNSS_A_B_PARTY_ADDR, "A/B Party Address"}, + { DPNSS_DIVERSION_TYPE, "Diversion Type"}, + { DPNSS_NSI_IDENTIFIER, "NSI Identifier"}, + { DPNSS_USER_DEFINED, "User Defined"}, + { DPNSS_TEXT, "Text"}, + { DPNSS_CALL_INDEX, "Call Index"}, + { DPNSS_PASSWORD, "Password"}, + { DPNSS_CALL_DIR, "Call Direction"}, + { DPNSS_DPNSS_ISDN_TYPE, "DPNNS ISDN Type"}, + { DPNSS_HC_CLC, "HC CLC"}, + { DPNSS_ENHANCED_STR_ID, "Enhanced String Identity"}, + { DPNSS_STRING_ID, "String Identity"}, + { DPNSS_STRING_ID_LIST, "String Identity List"}, + { DPNSS_TEXT_TYPE, "Text Type"}, + { DPNSS_CHANNEL_STATUS, "Channel Status"}, + { DPNSS_CHANNEL_NUMBER, "Channel Number"}, + { DPNSS_BPL, "BPL"}, + { DPNSS_BCL, "BCL"}, + { DPNSS_DEVICE_INDEX, "Device Index"}, + { DPNSS_CR_NO, "Call Reference Number"}, + { DPNSS_CALL_ID_LENGTH, "Call Identity Length"}, + { DPNSS_STATE_OF_DEST, "State of Destination"}, + { DPNSS_STATE_OF_DEST_QUAL, "State of Destination Qualifier"}, + { DPNSS_REASON_FOR_REDIR, "Reason For Redirection"}, + { DPNSS_CLEARING_CAUSE, "Clearing Cause"}, + { DPNSS_RECONT_ADDR, "Reconnect Address"}, + { DPNSS_STATE_OF_OPERATOR, "State of Operator"}, + { DPNSS_NIGHT_SERVICE, "Night Service"}, + { DPNSS_PBX_FLAG, "PBX flag"}, + { DPNSS_NUMBER_OF_CALLS, "Number of Calls"}, + { DPNSS_NUMBER_OF_SERVERS, "Number of Servers"}, + { DPNSS_PRIORITY_LEVEL, "Priority Level"}, + { DPNSS_LOCATION, "Location"}, + { DPNSS_SUBADDRESS, "Subaddress"}, + { DPNSS_ALARM_LEVEL, "Alarm Level"}, + { DPNSS_STAFF_PRESENT, "Staff Present"}, + { DPNSS_TIME_AND_DATE, "Time and Date"}, + { DPNSS_SERVICES, "Services"}, + { DPNSS_PBX_REFERENCE, "PBX Reference"}, + { DPNSS_TRUNK_GROUP_REF_NUMBER, "Trunk Group reference Number"}, + { DPNSS_TRUNK_MEMBER_REF_NUMBER,"Trunk Member Reference Number"}, + { DPNSS_CONF_PARTY_INDEX, "Conference Party Index"}, + { DPNSS_CONF_PARTY_DET, "Conference Party Details"}, + { DPNSS_ACCOUNT_CODE, "Account code"}, + { DPNSS_CONF_BRIDGE_ADDR, "Conference Bridge Address"}, + { DPNSS_COST_QUALIFIER, "Cost Qualifier"}, + { DPNSS_CURRENCY_INDICATION, "Currency Indication"}, + { DPNSS_CURRENCY_UNITS, "Currency Units"}, + { DPNSS_TIME_INTERVAL, "Time Interval"}, + { DPNSS_UNITS, "Units"}, + { DPNSS_REMOTE_ADDRESS, "Remote Address"}, + { DPNSS_TEST_INDEX, "Test Index"}, + { DPNSS_TEST_RESULT, "Test Result"}, + { DPNSS_TYPE_OF_ASSISTANCE, "Type of assistance"}, + { DPNSS_REST_DOMAIN, "Restriction Domain"}, + { DPNSS_GRP_PICK_UP_CODE, "Group Pick-Up Code"}, + { DPNSS_PICK_UP_CALL_TYPE, "Pick-Up call type"}, + { DPNSS_MALICIOUS_CALL_REF, "Malicious call reference"}, + { DPNSS_TIMER_VALUE, "Timer Value"}, + { DPNSS_BEARER_CAP, "Bearer capability"}, + { DPNSS_ISDN_NUM_ATTR, "ISDM number attribute"}, + { DPNSS_ISDN_DPNSS_SUBADDRESS, "ISDN DPNNS Subaddress"}, + { DPNSS_ISDN_NUMBER_DIGITS, "ISDN Number Digits"}, + { DPNSS_HIGH_LAYER_COMP, "High Layer Compatibility"}, + { DPNSS_LOW_LAYER_COMP, "Low layer Compatibility"}, + { DPNSS_PROGRESS_INDICATOR, "Progress Indicator"}, + { DPNSS_VPN_ACCESS_REF_NUM, "VPN Access reference Number"}, + { DPNSS_INDEX_NUMBER, "Index Number"}, + { DPNSS_RESTRICTION_INDICATOR, "Restriction Indicator"}, + { DPNSS_CAUSE, "Cause"}, + { 0, NULL } }; static void dissect_dpnns_sup_str_par(tvbuff_t *tvb, proto_tree * tree, int par_type_num, int par_start_offset, int par_end_offset) { - int par_len; + int par_len; - par_len = par_end_offset - par_start_offset; - if(par_len==0){ - par_type_num = DPNSS_NONE; - } - switch (par_type_num){ - case DPNSS_NONE: - proto_tree_add_text(tree, tvb, par_start_offset, par_len,"Par: None"); - break; + par_len = par_end_offset - par_start_offset; + if(par_len==0){ + par_type_num = DPNSS_NONE; + } + switch (par_type_num){ + case DPNSS_NONE: + proto_tree_add_text(tree, tvb, par_start_offset, par_len,"Par: None"); + break; /* TODO: Use individual dissection of parameters if hf fields needed or in the case where - special handling is needed for greater detail - - case DPNSS_SERV_MAR: - * p 173 - * More than one Service Marking character can be - * included in the Parameter, each being separated - * by the IA5 character space (2/0). - * If decoded use: dpnss_serv_mark_vals - * - case DPNSS_STATUS: - case DPNSS_ROUTE_RES_CLASS: - case DPNSS_CBR_GRP: - case DPNSS_FAC_LST_CODE: - case DPNSS_NO_OF_FUR_TRANS: - case DPNSS_NO_OF_FUR_ALT_R: - case DPNSS_INT_CAP_LEV: - case DPNSS_NESTING_LEVEL: - case DPNSS_C_PARTY_ADDR: - case DPNSS_B_PARTY_ADDR: - case DPNSS_SIC: - */ - case DPNSS_A_B_PARTY_ADDR: - proto_tree_add_item(tree, hf_dpnss_a_b_party_addr, tvb, par_start_offset, par_len, FALSE); - break; - - /* - case DPNSS_DIVERSION_TYPE: - case DPNSS_NSI_IDENTIFIER: - case DPNSS_USER_DEFINED: - case DPNSS_TEXT: - */ - case DPNSS_CALL_INDEX: - proto_tree_add_item(tree, hf_dpnss_call_idx, tvb, par_start_offset, par_len, FALSE); - break; - /* - - case DPNSS_PASSWORD: - case DPNSS_CALL_DIR: - case DPNSS_DPNSS_ISDN_TYPE: - case DPNSS_HC_CLC: - case DPNSS_ENHANCED_STR_ID: - case DPNSS_STRING_ID: - case DPNSS_STRING_ID_LIST: - case DPNSS_TEXT_TYPE: - case DPNSS_CHANNEL_STATUS: - case DPNSS_CHANNEL_NUMBER: - case DPNSS_BPL: - case DPNSS_BCL: - case DPNSS_DEVICE_INDEX: - case DPNSS_CR_NO: - case DPNSS_CALL_ID_LENGTH: - case DPNSS_STATE_OF_DEST: - case DPNSS_STATE_OF_DEST_QUAL: - case DPNSS_REASON_FOR_REDIR: - case DPNSS_CLEARING_CAUSE: - case DPNSS_RECONT_ADDR: - case DPNSS_STATE_OF_OPERATOR: - case DPNSS_NIGHT_SERVICE: - case DPNSS_PBX_FLAG: - case DPNSS_NUMBER_OF_CALLS: - case DPNSS_NUMBER_OF_SERVERS: - case DPNSS_PRIORITY_LEVEL: - case DPNSS_LOCATION: - case DPNSS_SUBADDRESS: - case DPNSS_ALARM_LEVEL: - case DPNSS_STAFF_PRESENT: - case DPNSS_TIME_AND_DATE: - case DPNSS_SERVICES: - * More than one Service Marking character can be - * included in the Parameter, each being separated - * by the IA5 character space (2/0). - * 1 = Call Offer not possible - * 2 = Executive Intrusion not possible - * 3 = Call Back When Free not possible - * 4 = Call Back Messaging not possible (see Note) - * 5 = Hold not possible - * 6 = Call Back When Next Used not possible - case DPNSS_PBX_REFERENCE: - case DPNSS_TRUNK_GROUP_REF_NUMBER: - case DPNSS_TRUNK_MEMBER_REF_NUMBER: - case DPNSS_CONF_PARTY_INDEX: - case DPNSS_CONF_PARTY_DET: - case DPNSS_ACCOUNT_CODE: - case DPNSS_CONF_BRIDGE_ADDR: - case DPNSS_COST_QUALIFIER: - case DPNSS_CURRENCY_INDICATION: - case DPNSS_CURRENCY_UNITS: - case DPNSS_TIME_INTERVAL: - case DPNSS_UNITS: - case DPNSS_REMOTE_ADDRESS: - case DPNSS_TEST_INDEX: - case DPNSS_TEST_RESULT: - case DPNSS_TYPE_OF_ASSISTANCE: - case DPNSS_REST_DOMAIN: - case DPNSS_GRP_PICK_UP_CODE: - case DPNSS_PICK_UP_CALL_TYPE: - case DPNSS_MALICIOUS_CALL_REF: - case DPNSS_TIMER_VALUE: - case DPNSS_BEARER_CAP: - case DPNSS_ISDN_NUM_ATTR: - case DPNSS_ISDN_DPNSS_SUBADDRESS: - case DPNSS_ISDN_NUMBER_DIGITS: - case DPNSS_HIGH_LAYER_COMP: - case DPNSS_LOW_LAYER_COMP: - case DPNSS_PROGRESS_INDICATOR: - case DPNSS_VPN_ACCESS_REF_NUM: - case DPNSS_INDEX_NUMBER: - case DPNSS_RESTRICTION_INDICATOR: - case DPNSS_CAUSE: + special handling is needed for greater detail + + case DPNSS_SERV_MAR: + * p 173 + * More than one Service Marking character can be + * included in the Parameter, each being separated + * by the IA5 character space (2/0). + * If decoded use: dpnss_serv_mark_vals + * + case DPNSS_STATUS: + case DPNSS_ROUTE_RES_CLASS: + case DPNSS_CBR_GRP: + case DPNSS_FAC_LST_CODE: + case DPNSS_NO_OF_FUR_TRANS: + case DPNSS_NO_OF_FUR_ALT_R: + case DPNSS_INT_CAP_LEV: + case DPNSS_NESTING_LEVEL: + case DPNSS_C_PARTY_ADDR: + case DPNSS_B_PARTY_ADDR: + case DPNSS_SIC: + */ + case DPNSS_A_B_PARTY_ADDR: + proto_tree_add_item(tree, hf_dpnss_a_b_party_addr, tvb, par_start_offset, par_len, FALSE); + break; + + /* + case DPNSS_DIVERSION_TYPE: + case DPNSS_NSI_IDENTIFIER: + case DPNSS_USER_DEFINED: + case DPNSS_TEXT: + */ + case DPNSS_CALL_INDEX: + proto_tree_add_item(tree, hf_dpnss_call_idx, tvb, par_start_offset, par_len, FALSE); + break; + /* + + case DPNSS_PASSWORD: + case DPNSS_CALL_DIR: + case DPNSS_DPNSS_ISDN_TYPE: + case DPNSS_HC_CLC: + case DPNSS_ENHANCED_STR_ID: + case DPNSS_STRING_ID: + case DPNSS_STRING_ID_LIST: + case DPNSS_TEXT_TYPE: + case DPNSS_CHANNEL_STATUS: + case DPNSS_CHANNEL_NUMBER: + case DPNSS_BPL: + case DPNSS_BCL: + case DPNSS_DEVICE_INDEX: + case DPNSS_CR_NO: + case DPNSS_CALL_ID_LENGTH: + case DPNSS_STATE_OF_DEST: + case DPNSS_STATE_OF_DEST_QUAL: + case DPNSS_REASON_FOR_REDIR: + case DPNSS_CLEARING_CAUSE: + case DPNSS_RECONT_ADDR: + case DPNSS_STATE_OF_OPERATOR: + case DPNSS_NIGHT_SERVICE: + case DPNSS_PBX_FLAG: + case DPNSS_NUMBER_OF_CALLS: + case DPNSS_NUMBER_OF_SERVERS: + case DPNSS_PRIORITY_LEVEL: + case DPNSS_LOCATION: + case DPNSS_SUBADDRESS: + case DPNSS_ALARM_LEVEL: + case DPNSS_STAFF_PRESENT: + case DPNSS_TIME_AND_DATE: + case DPNSS_SERVICES: + * More than one Service Marking character can be + * included in the Parameter, each being separated + * by the IA5 character space (2/0). + * 1 = Call Offer not possible + * 2 = Executive Intrusion not possible + * 3 = Call Back When Free not possible + * 4 = Call Back Messaging not possible (see Note) + * 5 = Hold not possible + * 6 = Call Back When Next Used not possible + case DPNSS_PBX_REFERENCE: + case DPNSS_TRUNK_GROUP_REF_NUMBER: + case DPNSS_TRUNK_MEMBER_REF_NUMBER: + case DPNSS_CONF_PARTY_INDEX: + case DPNSS_CONF_PARTY_DET: + case DPNSS_ACCOUNT_CODE: + case DPNSS_CONF_BRIDGE_ADDR: + case DPNSS_COST_QUALIFIER: + case DPNSS_CURRENCY_INDICATION: + case DPNSS_CURRENCY_UNITS: + case DPNSS_TIME_INTERVAL: + case DPNSS_UNITS: + case DPNSS_REMOTE_ADDRESS: + case DPNSS_TEST_INDEX: + case DPNSS_TEST_RESULT: + case DPNSS_TYPE_OF_ASSISTANCE: + case DPNSS_REST_DOMAIN: + case DPNSS_GRP_PICK_UP_CODE: + case DPNSS_PICK_UP_CALL_TYPE: + case DPNSS_MALICIOUS_CALL_REF: + case DPNSS_TIMER_VALUE: + case DPNSS_BEARER_CAP: + case DPNSS_ISDN_NUM_ATTR: + case DPNSS_ISDN_DPNSS_SUBADDRESS: + case DPNSS_ISDN_NUMBER_DIGITS: + case DPNSS_HIGH_LAYER_COMP: + case DPNSS_LOW_LAYER_COMP: + case DPNSS_PROGRESS_INDICATOR: + case DPNSS_VPN_ACCESS_REF_NUM: + case DPNSS_INDEX_NUMBER: + case DPNSS_RESTRICTION_INDICATOR: + case DPNSS_CAUSE: */ - default: - /* Used to print all pars without any special handling */ - proto_tree_add_text(tree, tvb, par_start_offset, par_len,"Parameter %s: %s", - val_to_str(par_type_num, dpnss_sup_serv_par_str_vals, "Unknown (%d)" ), - tvb_format_text(tvb,par_start_offset, par_len) - ); - break; - } + default: + /* Used to print all pars without any special handling */ + proto_tree_add_text(tree, tvb, par_start_offset, par_len,"Parameter %s: %s", + val_to_str(par_type_num, dpnss_sup_serv_par_str_vals, "Unknown (%d)" ), + tvb_format_text(tvb,par_start_offset, par_len) + ); + break; + } } -/* 3.1 Supplementary Information Strings +/* 3.1 Supplementary Information Strings * A Supplementary Information String comprises a Supplementary * Information Identifier which may be followed by one or more * Parameters. A Supplementary Information String starts with the - * IA5 character * and ends with the IA5 character #. - * + * IA5 character * and ends with the IA5 character #. + * * When the Supplementary Information String includes Parameters * these are separated from the identifier and each other by a *. * eg * Supplementary Information Identifier code # @@ -1057,7 +1055,7 @@ dissect_dpnns_sup_str_par(tvbuff_t *tvb, proto_tree * tree, int par_type_num, in * The numerals of the identifier indicate the main function of the * Supplementary Information String, eg "39F" indicates "Diverting * on No Reply". "F" is the suffix. - * + * * 3.5 Destination Address * The Destination Address comprises one or more IA5 numerals 0 to * 9, has no identifier code and is not prefixed by a * or @@ -1070,567 +1068,600 @@ dissect_dpnns_sup_str_par(tvbuff_t *tvb, proto_tree * tree, int par_type_num, in static int dissect_dpnss_sup_info_str(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset) { - proto_item *sup_str_item; - proto_tree *sup_str_tree; - gint start_offset, hash_offset, tvb_end_offset, sup_inf_str_end_offset, str_no; - gint par_start_offset, par_end_offset, number_of_found_par; - gint sup_inf_str_len, par_type_num; - guint sup_str_num; - guint8 octet; - gboolean last_string = FALSE; - gboolean has_par; - - tvb_end_offset = tvb_length(tvb); - - str_no = 1; - while((offset<tvb_end_offset)&&(last_string == FALSE)){ - octet = tvb_get_guint8(tvb,offset); - if (octet == '*'){ - /* Supplementary Information String */ - start_offset = offset; - has_par = TRUE; - number_of_found_par = 0; - /* offset points to start of supplementary information string */ - offset++; - hash_offset = tvb_find_guint8(tvb, offset, -1, '#'); - sup_str_item = proto_tree_add_text(tree, tvb, start_offset, hash_offset-start_offset+1, "Supplementary Information %u: %s",str_no,tvb_format_text(tvb,start_offset,hash_offset-start_offset+1)); - sup_str_tree = proto_item_add_subtree(sup_str_item, ett_dpnss_sup_str); - /* SUPPLEMENTARY INFORMATION STRING IDENTIFIER - * Get the parameter number string and translate it to an index into the dpnns_sup_serv_set. - * The number may have a trailing alpha character at the end. - */ - sup_inf_str_end_offset = tvb_find_guint8(tvb, offset, hash_offset-offset, '*'); - if(sup_inf_str_end_offset==-1){ - /* no parameters */ - has_par = FALSE; - sup_inf_str_end_offset = hash_offset; - } - sup_inf_str_len = sup_inf_str_end_offset - offset; - sup_str_num = atoi(tvb_format_text(tvb, offset, sup_inf_str_len)); - if((sup_str_num != 0) && (sup_str_num < array_length(dpnns_sup_serv_set))){ - proto_tree_add_text(sup_str_tree, tvb,offset,sup_inf_str_len,"Sup str:%s ",dpnns_sup_serv_set[sup_str_num].compact_name); - offset = sup_inf_str_end_offset+1; - /* Find parameter(s) */ - while(has_par){ - number_of_found_par++; - /* 1:st Parameter */ - par_start_offset = offset; - par_end_offset = tvb_find_guint8(tvb, offset, -1, '*'); - if(par_end_offset == -1){ - /* last parameter */ - par_end_offset = hash_offset; - has_par = FALSE; - } - switch(number_of_found_par){ - case 1: - par_type_num = dpnns_sup_serv_set[sup_str_num].par1_num; - dissect_dpnns_sup_str_par(tvb,sup_str_tree, par_type_num, par_start_offset, par_end_offset); - break; - case 2: - par_type_num = dpnns_sup_serv_set[sup_str_num].par2_num; - dissect_dpnns_sup_str_par(tvb,sup_str_tree, par_type_num, par_start_offset, par_end_offset); - break; - case 3: - par_type_num = dpnns_sup_serv_set[sup_str_num].par3_num; - dissect_dpnns_sup_str_par(tvb,sup_str_tree, par_type_num, par_start_offset, par_end_offset); - break; - case 4: - par_type_num = dpnns_sup_serv_set[sup_str_num].par4_num; - dissect_dpnns_sup_str_par(tvb,sup_str_tree, par_type_num, par_start_offset, par_end_offset); - break; - default: - break; - } - /* More parameters ? */ - offset = par_end_offset+1; - - } - } - offset = hash_offset+1; - str_no++; - }else{ - last_string = TRUE; - proto_tree_add_item(tree, hf_dpnss_dest_addr, tvb, offset, -1, FALSE); - } - } - return offset; + proto_item *sup_str_item; + proto_tree *sup_str_tree; + gint start_offset, hash_offset, tvb_end_offset, sup_inf_str_end_offset, str_no; + gint par_start_offset, par_end_offset, number_of_found_par; + gint sup_inf_str_len, par_type_num; + guint sup_str_num; + guint8 octet; + gboolean last_string = FALSE; + gboolean has_par; + + tvb_end_offset = tvb_length(tvb); + + str_no = 1; + while((offset<tvb_end_offset)&&(last_string == FALSE)){ + octet = tvb_get_guint8(tvb,offset); + if (octet == '*'){ + /* Supplementary Information String */ + start_offset = offset; + has_par = TRUE; + number_of_found_par = 0; + /* offset points to start of supplementary information string */ + offset++; + hash_offset = tvb_find_guint8(tvb, offset, -1, '#'); + sup_str_item = proto_tree_add_text(tree, tvb, start_offset, hash_offset-start_offset+1, + "Supplementary Information %u: %s",str_no, + tvb_format_text(tvb,start_offset,hash_offset-start_offset+1)); + sup_str_tree = proto_item_add_subtree(sup_str_item, ett_dpnss_sup_str); + /* SUPPLEMENTARY INFORMATION STRING IDENTIFIER + * Get the parameter number string and translate it to an index into the dpnns_sup_serv_set. + * The number may have a trailing alpha character at the end. + */ + sup_inf_str_end_offset = tvb_find_guint8(tvb, offset, hash_offset-offset, '*'); + if(sup_inf_str_end_offset==-1){ + /* no parameters */ + has_par = FALSE; + sup_inf_str_end_offset = hash_offset; + } + sup_inf_str_len = sup_inf_str_end_offset - offset; + sup_str_num = atoi(tvb_format_text(tvb, offset, sup_inf_str_len)); + if((sup_str_num != 0) && (sup_str_num < array_length(dpnns_sup_serv_set))){ + proto_tree_add_text(sup_str_tree, tvb,offset,sup_inf_str_len, + "Sup str:%s ", dpnns_sup_serv_set[sup_str_num].compact_name); + offset = sup_inf_str_end_offset+1; + /* Find parameter(s) */ + while(has_par){ + number_of_found_par++; + /* 1:st Parameter */ + par_start_offset = offset; + par_end_offset = tvb_find_guint8(tvb, offset, -1, '*'); + if(par_end_offset == -1){ + /* last parameter */ + par_end_offset = hash_offset; + has_par = FALSE; + } + switch(number_of_found_par){ + case 1: + par_type_num = dpnns_sup_serv_set[sup_str_num].par1_num; + dissect_dpnns_sup_str_par(tvb,sup_str_tree, par_type_num, par_start_offset, par_end_offset); + break; + case 2: + par_type_num = dpnns_sup_serv_set[sup_str_num].par2_num; + dissect_dpnns_sup_str_par(tvb,sup_str_tree, par_type_num, par_start_offset, par_end_offset); + break; + case 3: + par_type_num = dpnns_sup_serv_set[sup_str_num].par3_num; + dissect_dpnns_sup_str_par(tvb,sup_str_tree, par_type_num, par_start_offset, par_end_offset); + break; + case 4: + par_type_num = dpnns_sup_serv_set[sup_str_num].par4_num; + dissect_dpnns_sup_str_par(tvb,sup_str_tree, par_type_num, par_start_offset, par_end_offset); + break; + default: + break; + } + /* More parameters ? */ + offset = par_end_offset+1; + + } + } + offset = hash_offset+1; + str_no++; + }else{ + last_string = TRUE; + proto_tree_add_item(tree, hf_dpnss_dest_addr, tvb, offset, -1, FALSE); + } + } + return offset; } static void dissect_dpnss_LbL_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - proto_item *sic_field_item, *ind_field_item; - proto_tree *sic_field_tree, *ind_field_tree; - int offset = 0; - int tvb_end_offset; - guint8 octet; - - tvb_end_offset = tvb_length(tvb); - - proto_tree_add_item(tree, hf_dpnss_LbL_msg_type, tvb, offset, 1, FALSE); - octet = tvb_get_guint8(tvb,offset)&0x0f; - offset++; - if(check_col(pinfo->cinfo, COL_INFO)) - col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", - val_to_str(octet, dpnss_LbL_msg_short_type_vals, "Unknown (%d)" )); - if(tree){ - switch (octet){ - case DPNSS_LbL_MSG_LLM_C: - /* 2.3.1 LINK-by-LINK Message (COMPLETE) - LLM(C)*/ - case DPNSS_LbL_MSG_LLM_I: - /* 2.3.2 LINK-by-LINK Message (INCOMPLETE) - LLM(I) */ - /* Indication Field */ - ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, "Indication Field: %s",tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); - ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); - offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); - break; - case DPNSS_LbL_MSG_LLRM: - /* 2.3.3 LINK-by-LINK REJECT Message - LLRM */ - /* Rejection Cause */ - proto_tree_add_item(tree, hf_dpnss_rejection_cause, tvb, offset, 1, FALSE); - /* Indication Field (Optional) */ - if(tvb_end_offset>offset){ - ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, "Indication Field: %s",tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); - ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); - offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); - } - break; - case DPNSS_LbL_MSG_SM: - /* 2.3.4 SWAP Message - SM */ - /* Service Indicator Code - * Note: On data calls the SIC may comprise more than one octet. - * The Service Indicator Code is coded in accordance with ANNEX 1. - */ - sic_field_item = proto_tree_add_text(tree, tvb, offset, -1, "Service Indicator Code"); - sic_field_tree = proto_item_add_subtree(sic_field_item, ett_dpnss_sic_field); - offset =dissect_dpnss_sic(tvb, pinfo, sic_field_tree, offset); - /* Indication Field */ - ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, "Indication Field: %s",tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); - ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); - offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); - break; - case DPNSS_LbL_MSG_LMM: - /* 2.3.5 LINK MAINTENANCE Message - LMM */ - /* Maintenance Action - * respond to a request for,maintenance actions to be performed. - * The Maintenance Action field identifies the action required or - * the response being made. The Maintenance Action field is coded - * as shown in ANNEX 6. - */ - proto_tree_add_item(tree, hf_dpnss_maintenance_action, tvb, offset, 1, FALSE); - offset++; - /* Indication Field */ - ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, "Indication Field: %s",tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); - ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); - offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); - break; - case DPNSS_LbL_MSG_LMRM: - /* 2.3.6 LINK MAINTENANCE REJECT Message - LMRM */ - proto_tree_add_item(tree, hf_dpnss_clearing_cause, tvb, offset, 1, FALSE); - offset++; - /* Indication Field */ - ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, "Indication Field: %s",tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); - ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); - offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); - break; - default: - proto_tree_add_text(tree, tvb, offset, 1, "Dissection of this message not supported yet"); - break; - } - } + proto_item *sic_field_item, *ind_field_item; + proto_tree *sic_field_tree, *ind_field_tree; + int offset = 0; + int tvb_end_offset; + guint8 octet; + + tvb_end_offset = tvb_length(tvb); + + proto_tree_add_item(tree, hf_dpnss_LbL_msg_type, tvb, offset, 1, FALSE); + octet = tvb_get_guint8(tvb,offset)&0x0f; + offset++; + if(check_col(pinfo->cinfo, COL_INFO)) + col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", + val_to_str(octet, dpnss_LbL_msg_short_type_vals, "Unknown (%d)" )); + if(tree){ + switch (octet){ + case DPNSS_LbL_MSG_LLM_C: + /* 2.3.1 LINK-by-LINK Message (COMPLETE) - LLM(C)*/ + case DPNSS_LbL_MSG_LLM_I: + /* 2.3.2 LINK-by-LINK Message (INCOMPLETE) - LLM(I) */ + /* Indication Field */ + ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, + "Indication Field: %s", + tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); + ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); + offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); + break; + case DPNSS_LbL_MSG_LLRM: + /* 2.3.3 LINK-by-LINK REJECT Message - LLRM */ + /* Rejection Cause */ + proto_tree_add_item(tree, hf_dpnss_rejection_cause, tvb, offset, 1, FALSE); + /* Indication Field (Optional) */ + if(tvb_end_offset>offset){ + ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, + "Indication Field: %s", + tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); + ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); + offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); + } + break; + case DPNSS_LbL_MSG_SM: + /* 2.3.4 SWAP Message - SM */ + /* Service Indicator Code + * Note: On data calls the SIC may comprise more than one octet. + * The Service Indicator Code is coded in accordance with ANNEX 1. + */ + sic_field_item = proto_tree_add_text(tree, tvb, offset, -1, "Service Indicator Code"); + sic_field_tree = proto_item_add_subtree(sic_field_item, ett_dpnss_sic_field); + offset =dissect_dpnss_sic(tvb, pinfo, sic_field_tree, offset); + /* Indication Field */ + ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, + "Indication Field: %s", + tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); + ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); + offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); + break; + case DPNSS_LbL_MSG_LMM: + /* 2.3.5 LINK MAINTENANCE Message - LMM */ + /* Maintenance Action + * respond to a request for,maintenance actions to be performed. + * The Maintenance Action field identifies the action required or + * the response being made. The Maintenance Action field is coded + * as shown in ANNEX 6. + */ + proto_tree_add_item(tree, hf_dpnss_maintenance_action, tvb, offset, 1, FALSE); + offset++; + /* Indication Field */ + ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, + "Indication Field: %s", + tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); + ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); + offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); + break; + case DPNSS_LbL_MSG_LMRM: + /* 2.3.6 LINK MAINTENANCE REJECT Message - LMRM */ + proto_tree_add_item(tree, hf_dpnss_clearing_cause, tvb, offset, 1, FALSE); + offset++; + /* Indication Field */ + ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, + "Indication Field: %s", + tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); + ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); + offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); + break; + default: + proto_tree_add_text(tree, tvb, offset, 1, "Dissection of this message not supported yet"); + break; + } + } } static void dissect_dpnss_e2e_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - proto_item *sel_field_item, *sic_field_item, *ind_field_item; - proto_tree *sel_field_tree, *sic_field_tree, *ind_field_tree; - int offset = 0; - int tvb_end_offset; - guint8 octet; - - tvb_end_offset = tvb_length(tvb); - - proto_tree_add_item(tree, hf_dpnss_e2e_msg_type, tvb, offset, 1, FALSE); - octet = tvb_get_guint8(tvb,offset)&0x0f; - offset++; - if(check_col(pinfo->cinfo, COL_INFO)) - col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", - val_to_str(octet, dpnss_e2e_msg_short_type_vals, "Unknown (%d)" )); - if(tree){ - switch (octet){ - case DPNSS_E2E_MSG_EEM_C: - /* 2.2.1 END-to-END Message (COMPLETE) - EEM(C) */ - case DPNSS_E2E_MSG_EEM_I: - /* Fall trough */ - /* Indication Field */ - ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, "Indication Field: %s",tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); - ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); - offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); - break; - case DPNSS_E2E_MSG_SCRM: - /* 2.2.3 SINGLE-CHANNEL CLEAR REQUEST Message - SCRM */ - case DPNSS_E2E_MSG_SCIM: - /* 2.2.4 SINGLE-CHANNEL CLEAR INDICATION Message - SCIM */ - /* Clearing Cause */ - proto_tree_add_item(tree, hf_dpnss_clearing_cause, tvb, offset, 1, FALSE); - offset++; - /* Indication Field (Optional) */ - if(tvb_end_offset>offset){ - ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, "Indication Field: %s",tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); - ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); - offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); - } - break; - case DPNSS_E2E_MSG_ERM_C: - /* 2.2.5 END-to-END RECALL Message (COMPLETE) - ERM(C) */ - case DPNSS_E2E_MSG_ERM_I: - /* 2.2.6 END-to-END RECALL Message (INCOMPLETE) - ERM(I) */ - /* Service Indicator Code - * Note: On data calls the SIC may comprise more than one octet. - * The Service Indicator Code is coded in accordance with ANNEX 1. - */ - sic_field_item = proto_tree_add_text(tree, tvb, offset, -1, "Service Indicator Code"); - sic_field_tree = proto_item_add_subtree(sic_field_item, ett_dpnss_sic_field); - offset =dissect_dpnss_sic(tvb, pinfo, sic_field_tree, offset); - /* - * Selection Field - * The Selection Field contains the selection information relating - * to a call set-up or Supplementary Service Request, and is - * structured as shown in Subsection 3. - */ - sel_field_item = proto_tree_add_text(tree, tvb, offset, -1, "Selection Field: %s",tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); - sel_field_tree = proto_item_add_subtree(sel_field_item, ett_dpnss_sel_field); - offset = dissect_dpnss_sup_info_str(tvb, pinfo, sel_field_tree, offset); - break; - case DPNSS_E2E_MSG_NSIM: - /* 2.2.7 NON SPECIFIED INFORMATION Message - NSIM */ - /* Usage Identifier Oct 1 - - * coding of the Usage Identifier, as described in section 49. - * The use of NSIMs is described in greater detail in SECTION 49. - * BIT 8 7 6 5 4 3 2 1 - * ext | Manufacturer code | subcode - */ - octet = tvb_get_guint8(tvb,offset); - proto_tree_add_item(tree, hf_dpnss_ext_bit, tvb, offset, 1, FALSE); - proto_tree_add_item(tree, hf_dpnss_man_code, tvb, offset, 1, FALSE); - proto_tree_add_item(tree, hf_dpnss_subcode, tvb, offset, 1, FALSE); - offset++; - if((octet&0x80)==0x80){ - /* Extension bit set */ - offset++; - } - /* User Information oct 2 + n - */ - proto_tree_add_text(tree, tvb, offset, -1, "User Information"); - default: - proto_tree_add_text(tree, tvb, offset, 1, "Dissection of this message not supported yet"); - break; - } - } + proto_item *sel_field_item, *sic_field_item, *ind_field_item; + proto_tree *sel_field_tree, *sic_field_tree, *ind_field_tree; + int offset = 0; + int tvb_end_offset; + guint8 octet; + + tvb_end_offset = tvb_length(tvb); + + proto_tree_add_item(tree, hf_dpnss_e2e_msg_type, tvb, offset, 1, FALSE); + octet = tvb_get_guint8(tvb,offset)&0x0f; + offset++; + if(check_col(pinfo->cinfo, COL_INFO)) + col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", + val_to_str(octet, dpnss_e2e_msg_short_type_vals, "Unknown (%d)" )); + if(tree){ + switch (octet){ + case DPNSS_E2E_MSG_EEM_C: + /* 2.2.1 END-to-END Message (COMPLETE) - EEM(C) */ + case DPNSS_E2E_MSG_EEM_I: + /* Fall trough */ + /* Indication Field */ + ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, + "Indication Field: %s", + tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); + ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); + offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); + break; + case DPNSS_E2E_MSG_SCRM: + /* 2.2.3 SINGLE-CHANNEL CLEAR REQUEST Message - SCRM */ + case DPNSS_E2E_MSG_SCIM: + /* 2.2.4 SINGLE-CHANNEL CLEAR INDICATION Message - SCIM */ + /* Clearing Cause */ + proto_tree_add_item(tree, hf_dpnss_clearing_cause, tvb, offset, 1, FALSE); + offset++; + /* Indication Field (Optional) */ + if(tvb_end_offset>offset){ + ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, + "Indication Field: %s", + tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); + ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); + offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); + } + break; + case DPNSS_E2E_MSG_ERM_C: + /* 2.2.5 END-to-END RECALL Message (COMPLETE) - ERM(C) */ + case DPNSS_E2E_MSG_ERM_I: + /* 2.2.6 END-to-END RECALL Message (INCOMPLETE) - ERM(I) */ + /* Service Indicator Code + * Note: On data calls the SIC may comprise more than one octet. + * The Service Indicator Code is coded in accordance with ANNEX 1. + */ + sic_field_item = proto_tree_add_text(tree, tvb, offset, -1, "Service Indicator Code"); + sic_field_tree = proto_item_add_subtree(sic_field_item, ett_dpnss_sic_field); + offset =dissect_dpnss_sic(tvb, pinfo, sic_field_tree, offset); + /* + * Selection Field + * The Selection Field contains the selection information relating + * to a call set-up or Supplementary Service Request, and is + * structured as shown in Subsection 3. + */ + sel_field_item = proto_tree_add_text(tree, tvb, offset, -1, + "Selection Field: %s", + tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); + sel_field_tree = proto_item_add_subtree(sel_field_item, ett_dpnss_sel_field); + offset = dissect_dpnss_sup_info_str(tvb, pinfo, sel_field_tree, offset); + break; + case DPNSS_E2E_MSG_NSIM: + /* 2.2.7 NON SPECIFIED INFORMATION Message - NSIM */ + /* Usage Identifier Oct 1 - + * coding of the Usage Identifier, as described in section 49. + * The use of NSIMs is described in greater detail in SECTION 49. + * BIT 8 7 6 5 4 3 2 1 + * ext | Manufacturer code | subcode + */ + octet = tvb_get_guint8(tvb,offset); + proto_tree_add_item(tree, hf_dpnss_ext_bit, tvb, offset, 1, FALSE); + proto_tree_add_item(tree, hf_dpnss_man_code, tvb, offset, 1, FALSE); + proto_tree_add_item(tree, hf_dpnss_subcode, tvb, offset, 1, FALSE); + offset++; + if((octet&0x80)==0x80){ + /* Extension bit set */ + offset++; + } + /* User Information oct 2 + n + */ + proto_tree_add_text(tree, tvb, offset, -1, "User Information"); + default: + proto_tree_add_text(tree, tvb, offset, 1, "Dissection of this message not supported yet"); + break; + } + } } static void dissect_dpnss_cc_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - proto_item *sel_field_item, *sic_field_item, *ind_field_item; - proto_tree *sel_field_tree, *sic_field_tree, *ind_field_tree; - int offset = 0; - int tvb_end_offset; - guint8 octet; - - tvb_end_offset = tvb_length(tvb); - proto_tree_add_item(tree, hf_dpnss_cc_msg_type, tvb, offset, 1, FALSE); - octet = tvb_get_guint8(tvb,offset)&0x0f; - offset++; - if(check_col(pinfo->cinfo, COL_INFO)) - col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", - val_to_str(octet, dpnss_cc_msg_short_type_vals, "Unknown (%d)" )); - - if(tree){ - switch (octet){ - case DPNSS_CC_MSG_ISRM_C: - /* 2.1.1 INITIAL SERVICE REQUEST Message (COMPLETE) - ISRM (C) */ - /* fall trough */ - case DPNSS_CC_MSG_ISRM_I: - /* 2.1.2 INITIAL SERVICE REQUEST Message (INCOMPLETE) - ISRM(I) */ - case DPNSS_CC_MSG_RM_C: - /* 2.1.3 RECALL Message (COMPLETE) - RM(C) */ - /* fall trough */ - case DPNSS_CC_MSG_RM_I: - /* 2.1.4 RECALL Message (INCOMPLETE) - RM(I)*/ - /* fall trough */ - /* Service Indicator Code - * Note: On data calls the SIC may comprise more than one octet. - * The Service Indicator Code is coded in accordance with ANNEX 1. - */ - sic_field_item = proto_tree_add_text(tree, tvb, offset, -1, "Service Indicator Code"); - sic_field_tree = proto_item_add_subtree(sic_field_item, ett_dpnss_sic_field); - offset =dissect_dpnss_sic(tvb, pinfo, sic_field_tree, offset); - /* - * Selection Field - * The Selection Field contains the selection information relating - * to a call set-up or Supplementary Service Request, and is - * structured as shown in Subsection 3. - */ - sel_field_item = proto_tree_add_text(tree, tvb, offset, -1, "Selection Field: %s",tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); - sel_field_tree = proto_item_add_subtree(sel_field_item, ett_dpnss_sel_field); - offset = dissect_dpnss_sup_info_str(tvb, pinfo, sel_field_tree, offset); - break; - case DPNSS_CC_MSG_CCM: - /* 2.1.5 CALL CONNECTED Message - CCM */ - if(tvb_end_offset>offset){ - /* Indication Field (Optional) */ - ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, "Indication Field: %s",tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); - ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); - offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); - } - break; - case DPNSS_CC_MSG_NIM: - /* 2.1.6 NETWORK INDICATION Message - NIM */ - /* fall trough */ - case DPNSS_CC_MSG_NAM: - /* 2.1.9 NUMBER ACKNOWLEDGE Message - NAM */ - /* Indication Field */ - ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, "Indication Field: %s",tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); - ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); - offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); - break; - case DPNSS_CC_MSG_CRM: - /* 2.1.7 CLEAR REQUEST Message - CRM */ - /* 2.1.8 CLEAR INDICATION Message - CIM */ - /* Clearing Cause */ - proto_tree_add_item(tree, hf_dpnss_clearing_cause, tvb, offset, 1, FALSE); - offset++; - /* Indication Field (Optional) */ - if(tvb_end_offset>offset){ - ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, "Indication Field: %s",tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); - ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); - offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); - } - break; - case DPNSS_CC_MSG_RRM: - /* 2.1.10 RECALL REJECTION Message - RRM */ - /* Rejection Cause */ - proto_tree_add_item(tree, hf_dpnss_rejection_cause, tvb, offset, 1, FALSE); - /* Indication Field (Optional) */ - if(tvb_end_offset>offset){ - ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, "Indication Field: %s",tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); - ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); - offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); - } - break; - case DPNSS_CC_MSG_SSRM_I: - /* 2.1.11 SUBSEQUENT SERVICE REQUEST Message (INCOMPLETE) - SSRM(I) */ - /* Selection Field */ - sel_field_item = proto_tree_add_text(tree, tvb, offset, -1, "Selection Field: %s",tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); - sel_field_tree = proto_item_add_subtree(sel_field_item, ett_dpnss_sel_field); - offset = dissect_dpnss_sup_info_str(tvb, pinfo, sel_field_tree, offset); - break; - case DPNSS_CC_MSG_SSRM_C: - /* 2.1.12 SUBSEQUENT SERVICE REQUEST Message (COMPLETE) - SSRM(C) */ - /* Selection Field (Optional) */ - if(tvb_end_offset>offset){ - sel_field_item = proto_tree_add_text(tree, tvb, offset, -1, "Selection Field: %s",tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); - sel_field_tree = proto_item_add_subtree(sel_field_item, ett_dpnss_sel_field); - offset = dissect_dpnss_sup_info_str(tvb, pinfo, sel_field_tree, offset); - } - break; - case DPNSS_CC_MSG_CS: - case DPNSS_CC_MSG_CA: - /* DASS2 ?*/ - default: - proto_tree_add_text(tree, tvb, offset, 1, "Unknown or Dissection of this message not supported yet"); - break; - } - } + proto_item *sel_field_item, *sic_field_item, *ind_field_item; + proto_tree *sel_field_tree, *sic_field_tree, *ind_field_tree; + int offset = 0; + int tvb_end_offset; + guint8 octet; + + tvb_end_offset = tvb_length(tvb); + proto_tree_add_item(tree, hf_dpnss_cc_msg_type, tvb, offset, 1, FALSE); + octet = tvb_get_guint8(tvb,offset)&0x0f; + offset++; + if(check_col(pinfo->cinfo, COL_INFO)) + col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", + val_to_str(octet, dpnss_cc_msg_short_type_vals, "Unknown (%d)" )); + + if(tree){ + switch (octet){ + case DPNSS_CC_MSG_ISRM_C: + /* 2.1.1 INITIAL SERVICE REQUEST Message (COMPLETE) - ISRM (C) */ + /* fall trough */ + case DPNSS_CC_MSG_ISRM_I: + /* 2.1.2 INITIAL SERVICE REQUEST Message (INCOMPLETE) - ISRM(I) */ + case DPNSS_CC_MSG_RM_C: + /* 2.1.3 RECALL Message (COMPLETE) - RM(C) */ + /* fall trough */ + case DPNSS_CC_MSG_RM_I: + /* 2.1.4 RECALL Message (INCOMPLETE) - RM(I)*/ + /* fall trough */ + /* Service Indicator Code + * Note: On data calls the SIC may comprise more than one octet. + * The Service Indicator Code is coded in accordance with ANNEX 1. + */ + sic_field_item = proto_tree_add_text(tree, tvb, offset, -1, "Service Indicator Code"); + sic_field_tree = proto_item_add_subtree(sic_field_item, ett_dpnss_sic_field); + offset =dissect_dpnss_sic(tvb, pinfo, sic_field_tree, offset); + /* + * Selection Field + * The Selection Field contains the selection information relating + * to a call set-up or Supplementary Service Request, and is + * structured as shown in Subsection 3. + */ + sel_field_item = proto_tree_add_text(tree, tvb, offset, -1, + "Selection Field: %s", + tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); + sel_field_tree = proto_item_add_subtree(sel_field_item, ett_dpnss_sel_field); + offset = dissect_dpnss_sup_info_str(tvb, pinfo, sel_field_tree, offset); + break; + case DPNSS_CC_MSG_CCM: + /* 2.1.5 CALL CONNECTED Message - CCM */ + if(tvb_end_offset>offset){ + /* Indication Field (Optional) */ + ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, + "Indication Field: %s", + tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); + ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); + offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); + } + break; + case DPNSS_CC_MSG_NIM: + /* 2.1.6 NETWORK INDICATION Message - NIM */ + /* fall trough */ + case DPNSS_CC_MSG_NAM: + /* 2.1.9 NUMBER ACKNOWLEDGE Message - NAM */ + /* Indication Field */ + ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, + "Indication Field: %s", + tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); + ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); + offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); + break; + case DPNSS_CC_MSG_CRM: + /* 2.1.7 CLEAR REQUEST Message - CRM */ + /* 2.1.8 CLEAR INDICATION Message - CIM */ + /* Clearing Cause */ + proto_tree_add_item(tree, hf_dpnss_clearing_cause, tvb, offset, 1, FALSE); + offset++; + /* Indication Field (Optional) */ + if(tvb_end_offset>offset){ + ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, + "Indication Field: %s", + tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); + ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); + offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); + } + break; + case DPNSS_CC_MSG_RRM: + /* 2.1.10 RECALL REJECTION Message - RRM */ + /* Rejection Cause */ + proto_tree_add_item(tree, hf_dpnss_rejection_cause, tvb, offset, 1, FALSE); + /* Indication Field (Optional) */ + if(tvb_end_offset>offset){ + ind_field_item = proto_tree_add_text(tree, tvb, offset, -1, + "Indication Field: %s", + tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); + ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field); + offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset); + } + break; + case DPNSS_CC_MSG_SSRM_I: + /* 2.1.11 SUBSEQUENT SERVICE REQUEST Message (INCOMPLETE) - SSRM(I) */ + /* Selection Field */ + sel_field_item = proto_tree_add_text(tree, tvb, offset, -1, + "Selection Field: %s", + tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); + sel_field_tree = proto_item_add_subtree(sel_field_item, ett_dpnss_sel_field); + offset = dissect_dpnss_sup_info_str(tvb, pinfo, sel_field_tree, offset); + break; + case DPNSS_CC_MSG_SSRM_C: + /* 2.1.12 SUBSEQUENT SERVICE REQUEST Message (COMPLETE) - SSRM(C) */ + /* Selection Field (Optional) */ + if(tvb_end_offset>offset){ + sel_field_item = proto_tree_add_text(tree, tvb, offset, -1, + "Selection Field: %s", + tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset))); + sel_field_tree = proto_item_add_subtree(sel_field_item, ett_dpnss_sel_field); + offset = dissect_dpnss_sup_info_str(tvb, pinfo, sel_field_tree, offset); + } + break; + case DPNSS_CC_MSG_CS: + case DPNSS_CC_MSG_CA: + /* DASS2 ?*/ + default: + proto_tree_add_text(tree, tvb, offset, 1, "Unknown or Dissection of this message not supported yet"); + break; + } + } } /* Code to actually dissect the packets */ static void dissect_dpnss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - int offset = 0; - proto_item *item; - proto_tree *dpnss_tree; - guint8 octet; + int offset = 0; + proto_item *item; + proto_tree *dpnss_tree; + guint8 octet; /* Make entries in Protocol column and Info column on summary display */ - col_set_str(pinfo->cinfo, COL_PROTOCOL, "DPNSS"); - - item = proto_tree_add_item(tree, proto_dpnss, tvb, 0, -1, FALSE); - dpnss_tree = proto_item_add_subtree(item, ett_dpnss); - proto_tree_add_item(dpnss_tree, hf_dpnss_msg_grp_id, tvb, offset, 1, FALSE); - octet = tvb_get_guint8(tvb,offset)>>4; - switch (octet){ - case DPNNS_MESSAGE_GROUP_CC: - /* Call Control Message Group */ - dissect_dpnss_cc_msg(tvb, pinfo, dpnss_tree); - break; - case DPNNS_MESSAGE_GROUP_E2E: - /* End-to-End Message Group */ - dissect_dpnss_e2e_msg(tvb, pinfo, dpnss_tree); - break; - case DPNNS_MESSAGE_GROUP_LbL: - /* Link-by-Link Message Group */ - dissect_dpnss_LbL_msg(tvb, pinfo, dpnss_tree); - break; - default: - proto_tree_add_text(tree, tvb, offset, 1, "Unknown Message Group"); - break; - } + col_set_str(pinfo->cinfo, COL_PROTOCOL, "DPNSS"); + + item = proto_tree_add_item(tree, proto_dpnss, tvb, 0, -1, FALSE); + dpnss_tree = proto_item_add_subtree(item, ett_dpnss); + proto_tree_add_item(dpnss_tree, hf_dpnss_msg_grp_id, tvb, offset, 1, FALSE); + octet = tvb_get_guint8(tvb,offset)>>4; + switch (octet){ + case DPNNS_MESSAGE_GROUP_CC: + /* Call Control Message Group */ + dissect_dpnss_cc_msg(tvb, pinfo, dpnss_tree); + break; + case DPNNS_MESSAGE_GROUP_E2E: + /* End-to-End Message Group */ + dissect_dpnss_e2e_msg(tvb, pinfo, dpnss_tree); + break; + case DPNNS_MESSAGE_GROUP_LbL: + /* Link-by-Link Message Group */ + dissect_dpnss_LbL_msg(tvb, pinfo, dpnss_tree); + break; + default: + proto_tree_add_text(tree, tvb, offset, 1, "Unknown Message Group"); + break; + } } void proto_register_dpnss(void) -{ +{ /* Setup list of header fields See Section 1.6.1 for details*/ - static hf_register_info hf[] = { - { &hf_dpnss_msg_grp_id, - { "Message Group Identifier", "dpnss.msg_grp_id", - FT_UINT8, BASE_DEC, VALS(dpnss_msg_grp_id_vals), 0xf0, - NULL, HFILL } - }, - { &hf_dpnss_cc_msg_type, - { "Call Control Message Type", "dpnss.cc_msg_type", - FT_UINT8, BASE_DEC, VALS(dpnss_cc_msg_type_vals), 0x0f, - NULL, HFILL } - }, - { &hf_dpnss_e2e_msg_type, - { "END-TO-END Message Type", "dpnss.e2e_msg_type", - FT_UINT8, BASE_DEC, VALS(dpnss_e2e_msg_type_vals), 0x0f, - NULL, HFILL } - }, - { &hf_dpnss_LbL_msg_type, - { "LINK-BY-LINK Message Type", "dpnss.lbl_msg_type", - FT_UINT8, BASE_DEC, VALS(dpnss_LbL_msg_type_vals), 0x0f, - NULL, HFILL } - }, - { &hf_dpnss_ext_bit, - { "Extension bit", "dpnss.ext_bit", - FT_BOOLEAN, 8, TFS(&dpnss_ext_bit_vals), 0x80, - NULL, HFILL } - }, - { &hf_dpnss_ext_bit_notall, - { "Extension bit", "dpnss.ext_bit_notall", - FT_BOOLEAN, 8, TFS(&dpnss_ext_bit_no_ext_vals), 0x80, - NULL, HFILL } - }, - { &hf_dpnss_sic_type, - { "Type of data", "dpnss.sic_type", - FT_UINT8, BASE_DEC, VALS(dpnss_sic_type_type_vals), 0x70, - NULL, HFILL } - }, - { &hf_dpnss_sic_details_for_speech, - { "Details for Speech", "dpnss.sic_details_for_speech", - FT_UINT8, BASE_DEC, VALS(dpnss_sic_details_for_speech_vals), 0x0f, - NULL, HFILL } - }, - { &hf_dpnss_sic_details_for_data1, - { "Data Rates", "dpnss.sic_details_for_data1", - FT_UINT8, BASE_DEC, VALS(dpnss_sic_details_for_data_rates1_vals), 0x0f, - "Type of Data (010) : Data Rates", HFILL } - }, - { &hf_dpnss_sic_details_for_data2, - { "Data Rates", "dpnss.sic_details_data2", - FT_UINT8, BASE_DEC, VALS(dpnss_sic_details_for_data_rates2_vals), 0x0f, - "Type of Data (011) : Data Rates", HFILL } - }, - { &hf_dpnss_dest_addr, - { "Destination Address", "dpnss.dest_addr", - FT_STRING, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, - { &hf_dpnss_sic_oct2_data_type, - { "Data Type", "dpnss.sic_oct2_data_type", - FT_UINT8, BASE_DEC, VALS(dpnss_sic_oct2_data_type_vals), 0x03, - NULL, HFILL } - }, - { &hf_dpnss_sic_oct2_duplex, - { "Data Type", "dpnss.sic_oct2_duplex", - FT_BOOLEAN, 8, TFS(&dpnss_duplex_vals), 0x08, - NULL, HFILL } - }, - { &hf_dpnss_sic_oct2_net_ind_clk, - { "Network Independent Clock", "dpnss.sic_oct2_sync_data_format", - FT_BOOLEAN, 8, TFS(&dpnss_sic_oct2_net_ind_clk_vals), 0x40, - NULL, HFILL } - }, - { &hf_dpnss_sic_oct2_sync_data_format, - { "Data Format", "dpnss.sic_oct2_sync_data_format", - FT_BOOLEAN, 8, TFS(&dpnss_sic_oct2_sync_data_format_vals), 0x20, - NULL, HFILL } - }, - { &hf_dpnss_sic_oct2_sync_byte_timing, - { "Byte Timing", "dpnss.sic_oct2_sync_byte_timing", - FT_BOOLEAN, 8, TFS(&dpnss_provided_vals), 0x10, - NULL, HFILL } - }, - { &hf_dpnss_sic_oct2_async_data, - { "Data Format", "dpnss.sic_oct2_async_data", - FT_UINT8, BASE_DEC, VALS(dpnss_sic_oct2_async_data_type_vals), 0x30, - NULL, HFILL } - }, - { &hf_dpnss_sic_oct2_async_flow_ctrl, - { "Flow Control", "dpnss.sic_oct2_async_flow_ctrl", - FT_BOOLEAN, 8, TFS(&dpnss_flow_control_vals), 0x40, - NULL, HFILL } - }, - { &hf_dpnss_clearing_cause, - { "Clearing Cause", "dpnss.clearing_cause", - FT_UINT8, BASE_DEC, VALS(dpnss_clearing_cause_code_vals), 0x0, - NULL, HFILL } - }, - { &hf_dpnss_rejection_cause, - { "Rejection Cause", "dpnss.rejection_cause", - FT_UINT8, BASE_DEC, VALS(dpnss_clearing_cause_code_vals), 0x0, - NULL, HFILL } - }, - { &hf_dpnss_man_code, - { "Manufacturer Code", "dpnss.man_code", - FT_UINT8, BASE_DEC, VALS(dpnss_man_code_vals), 0x3c, - NULL, HFILL } - }, - { &hf_dpnss_subcode, - { "Subcode", "dpnss.subcode", - FT_UINT8, BASE_DEC, NULL, 0x03, - NULL, HFILL } - }, - { &hf_dpnss_maintenance_action, - { "Maintenance action", "dpnss.maint_act", - FT_UINT8, BASE_DEC, VALS(dpnss_maintenance_actions_vals), 0x0, - NULL, HFILL } - }, - { &hf_dpnss_a_b_party_addr, - { "A/B party Address", "dpnss.a_b_party_addr", - FT_STRING, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, - { &hf_dpnss_call_idx, - { "Call Index", "dpnss.call_idx", - FT_STRING, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, - }; + static hf_register_info hf[] = { + { &hf_dpnss_msg_grp_id, + { "Message Group Identifier", "dpnss.msg_grp_id", + FT_UINT8, BASE_DEC, VALS(dpnss_msg_grp_id_vals), 0xf0, + NULL, HFILL } + }, + { &hf_dpnss_cc_msg_type, + { "Call Control Message Type", "dpnss.cc_msg_type", + FT_UINT8, BASE_DEC, VALS(dpnss_cc_msg_type_vals), 0x0f, + NULL, HFILL } + }, + { &hf_dpnss_e2e_msg_type, + { "END-TO-END Message Type", "dpnss.e2e_msg_type", + FT_UINT8, BASE_DEC, VALS(dpnss_e2e_msg_type_vals), 0x0f, + NULL, HFILL } + }, + { &hf_dpnss_LbL_msg_type, + { "LINK-BY-LINK Message Type", "dpnss.lbl_msg_type", + FT_UINT8, BASE_DEC, VALS(dpnss_LbL_msg_type_vals), 0x0f, + NULL, HFILL } + }, + { &hf_dpnss_ext_bit, + { "Extension bit", "dpnss.ext_bit", + FT_BOOLEAN, 8, TFS(&dpnss_ext_bit_vals), 0x80, + NULL, HFILL } + }, + { &hf_dpnss_ext_bit_notall, + { "Extension bit", "dpnss.ext_bit_notall", + FT_BOOLEAN, 8, TFS(&dpnss_ext_bit_no_ext_vals), 0x80, + NULL, HFILL } + }, + { &hf_dpnss_sic_type, + { "Type of data", "dpnss.sic_type", + FT_UINT8, BASE_DEC, VALS(dpnss_sic_type_type_vals), 0x70, + NULL, HFILL } + }, + { &hf_dpnss_sic_details_for_speech, + { "Details for Speech", "dpnss.sic_details_for_speech", + FT_UINT8, BASE_DEC, VALS(dpnss_sic_details_for_speech_vals), 0x0f, + NULL, HFILL } + }, + { &hf_dpnss_sic_details_for_data1, + { "Data Rates", "dpnss.sic_details_for_data1", + FT_UINT8, BASE_DEC, VALS(dpnss_sic_details_for_data_rates1_vals), 0x0f, + "Type of Data (010) : Data Rates", HFILL } + }, + { &hf_dpnss_sic_details_for_data2, + { "Data Rates", "dpnss.sic_details_data2", + FT_UINT8, BASE_DEC, VALS(dpnss_sic_details_for_data_rates2_vals), 0x0f, + "Type of Data (011) : Data Rates", HFILL } + }, + { &hf_dpnss_dest_addr, + { "Destination Address", "dpnss.dest_addr", + FT_STRING, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_dpnss_sic_oct2_data_type, + { "Data Type", "dpnss.sic_oct2_data_type", + FT_UINT8, BASE_DEC, VALS(dpnss_sic_oct2_data_type_vals), 0x03, + NULL, HFILL } + }, + { &hf_dpnss_sic_oct2_duplex, + { "Data Type", "dpnss.sic_oct2_duplex", + FT_BOOLEAN, 8, TFS(&dpnss_duplex_vals), 0x08, + NULL, HFILL } + }, + { &hf_dpnss_sic_oct2_net_ind_clk, + { "Network Independent Clock", "dpnss.sic_oct2_sync_data_format", + FT_BOOLEAN, 8, TFS(&dpnss_sic_oct2_net_ind_clk_vals), 0x40, + NULL, HFILL } + }, + { &hf_dpnss_sic_oct2_sync_data_format, + { "Data Format", "dpnss.sic_oct2_sync_data_format", + FT_BOOLEAN, 8, TFS(&dpnss_sic_oct2_sync_data_format_vals), 0x20, + NULL, HFILL } + }, + { &hf_dpnss_sic_oct2_sync_byte_timing, + { "Byte Timing", "dpnss.sic_oct2_sync_byte_timing", + FT_BOOLEAN, 8, TFS(&dpnss_provided_vals), 0x10, + NULL, HFILL } + }, + { &hf_dpnss_sic_oct2_async_data, + { "Data Format", "dpnss.sic_oct2_async_data", + FT_UINT8, BASE_DEC, VALS(dpnss_sic_oct2_async_data_type_vals), 0x30, + NULL, HFILL } + }, + { &hf_dpnss_sic_oct2_async_flow_ctrl, + { "Flow Control", "dpnss.sic_oct2_async_flow_ctrl", + FT_BOOLEAN, 8, TFS(&dpnss_flow_control_vals), 0x40, + NULL, HFILL } + }, + { &hf_dpnss_clearing_cause, + { "Clearing Cause", "dpnss.clearing_cause", + FT_UINT8, BASE_DEC, VALS(dpnss_clearing_cause_code_vals), 0x0, + NULL, HFILL } + }, + { &hf_dpnss_rejection_cause, + { "Rejection Cause", "dpnss.rejection_cause", + FT_UINT8, BASE_DEC, VALS(dpnss_clearing_cause_code_vals), 0x0, + NULL, HFILL } + }, + { &hf_dpnss_man_code, + { "Manufacturer Code", "dpnss.man_code", + FT_UINT8, BASE_DEC, VALS(dpnss_man_code_vals), 0x3c, + NULL, HFILL } + }, + { &hf_dpnss_subcode, + { "Subcode", "dpnss.subcode", + FT_UINT8, BASE_DEC, NULL, 0x03, + NULL, HFILL } + }, + { &hf_dpnss_maintenance_action, + { "Maintenance action", "dpnss.maint_act", + FT_UINT8, BASE_DEC, VALS(dpnss_maintenance_actions_vals), 0x0, + NULL, HFILL } + }, + { &hf_dpnss_a_b_party_addr, + { "A/B party Address", "dpnss.a_b_party_addr", + FT_STRING, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_dpnss_call_idx, + { "Call Index", "dpnss.call_idx", + FT_STRING, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + }; /* Setup protocol subtree array */ - static gint *ett[] = { - &ett_dpnss, - &ett_dpnss_sel_field, - &ett_dpnss_sic_field, - &ett_dpnss_ind_field, - &ett_dpnss_sup_str, - }; + static gint *ett[] = { + &ett_dpnss, + &ett_dpnss_sel_field, + &ett_dpnss_sic_field, + &ett_dpnss_ind_field, + &ett_dpnss_sup_str, + }; /* Register the protocol name and description */ - proto_dpnss = proto_register_protocol("Digital Private Signalling System No 1","DPNSS", "dpnss"); - register_dissector("dpnss", dissect_dpnss, proto_dpnss); + proto_dpnss = proto_register_protocol("Digital Private Signalling System No 1","DPNSS", "dpnss"); + register_dissector("dpnss", dissect_dpnss, proto_dpnss); - /* Required function calls to register the header fields and subtrees used */ - proto_register_field_array(proto_dpnss, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); + /* Required function calls to register the header fields and subtrees used */ + proto_register_field_array(proto_dpnss, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); } diff --git a/epan/dissectors/packet-eigrp.c b/epan/dissectors/packet-eigrp.c index 6066fa782d..3d66f3627a 100644 --- a/epan/dissectors/packet-eigrp.c +++ b/epan/dissectors/packet-eigrp.c @@ -286,8 +286,8 @@ static dissector_handle_t ipxsap_handle; static const value_string eigrp_opcode_vals[] = { { EIGRP_HELLO, "Hello/Ack" }, { EIGRP_UPDATE, "Update" }, - { EIGRP_REPLY, "Reply" }, - { EIGRP_QUERY, "Query" }, + { EIGRP_REPLY, "Reply" }, + { EIGRP_QUERY, "Query" }, { EIGRP_REQUEST, "Request" }, { EIGRP_SAP, "IPX/SAP Update" }, { EIGRP_SIA_QUERY, "SIA-Query" }, @@ -467,7 +467,7 @@ static void dissect_eigrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { break; case TLV_AT_EXT: dissect_eigrp_at_ext(tvb_new_subset(tvb, offset + 4, size - 4, -1), tlv_tree, ti); - break; + break; case TLV_IP6_INT: dissect_eigrp_ip6_int(tvb_new_subset(tvb, offset + 4, size - 4, -1), pinfo, tlv_tree, ti); @@ -578,22 +578,22 @@ static void dissect_eigrp_seq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre static void dissect_eigrp_sv(tvbuff_t *tvb, proto_tree *tree, proto_item *ti) { int offset = 0; - guint8 ios_rel_major, ios_rel_minor; - guint8 eigrp_rel_major, eigrp_rel_minor; + guint8 ios_rel_major, ios_rel_minor; + guint8 eigrp_rel_major, eigrp_rel_minor; - ios_rel_major = tvb_get_guint8(tvb, 0); - ios_rel_minor = tvb_get_guint8(tvb, 1); - proto_tree_add_text(tree, tvb, offset, 2, "IOS release version: %u.%u", - ios_rel_major, ios_rel_minor); + ios_rel_major = tvb_get_guint8(tvb, 0); + ios_rel_minor = tvb_get_guint8(tvb, 1); + proto_tree_add_text(tree, tvb, offset, 2, "IOS release version: %u.%u", + ios_rel_major, ios_rel_minor); offset += 2; - proto_item_append_text(ti, ": IOS=%u.%u", ios_rel_major, ios_rel_minor); - - eigrp_rel_major = tvb_get_guint8(tvb, 2); - eigrp_rel_minor = tvb_get_guint8(tvb, 3); - proto_tree_add_text(tree,tvb,offset, 2, "EIGRP release version: %u.%u", - eigrp_rel_major, eigrp_rel_minor); - proto_item_append_text(ti, ", EIGRP=%u.%u", - eigrp_rel_major, eigrp_rel_minor); + proto_item_append_text(ti, ": IOS=%u.%u", ios_rel_major, ios_rel_minor); + + eigrp_rel_major = tvb_get_guint8(tvb, 2); + eigrp_rel_minor = tvb_get_guint8(tvb, 3); + proto_tree_add_text(tree,tvb,offset, 2, "EIGRP release version: %u.%u", + eigrp_rel_major, eigrp_rel_minor); + proto_item_append_text(ti, ", EIGRP=%u.%u", + eigrp_rel_major, eigrp_rel_minor); } static void dissect_eigrp_nms(tvbuff_t *tvb, proto_tree *tree, proto_item *ti) { @@ -763,7 +763,7 @@ static void dissect_eigrp_ipx_int(tvbuff_t *tvb, packet_info *pinfo, proto_tree proto_tree_add_item(tree, hf_eigrp_ipx_int_reserved, tvb, offset, 2, FALSE); offset += 2; ti_dst = proto_tree_add_item(tree, hf_eigrp_ipx_int_dst, tvb, offset, 4, FALSE); - proto_item_append_text(ti, " = %08x%s", tvb_get_ntohl(tvb, 26), ((tvb_get_ntohl(tvb, 10) == 0xffffffff) ? " - Destination unreachable":"")); + proto_item_append_text(ti, " = %08x%s", tvb_get_ntohl(tvb, 26), ((tvb_get_ntohl(tvb, 10) == 0xffffffff) ? " - Destination unreachable":"")); if (tvb_get_ntohl(tvb, 10) == 0xffffffff) { expert_add_info_format(pinfo, ti_dst, PI_RESPONSE_CODE, PI_NOTE, "Destination unreachable"); } @@ -808,7 +808,7 @@ static void dissect_eigrp_ipx_ext(tvbuff_t *tvb, packet_info *pinfo, proto_tree proto_tree_add_item(tree, hf_eigrp_ipx_ext_reserved2, tvb, offset, 2, FALSE); offset += 2; ti_dst = proto_tree_add_item(tree, hf_eigrp_ipx_ext_dst, tvb, offset, 4, FALSE); - proto_item_append_text(ti, " = %08x%s", tvb_get_ntohl(tvb, 46), ((tvb_get_ntohl(tvb, 30) == 0xffffffff) ? " - Destination unreachable":"")); + proto_item_append_text(ti, " = %08x%s", tvb_get_ntohl(tvb, 46), ((tvb_get_ntohl(tvb, 30) == 0xffffffff) ? " - Destination unreachable":"")); if (tvb_get_ntohl(tvb, 30) == 0xffffffff) { expert_add_info_format(pinfo, ti_dst, PI_RESPONSE_CODE, PI_NOTE, "Destination unreachable"); } @@ -818,9 +818,9 @@ static void dissect_eigrp_ipx_ext(tvbuff_t *tvb, packet_info *pinfo, proto_tree static void dissect_eigrp_at_cbl(tvbuff_t *tvb, proto_tree *tree, proto_item *ti) { - proto_tree_add_text(tree, tvb, 0, 4, "AppleTalk Cable Range = %u-%u", tvb_get_ntohs(tvb, 0), tvb_get_ntohs(tvb, 2)); + proto_tree_add_text(tree, tvb, 0, 4, "AppleTalk Cable Range = %u-%u", tvb_get_ntohs(tvb, 0), tvb_get_ntohs(tvb, 2)); proto_tree_add_item(tree, hf_eigrp_at_cbl_routerid, tvb, 4, 4, FALSE); - proto_item_append_text(ti, ": Cable range= %u-%u, Router ID= %u", tvb_get_ntohs(tvb, 0), tvb_get_ntohs(tvb, 2), tvb_get_ntohl(tvb, 4)); + proto_item_append_text(ti, ": Cable range= %u-%u, Router ID= %u", tvb_get_ntohs(tvb, 0), tvb_get_ntohs(tvb, 2), tvb_get_ntohl(tvb, 4)); } @@ -847,7 +847,7 @@ static void dissect_eigrp_at_int(tvbuff_t *tvb, proto_tree *tree, proto_item *ti offset += 2; proto_tree_add_text(tree,tvb,offset,4,"Cable range = %u-%u",tvb_get_ntohs(tvb,20),tvb_get_ntohs(tvb,22)); - proto_item_append_text(ti, ": %u-%u", tvb_get_ntohs(tvb, 20), tvb_get_ntohs(tvb, 22)); + proto_item_append_text(ti, ": %u-%u", tvb_get_ntohs(tvb, 20), tvb_get_ntohs(tvb, 22)); } static void dissect_eigrp_at_ext(tvbuff_t *tvb, proto_tree *tree, proto_item *ti) { @@ -894,7 +894,7 @@ static void dissect_eigrp_at_ext(tvbuff_t *tvb, proto_tree *tree, proto_item *ti offset += 2; proto_tree_add_text(tree, tvb, offset, 4, "Cable range = %u-%u", tvb_get_ntohs(tvb, 36), tvb_get_ntohs(tvb, 38)); - proto_item_append_text(ti, ": %u-%u", tvb_get_ntohs(tvb, 36), tvb_get_ntohs(tvb, 38)); + proto_item_append_text(ti, ": %u-%u", tvb_get_ntohs(tvb, 36), tvb_get_ntohs(tvb, 38)); } static void dissect_eigrp_ip6_int(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *ti) { @@ -1028,727 +1028,727 @@ static void dissect_eigrp_ip6_ext(tvbuff_t *tvb, packet_info *pinfo, proto_tree void proto_register_eigrp(void) { - static hf_register_info hf[] = { - { &hf_eigrp_version, - { "Version", "eigrp.version", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_opcode, - { "Opcode", "eigrp.opcode", - FT_UINT8, BASE_DEC, VALS(eigrp_opcode_vals), 0x0, - "Opcode number", HFILL } - }, - { &hf_eigrp_checksum, - { "Checksum", "eigrp.checksum", - FT_UINT16, BASE_HEX, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_flags, - { "Flags", "eigrp.flags", - FT_UINT32, BASE_HEX, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_flags_init, - { "Init", "eigrp.flags.init", - FT_BOOLEAN, 32, NULL, EIGRP_FLAGS_INIT, - NULL, HFILL } - }, - { &hf_eigrp_flags_condrecv, - { "Conditional Receive", "eigrp.flags.condrecv", - FT_BOOLEAN, 32, NULL, EIGRP_FLAGS_CONDRECV, - NULL, HFILL } - }, - { &hf_eigrp_sequence, - { "Sequence", "eigrp.seq", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_acknowledge, - { "Acknowledge", "eigrp.ack", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_as, - { "Autonomous System", "eigrp.as", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Autonomous System number", HFILL } - }, - { &hf_eigrp_tlv, - { "Type", "eigrp.tlv", - FT_UINT16, BASE_DEC, VALS(eigrp_tlv_vals), 0x0, - "Type/Length/Value", HFILL } - }, - { &hf_eigrp_tlv_size, - { "Size", "eigrp.tlv.size", - FT_UINT16, BASE_DEC, NULL, 0x0, - "TLV size", HFILL } - }, + static hf_register_info hf[] = { + { &hf_eigrp_version, + { "Version", "eigrp.version", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_opcode, + { "Opcode", "eigrp.opcode", + FT_UINT8, BASE_DEC, VALS(eigrp_opcode_vals), 0x0, + "Opcode number", HFILL } + }, + { &hf_eigrp_checksum, + { "Checksum", "eigrp.checksum", + FT_UINT16, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_flags, + { "Flags", "eigrp.flags", + FT_UINT32, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_flags_init, + { "Init", "eigrp.flags.init", + FT_BOOLEAN, 32, NULL, EIGRP_FLAGS_INIT, + NULL, HFILL } + }, + { &hf_eigrp_flags_condrecv, + { "Conditional Receive", "eigrp.flags.condrecv", + FT_BOOLEAN, 32, NULL, EIGRP_FLAGS_CONDRECV, + NULL, HFILL } + }, + { &hf_eigrp_sequence, + { "Sequence", "eigrp.seq", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_acknowledge, + { "Acknowledge", "eigrp.ack", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_as, + { "Autonomous System", "eigrp.as", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Autonomous System number", HFILL } + }, + { &hf_eigrp_tlv, + { "Type", "eigrp.tlv", + FT_UINT16, BASE_DEC, VALS(eigrp_tlv_vals), 0x0, + "Type/Length/Value", HFILL } + }, + { &hf_eigrp_tlv_size, + { "Size", "eigrp.tlv.size", + FT_UINT16, BASE_DEC, NULL, 0x0, + "TLV size", HFILL } + }, /* EIGRP Parameters TLV */ - { &hf_eigrp_par_k1, - { "K1", "eigrp.par.k1", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_par_k2, - { "K2", "eigrp.par.k2", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_par_k3, - { "K3", "eigrp.par.k3", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_par_k4, - { "K4", "eigrp.par.k4", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_par_k5, - { "K5", "eigrp.par.k5", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_par_reserved, - { "Reserved", "eigrp.par.reserved", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_par_holdtime, - { "Hold Time", "eigrp.par.holdtime", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, + { &hf_eigrp_par_k1, + { "K1", "eigrp.par.k1", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_par_k2, + { "K2", "eigrp.par.k2", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_par_k3, + { "K3", "eigrp.par.k3", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_par_k4, + { "K4", "eigrp.par.k4", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_par_k5, + { "K5", "eigrp.par.k5", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_par_reserved, + { "Reserved", "eigrp.par.reserved", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_par_holdtime, + { "Hold Time", "eigrp.par.holdtime", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, /* Authentication TLV */ - { &hf_eigrp_auth_type, - { "Authentication Type", "eigrp.auth.type", - FT_UINT16, BASE_DEC, VALS(eigrp_auth_type_vals), 0x0, - NULL, HFILL } - }, - { &hf_eigrp_auth_keysize, - { "Key size", "eigrp.auth.keysize", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_auth_keyid, - { "Key ID", "eigrp.auth.keyid", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_auth_nullpad, - { "Nullpad", "eigrp.auth.nullapd", - FT_STRING, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_auth_data, - { "Data", "eigrp.auth.data", - FT_STRING, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, + { &hf_eigrp_auth_type, + { "Authentication Type", "eigrp.auth.type", + FT_UINT16, BASE_DEC, VALS(eigrp_auth_type_vals), 0x0, + NULL, HFILL } + }, + { &hf_eigrp_auth_keysize, + { "Key size", "eigrp.auth.keysize", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_auth_keyid, + { "Key ID", "eigrp.auth.keyid", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_auth_nullpad, + { "Nullpad", "eigrp.auth.nullapd", + FT_STRING, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_auth_data, + { "Data", "eigrp.auth.data", + FT_STRING, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, /* Sequence TLV */ - { &hf_eigrp_seq_addrlen, - { "Address length", "eigrp.seq.addrlen", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_seq_ipaddr, - { "IP Address", "eigrp.seq.ipaddr", - FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_seq_ip6addr, - { "IPv6 Address", "eigrp.seq.ip6addr", - FT_IPv6, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, + { &hf_eigrp_seq_addrlen, + { "Address length", "eigrp.seq.addrlen", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_seq_ipaddr, + { "IP Address", "eigrp.seq.ipaddr", + FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_seq_ip6addr, + { "IPv6 Address", "eigrp.seq.ip6addr", + FT_IPv6, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, /* Software Version TLV */ - { &hf_eigrp_sv_ios, - { "IOS release version", "eigrp.sv.ios", - FT_STRING, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_sv_eigrp, - { "EIGRP release version", "eigrp.sv.eigrp", - FT_STRING, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, + { &hf_eigrp_sv_ios, + { "IOS release version", "eigrp.sv.ios", + FT_STRING, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_sv_eigrp, + { "EIGRP release version", "eigrp.sv.eigrp", + FT_STRING, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, /* Next multicast sequence TLV */ - { &hf_eigrp_nms, - { "Next Multicast Sequence", "eigrp.nms", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, + { &hf_eigrp_nms, + { "Next Multicast Sequence", "eigrp.nms", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, /* Stub routing TLV */ - { &hf_eigrp_stub_flags, - { "Stub Flags", "eigrp.stub_flags", - FT_UINT16, BASE_HEX, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_stub_flags_connected, - { "Connected", "eigrp.stub_flags.connected", - FT_BOOLEAN, 16, NULL, EIGRP_STUB_FLAGS_CONNECTED, - NULL, HFILL } - }, - { &hf_eigrp_stub_flags_static, - { "Static", "eigrp.stub_flags.static", - FT_BOOLEAN, 16, NULL, EIGRP_STUB_FLAGS_STATIC, - NULL, HFILL } - }, - { &hf_eigrp_stub_flags_summary, - { "Summary", "eigrp.stub_flags.summary", - FT_BOOLEAN, 16, NULL, EIGRP_STUB_FLAGS_SUMMARY, - NULL, HFILL } - }, - { &hf_eigrp_stub_flags_recvonly, - { "Receive-Only", "eigrp.stub_flags.recvonly", - FT_BOOLEAN, 16, NULL, EIGRP_STUB_FLAGS_RECVONLY, - NULL, HFILL } - }, - { &hf_eigrp_stub_flags_redist, - { "Redistributed", "eigrp.stub_flags.redist", - FT_BOOLEAN, 16, NULL, EIGRP_STUB_FLAGS_REDIST, - NULL, HFILL } - }, - { &hf_eigrp_stub_flags_leakmap, - { "Leak-Map", "eigrp.stub_flags.leakmap", - FT_BOOLEAN, 16, NULL, EIGRP_STUB_FLAGS_LEAKMAP, - NULL, HFILL } - }, + { &hf_eigrp_stub_flags, + { "Stub Flags", "eigrp.stub_flags", + FT_UINT16, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_stub_flags_connected, + { "Connected", "eigrp.stub_flags.connected", + FT_BOOLEAN, 16, NULL, EIGRP_STUB_FLAGS_CONNECTED, + NULL, HFILL } + }, + { &hf_eigrp_stub_flags_static, + { "Static", "eigrp.stub_flags.static", + FT_BOOLEAN, 16, NULL, EIGRP_STUB_FLAGS_STATIC, + NULL, HFILL } + }, + { &hf_eigrp_stub_flags_summary, + { "Summary", "eigrp.stub_flags.summary", + FT_BOOLEAN, 16, NULL, EIGRP_STUB_FLAGS_SUMMARY, + NULL, HFILL } + }, + { &hf_eigrp_stub_flags_recvonly, + { "Receive-Only", "eigrp.stub_flags.recvonly", + FT_BOOLEAN, 16, NULL, EIGRP_STUB_FLAGS_RECVONLY, + NULL, HFILL } + }, + { &hf_eigrp_stub_flags_redist, + { "Redistributed", "eigrp.stub_flags.redist", + FT_BOOLEAN, 16, NULL, EIGRP_STUB_FLAGS_REDIST, + NULL, HFILL } + }, + { &hf_eigrp_stub_flags_leakmap, + { "Leak-Map", "eigrp.stub_flags.leakmap", + FT_BOOLEAN, 16, NULL, EIGRP_STUB_FLAGS_LEAKMAP, + NULL, HFILL } + }, /* IP internal route TLV */ - { &hf_eigrp_ip_int_nexthop, - { "Next Hop", "eigrp.ip_int.nexthop", - FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_int_delay, - { "Delay", "eigrp.ip_int.delay", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_int_bandwidth, - { "Bandwidth", "eigrp.ip_int.bandwidth", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_int_mtu, - { "MTU", "eigrp.ip_int.mtu", - FT_UINT24, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_int_hopcount, - { "Hop Count", "eigrp.ip_int.hopcount", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_int_reliability, - { "Reliability", "eigrp.ip_int.reliability", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_int_load, - { "Load", "eigrp.ip_int.load", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_int_reserved, - { "Reserved", "eigrp.ip_int.reserved", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_int_prefixlen, - { "Prefix Length", "eigrp.ip_int.prefixlen", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_int_dst, - { "Destination", "eigrp.ip_int.dst", - FT_STRING, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, + { &hf_eigrp_ip_int_nexthop, + { "Next Hop", "eigrp.ip_int.nexthop", + FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_int_delay, + { "Delay", "eigrp.ip_int.delay", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_int_bandwidth, + { "Bandwidth", "eigrp.ip_int.bandwidth", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_int_mtu, + { "MTU", "eigrp.ip_int.mtu", + FT_UINT24, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_int_hopcount, + { "Hop Count", "eigrp.ip_int.hopcount", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_int_reliability, + { "Reliability", "eigrp.ip_int.reliability", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_int_load, + { "Load", "eigrp.ip_int.load", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_int_reserved, + { "Reserved", "eigrp.ip_int.reserved", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_int_prefixlen, + { "Prefix Length", "eigrp.ip_int.prefixlen", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_int_dst, + { "Destination", "eigrp.ip_int.dst", + FT_STRING, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, /* IP external route TLV */ - { &hf_eigrp_ip_ext_nexthop, - { "Next Hop", "eigrp.ip_ext.nexthop", - FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_ext_origrouter, - { "Originating router", "eigrp.ip_ext.origrouter", - FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_ext_as, - { "Originating A.S.", "eigrp.ip_ext.as", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_ext_tag, - { "Arbitrary tag", "eigrp.ip_ext.tag", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_ext_metric, - { "External protocol metric", "eigrp.ip_ext.metric", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_ext_reserved, - { "Reserved", "eigrp.ip_ext.reserved", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_ext_proto, - { "External protocol ID", "eigrp.ip_ext.proto", - FT_UINT8, BASE_DEC, VALS(eigrp_pid_vals), 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_ext_flags, - { "Flags", "eigrp.ip_ext.flags", - FT_UINT8, BASE_HEX, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_ext_flags_ext, - { "External Route", "eigrp.ip_ext.flags.ext", - FT_BOOLEAN, 8, NULL, EIGRP_IP_EXT_FLAGS_EXT, - NULL, HFILL } - }, - { &hf_eigrp_ip_ext_flags_default, - { "Candidate Default Route", "eigrp.ip_ext.flags.default", - FT_BOOLEAN, 8, NULL, EIGRP_IP_EXT_FLAGS_DEFAULT, - NULL, HFILL } - }, - { &hf_eigrp_ip_ext_delay, - { "Delay", "eigrp.ip_ext.delay", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_ext_bandwidth, - { "Bandwidth", "eigrp.ip_ext.bandwidth", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_ext_mtu, - { "MTU", "eigrp.ip_ext.mtu", - FT_UINT24, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_ext_hopcount, - { "Hop Count", "eigrp.ip_ext.hopcount", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_ext_reliability, - { "Reliability", "eigrp.ip_ext.reliability", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_ext_load, - { "Load", "eigrp.ip_ext.load", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_ext_reserved2, - { "Reserved", "eigrp.ip_ext.reserved2", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip_ext_prefixlen, - { "Prefix Length", "eigrp.ip_ext.prefixlen", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, + { &hf_eigrp_ip_ext_nexthop, + { "Next Hop", "eigrp.ip_ext.nexthop", + FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_ext_origrouter, + { "Originating router", "eigrp.ip_ext.origrouter", + FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_ext_as, + { "Originating A.S.", "eigrp.ip_ext.as", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_ext_tag, + { "Arbitrary tag", "eigrp.ip_ext.tag", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_ext_metric, + { "External protocol metric", "eigrp.ip_ext.metric", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_ext_reserved, + { "Reserved", "eigrp.ip_ext.reserved", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_ext_proto, + { "External protocol ID", "eigrp.ip_ext.proto", + FT_UINT8, BASE_DEC, VALS(eigrp_pid_vals), 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_ext_flags, + { "Flags", "eigrp.ip_ext.flags", + FT_UINT8, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_ext_flags_ext, + { "External Route", "eigrp.ip_ext.flags.ext", + FT_BOOLEAN, 8, NULL, EIGRP_IP_EXT_FLAGS_EXT, + NULL, HFILL } + }, + { &hf_eigrp_ip_ext_flags_default, + { "Candidate Default Route", "eigrp.ip_ext.flags.default", + FT_BOOLEAN, 8, NULL, EIGRP_IP_EXT_FLAGS_DEFAULT, + NULL, HFILL } + }, + { &hf_eigrp_ip_ext_delay, + { "Delay", "eigrp.ip_ext.delay", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_ext_bandwidth, + { "Bandwidth", "eigrp.ip_ext.bandwidth", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_ext_mtu, + { "MTU", "eigrp.ip_ext.mtu", + FT_UINT24, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_ext_hopcount, + { "Hop Count", "eigrp.ip_ext.hopcount", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_ext_reliability, + { "Reliability", "eigrp.ip_ext.reliability", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_ext_load, + { "Load", "eigrp.ip_ext.load", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_ext_reserved2, + { "Reserved", "eigrp.ip_ext.reserved2", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip_ext_prefixlen, + { "Prefix Length", "eigrp.ip_ext.prefixlen", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, /* IPX internal route TLV */ - { &hf_eigrp_ipx_int_nexthop_addr, - { "Next Hop Address", "eigrp.ipx_int.nexthop_addr", - FT_IPXNET, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_int_nexthop_id, - { "Next Hop ID", "eigrp.ipx_int.nexthop_id", - FT_ETHER, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_int_delay, - { "Delay", "eigrp.ipx_int.delay", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_int_bandwidth, - { "Bandwidth", "eigrp.ipx_int.bandwidth", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_int_mtu, - { "MTU", "eigrp.ipx_int.mtu", - FT_UINT24, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_int_hopcount, - { "Hop Count", "eigrp.ipx_int.hopcount", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_int_reliability, - { "Reliability", "eigrp.ipx_int.reliability", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_int_load, - { "Load", "eigrp.ipx_int.load", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_int_reserved, - { "Reserved", "eigrp.ipx_int.reserved", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_int_dst, - { "Destination", "eigrp.ipx_int.dst", - FT_IPXNET, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, + { &hf_eigrp_ipx_int_nexthop_addr, + { "Next Hop Address", "eigrp.ipx_int.nexthop_addr", + FT_IPXNET, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_int_nexthop_id, + { "Next Hop ID", "eigrp.ipx_int.nexthop_id", + FT_ETHER, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_int_delay, + { "Delay", "eigrp.ipx_int.delay", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_int_bandwidth, + { "Bandwidth", "eigrp.ipx_int.bandwidth", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_int_mtu, + { "MTU", "eigrp.ipx_int.mtu", + FT_UINT24, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_int_hopcount, + { "Hop Count", "eigrp.ipx_int.hopcount", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_int_reliability, + { "Reliability", "eigrp.ipx_int.reliability", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_int_load, + { "Load", "eigrp.ipx_int.load", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_int_reserved, + { "Reserved", "eigrp.ipx_int.reserved", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_int_dst, + { "Destination", "eigrp.ipx_int.dst", + FT_IPXNET, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, /* IPX external route TLV */ - { &hf_eigrp_ipx_ext_nexthop_addr, - { "Next Hop Address", "eigrp.ipx_ext.nexthop_addr", - FT_IPXNET, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_ext_nexthop_id, - { "Next Hop ID", "eigrp.ipx_ext.nexthop_id", - FT_ETHER, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_ext_origrouter, - { "Originating router", "eigrp.ipx_ext.origrouter", - FT_ETHER, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_ext_as, - { "Originating A.S.", "eigrp.ipx_ext.as", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_ext_tag, - { "Arbitrary tag", "eigrp.ipx_ext.tag", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_ext_proto, - { "External protocol ID", "eigrp.ipx_ext.proto", - FT_UINT8, BASE_DEC, VALS(eigrp_pid_vals), 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_ext_reserved, - { "Reserved", "eigrp.ipx_ext.reserved", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_ext_metric, - { "External protocol metric", "eigrp.ipx_ext.metric", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_ext_extdelay, - { "External protocol delay", "eigrp.ipx_ext.extdelay", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_ext_delay, - { "Delay", "eigrp.ipx_ext.delay", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_ext_bandwidth, - { "Bandwidth", "eigrp.ipx_ext.bandwidth", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_ext_mtu, - { "MTU", "eigrp.ipx_ext.mtu", - FT_UINT24, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_ext_hopcount, - { "Hop Count", "eigrp.ipx_ext.hopcount", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_ext_reliability, - { "Reliability", "eigrp.ipx_ext.reliability", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_ext_load, - { "Load", "eigrp.ipx_ext.load", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_ext_reserved2, - { "Reserved", "eigrp.ipx_ext.reserved2", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ipx_ext_dst, - { "Destination", "eigrp.ipx_ext.dst", - FT_IPXNET, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, + { &hf_eigrp_ipx_ext_nexthop_addr, + { "Next Hop Address", "eigrp.ipx_ext.nexthop_addr", + FT_IPXNET, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_ext_nexthop_id, + { "Next Hop ID", "eigrp.ipx_ext.nexthop_id", + FT_ETHER, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_ext_origrouter, + { "Originating router", "eigrp.ipx_ext.origrouter", + FT_ETHER, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_ext_as, + { "Originating A.S.", "eigrp.ipx_ext.as", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_ext_tag, + { "Arbitrary tag", "eigrp.ipx_ext.tag", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_ext_proto, + { "External protocol ID", "eigrp.ipx_ext.proto", + FT_UINT8, BASE_DEC, VALS(eigrp_pid_vals), 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_ext_reserved, + { "Reserved", "eigrp.ipx_ext.reserved", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_ext_metric, + { "External protocol metric", "eigrp.ipx_ext.metric", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_ext_extdelay, + { "External protocol delay", "eigrp.ipx_ext.extdelay", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_ext_delay, + { "Delay", "eigrp.ipx_ext.delay", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_ext_bandwidth, + { "Bandwidth", "eigrp.ipx_ext.bandwidth", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_ext_mtu, + { "MTU", "eigrp.ipx_ext.mtu", + FT_UINT24, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_ext_hopcount, + { "Hop Count", "eigrp.ipx_ext.hopcount", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_ext_reliability, + { "Reliability", "eigrp.ipx_ext.reliability", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_ext_load, + { "Load", "eigrp.ipx_ext.load", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_ext_reserved2, + { "Reserved", "eigrp.ipx_ext.reserved2", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ipx_ext_dst, + { "Destination", "eigrp.ipx_ext.dst", + FT_IPXNET, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, /* AppleTalk cable configuration TLV */ - { &hf_eigrp_at_cbl_routerid, - { "AppleTalk Router ID", "eigrp.at_cbl.routerid", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, + { &hf_eigrp_at_cbl_routerid, + { "AppleTalk Router ID", "eigrp.at_cbl.routerid", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, /* AppleTalk internal route TLV */ - { &hf_eigrp_at_int_delay, - { "Delay", "eigrp.at_int.delay", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_at_int_bandwidth, - { "Bandwidth", "eigrp.at_int.bandwidth", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_at_int_mtu, - { "MTU", "eigrp.at_int.mtu", - FT_UINT24, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_at_int_hopcount, - { "Hop Count", "eigrp.at_int.hopcount", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_at_int_reliability, - { "Reliability", "eigrp.at_int.reliability", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_at_int_load, - { "Load", "eigrp.at_int.load", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_at_int_reserved, - { "Reserved", "eigrp.at_int.reserved", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, + { &hf_eigrp_at_int_delay, + { "Delay", "eigrp.at_int.delay", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_at_int_bandwidth, + { "Bandwidth", "eigrp.at_int.bandwidth", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_at_int_mtu, + { "MTU", "eigrp.at_int.mtu", + FT_UINT24, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_at_int_hopcount, + { "Hop Count", "eigrp.at_int.hopcount", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_at_int_reliability, + { "Reliability", "eigrp.at_int.reliability", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_at_int_load, + { "Load", "eigrp.at_int.load", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_at_int_reserved, + { "Reserved", "eigrp.at_int.reserved", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, /* AppleTalk external route TLV */ - { &hf_eigrp_at_ext_origrouter, - { "Originating router", "eigrp.at_ext.origrouter", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_at_ext_as, - { "Originating A.S.", "eigrp.at_ext.as", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_at_ext_tag, - { "Arbitrary tag", "eigrp.at_ext.tag", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_at_ext_proto, - { "External protocol ID", "eigrp.at_ext.proto", - FT_UINT8, BASE_DEC, VALS(eigrp_pid_vals), 0x0, - NULL, HFILL } - }, - { &hf_eigrp_at_ext_flags, - { "Flags", "eigrp.at_ext.flags", - FT_UINT8, BASE_HEX, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_at_ext_flags_ext, - { "External Route", "eigrp.at_ext.flags.ext", - FT_BOOLEAN, 8, NULL, EIGRP_IP_EXT_FLAGS_EXT, - NULL, HFILL } - }, - { &hf_eigrp_at_ext_flags_default, - { "Candidate Default Route", "eigrp.at_ext.flags.default", - FT_BOOLEAN, 8, NULL, EIGRP_IP_EXT_FLAGS_DEFAULT, - NULL, HFILL } - }, - { &hf_eigrp_at_ext_metric, - { "External protocol metric", "eigrp.at_ext.metric", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_at_ext_delay, - { "Delay", "eigrp.at_ext.delay", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_at_ext_bandwidth, - { "Bandwidth", "eigrp.at_ext.bandwidth", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_at_ext_mtu, - { "MTU", "eigrp.at_ext.mtu", - FT_UINT24, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_at_ext_hopcount, - { "Hop Count", "eigrp.at_ext.hopcount", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_at_ext_reliability, - { "Reliability", "eigrp.at_ext.reliability", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_at_ext_load, - { "Load", "eigrp.at_ext.load", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_at_ext_reserved, - { "Reserved", "eigrp.at_ext.reserved", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, + { &hf_eigrp_at_ext_origrouter, + { "Originating router", "eigrp.at_ext.origrouter", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_at_ext_as, + { "Originating A.S.", "eigrp.at_ext.as", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_at_ext_tag, + { "Arbitrary tag", "eigrp.at_ext.tag", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_at_ext_proto, + { "External protocol ID", "eigrp.at_ext.proto", + FT_UINT8, BASE_DEC, VALS(eigrp_pid_vals), 0x0, + NULL, HFILL } + }, + { &hf_eigrp_at_ext_flags, + { "Flags", "eigrp.at_ext.flags", + FT_UINT8, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_at_ext_flags_ext, + { "External Route", "eigrp.at_ext.flags.ext", + FT_BOOLEAN, 8, NULL, EIGRP_IP_EXT_FLAGS_EXT, + NULL, HFILL } + }, + { &hf_eigrp_at_ext_flags_default, + { "Candidate Default Route", "eigrp.at_ext.flags.default", + FT_BOOLEAN, 8, NULL, EIGRP_IP_EXT_FLAGS_DEFAULT, + NULL, HFILL } + }, + { &hf_eigrp_at_ext_metric, + { "External protocol metric", "eigrp.at_ext.metric", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_at_ext_delay, + { "Delay", "eigrp.at_ext.delay", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_at_ext_bandwidth, + { "Bandwidth", "eigrp.at_ext.bandwidth", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_at_ext_mtu, + { "MTU", "eigrp.at_ext.mtu", + FT_UINT24, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_at_ext_hopcount, + { "Hop Count", "eigrp.at_ext.hopcount", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_at_ext_reliability, + { "Reliability", "eigrp.at_ext.reliability", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_at_ext_load, + { "Load", "eigrp.at_ext.load", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_at_ext_reserved, + { "Reserved", "eigrp.at_ext.reserved", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, /* IPv6 internal route TLV */ - { &hf_eigrp_ip6_int_nexthop, - { "Next Hop", "eigrp.ip6_int.nexthop", - FT_IPv6, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_int_delay, - { "Delay", "eigrp.ip6_int.delay", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_int_bandwidth, - { "Bandwidth", "eigrp.ip6_int.bandwidth", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_int_mtu, - { "MTU", "eigrp.ip6_int.mtu", - FT_UINT24, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_int_hopcount, - { "Hop Count", "eigrp.ip6_int.hopcount", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_int_reliability, - { "Reliability", "eigrp.ip6_int.reliability", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_int_load, - { "Load", "eigrp.ip6_int.load", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_int_reserved, - { "Reserved", "eigrp.ip6_int.reserved", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_int_prefixlen, - { "Prefix Length", "eigrp.ip6_int.prefixlen", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, + { &hf_eigrp_ip6_int_nexthop, + { "Next Hop", "eigrp.ip6_int.nexthop", + FT_IPv6, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_int_delay, + { "Delay", "eigrp.ip6_int.delay", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_int_bandwidth, + { "Bandwidth", "eigrp.ip6_int.bandwidth", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_int_mtu, + { "MTU", "eigrp.ip6_int.mtu", + FT_UINT24, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_int_hopcount, + { "Hop Count", "eigrp.ip6_int.hopcount", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_int_reliability, + { "Reliability", "eigrp.ip6_int.reliability", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_int_load, + { "Load", "eigrp.ip6_int.load", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_int_reserved, + { "Reserved", "eigrp.ip6_int.reserved", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_int_prefixlen, + { "Prefix Length", "eigrp.ip6_int.prefixlen", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, /* IPv6 external route TLV */ - { &hf_eigrp_ip6_ext_nexthop, - { "Next Hop", "eigrp.ip6_ext.nexthop", - FT_IPv6, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_ext_origrouter, - { "Originating router", "eigrp.ip6_ext.origrouter", - FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_ext_as, - { "Originating A.S.", "eigrp.ip6_ext.as", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_ext_tag, - { "Arbitrary tag", "eigrp.ip6_ext.tag", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_ext_metric, - { "External protocol metric", "eigrp.ip6_ext.metric", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_ext_reserved, - { "Reserved", "eigrp.ip6_ext.reserved", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_ext_proto, - { "External protocol ID", "eigrp.ip6_ext.proto", - FT_UINT8, BASE_DEC, VALS(eigrp_pid_vals), 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_ext_flags, - { "Flags", "eigrp.ip6_ext.flags", - FT_UINT8, BASE_HEX, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_ext_flags_ext, - { "External Route", "eigrp.ip6_ext.flags.ext", - FT_BOOLEAN, 8, NULL, EIGRP_IP_EXT_FLAGS_EXT, - NULL, HFILL } - }, - { &hf_eigrp_ip6_ext_flags_default, - { "Candidate Default Route", "eigrp.ip6_ext.flags.default", - FT_BOOLEAN, 8, NULL, EIGRP_IP_EXT_FLAGS_DEFAULT, - NULL, HFILL } - }, - { &hf_eigrp_ip6_ext_delay, - { "Delay", "eigrp.ip6_ext.delay", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_ext_bandwidth, - { "Bandwidth", "eigrp.ip6_ext.bandwidth", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_ext_mtu, - { "MTU", "eigrp.ip6_ext.mtu", - FT_UINT24, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_ext_hopcount, - { "Hop Count", "eigrp.ip6_ext.hopcount", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_ext_reliability, - { "Reliability", "eigrp.ip6_ext.reliability", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_ext_load, - { "Load", "eigrp.ip6_ext.load", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_ext_reserved2, - { "Reserved", "eigrp.ip6_ext.reserved2", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_eigrp_ip6_ext_prefixlen, - { "Prefix Length", "eigrp.ip6_ext.prefixlen", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } - } + { &hf_eigrp_ip6_ext_nexthop, + { "Next Hop", "eigrp.ip6_ext.nexthop", + FT_IPv6, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_ext_origrouter, + { "Originating router", "eigrp.ip6_ext.origrouter", + FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_ext_as, + { "Originating A.S.", "eigrp.ip6_ext.as", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_ext_tag, + { "Arbitrary tag", "eigrp.ip6_ext.tag", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_ext_metric, + { "External protocol metric", "eigrp.ip6_ext.metric", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_ext_reserved, + { "Reserved", "eigrp.ip6_ext.reserved", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_ext_proto, + { "External protocol ID", "eigrp.ip6_ext.proto", + FT_UINT8, BASE_DEC, VALS(eigrp_pid_vals), 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_ext_flags, + { "Flags", "eigrp.ip6_ext.flags", + FT_UINT8, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_ext_flags_ext, + { "External Route", "eigrp.ip6_ext.flags.ext", + FT_BOOLEAN, 8, NULL, EIGRP_IP_EXT_FLAGS_EXT, + NULL, HFILL } + }, + { &hf_eigrp_ip6_ext_flags_default, + { "Candidate Default Route", "eigrp.ip6_ext.flags.default", + FT_BOOLEAN, 8, NULL, EIGRP_IP_EXT_FLAGS_DEFAULT, + NULL, HFILL } + }, + { &hf_eigrp_ip6_ext_delay, + { "Delay", "eigrp.ip6_ext.delay", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_ext_bandwidth, + { "Bandwidth", "eigrp.ip6_ext.bandwidth", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_ext_mtu, + { "MTU", "eigrp.ip6_ext.mtu", + FT_UINT24, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_ext_hopcount, + { "Hop Count", "eigrp.ip6_ext.hopcount", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_ext_reliability, + { "Reliability", "eigrp.ip6_ext.reliability", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_ext_load, + { "Load", "eigrp.ip6_ext.load", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_ext_reserved2, + { "Reserved", "eigrp.ip6_ext.reserved2", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_eigrp_ip6_ext_prefixlen, + { "Prefix Length", "eigrp.ip6_ext.prefixlen", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + } }; static gint *ett[] = { diff --git a/epan/dissectors/packet-erf.c b/epan/dissectors/packet-erf.c index fbf3289c56..64e049e111 100644 --- a/epan/dissectors/packet-erf.c +++ b/epan/dissectors/packet-erf.c @@ -25,8 +25,6 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif -#include <stdlib.h> -#include <string.h> #include <glib.h> #include <epan/packet.h> @@ -65,7 +63,7 @@ static int hf_erf_wlen = -1; static int hf_erf_ehdr_int_res1 = -1; static int hf_erf_ehdr_int_id = -1; static int hf_erf_ehdr_int_res2 = -1; - + /* Raw Link extension header */ static int hf_erf_ehdr_raw_link_res = -1; static int hf_erf_ehdr_raw_link_seqnum = -1; @@ -195,7 +193,7 @@ static dissector_handle_t ipv6_handle; static dissector_handle_t infiniband_handle; static dissector_handle_t infiniband_link_handle; -typedef enum { +typedef enum { ERF_HDLC_CHDLC = 0, ERF_HDLC_PPP = 1, ERF_HDLC_FRELAY = 2, @@ -316,7 +314,7 @@ static const value_string erf_type_vals[] = { { ERF_TYPE_HDLC_POS,"HDLC_POS"}, { ERF_TYPE_ETH,"ETH"}, { ERF_TYPE_ATM,"ATM"}, - { ERF_TYPE_AAL5,"AAL5"}, + { ERF_TYPE_AAL5,"AAL5"}, { ERF_TYPE_MC_HDLC,"MC_HDLC"}, { ERF_TYPE_MC_RAW,"MC_RAW"}, { ERF_TYPE_MC_ATM,"MC_ATM"}, @@ -372,103 +370,103 @@ static void erf_atm_guess_lane_type(const guint8 *pd, guint len, union wtap_pseudo_header *pseudo_header) { - if (len >= 2) { - if (pd[0] == 0xff && pd[1] == 0x00) { - /* - * Looks like LE Control traffic. - */ - pseudo_header->atm.subtype = TRAF_ST_LANE_LE_CTRL; - } else { - /* - * XXX - Ethernet, or Token Ring? - * Assume Ethernet for now; if we see earlier - * LANE traffic, we may be able to figure out - * the traffic type from that, but there may - * still be situations where the user has to - * tell us. - */ - pseudo_header->atm.subtype = TRAF_ST_LANE_802_3; - } - } + if (len >= 2) { + if (pd[0] == 0xff && pd[1] == 0x00) { + /* + * Looks like LE Control traffic. + */ + pseudo_header->atm.subtype = TRAF_ST_LANE_LE_CTRL; + } else { + /* + * XXX - Ethernet, or Token Ring? + * Assume Ethernet for now; if we see earlier + * LANE traffic, we may be able to figure out + * the traffic type from that, but there may + * still be situations where the user has to + * tell us. + */ + pseudo_header->atm.subtype = TRAF_ST_LANE_802_3; + } + } } static void erf_atm_guess_traffic_type(const guint8 *pd, guint len, union wtap_pseudo_header *pseudo_header) { - /* - * Start out assuming nothing other than that it's AAL5. - */ - pseudo_header->atm.aal = AAL_5; - pseudo_header->atm.type = TRAF_UNKNOWN; - pseudo_header->atm.subtype = TRAF_ST_UNKNOWN; - - if (pseudo_header->atm.vpi == 0) { - /* - * Traffic on some PVCs with a VPI of 0 and certain - * VCIs is of particular types. - */ - switch (pseudo_header->atm.vci) { - - case 5: - /* - * Signalling AAL. - */ - pseudo_header->atm.aal = AAL_SIGNALLING; - return; - - case 16: - /* - * ILMI. - */ - pseudo_header->atm.type = TRAF_ILMI; - return; - } - } - - /* - * OK, we can't tell what it is based on the VPI/VCI; try - * guessing based on the contents, if we have enough data - * to guess. - */ - - if (len >= 3) { - if (pd[0] == 0xaa && pd[1] == 0xaa && pd[2] == 0x03) { - /* - * Looks like a SNAP header; assume it's LLC - * multiplexed RFC 1483 traffic. - */ - pseudo_header->atm.type = TRAF_LLCMX; - } else if ((pseudo_header->atm.aal5t_len && - pseudo_header->atm.aal5t_len < 16) || len<16) { - /* - * As this cannot be a LANE Ethernet frame (less - * than 2 bytes of LANE header + 14 bytes of - * Ethernet header) we can try it as a SSCOP frame. - */ - pseudo_header->atm.aal = AAL_SIGNALLING; - } else if (pd[0] == 0x83 || pd[0] == 0x81) { - /* - * MTP3b headers often encapsulate - * a SCCP or MTN in the 3G network. - * This should cause 0x83 or 0x81 - * in the first byte. - */ - pseudo_header->atm.aal = AAL_SIGNALLING; - } else { - /* - * Assume it's LANE. - */ - pseudo_header->atm.type = TRAF_LANE; - erf_atm_guess_lane_type(pd, len, pseudo_header); - } - } else { - /* - * Not only VCI 5 is used for signaling. It might be - * one of these VCIs. - */ - pseudo_header->atm.aal = AAL_SIGNALLING; - } + /* + * Start out assuming nothing other than that it's AAL5. + */ + pseudo_header->atm.aal = AAL_5; + pseudo_header->atm.type = TRAF_UNKNOWN; + pseudo_header->atm.subtype = TRAF_ST_UNKNOWN; + + if (pseudo_header->atm.vpi == 0) { + /* + * Traffic on some PVCs with a VPI of 0 and certain + * VCIs is of particular types. + */ + switch (pseudo_header->atm.vci) { + + case 5: + /* + * Signalling AAL. + */ + pseudo_header->atm.aal = AAL_SIGNALLING; + return; + + case 16: + /* + * ILMI. + */ + pseudo_header->atm.type = TRAF_ILMI; + return; + } + } + + /* + * OK, we can't tell what it is based on the VPI/VCI; try + * guessing based on the contents, if we have enough data + * to guess. + */ + + if (len >= 3) { + if (pd[0] == 0xaa && pd[1] == 0xaa && pd[2] == 0x03) { + /* + * Looks like a SNAP header; assume it's LLC + * multiplexed RFC 1483 traffic. + */ + pseudo_header->atm.type = TRAF_LLCMX; + } else if ((pseudo_header->atm.aal5t_len && + pseudo_header->atm.aal5t_len < 16) || len<16) { + /* + * As this cannot be a LANE Ethernet frame (less + * than 2 bytes of LANE header + 14 bytes of + * Ethernet header) we can try it as a SSCOP frame. + */ + pseudo_header->atm.aal = AAL_SIGNALLING; + } else if (pd[0] == 0x83 || pd[0] == 0x81) { + /* + * MTP3b headers often encapsulate + * a SCCP or MTN in the 3G network. + * This should cause 0x83 or 0x81 + * in the first byte. + */ + pseudo_header->atm.aal = AAL_SIGNALLING; + } else { + /* + * Assume it's LANE. + */ + pseudo_header->atm.type = TRAF_LANE; + erf_atm_guess_lane_type(pd, len, pseudo_header); + } + } else { + /* + * Not only VCI 5 is used for signaling. It might be + * one of these VCIs. + */ + pseudo_header->atm.aal = AAL_SIGNALLING; + } } static void @@ -478,17 +476,17 @@ dissect_classification_ex_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree proto_tree *int_tree = NULL, *flags_tree = NULL; guint64 hdr = pinfo->pseudo_header->erf.ehdr_list[idx].ehdr; guint32 value = (guint32)(hdr >> 32); - + if (pseudo_hdr_tree){ int_item = proto_tree_add_text(pseudo_hdr_tree, tvb, 0, 0, "Classification"); - int_tree = proto_item_add_subtree(int_item, ett_erf_pseudo_hdr); + int_tree = proto_item_add_subtree(int_item, ett_erf_pseudo_hdr); PROTO_ITEM_SET_GENERATED(int_item); - + proto_tree_add_uint(int_tree, hf_erf_ehdr_t , tvb, 0, 0, (guint8)((hdr >> 56) & 0x7F)); flags_item=proto_tree_add_uint(int_tree, hf_erf_ehdr_class_flags, tvb, 0, 0, value & 0xFFFFFF); flags_tree = proto_item_add_subtree(flags_item, ett_erf_flags); - + proto_tree_add_uint(flags_tree, hf_erf_ehdr_class_flags_sh, tvb, 0, 0, value); proto_tree_add_uint(flags_tree, hf_erf_ehdr_class_flags_shm, tvb, 0, 0, value); proto_tree_add_uint(flags_tree, hf_erf_ehdr_class_flags_res1, tvb, 0, 0, value); @@ -508,13 +506,13 @@ dissect_intercept_ex_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pseu guint64 hdr = pinfo->pseudo_header->erf.ehdr_list[idx].ehdr; if (pseudo_hdr_tree){ int_item = proto_tree_add_text(pseudo_hdr_tree, tvb, 0, 0, "InterceptID"); - int_tree = proto_item_add_subtree(int_item, ett_erf_pseudo_hdr); + int_tree = proto_item_add_subtree(int_item, ett_erf_pseudo_hdr); PROTO_ITEM_SET_GENERATED(int_item); - + proto_tree_add_uint(int_tree, hf_erf_ehdr_t , tvb, 0, 0, (guint8)((hdr >> 56) & 0x7F)); - proto_tree_add_uint(int_tree, hf_erf_ehdr_int_res1, tvb, 0, 0, (guint8)((hdr >> 48) & 0xFF)); - proto_tree_add_uint(int_tree, hf_erf_ehdr_int_id, tvb, 0, 0, (guint16)((hdr >> 32 ) & 0xFFFF)); - proto_tree_add_uint(int_tree, hf_erf_ehdr_int_res2, tvb, 0, 0, (guint32)hdr); + proto_tree_add_uint(int_tree, hf_erf_ehdr_int_res1, tvb, 0, 0, (guint8)((hdr >> 48) & 0xFF)); + proto_tree_add_uint(int_tree, hf_erf_ehdr_int_id, tvb, 0, 0, (guint16)((hdr >> 32 ) & 0xFFFF)); + proto_tree_add_uint(int_tree, hf_erf_ehdr_int_res2, tvb, 0, 0, (guint32)hdr); } } @@ -524,14 +522,14 @@ dissect_raw_link_ex_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pseud proto_item *int_item= NULL; proto_tree *int_tree = NULL; guint64 hdr = pinfo->pseudo_header->erf.ehdr_list[idx].ehdr; - + if (pseudo_hdr_tree){ int_item = proto_tree_add_text(pseudo_hdr_tree, tvb, 0, 0, "Raw Link"); - int_tree = proto_item_add_subtree(int_item, ett_erf_pseudo_hdr); + int_tree = proto_item_add_subtree(int_item, ett_erf_pseudo_hdr); PROTO_ITEM_SET_GENERATED(int_item); - + proto_tree_add_uint(int_tree, hf_erf_ehdr_t , tvb, 0, 0, (guint8)((hdr >> 56) & 0x7F)); - proto_tree_add_uint(int_tree, hf_erf_ehdr_raw_link_res , tvb, 0, 0, (guint32)((hdr >> 32) & 0xFFFFFF)); + proto_tree_add_uint(int_tree, hf_erf_ehdr_raw_link_res , tvb, 0, 0, (guint32)((hdr >> 32) & 0xFFFFFF)); proto_tree_add_uint(int_tree, hf_erf_ehdr_raw_link_seqnum , tvb, 0, 0, (guint32)((hdr >> 16) & 0xffff)); proto_tree_add_uint(int_tree, hf_erf_ehdr_raw_link_rate, tvb, 0, 0, (guint32)((hdr >> 8) & 0x00ff)); proto_tree_add_uint(int_tree, hf_erf_ehdr_raw_link_type, tvb, 0, 0, (guint32)(hdr & 0x00ff)); @@ -544,12 +542,12 @@ dissect_bfs_ex_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pseudo_hdr proto_item *int_item= NULL; proto_tree *int_tree = NULL; guint64 hdr = pinfo->pseudo_header->erf.ehdr_list[idx].ehdr; - + if (pseudo_hdr_tree){ int_item = proto_tree_add_text(pseudo_hdr_tree, tvb, 0, 0, "BFS Filter/Hash"); - int_tree = proto_item_add_subtree(int_item, ett_erf_pseudo_hdr); + int_tree = proto_item_add_subtree(int_item, ett_erf_pseudo_hdr); PROTO_ITEM_SET_GENERATED(int_item); - + proto_tree_add_uint(int_tree, hf_erf_ehdr_t , tvb, 0, 0, (guint8)((hdr >> 56) & 0x7F)); proto_tree_add_uint(int_tree, hf_erf_ehdr_bfs_hash, tvb, 0, 0, (guint32)((hdr >> 48) & 0xFF)); proto_tree_add_uint(int_tree, hf_erf_ehdr_bfs_color, tvb, 0, 0, (guint32)((hdr >> 32) & 0xFFFF)); @@ -563,10 +561,10 @@ dissect_unknown_ex_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pseudo proto_item *unk_item= NULL; proto_tree *unk_tree = NULL; guint64 hdr = pinfo->pseudo_header->erf.ehdr_list[idx].ehdr; - + if (pseudo_hdr_tree){ unk_item = proto_tree_add_text(pseudo_hdr_tree, tvb, 0, 0, "Unknown"); - unk_tree = proto_item_add_subtree(unk_item, ett_erf_pseudo_hdr); + unk_tree = proto_item_add_subtree(unk_item, ett_erf_pseudo_hdr); PROTO_ITEM_SET_GENERATED(unk_item); proto_tree_add_uint(unk_tree, hf_erf_ehdr_t , tvb, 0, 0, (guint8)((hdr >> 56) & 0x7F)); @@ -576,18 +574,18 @@ dissect_unknown_ex_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pseudo static void dissect_mc_hdlc_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ +{ proto_item *mc_hdlc_item = NULL; proto_tree *mc_hdlc_tree = NULL; struct erf_mc_hdlc_hdrx * mc_hdlc; - if (tree) { + if (tree) { mc_hdlc_item = proto_tree_add_text(tree, tvb, 0, 0, "Multi Channel HDLC Header"); - mc_hdlc_tree = proto_item_add_subtree(mc_hdlc_item, ett_erf_mc_hdlc); + mc_hdlc_tree = proto_item_add_subtree(mc_hdlc_item, ett_erf_mc_hdlc); PROTO_ITEM_SET_GENERATED(mc_hdlc_item); mc_hdlc = (struct erf_mc_hdlc_hdrx *) (&pinfo->pseudo_header->erf.subhdr.mc_hdr); - proto_tree_add_uint(mc_hdlc_tree, hf_erf_mc_hdlc_cn, tvb, 0, 0, mc_hdlc->byte01); + proto_tree_add_uint(mc_hdlc_tree, hf_erf_mc_hdlc_cn, tvb, 0, 0, mc_hdlc->byte01); proto_tree_add_uint(mc_hdlc_tree, hf_erf_mc_hdlc_res1, tvb, 0, 0, mc_hdlc->byte01); proto_tree_add_uint(mc_hdlc_tree, hf_erf_mc_hdlc_res2, tvb, 0, 0, mc_hdlc->byte2); proto_tree_add_uint(mc_hdlc_tree, hf_erf_mc_hdlc_fcse, tvb, 0, 0, mc_hdlc->byte3); @@ -603,12 +601,12 @@ dissect_mc_hdlc_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static void dissect_mc_raw_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ +{ proto_item *mc_raw_item = NULL; proto_tree *mc_raw_tree = NULL; struct erf_mc_raw_hdrx * mc_raw; - if (tree) { + if (tree) { mc_raw_item = proto_tree_add_text(tree, tvb, 0, 0, "Multi Channel RAW Header"); mc_raw_tree = proto_item_add_subtree(mc_raw_item, ett_erf_mc_raw); PROTO_ITEM_SET_GENERATED(mc_raw_item); @@ -629,12 +627,12 @@ dissect_mc_raw_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static void dissect_mc_atm_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ +{ proto_item *mc_atm_item = NULL; proto_tree *mc_atm_tree = NULL; struct erf_mc_atm_hdrx * mc_atm; - - if (tree) { + + if (tree) { mc_atm_item = proto_tree_add_text(tree, tvb, 0, 0, "Multi Channel ATM Header"); mc_atm_tree = proto_item_add_subtree(mc_atm_item, ett_erf_mc_atm); PROTO_ITEM_SET_GENERATED(mc_atm_item); @@ -658,12 +656,12 @@ dissect_mc_atm_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static void dissect_mc_rawlink_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ +{ proto_item *mc_rawl_item = NULL; proto_tree *mc_rawl_tree = NULL; struct erf_mc_rawl_hdrx * mc_rawl; - if (tree) { + if (tree) { mc_rawl_item = proto_tree_add_text(tree, tvb, 0, 0, "Multi Channel RAW Link Header"); mc_rawl_tree = proto_item_add_subtree(mc_rawl_item, ett_erf_mc_rawlink); PROTO_ITEM_SET_GENERATED(mc_rawl_item); @@ -679,12 +677,12 @@ dissect_mc_rawlink_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static void dissect_mc_aal5_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ +{ proto_item *mc_aal5_item = NULL; proto_tree *mc_aal5_tree = NULL; struct erf_mc_aal5_hdrx * mc_aal5; - if (tree) { + if (tree) { mc_aal5_item = proto_tree_add_text(tree, tvb, 0, 0, "Multi Channel AAL5 Header"); mc_aal5_tree = proto_item_add_subtree(mc_aal5_item, ett_erf_mc_aal5); PROTO_ITEM_SET_GENERATED(mc_aal5_item); @@ -707,17 +705,17 @@ dissect_mc_aal5_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static void dissect_mc_aal2_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ +{ proto_item *mc_aal2_item = NULL; proto_tree *mc_aal2_tree = NULL; struct erf_mc_aal2_hdrx * mc_aal2; - if (tree) { + if (tree) { mc_aal2_item = proto_tree_add_text(tree, tvb, 0, 0, "Multi Channel AAL2 Header"); mc_aal2_tree = proto_item_add_subtree(mc_aal2_item, ett_erf_mc_aal2); PROTO_ITEM_SET_GENERATED(mc_aal2_item); mc_aal2 = (struct erf_mc_aal2_hdrx *) (&pinfo->pseudo_header->erf.subhdr.mc_hdr); - + proto_tree_add_uint(mc_aal2_tree, hf_erf_mc_aal2_cn, tvb, 0, 0, mc_aal2->byte01); proto_tree_add_uint(mc_aal2_tree, hf_erf_mc_aal2_res1, tvb, 0, 0, mc_aal2->byte01); proto_tree_add_uint(mc_aal2_tree, hf_erf_mc_aal2_res2, tvb, 0, 0, mc_aal2->byte01); @@ -734,17 +732,17 @@ dissect_mc_aal2_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static void dissect_aal2_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ +{ proto_item *aal2_item = NULL; proto_tree *aal2_tree = NULL; struct erf_aal2_hdrx * aal2; - if (tree) { + if (tree) { aal2_item = proto_tree_add_text(tree, tvb, 0, 0, "AAL2 Header"); aal2_tree = proto_item_add_subtree(aal2_item, ett_erf_aal2); PROTO_ITEM_SET_GENERATED(aal2_item); aal2 = (struct erf_aal2_hdrx*) (&pinfo->pseudo_header->erf.subhdr.mc_hdr); - + proto_tree_add_uint(aal2_tree, hf_erf_aal2_cid, tvb, 0, 0, aal2->byte0); proto_tree_add_uint(aal2_tree, hf_erf_aal2_maale, tvb, 0, 0, aal2->byte1); @@ -758,17 +756,17 @@ dissect_aal2_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static void dissect_eth_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ +{ proto_item *eth_item = NULL; proto_tree *eth_tree = NULL; struct erf_eth_hdrx * eth_hdr; - - if (tree) { + + if (tree) { eth_item = proto_tree_add_text(tree, tvb, 0, 0, "Ethernet Header"); eth_tree = proto_item_add_subtree(eth_item, ett_erf_eth); PROTO_ITEM_SET_GENERATED(eth_item); eth_hdr = (struct erf_eth_hdrx *) (&pinfo->pseudo_header->erf.subhdr.eth_hdr); - + proto_tree_add_uint(eth_tree, hf_erf_eth_off, tvb, 0, 0, eth_hdr->byte0); proto_tree_add_uint(eth_tree, hf_erf_eth_res1, tvb, 0, 0, eth_hdr->byte1); } @@ -776,7 +774,7 @@ dissect_eth_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static void dissect_erf_pseudo_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ +{ proto_item *pi; proto_item *pseudo_hdr_item = NULL, *flags_item = NULL, *types_item = NULL; proto_tree *pseudo_hdr_tree = NULL, *flags_tree = NULL, *types_tree = NULL; @@ -796,7 +794,7 @@ dissect_erf_pseudo_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) flags_item=proto_tree_add_uint(pseudo_hdr_tree, hf_erf_flags, tvb, 0, 0, pinfo->pseudo_header->erf.phdr.flags); flags_tree = proto_item_add_subtree(flags_item, ett_erf_flags); - + pi=proto_tree_add_uint(flags_tree, hf_erf_flags_cap, tvb, 0, 0, pinfo->pseudo_header->erf.phdr.flags); pi=proto_tree_add_uint(flags_tree, hf_erf_flags_vlen, tvb, 0, 0, pinfo->pseudo_header->erf.phdr.flags); pi=proto_tree_add_uint(flags_tree, hf_erf_flags_trunc, tvb, 0, 0, pinfo->pseudo_header->erf.phdr.flags); @@ -814,7 +812,7 @@ dissect_erf_pseudo_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static void dissect_erf_pseudo_extension_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ +{ proto_item *pi; proto_item *pseudo_hdr_item = NULL; proto_tree *pseudo_hdr_tree = NULL; @@ -829,12 +827,12 @@ dissect_erf_pseudo_extension_header(tvbuff_t *tvb, packet_info *pinfo, proto_tre while(has_more && i < max){ type = (guint8) (pinfo->pseudo_header->erf.ehdr_list[i].ehdr >> 56); - + switch(type & 0x7f){ - case EXT_HDR_TYPE_CLASSIFICATION: + case EXT_HDR_TYPE_CLASSIFICATION: dissect_classification_ex_header(tvb, pinfo, pseudo_hdr_tree, i); break; - case EXT_HDR_TYPE_INTERCEPTID: + case EXT_HDR_TYPE_INTERCEPTID: dissect_intercept_ex_header(tvb, pinfo, pseudo_hdr_tree, i); break; case EXT_HDR_TYPE_RAW_LINK: @@ -875,22 +873,22 @@ dissect_erf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) erf_type=pinfo->pseudo_header->erf.phdr.type & 0x7F; col_set_str(pinfo->cinfo, COL_PROTOCOL, "ERF"); - + if (check_col(pinfo->cinfo, COL_INFO)) { col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(erf_type, erf_type_vals, "Unknown type %u")); - } + } if (tree) { erf_item = proto_tree_add_item(tree, proto_erf, tvb, 0, -1, FALSE); erf_tree = proto_item_add_subtree(erf_item, ett_erf); - + dissect_erf_pseudo_header(tvb, pinfo, erf_tree); if (pinfo->pseudo_header->erf.phdr.type & 0x80){ dissect_erf_pseudo_extension_header(tvb, pinfo, erf_tree); } } - + flags = pinfo->pseudo_header->erf.phdr.flags; /* * Set if frame is Received or Sent. @@ -903,7 +901,7 @@ dissect_erf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * between the two links. */ pinfo->p2p_dir = ( (flags & 0x01) ? P2P_DIR_RECV : P2P_DIR_SENT); - + switch(erf_type) { case ERF_TYPE_RAW_LINK: @@ -947,23 +945,23 @@ dissect_erf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case ERF_TYPE_PAD: /* Nothing to do */ break; - + case ERF_TYPE_MC_RAW: dissect_mc_raw_header(tvb, pinfo, erf_tree); if (data_handle) call_dissector(data_handle, tvb, pinfo, tree); break; - + case ERF_TYPE_MC_RAW_CHANNEL: dissect_mc_rawlink_header(tvb, pinfo, erf_tree); if (data_handle) call_dissector(data_handle, tvb, pinfo, tree); break; - + case ERF_TYPE_MC_ATM: dissect_mc_atm_header(tvb, pinfo, erf_tree); /* continue with type ATM */ - + case ERF_TYPE_ATM: memset(&pinfo->pseudo_header->atm, 0, sizeof(pinfo->pseudo_header->atm)); atm_hdr = tvb_get_ntohl(tvb, 0); @@ -1007,8 +1005,8 @@ dissect_erf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case ERF_TYPE_MC_AAL5: dissect_mc_aal5_header(tvb, pinfo, erf_tree); /* continue with type AAL5 */ - - case ERF_TYPE_AAL5: + + case ERF_TYPE_AAL5: atm_hdr = tvb_get_ntohl(tvb, 0); memset(&pinfo->pseudo_header->atm, 0, sizeof(pinfo->pseudo_header->atm)); pinfo->pseudo_header->atm.vpi = ((atm_hdr & 0x0ff00000) >> 20); @@ -1108,7 +1106,7 @@ dissect_erf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case ERF_TYPE_MC_HDLC: dissect_mc_hdlc_header(tvb, pinfo, erf_tree); /* continue with type HDLC */ - + case ERF_TYPE_HDLC_POS: case ERF_TYPE_COLOR_HDLC_POS: case ERF_TYPE_DSM_COLOR_HDLC_POS: @@ -1135,7 +1133,7 @@ dissect_erf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case ERF_HDLC_PPP: call_dissector(ppp_handle, tvb, pinfo, tree); break; - case ERF_HDLC_FRELAY: + case ERF_HDLC_FRELAY: memset(&pinfo->pseudo_header->x25, 0, sizeof(pinfo->pseudo_header->x25)); call_dissector(frelay_handle, tvb, pinfo, tree); break; @@ -1148,7 +1146,7 @@ dissect_erf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; } break; - + default: break; } /* erf type */ @@ -1159,7 +1157,7 @@ proto_register_erf(void) { static hf_register_info hf[] = { - /* ERF Header */ + /* ERF Header */ { &hf_erf_ts, { "Timestamp", "erf.ts", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_erf_types, { "types", "erf.types", FT_UINT8, BASE_DEC, NULL, 0xFF, NULL, HFILL } }, { &hf_erf_type, { "type", "erf.types.type", FT_UINT8, BASE_DEC, VALS(erf_type_vals), 0x7F, NULL, HFILL } }, @@ -1175,7 +1173,7 @@ proto_register_erf(void) { &hf_erf_lctr, { "loss counter", "erf.lctr", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_erf_wlen, { "wire length", "erf.wlen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &hf_erf_ehdr_t, { "Extension Type", "erf.ehdr.types", FT_UINT8, BASE_DEC, VALS(ehdr_type_vals), 0x0, NULL, HFILL } }, + { &hf_erf_ehdr_t, { "Extension Type", "erf.ehdr.types", FT_UINT8, BASE_DEC, VALS(ehdr_type_vals), 0x0, NULL, HFILL } }, /* Intercept ID Extension Header */ { &hf_erf_ehdr_int_res1, { "Reserved", "erf.ehdr.int.res1", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, @@ -1304,7 +1302,7 @@ proto_register_erf(void) &ett_erf_eth }; - static enum_val_t erf_hdlc_options[] = { + static enum_val_t erf_hdlc_options[] = { { "chdlc", "Cisco HDLC", ERF_HDLC_CHDLC }, { "ppp", "PPP serial", ERF_HDLC_PPP }, { "frelay", "Frame Relay", ERF_HDLC_FRELAY }, @@ -1313,7 +1311,7 @@ proto_register_erf(void) { NULL, NULL, 0 } }; - static enum_val_t erf_aal5_options[] = { + static enum_val_t erf_aal5_options[] = { { "guess", "Attempt to guess", ERF_AAL5_GUESS }, { "llc", "LLC multiplexed", ERF_AAL5_LLC }, { NULL, NULL, 0 } @@ -1326,7 +1324,7 @@ proto_register_erf(void) proto_register_field_array(proto_erf, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - + erf_module = prefs_register_protocol(proto_erf, NULL); prefs_register_enum_preference(erf_module, "hdlc_type", "ERF_HDLC Layer 2", @@ -1364,7 +1362,7 @@ proto_reg_handoff_erf(void) /* Get handle for IP dissectors) */ ipv4_handle = find_dissector("ip"); ipv6_handle = find_dissector("ipv6"); - + /* Get handle for Infiniband dissector */ infiniband_handle = find_dissector("infiniband"); infiniband_link_handle = find_dissector("infiniband_link"); @@ -1379,6 +1377,6 @@ proto_reg_handoff_erf(void) atm_untruncated_handle = find_dissector("atm_untruncated"); /* Get handles for Ethernet dissectors */ - ethwithfcs_handle = find_dissector("eth_withfcs"); + ethwithfcs_handle = find_dissector("eth_withfcs"); ethwithoutfcs_handle = find_dissector("eth_withoutfcs"); } diff --git a/epan/dissectors/packet-icep.c b/epan/dissectors/packet-icep.c index e2582c497b..c364587c09 100644 --- a/epan/dissectors/packet-icep.c +++ b/epan/dissectors/packet-icep.c @@ -1,6 +1,6 @@ /* packet-icep.c * Routines for "The ICE Protocol" dissection - * Copyright 2004 _FF_ + * Copyright 2004 _FF_ * Francesco Fondelli <fondelli dot francesco, tiscali dot it> * * $Id$ @@ -8,17 +8,17 @@ * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -46,9 +46,6 @@ # include "config.h" #endif -#include <stdio.h> -#include <stdlib.h> - #include <glib.h> #include <epan/packet.h> @@ -154,99 +151,99 @@ static packet_info *mypinfo; -/* - * This function dissects an "Ice string", adds hf to "tree" and returns consumed +/* + * This function dissects an "Ice string", adds hf to "tree" and returns consumed * bytes in "*consumed", if errors "*consumed" is -1. * * "*dest" is a null terminated version of the dissected Ice string. */ -static void dissect_ice_string(proto_tree *tree, int hf_icep, +static void dissect_ice_string(proto_tree *tree, int hf_icep, tvbuff_t *tvb, guint32 offset, gint32 *consumed, char **dest, gboolean add_hf) { - /* p. 586 chapter 23.2.1 and p. 588 chapter 23.2.5 - * string == Size + content - * string = 1byte (0..254) + string not null terminated - * or - * string = 1byte (255) + 1int (255..2^32-1) + string not null terminated + /* p. 586 chapter 23.2.1 and p. 588 chapter 23.2.5 + * string == Size + content + * string = 1byte (0..254) + string not null terminated + * or + * string = 1byte (255) + 1int (255..2^32-1) + string not null terminated */ - + guint32 Size = 0; char *s = NULL; - + (*consumed) = 0; - + /* check for first byte */ if ( !tvb_bytes_exist(tvb, offset, 1) ) { - + if (tree) - proto_tree_add_text(tree, tvb, offset, -1, + proto_tree_add_text(tree, tvb, offset, -1, "1st byte of Size missing"); - - col_append_str(mypinfo->cinfo, COL_INFO, + + col_append_str(mypinfo->cinfo, COL_INFO, " (1st byte of Size missing)"); - + (*consumed) = -1; return; } - + /* get the Size */ Size = tvb_get_guint8(tvb, offset); offset++; (*consumed)++; - + if ( Size == 255 ) { - + /* check for next 4 bytes */ if ( !tvb_bytes_exist(tvb, offset, 4) ) { - + if (tree) proto_tree_add_text(tree, tvb, offset, -1, "second field of Size missing"); - - col_append_str(mypinfo->cinfo, COL_INFO, + + col_append_str(mypinfo->cinfo, COL_INFO, " (second field of Size missing)"); - + (*consumed) = -1; return; } - + /* get second field of Size */ Size = tvb_get_letohl(tvb, offset); offset += 4; (*consumed) += 4; } - + DBG1("string.Size --> %d\n", Size); - + /* check if the string exists */ if ( !tvb_bytes_exist(tvb, offset, Size) ) { - + if (tree) - proto_tree_add_text(tree, tvb, offset, -1, + proto_tree_add_text(tree, tvb, offset, -1, "missing or truncated string"); - - col_append_str(mypinfo->cinfo, COL_INFO, + + col_append_str(mypinfo->cinfo, COL_INFO, " (missing or truncated string)"); - + (*consumed) = -1; return; } if ( Size > ICEP_MAX_ICE_STRING_LEN ) { - + if (tree) proto_tree_add_text(tree, tvb, offset, -1, "string too long"); - - col_append_str(mypinfo->cinfo, COL_INFO, + + col_append_str(mypinfo->cinfo, COL_INFO, " (string too long)"); - + (*consumed) = -1; return; } - - - + + + if ( Size != 0 ) { s = tvb_get_ephemeral_string(tvb, offset, Size); if (tree && add_hf) @@ -257,64 +254,64 @@ static void dissect_ice_string(proto_tree *tree, int hf_icep, if (tree && add_hf) proto_tree_add_string(tree, hf_icep, tvb, offset - 1, 1, s); } - + if ( dest != NULL ) *dest = s; - + offset += Size; (*consumed) += Size; return; } -/* - * This function dissects an "Ice facet", adds hf(s) to "tree" and returns consumed +/* + * This function dissects an "Ice facet", adds hf(s) to "tree" and returns consumed * bytes in "*consumed", if errors "*consumed" is -1. */ -static void dissect_ice_facet(proto_tree *tree, int hf_icep, +static void dissect_ice_facet(proto_tree *tree, int hf_icep, tvbuff_t *tvb, guint32 offset, gint32 *consumed) { /* p. 588, chapter 23.2.6: - * "facet" is a StringSeq, a StringSeq is a: + * "facet" is a StringSeq, a StringSeq is a: * sequence<string> * * - * sequence == Size + SizeElements - * sequence = 1byte (0..254) + SizeElements - * or - * sequence = 1byte (255) + 1int (255..2^32-1) + SizeElements + * sequence == Size + SizeElements + * sequence = 1byte (0..254) + SizeElements + * or + * sequence = 1byte (255) + 1int (255..2^32-1) + SizeElements * * * p.613. chapter 23.3.2 * "facet has either zero elements (empty) or one element" * - * + * */ - + guint32 Size = 0; /* number of elements in the sequence */ char *s = NULL; - + (*consumed) = 0; - + /* check first byte */ if ( !tvb_bytes_exist(tvb, offset, 1) ) { - + if (tree) proto_tree_add_text(tree, tvb, offset, -1, "facet field missing"); - - col_append_str(mypinfo->cinfo, COL_INFO, + + col_append_str(mypinfo->cinfo, COL_INFO, " (facet field missing)"); - + (*consumed) = -1; return; } - + /* get first byte of Size */ Size = tvb_get_guint8(tvb, offset); offset++; (*consumed)++; - + if ( Size == 0 ) { - + if (tree) { s = ep_strdup( "(empty)" ); /* display the 0x00 Size byte when click on a empty ice_string */ @@ -322,115 +319,115 @@ static void dissect_ice_facet(proto_tree *tree, int hf_icep, } return; } - + if ( Size == 1 ) { - + gint32 consumed_facet = 0; - + dissect_ice_string(tree, hf_icep, tvb, offset, &consumed_facet, NULL, TRUE); - + if ( consumed_facet == -1 ) { (*consumed) = -1; return; } - + offset += consumed_facet; (*consumed) += consumed_facet; return; } - + /* if here => Size > 1 => not possible */ - + if (tree) /* display the XX Size byte when click here */ - proto_tree_add_text(tree, tvb, offset - 1, 1, + proto_tree_add_text(tree, tvb, offset - 1, 1, "facet can be max one element"); - - col_append_str(mypinfo->cinfo, COL_INFO, + + col_append_str(mypinfo->cinfo, COL_INFO, " (facet can be max one element)"); - + (*consumed) = -1; return; } -/* - * This function dissects an "Ice context", adds hf(s) to "tree" and returns consumed +/* + * This function dissects an "Ice context", adds hf(s) to "tree" and returns consumed * bytes in "*consumed", if errors "*consumed" is -1. */ -static void dissect_ice_context(proto_tree *tree, tvbuff_t *tvb, guint32 offset, +static void dissect_ice_context(proto_tree *tree, tvbuff_t *tvb, guint32 offset, gint32 *consumed) { /* p. 588, chapter 23.2.7 and p. 613, 23.3.2: - * "context" is a dictionary<string, string> + * "context" is a dictionary<string, string> * - * dictionary<string, string> == Size + SizeKeyValuePairs + * dictionary<string, string> == Size + SizeKeyValuePairs * dictionary<string, string> = 1byte (0..254) + SizeKeyValuePairs - * or - * dictionary<string, string>= 1byte (255) + 1int (255..2^32-1)+SizeKeyValuePairs - * + * or + * dictionary<string, string>= 1byte (255) + 1int (255..2^32-1)+SizeKeyValuePairs + * */ - + guint32 Size = 0; /* number of key-value in the dictionary */ guint32 i = 0; const char *s = NULL; - + (*consumed) = 0; - + /* check first byte */ if ( !tvb_bytes_exist(tvb, offset, 1) ) { - + if (tree) proto_tree_add_text(tree, tvb, offset, -1, "context missing"); - - col_append_str(mypinfo->cinfo, COL_INFO, + + col_append_str(mypinfo->cinfo, COL_INFO, " (context missing)"); - + (*consumed) = -1; return; } - + /* get first byte of Size */ Size = tvb_get_guint8(tvb, offset); offset++; (*consumed)++; - + if ( Size == 255 ) { - + /* check for next 4 bytes */ if ( !tvb_bytes_exist(tvb, offset, 4) ) { - + if (tree) proto_tree_add_text(tree, tvb, offset, -1, "second field of Size missing"); - - col_append_str(mypinfo->cinfo, COL_INFO, + + col_append_str(mypinfo->cinfo, COL_INFO, " (second field of Size missing)"); - + (*consumed) = -1; return; } - + /* get second field of Size */ Size = tvb_get_letohl(tvb, offset); offset += 4; (*consumed) += 4; } - + DBG1("context.Size --> %d\n", Size); if ( Size > ICEP_MAX_ICE_CONTEXT_PAIRS ) { - + if (tree) /* display the XX Size byte when click here */ proto_tree_add_text(tree, tvb, offset - 1, 1, "too long context"); - - col_append_str(mypinfo->cinfo, COL_INFO, + + col_append_str(mypinfo->cinfo, COL_INFO, " (too long context)"); - + (*consumed) = -1; return; } - + if (Size == 0) { s = "(empty)"; /* display the 0x00 Size byte when click on a empty context */ @@ -438,62 +435,62 @@ static void dissect_ice_context(proto_tree *tree, tvbuff_t *tvb, guint32 offset, proto_tree_add_string(tree, hf_icep_context, tvb, offset - 1, 1, s); return; } - + /* looping through the dictionary */ for ( i = 0; i < Size; i++ ) { - /* key */ + /* key */ gint32 consumed_key = 0; char *str_key = NULL; /* value */ gint32 consumed_value = 0; char *str_value = NULL; - + DBG1("looping through context dictionary, loop #%d\n", i); - - dissect_ice_string(tree, -1, tvb, offset, &consumed_key, + + dissect_ice_string(tree, -1, tvb, offset, &consumed_key, &str_key, FALSE); - + if ( consumed_key == -1 ) { (*consumed) = -1; return; } - + offset += consumed_key; (*consumed) += consumed_key; - - dissect_ice_string(tree, -1, tvb, offset, &consumed_value, + + dissect_ice_string(tree, -1, tvb, offset, &consumed_value, &str_value, FALSE); - + if ( consumed_value == -1 ) { (*consumed) = -1; return; } - + offset += consumed_value; (*consumed) += consumed_value; - + if (tree && str_value && str_key) { - + proto_tree_add_text(tree, tvb, - offset - (consumed_key + consumed_value) - 1, + offset - (consumed_key + consumed_value) - 1, (consumed_key + consumed_value) + 1, "Invocation Context: %s/%s", str_key, str_value); } - + } } -/* - * This function dissects an "Ice params", adds hf(s) to "tree" and returns consumed +/* + * This function dissects an "Ice params", adds hf(s) to "tree" and returns consumed * bytes in "*consumed", if errors "*consumed" is -1. */ -static void dissect_ice_params(proto_tree *tree, tvbuff_t *tvb, +static void dissect_ice_params(proto_tree *tree, tvbuff_t *tvb, guint32 offset, gint32 *consumed) { /* p. 612, chapter 23.3.2 and p. 587, 23.2.2: - * "params" is an Encapsulation + * "params" is an Encapsulation * * struct Encapsulation { * int size; @@ -501,104 +498,104 @@ static void dissect_ice_params(proto_tree *tree, tvbuff_t *tvb, * byte minor; * //(size - 6) bytes of data * } - * + * */ - + gint32 size = 0; gint tvb_data_remained = 0; - + (*consumed) = 0; - + /* check first 6 bytes */ if ( !tvb_bytes_exist(tvb, offset, ICEP_MIN_PARAMS_SIZE) ) { - + if (tree) proto_tree_add_text(tree, tvb, offset, -1, "params missing"); - - col_append_str(mypinfo->cinfo, COL_INFO, + + col_append_str(mypinfo->cinfo, COL_INFO, " (params missing)"); - + (*consumed) = -1; return; } - + /* get the size */ size = tvb_get_letohl(tvb, offset); - + DBG1("params.size --> %d\n", size); - + if ( size < ICEP_MIN_PARAMS_SIZE ) { - + if (tree) - proto_tree_add_text(tree, tvb, offset, 4, + proto_tree_add_text(tree, tvb, offset, 4, "params size too small"); - - col_append_str(mypinfo->cinfo, COL_INFO, + + col_append_str(mypinfo->cinfo, COL_INFO, " (params size too small)"); - + (*consumed) = -1; return; } - + if ( tree ) { - + proto_tree_add_item(tree, hf_icep_params_size, tvb, offset, 4, TRUE); offset += 4; (*consumed) += 4; - + proto_tree_add_item(tree, hf_icep_params_major, tvb, offset, 1, TRUE); offset += 1; (*consumed)++; - + proto_tree_add_item(tree, hf_icep_params_minor, tvb, offset, 1, TRUE); offset += 1; (*consumed)++; - + } else { /* skipp size, major, minor */ offset += 6; (*consumed) += 6; } - + if( size == ICEP_MIN_PARAMS_SIZE ) /* no encapsulatd data present, it's normal */ return; - + /* check if I got all encapsulated data */ tvb_data_remained = tvb_reported_length_remaining(tvb, offset); - + if ( tvb_data_remained < ( size - ICEP_MIN_PARAMS_SIZE ) ) { - + if (tree) proto_tree_add_text(tree, tvb, offset, -1, "missing encapsulated data (%d bytes)", - size - - ICEP_MIN_PARAMS_SIZE + size + - ICEP_MIN_PARAMS_SIZE - tvb_data_remained); - + if ( check_col(mypinfo->cinfo, COL_INFO) ) { col_append_fstr(mypinfo->cinfo, COL_INFO, " (missing encapsulated data (%d bytes))", size - - ICEP_MIN_PARAMS_SIZE + - ICEP_MIN_PARAMS_SIZE - tvb_data_remained); } - + (*consumed) = -1; return; } - + /* encapsulated params */ - + if (tree) { proto_tree_add_text(tree, tvb, offset, (size - ICEP_MIN_PARAMS_SIZE), - "Encapsulated parameters (%d bytes)", + "Encapsulated parameters (%d bytes)", (size - ICEP_MIN_PARAMS_SIZE)); } - + (*consumed) += (size - ICEP_MIN_PARAMS_SIZE); } -static void dissect_icep_request_common(tvbuff_t *tvb, guint32 offset, +static void dissect_icep_request_common(tvbuff_t *tvb, guint32 offset, proto_tree *icep_sub_tree, gint32 *total_consumed) { /* p. 613, chapter 23.3.3 and p. 612 chapter 23.3.2: @@ -613,75 +610,75 @@ static void dissect_icep_request_common(tvbuff_t *tvb, guint32 offset, * Encapsulation params; * } */ - + gint32 consumed = 0; char *namestr = NULL; char *opstr = NULL; - + (*total_consumed) = 0; - + /* check common header (i.e. the batch request one)*/ if ( !tvb_bytes_exist(tvb, offset, ICEP_MIN_COMMON_REQ_HEADER_SIZE) ) { - + if (icep_sub_tree) - proto_tree_add_text(icep_sub_tree, tvb, offset, -1, + proto_tree_add_text(icep_sub_tree, tvb, offset, -1, "too short header"); - - col_append_str(mypinfo->cinfo, COL_INFO, + + col_append_str(mypinfo->cinfo, COL_INFO, " (too short header)"); - + goto error; } - + /* got at least 15 bytes */ - + /* "id" is a: * struct Identity { * string name; * string category; * } */ - - dissect_ice_string(icep_sub_tree, hf_icep_id_name, tvb, offset, + + dissect_ice_string(icep_sub_tree, hf_icep_id_name, tvb, offset, &consumed, &namestr, TRUE); - + if ( consumed == -1 ) goto error; - + offset += consumed; DBG1("consumed --> %d\n", consumed); (*total_consumed) += consumed; - - - dissect_ice_string(icep_sub_tree, hf_icep_id_category, tvb, offset, + + + dissect_ice_string(icep_sub_tree, hf_icep_id_category, tvb, offset, &consumed, NULL, TRUE); - + if ( consumed == -1 ) goto error; - + offset += consumed; DBG1("consumed --> %d\n", consumed); (*total_consumed) += consumed; - - + + /* "facet" is a: * sequence<string> StringSeq * */ - + dissect_ice_facet(icep_sub_tree, hf_icep_facet, tvb, offset, &consumed); - + if ( consumed == -1 ) goto error; - + offset += consumed; DBG1("consumed --> %d\n", consumed); (*total_consumed) += consumed; - + /* "operation" is an ice_string * */ - - dissect_ice_string(icep_sub_tree, hf_icep_operation, tvb, offset, + + dissect_ice_string(icep_sub_tree, hf_icep_operation, tvb, offset, &consumed, &opstr, TRUE); - + if ( consumed == -1 ) goto error; else { @@ -691,60 +688,60 @@ static void dissect_icep_request_common(tvbuff_t *tvb, guint32 offset, if ( opstr && namestr ) { DBG2("operation --> %s.%s()\n", namestr, opstr); if ( check_col(mypinfo->cinfo, COL_INFO) ) { - col_append_fstr(mypinfo->cinfo, COL_INFO, " %s.%s()", + col_append_fstr(mypinfo->cinfo, COL_INFO, " %s.%s()", namestr, opstr); } opstr = NULL; namestr = NULL; } } - + /* check and get mode byte */ if ( !tvb_bytes_exist(tvb, offset, 1) ) { - + if (icep_sub_tree) - proto_tree_add_text(icep_sub_tree, tvb, offset, -1, + proto_tree_add_text(icep_sub_tree, tvb, offset, -1, "mode field missing"); - - col_append_str(mypinfo->cinfo, COL_INFO, + + col_append_str(mypinfo->cinfo, COL_INFO, " (mode field missing)"); - + goto error; } - - if (icep_sub_tree) + + if (icep_sub_tree) proto_tree_add_item(icep_sub_tree, hf_icep_mode, tvb, offset, 1, TRUE); - + offset++; DBG0("consumed --> 1\n"); (*total_consumed)++; - - + + /* "context" is a dictionary<string, string> * */ - + dissect_ice_context(icep_sub_tree, tvb, offset, &consumed); - + if ( consumed == -1 ) goto error; - + offset += consumed; DBG1("consumed --> %d\n", consumed); (*total_consumed) += consumed; - + /* "params" is a Encapsulation - * + * */ - + dissect_ice_params(icep_sub_tree, tvb, offset, &consumed); - + if ( consumed == -1 ) goto error; - + offset += consumed; DBG1("consumed --> %d\n", consumed); (*total_consumed) += consumed; - + return; - + error: (*total_consumed) = -1; } @@ -764,45 +761,45 @@ static void dissect_icep_request(tvbuff_t *tvb, guint32 offset, proto_tree *icep * Encapsulation params; * } */ - + proto_item *ti = NULL; proto_tree *icep_sub_tree = NULL; gint32 consumed = 0; guint32 reqid = 0; - + DBG0("dissect request\n"); - + /* check for req id */ if ( !tvb_bytes_exist(tvb, offset, 4) ) { - + if (icep_tree) - proto_tree_add_text(icep_tree, tvb, offset, -1, + proto_tree_add_text(icep_tree, tvb, offset, -1, "too short header"); - - col_append_str(mypinfo->cinfo, COL_INFO, + + col_append_str(mypinfo->cinfo, COL_INFO, " (too short header)"); - + return; } - + /* got at least 4 bytes */ - - /* create display subtree for this message type */ - + + /* create display subtree for this message type */ + reqid = tvb_get_letohl(tvb, offset); - + if (icep_tree) { - - ti = proto_tree_add_text(icep_tree, tvb, offset, -1, + + ti = proto_tree_add_text(icep_tree, tvb, offset, -1, "Request Message Body"); - + icep_sub_tree = proto_item_add_subtree(ti, ett_icep_msg); - - proto_tree_add_item(icep_sub_tree, hf_icep_request_id, tvb, offset, 4, + + proto_tree_add_item(icep_sub_tree, hf_icep_request_id, tvb, offset, 4, TRUE); - + } - + if ( reqid != 0 ) { if ( check_col(mypinfo->cinfo, COL_INFO) ) { col_append_fstr(mypinfo->cinfo, COL_INFO, "(%d):", @@ -810,23 +807,23 @@ static void dissect_icep_request(tvbuff_t *tvb, guint32 offset, proto_tree *icep } } else col_append_str(mypinfo->cinfo, COL_INFO, "(oneway):"); - - + + offset += 4; DBG0("consumed --> 4\n"); - + dissect_icep_request_common(tvb, offset, icep_sub_tree, &consumed); - + if ( consumed == -1 ) return; - + offset += consumed; DBG1("consumed --> %d\n", consumed); } -static void dissect_icep_batch_request(tvbuff_t *tvb, guint32 offset, +static void dissect_icep_batch_request(tvbuff_t *tvb, guint32 offset, proto_tree *icep_tree) { /* p. 613, chapter 23.3.3 @@ -847,95 +844,95 @@ static void dissect_icep_batch_request(tvbuff_t *tvb, guint32 offset, * of a Batch Request, *not* an Ice::Sequence (as the standard says). Basically the * same people wrote both code and standard so I'll follow the code. */ - + proto_item *ti = NULL; proto_tree *icep_sub_tree = NULL; guint32 num_reqs = 0; guint32 i = 0; gint32 consumed = 0; - + DBG0("dissect batch request\n"); - + /* check for first 4 byte */ if ( !tvb_bytes_exist(tvb, offset, 4) ) { - + if (icep_tree) - proto_tree_add_text(icep_tree, tvb, offset, -1, + proto_tree_add_text(icep_tree, tvb, offset, -1, "counter of batch requests missing"); - - col_append_str(mypinfo->cinfo, COL_INFO, + + col_append_str(mypinfo->cinfo, COL_INFO, " (counter of batch requests missing)"); - + return; } - + num_reqs = tvb_get_letohl(tvb, offset); offset += 4; - + DBG1("batch_requests.count --> %d\n", num_reqs); - + if ( num_reqs > ICEP_MAX_BATCH_REQUESTS ) { - + if (icep_tree) proto_tree_add_text(icep_tree, tvb, offset, -1, "too many batch requests (%d)", num_reqs); - + if ( check_col(mypinfo->cinfo, COL_INFO) ) { - col_append_fstr(mypinfo->cinfo, COL_INFO, - " (too many batch requests, %d)", + col_append_fstr(mypinfo->cinfo, COL_INFO, + " (too many batch requests, %d)", num_reqs); } - + return; } if ( num_reqs == 0 ) { - + if (icep_tree) proto_tree_add_text(icep_tree, tvb, offset, -1, "empty batch requests sequence"); - col_append_str(mypinfo->cinfo, COL_INFO, + col_append_str(mypinfo->cinfo, COL_INFO, " (empty batch requests sequence)"); - + return; } - - - col_append_str(mypinfo->cinfo, COL_INFO, + + + col_append_str(mypinfo->cinfo, COL_INFO, ":"); - + /* - * process requests + * process requests */ - + for ( i = 0; i < num_reqs; i++ ) { - + DBG1("looping through sequence of batch requests, loop #%d\n", i); - + /* create display subtree for this message type */ - + if (icep_tree) { - + ti = proto_tree_add_text(icep_tree, tvb, offset, -1, "Batch Request Message Body: #%d", i); - + icep_sub_tree = proto_item_add_subtree(ti, ett_icep_msg); - + } - + if ( check_col(mypinfo->cinfo, COL_INFO) && (i != 0) ) { col_append_str(mypinfo->cinfo, COL_INFO, ","); } - + dissect_icep_request_common(tvb, offset, icep_sub_tree, &consumed); - + if ( consumed == -1 ) return; - + if ( icep_tree && ti ) proto_item_set_len(ti, consumed); - + offset += consumed; DBG1("consumed --> %d\n", consumed); } @@ -951,106 +948,106 @@ static void dissect_icep_reply(tvbuff_t *tvb, guint32 offset, proto_tree *icep_t * [... messageSize - 19 bytes ... ] * } */ - + gint32 messageSize = 0; guint32 tvb_data_remained = 0; guint32 reported_reply_data = 0; proto_item *ti = NULL; proto_tree *icep_sub_tree = NULL; - + DBG0("dissect reply\n"); - + /* get at least a full reply message header */ - + if ( !tvb_bytes_exist(tvb, offset, ICEP_MIN_REPLY_SIZE) ) { - + if (icep_tree) - proto_tree_add_text(icep_tree, tvb, offset, -1, + proto_tree_add_text(icep_tree, tvb, offset, -1, "too short header"); - - col_append_str(mypinfo->cinfo, COL_INFO, + + col_append_str(mypinfo->cinfo, COL_INFO, " (too short header)"); - + return; } - + /* got 5 bytes, then data */ - + /* create display subtree for this message type */ - + if (icep_tree) { - - ti = proto_tree_add_text(icep_tree, tvb, offset, -1, + + ti = proto_tree_add_text(icep_tree, tvb, offset, -1, "Reply Message Body"); - + icep_sub_tree = proto_item_add_subtree(ti, ett_icep_msg); - - proto_tree_add_item(icep_sub_tree, hf_icep_request_id, tvb, offset, 4, + + proto_tree_add_item(icep_sub_tree, hf_icep_request_id, tvb, offset, 4, TRUE); } - + if ( check_col(mypinfo->cinfo, COL_INFO) ) { col_append_fstr(mypinfo->cinfo, COL_INFO, "(%d):", tvb_get_letohl(tvb, offset)); } - + offset += 4; - + if (icep_tree) - proto_tree_add_item(icep_sub_tree, hf_icep_reply_status, tvb, offset, 1, + proto_tree_add_item(icep_sub_tree, hf_icep_reply_status, tvb, offset, 1, TRUE); - + if ( check_col(mypinfo->cinfo, COL_INFO) ) { col_append_fstr(mypinfo->cinfo, COL_INFO, " %s", val_to_str(tvb_get_guint8(tvb, offset), icep_replystatus_vals, "unknown reply status")); } - + offset++; - + DBG1("consumed --> %d\n", 5); - + /* check if I got all reply data */ tvb_data_remained = tvb_length_remaining(tvb, offset); messageSize = tvb_get_letohl(tvb, 10); reported_reply_data = messageSize - (ICEP_HEADER_SIZE + ICEP_MIN_REPLY_SIZE); - + /* no */ if ( tvb_data_remained < reported_reply_data ) { - - if (icep_sub_tree) + + if (icep_sub_tree) proto_tree_add_text(icep_sub_tree, tvb, offset, -1, "Reply Data (missing %d bytes out of %d)", reported_reply_data - tvb_data_remained, reported_reply_data); - + if ( check_col(mypinfo->cinfo, COL_INFO) ) { col_append_fstr(mypinfo->cinfo, COL_INFO, " (missing reply data, %d bytes)", reported_reply_data - tvb_data_remained); } - + offset += tvb_data_remained; DBG1("consumed --> %d\n", tvb_data_remained); return; } - + /* yes (reported_reply_data can be 0) */ - + if (icep_sub_tree) { - + if ( reported_reply_data !=0 ) - proto_tree_add_text(icep_sub_tree, tvb, offset, + proto_tree_add_text(icep_sub_tree, tvb, offset, reported_reply_data, "Reply data (%d bytes)", reported_reply_data); else - proto_tree_add_text(icep_sub_tree, tvb, offset, + proto_tree_add_text(icep_sub_tree, tvb, offset, reported_reply_data, "Reply data (empty)"); } - + offset += reported_reply_data; DBG1("consumed --> %d\n", reported_reply_data); } @@ -1075,73 +1072,73 @@ static void dissect_icep_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree * int messageSize; * } */ - + proto_item *ti = NULL; proto_tree *icep_tree = NULL; guint32 offset = 0; - /* Make entries in Protocol column and Info column on summary display */ - + /* Make entries in Protocol column and Info column on summary display */ + col_set_str(pinfo->cinfo, COL_PROTOCOL, "ICEP"); - + if ( check_col(pinfo->cinfo, COL_INFO) ) { - col_add_str(pinfo->cinfo, COL_INFO, + col_add_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(tvb, 8), icep_msgtype_vals, "Unknown Message Type: 0x%02x")); } - + mypinfo = pinfo; - + if (tree) { - + DBG0("got an icep msg, start analysis\n"); - - /* create display subtree for the protocol */ - + + /* create display subtree for the protocol */ + ti = proto_tree_add_item(tree, proto_icep, tvb, 0, -1, FALSE); - + icep_tree = proto_item_add_subtree(ti, ett_icep); - - /* add items to the subtree */ - + + /* add items to the subtree */ + /* message header */ - + proto_tree_add_text(icep_tree, tvb, offset, 4, "Magic Number: 'I','c','e','P'"); offset += 4; - - proto_tree_add_item(icep_tree, hf_icep_protocol_major, + + proto_tree_add_item(icep_tree, hf_icep_protocol_major, tvb, offset, 1, TRUE); offset++; - - proto_tree_add_item(icep_tree, hf_icep_protocol_minor, + + proto_tree_add_item(icep_tree, hf_icep_protocol_minor, tvb, offset, 1, TRUE); offset++; - - proto_tree_add_item(icep_tree, hf_icep_encoding_major, + + proto_tree_add_item(icep_tree, hf_icep_encoding_major, tvb, offset, 1, TRUE); offset++; - proto_tree_add_item(icep_tree, hf_icep_encoding_minor, + proto_tree_add_item(icep_tree, hf_icep_encoding_minor, tvb, offset, 1, TRUE); offset++; - proto_tree_add_item(icep_tree, hf_icep_message_type, + proto_tree_add_item(icep_tree, hf_icep_message_type, tvb, offset, 1, TRUE); offset++; - proto_tree_add_item(icep_tree, hf_icep_compression_status, + proto_tree_add_item(icep_tree, hf_icep_compression_status, tvb, offset, 1, TRUE); offset++; - proto_tree_add_item(icep_tree, hf_icep_message_size, + proto_tree_add_item(icep_tree, hf_icep_message_size, tvb, offset, 4, TRUE); offset += 4; } else { offset += ICEP_HEADER_SIZE; } - + switch(tvb_get_guint8(tvb, 8)) { case 0x0: DBG1("request message body: parsing %d bytes\n", @@ -1165,28 +1162,28 @@ static void dissect_icep_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree default: if (tree) proto_tree_add_text(tree, tvb, 8, 1, /* display msg type byte */ - "Unknown Message Type: 0x%02x", + "Unknown Message Type: 0x%02x", tvb_get_guint8(tvb, 8)); break; } -} +} /* entry point */ static gboolean dissect_icep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { DBG0("triggered\n"); - - /* get at least a full message header (taken from packet-yhoo.c) */ - - /* check for magic string (taken from packet-giop.c) */ - + + /* get at least a full message header (taken from packet-yhoo.c) */ + + /* check for magic string (taken from packet-giop.c) */ + if ( tvb_memeql(tvb, 0, icep_magic, 4) == -1 ) { /* Not a ICEP packet. */ return FALSE; } - + /* start dissecting */ - + tcp_dissect_pdus(tvb, pinfo, tree, TRUE, ICEP_HEADER_SIZE, get_icep_pdu_len, dissect_icep_pdu); @@ -1197,180 +1194,180 @@ static gboolean dissect_icep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree /* Register the protocol with Wireshark */ void proto_register_icep(void) -{ - - /* Setup list of header fields */ - +{ + + /* Setup list of header fields */ + static hf_register_info hf[] = { - + { &hf_icep_protocol_major, - { - "Protocol Major", "icep.protocol_major", - FT_INT8, BASE_DEC, NULL, 0x0, + { + "Protocol Major", "icep.protocol_major", + FT_INT8, BASE_DEC, NULL, 0x0, "The protocol major version number", HFILL } }, - + { &hf_icep_protocol_minor, - { - "Protocol Minor", "icep.protocol_minor", - FT_INT8, BASE_DEC, NULL, 0x0, + { + "Protocol Minor", "icep.protocol_minor", + FT_INT8, BASE_DEC, NULL, 0x0, "The protocol minor version number", HFILL } }, { &hf_icep_encoding_major, - { - "Encoding Major", "icep.encoding_major", - FT_INT8, BASE_DEC, NULL, 0x0, + { + "Encoding Major", "icep.encoding_major", + FT_INT8, BASE_DEC, NULL, 0x0, "The encoding major version number", HFILL } }, { &hf_icep_encoding_minor, - { - "Encoding Minor", "icep.encoding_minor", - FT_INT8, BASE_DEC, NULL, 0x0, + { + "Encoding Minor", "icep.encoding_minor", + FT_INT8, BASE_DEC, NULL, 0x0, "The encoding minor version number", HFILL } }, - + { &hf_icep_message_type, - { - "Message Type", "icep.message_type", - FT_INT8, BASE_DEC, VALS(icep_msgtype_vals), 0x0, + { + "Message Type", "icep.message_type", + FT_INT8, BASE_DEC, VALS(icep_msgtype_vals), 0x0, "The message type", HFILL } }, { &hf_icep_compression_status, - { - "Compression Status", "icep.compression_status", - FT_INT8, BASE_DEC, VALS(icep_zipstatus_vals), 0x0, + { + "Compression Status", "icep.compression_status", + FT_INT8, BASE_DEC, VALS(icep_zipstatus_vals), 0x0, "The compression status of the message", HFILL } }, - + { &hf_icep_message_size, - { - "Message Size", "icep.message_status", - FT_INT32, BASE_DEC, NULL, 0x0, - "The size of the message in bytes, including the header", + { + "Message Size", "icep.message_status", + FT_INT32, BASE_DEC, NULL, 0x0, + "The size of the message in bytes, including the header", HFILL } }, - + { &hf_icep_request_id, - { - "Request Identifier", "icep.request_id", - FT_INT32, BASE_DEC, NULL, 0x0, - "The request identifier", + { + "Request Identifier", "icep.request_id", + FT_INT32, BASE_DEC, NULL, 0x0, + "The request identifier", HFILL } }, - + { &hf_icep_reply_status, - { - "Reply Status", "icep.protocol_major", - FT_INT8, BASE_DEC, VALS(icep_replystatus_vals), 0x0, + { + "Reply Status", "icep.protocol_major", + FT_INT8, BASE_DEC, VALS(icep_replystatus_vals), 0x0, "The reply status", HFILL } }, { &hf_icep_id_name, - { - "Object Identity Name", "icep.id.name", - FT_STRINGZ, BASE_NONE, NULL, 0x0, + { + "Object Identity Name", "icep.id.name", + FT_STRINGZ, BASE_NONE, NULL, 0x0, "The object identity name", HFILL } }, { &hf_icep_id_category, - { - "Object Identity Content", "icep.id.content", + { + "Object Identity Content", "icep.id.content", FT_STRINGZ, BASE_NONE, NULL, 0x0, "The object identity content", HFILL } }, { &hf_icep_facet, - { - "Facet Name", "icep.facet", - FT_STRINGZ, BASE_NONE, NULL, 0x0, + { + "Facet Name", "icep.facet", + FT_STRINGZ, BASE_NONE, NULL, 0x0, "The facet name", HFILL } }, { &hf_icep_operation, - { - "Operation Name", "icep.operation", - FT_STRINGZ, BASE_NONE, NULL, 0x0, + { + "Operation Name", "icep.operation", + FT_STRINGZ, BASE_NONE, NULL, 0x0, "The operation name", HFILL } }, { &hf_icep_mode, - { - "Ice::OperationMode", "icep.operation_mode", - FT_INT8, BASE_DEC, VALS(icep_mode_vals), 0x0, + { + "Ice::OperationMode", "icep.operation_mode", + FT_INT8, BASE_DEC, VALS(icep_mode_vals), 0x0, "A byte representing Ice::OperationMode", HFILL } }, { &hf_icep_context, - { - "Invocation Context", "icep.context", - FT_STRINGZ, BASE_NONE, NULL, 0x0, + { + "Invocation Context", "icep.context", + FT_STRINGZ, BASE_NONE, NULL, 0x0, "The invocation context", HFILL } }, - + { &hf_icep_params_size, - { - "Input Parameters Size", "icep.params.size", - FT_INT32, BASE_DEC, NULL, 0x0, - "The encapsulated input parameters size", + { + "Input Parameters Size", "icep.params.size", + FT_INT32, BASE_DEC, NULL, 0x0, + "The encapsulated input parameters size", HFILL } }, - + { &hf_icep_params_major, - { - "Input Parameters Encoding Major", - "icep.params.major", - FT_INT8, BASE_DEC, NULL, 0x0, - "The major encoding version of encapsulated parameters", + { + "Input Parameters Encoding Major", + "icep.params.major", + FT_INT8, BASE_DEC, NULL, 0x0, + "The major encoding version of encapsulated parameters", HFILL } }, - + { &hf_icep_params_minor, - { - "Input Parameters Encoding Minor", - "icep.params.minor", - FT_INT8, BASE_DEC, NULL, 0x0, - "The minor encoding version of encapsulated parameters", + { + "Input Parameters Encoding Minor", + "icep.params.minor", + FT_INT8, BASE_DEC, NULL, 0x0, + "The minor encoding version of encapsulated parameters", HFILL } }, - + }; - - /* Setup protocol subtree array */ - + + /* Setup protocol subtree array */ + static gint *ett[] = { &ett_icep, &ett_icep_msg, }; - - /* Register the protocol name and description */ - - proto_icep = + + /* Register the protocol name and description */ + + proto_icep = proto_register_protocol("Internet Communications Engine Protocol", "ICEP", "icep"); - - /* Required function calls to register the header fields and subtrees used */ - + + /* Required function calls to register the header fields and subtrees used */ + proto_register_field_array(proto_icep, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } @@ -1378,8 +1375,8 @@ void proto_register_icep(void) void proto_reg_handoff_icep(void) { - /* Register as a heuristic TCP/UDP dissector */ - + /* Register as a heuristic TCP/UDP dissector */ + heur_dissector_add("tcp", dissect_icep, proto_icep); heur_dissector_add("udp", dissect_icep, proto_icep); } diff --git a/epan/dissectors/packet-icmpv6.c b/epan/dissectors/packet-icmpv6.c index da3492ce69..1e89ca06d8 100644 --- a/epan/dissectors/packet-icmpv6.c +++ b/epan/dissectors/packet-icmpv6.c @@ -54,7 +54,7 @@ /* * The information used comes from: - * RFC 1885/2463/4443: Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification + * RFC 1885/2463/4443: Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification * RFC 2461/4861: Neighbor Discovery for IP Version 6 (IPv6) * RFC 2491: IPv6 over Non-Broadcast Multiple Access (NBMA) networks * RFC 2710: Multicast Listener Discovery for IPv6 @@ -91,7 +91,7 @@ static int hf_icmpv6_echo_identifier = -1; static int hf_icmpv6_echo_sequence_number = -1; static int hf_icmpv6_nonce = -1; -/* RFC 2461/4861 : Neighbor Discovery for IP version 6 (IPv6) */ +/* RFC 2461/4861 : Neighbor Discovery for IP version 6 (IPv6) */ static int hf_icmpv6_nd_ra_cur_hop_limit = -1; static int hf_icmpv6_nd_ra_flag = -1; static int hf_icmpv6_nd_ra_flag_m = -1; @@ -271,7 +271,7 @@ static int hf_icmpv6_rr_rm_matchedlen = -1; static int hf_icmpv6_rr_rm_interfaceindex = -1; static int hf_icmpv6_rr_rm_matchedprefix = -1; -/* RFC 3810: Multicast Listener Discovery Version 2 (MLDv2) for IPv6 */ +/* RFC 3810: Multicast Listener Discovery Version 2 (MLDv2) for IPv6 */ static int hf_icmpv6_mld_mrc = -1; static int hf_icmpv6_mld_flag = -1; static int hf_icmpv6_mld_flag_s = -1; @@ -470,38 +470,38 @@ static gint ett_icmpv6_cga_param_name = -1; static dissector_handle_t ipv6_handle; static dissector_handle_t data_handle; -#define ICMP6_DST_UNREACH 1 -#define ICMP6_PACKET_TOO_BIG 2 -#define ICMP6_TIME_EXCEEDED 3 -#define ICMP6_PARAM_PROB 4 -#define ICMP6_ECHO_REQUEST 128 -#define ICMP6_ECHO_REPLY 129 -#define ICMP6_MEMBERSHIP_QUERY 130 -#define ICMP6_MEMBERSHIP_REPORT 131 -#define ICMP6_MEMBERSHIP_REDUCTION 132 -#define ICMP6_ND_ROUTER_SOLICIT 133 -#define ICMP6_ND_ROUTER_ADVERT 134 -#define ICMP6_ND_NEIGHBOR_SOLICIT 135 -#define ICMP6_ND_NEIGHBOR_ADVERT 136 -#define ICMP6_ND_REDIRECT 137 -#define ICMP6_ROUTER_RENUMBERING 138 -#define ICMP6_NI_QUERY 139 -#define ICMP6_NI_REPLY 140 -#define ICMP6_IND_SOLICIT 141 -#define ICMP6_IND_ADVERT 142 -#define ICMP6_MLDV2_REPORT 143 -#define ICMP6_MIP6_DHAAD_REQUEST 144 -#define ICMP6_MIP6_DHAAD_REPLY 145 -#define ICMP6_MIP6_MPS 146 -#define ICMP6_MIP6_MPA 147 -#define ICMP6_CERT_PATH_SOL 148 -#define ICMP6_CERT_PATH_AD 149 -#define ICMP6_EXPERIMENTAL_MOBILITY 150 -#define ICMP6_MCAST_ROUTER_ADVERT 151 -#define ICMP6_MCAST_ROUTER_SOLICIT 152 -#define ICMP6_MCAST_ROUTER_TERM 153 -#define ICMP6_FMIPV6_MESSAGES 154 -#define ICMP6_RPL_CONTROL 155 +#define ICMP6_DST_UNREACH 1 +#define ICMP6_PACKET_TOO_BIG 2 +#define ICMP6_TIME_EXCEEDED 3 +#define ICMP6_PARAM_PROB 4 +#define ICMP6_ECHO_REQUEST 128 +#define ICMP6_ECHO_REPLY 129 +#define ICMP6_MEMBERSHIP_QUERY 130 +#define ICMP6_MEMBERSHIP_REPORT 131 +#define ICMP6_MEMBERSHIP_REDUCTION 132 +#define ICMP6_ND_ROUTER_SOLICIT 133 +#define ICMP6_ND_ROUTER_ADVERT 134 +#define ICMP6_ND_NEIGHBOR_SOLICIT 135 +#define ICMP6_ND_NEIGHBOR_ADVERT 136 +#define ICMP6_ND_REDIRECT 137 +#define ICMP6_ROUTER_RENUMBERING 138 +#define ICMP6_NI_QUERY 139 +#define ICMP6_NI_REPLY 140 +#define ICMP6_IND_SOLICIT 141 +#define ICMP6_IND_ADVERT 142 +#define ICMP6_MLDV2_REPORT 143 +#define ICMP6_MIP6_DHAAD_REQUEST 144 +#define ICMP6_MIP6_DHAAD_REPLY 145 +#define ICMP6_MIP6_MPS 146 +#define ICMP6_MIP6_MPA 147 +#define ICMP6_CERT_PATH_SOL 148 +#define ICMP6_CERT_PATH_AD 149 +#define ICMP6_EXPERIMENTAL_MOBILITY 150 +#define ICMP6_MCAST_ROUTER_ADVERT 151 +#define ICMP6_MCAST_ROUTER_SOLICIT 152 +#define ICMP6_MCAST_ROUTER_TERM 153 +#define ICMP6_FMIPV6_MESSAGES 154 +#define ICMP6_RPL_CONTROL 155 static const value_string icmpv6_type_val[] = { @@ -546,14 +546,14 @@ static const value_string icmpv6_type_val[] = { { 0, NULL } }; -#define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */ -#define ICMP6_DST_UNREACH_ADMIN 1 /* administratively prohibited */ -#define ICMP6_DST_UNREACH_NOTNEIGHBOR 2 /* not a neighbor(obsolete) */ -#define ICMP6_DST_UNREACH_BEYONDSCOPE 2 /* beyond scope of source address */ -#define ICMP6_DST_UNREACH_ADDR 3 /* address unreachable */ -#define ICMP6_DST_UNREACH_NOPORT 4 /* port unreachable */ -#define ICMP6_DST_UNREACH_INGR_EGR 5 /* source address failed ingress/egress policy */ -#define ICMP6_DST_UNREACH_REJECT 6 /* reject route to destination */ +#define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */ +#define ICMP6_DST_UNREACH_ADMIN 1 /* administratively prohibited */ +#define ICMP6_DST_UNREACH_NOTNEIGHBOR 2 /* not a neighbor(obsolete) */ +#define ICMP6_DST_UNREACH_BEYONDSCOPE 2 /* beyond scope of source address */ +#define ICMP6_DST_UNREACH_ADDR 3 /* address unreachable */ +#define ICMP6_DST_UNREACH_NOPORT 4 /* port unreachable */ +#define ICMP6_DST_UNREACH_INGR_EGR 5 /* source address failed ingress/egress policy */ +#define ICMP6_DST_UNREACH_REJECT 6 /* reject route to destination */ static const value_string icmpv6_unreach_code_val[] = { { ICMP6_DST_UNREACH_NOROUTE, "no route to destination" }, @@ -566,8 +566,8 @@ static const value_string icmpv6_unreach_code_val[] = { { 0, NULL } }; -#define ICMP6_TIME_EXCEED_TRANSIT 0 /* ttl==0 in transit */ -#define ICMP6_TIME_EXCEED_REASSEMBLY 1 /* ttl==0 in reass */ +#define ICMP6_TIME_EXCEED_TRANSIT 0 /* ttl==0 in transit */ +#define ICMP6_TIME_EXCEED_REASSEMBLY 1 /* ttl==0 in reass */ static const value_string icmpv6_timeex_code_val[] = { { ICMP6_TIME_EXCEED_TRANSIT, "hop limit exceeded in transit" }, @@ -575,9 +575,9 @@ static const value_string icmpv6_timeex_code_val[] = { { 0, NULL } }; -#define ICMP6_PARAMPROB_HEADER 0 /* erroneous header field */ -#define ICMP6_PARAMPROB_NEXTHEADER 1 /* unrecognized next header */ -#define ICMP6_PARAMPROB_OPTION 2 /* unrecognized option */ +#define ICMP6_PARAMPROB_HEADER 0 /* erroneous header field */ +#define ICMP6_PARAMPROB_NEXTHEADER 1 /* unrecognized next header */ +#define ICMP6_PARAMPROB_OPTION 2 /* unrecognized option */ static const value_string icmpv6_paramprob_code_val[] = { { ICMP6_PARAMPROB_HEADER, "erroneous header field encountered" }, @@ -589,9 +589,9 @@ static const value_string icmpv6_paramprob_code_val[] = { /* RFC2894 - Router Renumbering for IPv6 */ -#define ICMP6_ROUTER_RENUMBERING_COMMAND 0 /* rr command */ -#define ICMP6_ROUTER_RENUMBERING_RESULT 1 /* rr result */ -#define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET 255 /* rr seq num reset */ +#define ICMP6_ROUTER_RENUMBERING_COMMAND 0 /* rr command */ +#define ICMP6_ROUTER_RENUMBERING_RESULT 1 /* rr result */ +#define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET 255 /* rr seq num reset */ static const value_string icmpv6_rr_code_val[] = { { ICMP6_ROUTER_RENUMBERING_COMMAND, "Command" }, @@ -600,11 +600,11 @@ static const value_string icmpv6_rr_code_val[] = { { 0, NULL } }; -#define RR_FLAG_T 0x80 -#define RR_FLAG_R 0x40 -#define RR_FLAG_A 0x20 -#define RR_FLAG_S 0x10 -#define RR_FLAG_P 0x08 +#define RR_FLAG_T 0x80 +#define RR_FLAG_R 0x40 +#define RR_FLAG_A 0x20 +#define RR_FLAG_S 0x10 +#define RR_FLAG_P 0x08 #define RR_FLAG_RSV 0x07 static const value_string rr_pco_mp_opcode_val[] = { @@ -635,10 +635,10 @@ static const value_string mldr_record_type_val[] = { /* RFC 4068/5268/5568: Fast Handovers for Mobile IPv6 ( Mobile IPv6 Fast Handovers ) */ -#define FMIP6_SUBTYPE_RTSOLPR 2 -#define FMIP6_SUBTYPE_PRRTADV 3 -#define FMIP6_SUBTYPE_HI 4 -#define FMIP6_SUBTYPE_HACK 5 +#define FMIP6_SUBTYPE_RTSOLPR 2 +#define FMIP6_SUBTYPE_PRRTADV 3 +#define FMIP6_SUBTYPE_HI 4 +#define FMIP6_SUBTYPE_HACK 5 static const value_string fmip6_subtype_val[] = { { FMIP6_SUBTYPE_RTSOLPR, "Router Solicitation for Proxy Advertisement" }, @@ -681,19 +681,19 @@ static const value_string fmip6_hack_code_val[] = { /* RFC 4620 - IPv6 Node Information Queries */ -#define ICMP6_NI_SUBJ_IPV6 0 /* Query Subject is an IPv6 address */ -#define ICMP6_NI_SUBJ_FQDN 1 /* Query Subject is a Domain name */ -#define ICMP6_NI_SUBJ_IPV4 2 /* Query Subject is an IPv4 address */ +#define ICMP6_NI_SUBJ_IPV6 0 /* Query Subject is an IPv6 address */ +#define ICMP6_NI_SUBJ_FQDN 1 /* Query Subject is a Domain name */ +#define ICMP6_NI_SUBJ_IPV4 2 /* Query Subject is an IPv4 address */ -#define ICMP6_NI_SUCCESS 0 /* node information successful reply */ -#define ICMP6_NI_REFUSED 1 /* node information request is refused */ -#define ICMP6_NI_UNKNOWN 2 /* unknown Qtype */ +#define ICMP6_NI_SUCCESS 0 /* node information successful reply */ +#define ICMP6_NI_REFUSED 1 /* node information request is refused */ +#define ICMP6_NI_UNKNOWN 2 /* unknown Qtype */ -#define NI_QTYPE_NOOP 0 /* NOOP */ -#define NI_QTYPE_SUPTYPES 1 /* Supported Qtypes (Obso) */ -#define NI_QTYPE_NODENAME 2 /* Node Name */ -#define NI_QTYPE_NODEADDR 3 /* Node Addresses */ -#define NI_QTYPE_IPV4ADDR 4 /* IPv4 Addresses */ +#define NI_QTYPE_NOOP 0 /* NOOP */ +#define NI_QTYPE_SUPTYPES 1 /* Supported Qtypes (Obso) */ +#define NI_QTYPE_NODENAME 2 /* Node Name */ +#define NI_QTYPE_NODEADDR 3 /* Node Addresses */ +#define NI_QTYPE_IPV4ADDR 4 /* IPv4 Addresses */ static const value_string ni_query_code_val[] = { { ICMP6_NI_SUBJ_IPV6, "Query subject = IPv6 addresses" }, @@ -717,12 +717,12 @@ static const value_string ni_qtype_val[] = { { 0, NULL } }; -#define NI_FLAG_G 0x0020 -#define NI_FLAG_S 0x0010 -#define NI_FLAG_L 0x0008 -#define NI_FLAG_C 0x0004 -#define NI_FLAG_A 0x0002 -#define NI_FLAG_T 0x0001 +#define NI_FLAG_G 0x0020 +#define NI_FLAG_S 0x0010 +#define NI_FLAG_L 0x0008 +#define NI_FLAG_C 0x0004 +#define NI_FLAG_A 0x0002 +#define NI_FLAG_T 0x0001 #define NI_FLAG_RSV 0xFFC0 static const true_false_string tfs_ni_flag_a = { @@ -730,29 +730,29 @@ static const true_false_string tfs_ni_flag_a = { "Unicast addresses on the queried interface" }; -#define ND_OPT_SOURCE_LINKADDR 1 -#define ND_OPT_TARGET_LINKADDR 2 -#define ND_OPT_PREFIX_INFORMATION 3 -#define ND_OPT_REDIRECTED_HEADER 4 -#define ND_OPT_MTU 5 -#define ND_OPT_NBMA 6 -#define ND_OPT_ADVINTERVAL 7 -#define ND_OPT_HOMEAGENT_INFO 8 -#define ND_OPT_SOURCE_ADDRLIST 9 -#define ND_OPT_TARGET_ADDRLIST 10 -#define ND_OPT_CGA 11 -#define ND_OPT_RSA 12 -#define ND_OPT_TIMESTAMP 13 -#define ND_OPT_NONCE 14 -#define ND_OPT_TRUST_ANCHOR 15 -#define ND_OPT_CERTIFICATE 16 +#define ND_OPT_SOURCE_LINKADDR 1 +#define ND_OPT_TARGET_LINKADDR 2 +#define ND_OPT_PREFIX_INFORMATION 3 +#define ND_OPT_REDIRECTED_HEADER 4 +#define ND_OPT_MTU 5 +#define ND_OPT_NBMA 6 +#define ND_OPT_ADVINTERVAL 7 +#define ND_OPT_HOMEAGENT_INFO 8 +#define ND_OPT_SOURCE_ADDRLIST 9 +#define ND_OPT_TARGET_ADDRLIST 10 +#define ND_OPT_CGA 11 +#define ND_OPT_RSA 12 +#define ND_OPT_TIMESTAMP 13 +#define ND_OPT_NONCE 14 +#define ND_OPT_TRUST_ANCHOR 15 +#define ND_OPT_CERTIFICATE 16 #define ND_OPT_IP_ADDRESS_PREFIX 17 #define ND_OPT_NEW_ROUTER_PREFIX_INFO 18 #define ND_OPT_LINK_LAYER_ADDRESS 19 #define ND_OPT_NEIGHBOR_ADV_ACK 20 -#define ND_OPT_MAP 23 -#define ND_OPT_ROUTE_INFO 24 -#define ND_OPT_RECURSIVE_DNS_SERVER 25 +#define ND_OPT_MAP 23 +#define ND_OPT_ROUTE_INFO 24 +#define ND_OPT_RECURSIVE_DNS_SERVER 25 #define ND_OPT_FLAGS_EXTENSION 26 #define ND_OPT_HANDOVER_KEY_REQUEST 27 #define ND_OPT_HANDOVER_KEY_REPLY 28 @@ -760,9 +760,9 @@ static const true_false_string tfs_ni_flag_a = { #define ND_OPT_MOBILE_NODE_ID 30 #define ND_OPT_DNS_SEARCH_LIST 31 /* draft-6lowpan-nd types, pending IANA assignment */ -#define ND_OPT_ADDR_RESOLUTION 131 /* Conflit with RFC6106.. */ -#define ND_OPT_6LOWPAN_CONTEXT 32 -#define ND_OPT_AUTH_BORDER_ROUTER 33 +#define ND_OPT_ADDR_RESOLUTION 131 /* Conflit with RFC6106.. */ +#define ND_OPT_6LOWPAN_CONTEXT 32 +#define ND_OPT_AUTH_BORDER_ROUTER 33 static const value_string option_vals[] = { /* 1 */ { ND_OPT_SOURCE_LINKADDR, "Source link-layer address" }, @@ -807,17 +807,17 @@ static const value_string option_vals[] = { { 0, NULL } }; -#define ND_RA_FLAG_M 0x80 -#define ND_RA_FLAG_O 0x40 -#define ND_RA_FLAG_H 0x20 +#define ND_RA_FLAG_M 0x80 +#define ND_RA_FLAG_O 0x40 +#define ND_RA_FLAG_H 0x20 #define ND_RA_FLAG_PRF 0x18 #define ND_RA_FLAG_P 0x04 #define ND_RA_FLAG_RSV 0x02 #define ND_NA_FLAG_R 0x80000000 -#define ND_NA_FLAG_S 0x40000000 -#define ND_NA_FLAG_O 0x20000000 -#define ND_NA_FLAG_RSV 0x1FFFFFFF +#define ND_NA_FLAG_S 0x40000000 +#define ND_NA_FLAG_O 0x20000000 +#define ND_NA_FLAG_RSV 0x1FFFFFFF static const value_string nd_flag_router_pref[] = { { 1, "High" }, @@ -899,8 +899,8 @@ static const value_string icmpv6_option_cert_type_vals[] = { /* RFC 4191: Default Router Preferences and More-Specific Routes */ -#define ND_RA_FLAG_RTPREF_MASK 0x18 /* 00011000 */ -#define ND_RA_FLAG_RESERV_MASK 0xE7 /* 11100111 */ +#define ND_RA_FLAG_RTPREF_MASK 0x18 /* 00011000 */ +#define ND_RA_FLAG_RESERV_MASK 0xE7 /* 11100111 */ /* RFC 5075/5175 : IPv6 Router Advertisement Flags Option */ #define FLAGS_EO_M 0x8000 @@ -951,7 +951,7 @@ static const value_string icmpv6_option_cert_type_vals[] = { #define RPL_SECURE_FLAG_T 0x80 #define RPL_SECURE_FLAG_RSV 0x7F -#define RPL_SECURE_LVL 0x07 +#define RPL_SECURE_LVL 0x07 #define RPL_SECURE_KIM 0xC0 #define RPL_SECURE_RSV 0x38 @@ -1015,15 +1015,15 @@ static const value_string rpl_secure_algorithm_signature_val[] = { #define RPL_OPT_TARGETDESC 9 /* RPL Target Descriptor */ static const value_string rpl_option_vals[] = { - { RPL_OPT_PAD1, "1-byte padding" }, - { RPL_OPT_PADN, "n-byte padding" }, - { RPL_OPT_METRIC, "Metric container" }, - { RPL_OPT_ROUTING, "Routing"}, - { RPL_OPT_CONFIG, "DODAG configuration" }, - { RPL_OPT_TARGET, "RPL Target" }, - { RPL_OPT_TRANSIT, "Transit Information" }, - { RPL_OPT_SOLICITED,"Solicited Information"}, - { RPL_OPT_PREFIX, "Prefix Information"}, + { RPL_OPT_PAD1, "1-byte padding" }, + { RPL_OPT_PADN, "n-byte padding" }, + { RPL_OPT_METRIC, "Metric container" }, + { RPL_OPT_ROUTING, "Routing"}, + { RPL_OPT_CONFIG, "DODAG configuration" }, + { RPL_OPT_TARGET, "RPL Target" }, + { RPL_OPT_TRANSIT, "Transit Information" }, + { RPL_OPT_SOLICITED, "Solicited Information"}, + { RPL_OPT_PREFIX, "Prefix Information"}, { RPL_OPT_TARGETDESC, "RPL Target Descriptor"}, { 0, NULL } }; @@ -1066,823 +1066,826 @@ dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree int opt_offset; while ((int)tvb_reported_length(tvb) > offset) { - /* there are more options */ + /* there are more options */ - /* ICMPv6 Option */ - opt_len = tvb_get_guint8(tvb, offset + 1) * 8; - ti = proto_tree_add_item(tree, hf_icmpv6_opt, tvb, offset, opt_len, FALSE); - icmp6opt_tree = proto_item_add_subtree(ti, ett_icmpv6_opt); + /* ICMPv6 Option */ + opt_len = tvb_get_guint8(tvb, offset + 1) * 8; + ti = proto_tree_add_item(tree, hf_icmpv6_opt, tvb, offset, opt_len, FALSE); + icmp6opt_tree = proto_item_add_subtree(ti, ett_icmpv6_opt); opt_offset = offset; - /* Option type */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_type, tvb, opt_offset, 1, FALSE); + /* Option type */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_type, tvb, opt_offset, 1, FALSE); opt_type = tvb_get_guint8(tvb, opt_offset); opt_offset += 1; - /* Add option name to option root label */ - proto_item_append_text(ti, " (%s", val_to_str(opt_type, option_vals, "Unknown %d")); + /* Add option name to option root label */ + proto_item_append_text(ti, " (%s", val_to_str(opt_type, option_vals, "Unknown %d")); - /* Option length */ - ti_opt_len = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_length, tvb,opt_offset, 1, FALSE); + /* Option length */ + ti_opt_len = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_length, tvb,opt_offset, 1, FALSE); opt_offset += 1; /* Add length value in bytes */ - proto_item_append_text(ti_opt_len, " (%i bytes)", opt_len); + proto_item_append_text(ti_opt_len, " (%i bytes)", opt_len); if(opt_len == 0){ expert_add_info_format(pinfo, ti_opt_len, PI_MALFORMED, PI_ERROR, "Invalid option length (Zero)"); return; } - /* decode... */ - switch (opt_type) { - case ND_OPT_SOURCE_LINKADDR: /* Source Link-layer Address (1) */ - { - const guint8 *link_addr; - /* if the opt len is 8, the Link Addr is MAC Address */ - if(opt_len == 8){ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr_mac, tvb, opt_offset, 6, FALSE); - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_src_linkaddr_mac, tvb, opt_offset, 6, FALSE); - PROTO_ITEM_SET_HIDDEN(ti_opt); - - link_addr = tvb_get_ptr(tvb, opt_offset, 6); - col_append_fstr(pinfo->cinfo, COL_INFO, " from %s", ether_to_str(link_addr)); - proto_item_append_text(ti, " : %s", ether_to_str(link_addr)); - - }else{ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr, tvb, opt_offset, opt_len-2, FALSE); - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_src_linkaddr, tvb, opt_offset, opt_len-2, FALSE); - PROTO_ITEM_SET_HIDDEN(ti_opt); + /* decode... */ + switch (opt_type) { + case ND_OPT_SOURCE_LINKADDR: /* Source Link-layer Address (1) */ + { + const guint8 *link_addr; + /* if the opt len is 8, the Link Addr is MAC Address */ + if(opt_len == 8){ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr_mac, tvb, opt_offset, 6, FALSE); + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_src_linkaddr_mac, tvb, opt_offset, 6, FALSE); + PROTO_ITEM_SET_HIDDEN(ti_opt); + + link_addr = tvb_get_ptr(tvb, opt_offset, 6); + col_append_fstr(pinfo->cinfo, COL_INFO, " from %s", ether_to_str(link_addr)); + proto_item_append_text(ti, " : %s", ether_to_str(link_addr)); + + }else{ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr, tvb, opt_offset, opt_len-2, FALSE); + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_src_linkaddr, tvb, opt_offset, opt_len-2, FALSE); + PROTO_ITEM_SET_HIDDEN(ti_opt); + } + break; } - break; - } - case ND_OPT_TARGET_LINKADDR: /* Target Link-layer Address (2) */ - { - const guint8 *link_addr; - /* if the opt len is 8, the Link Addr is MAC Address */ - if(opt_len == 8){ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr_mac, tvb, opt_offset, 6, FALSE); - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_target_linkaddr_mac, tvb, opt_offset, 6, FALSE); - PROTO_ITEM_SET_HIDDEN(ti_opt); - - link_addr = tvb_get_ptr(tvb, opt_offset, 6); - col_append_fstr(pinfo->cinfo, COL_INFO, " is at %s", ether_to_str(link_addr)); - proto_item_append_text(ti, " : %s", ether_to_str(link_addr)); - - }else{ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr, tvb, opt_offset, opt_len-2, FALSE); - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_target_linkaddr, tvb, opt_offset, opt_len-2, FALSE); - PROTO_ITEM_SET_HIDDEN(ti_opt); + case ND_OPT_TARGET_LINKADDR: /* Target Link-layer Address (2) */ + { + const guint8 *link_addr; + /* if the opt len is 8, the Link Addr is MAC Address */ + if(opt_len == 8){ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr_mac, tvb, opt_offset, 6, FALSE); + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_target_linkaddr_mac, tvb, opt_offset, 6, FALSE); + PROTO_ITEM_SET_HIDDEN(ti_opt); + + link_addr = tvb_get_ptr(tvb, opt_offset, 6); + col_append_fstr(pinfo->cinfo, COL_INFO, " is at %s", ether_to_str(link_addr)); + proto_item_append_text(ti, " : %s", ether_to_str(link_addr)); + + }else{ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr, tvb, opt_offset, opt_len-2, FALSE); + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_target_linkaddr, tvb, opt_offset, opt_len-2, FALSE); + PROTO_ITEM_SET_HIDDEN(ti_opt); + } + + break; } + case ND_OPT_PREFIX_INFORMATION: /* Prefix Information (3) */ + { + guint8 prefix_len; + /* RFC 4861 */ + + /* Prefix Length */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix_len, tvb, opt_offset, 1, FALSE); + prefix_len = tvb_get_guint8(tvb, opt_offset); + opt_offset += 1; + + /* Flags */ + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix_flag, tvb, opt_offset, 1, FALSE); + flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_flag_prefix); + + proto_tree_add_item(flag_tree, hf_icmpv6_opt_prefix_flag_l, tvb, opt_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_opt_prefix_flag_a, tvb, opt_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_opt_prefix_flag_reserved, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* Prefix Valid Lifetime */ + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix_valid_lifetime, tvb, opt_offset, 4, FALSE); + + switch(tvb_get_ntohl(tvb, opt_offset)){ + case 0xffffffff: + proto_item_append_text(ti_opt, " (Infinity)"); + break; + default: + break; + } + opt_offset += 4; - break; - } - case ND_OPT_PREFIX_INFORMATION: /* Prefix Information (3) */ - { - guint8 prefix_len; - /* RFC 4861 */ + /* Prefix Preferred Lifetime */ + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix_preferred_lifetime, tvb, opt_offset, 4, FALSE); - /* Prefix Length */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix_len, tvb, opt_offset, 1, FALSE); - prefix_len = tvb_get_guint8(tvb, opt_offset); - opt_offset += 1; + switch(tvb_get_ntohl(tvb, opt_offset)){ + case 0xffffffff: + proto_item_append_text(ti_opt, " (Infinity)"); + break; + default: + break; + } + opt_offset += 4; + + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, FALSE); + opt_offset += 4; + + /* Prefix */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix, tvb, opt_offset, 16, FALSE); + proto_item_append_text(ti, " : %s/%d", tvb_ip6_to_str(tvb, opt_offset), prefix_len); + opt_offset += 16; - /* Flags */ - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix_flag, tvb, opt_offset, 1, FALSE); - flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_flag_prefix); - - proto_tree_add_item(flag_tree, hf_icmpv6_opt_prefix_flag_l, tvb, opt_offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_opt_prefix_flag_a, tvb, opt_offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_opt_prefix_flag_reserved, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* Prefix Valid Lifetime */ - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix_valid_lifetime, tvb, opt_offset, 4, FALSE); - - switch(tvb_get_ntohl(tvb, opt_offset)){ - case 0xffffffff: - proto_item_append_text(ti_opt, " (Infinity)"); - break; - default: break; } - opt_offset += 4; + case ND_OPT_REDIRECTED_HEADER: /* Redirected Header (4) */ - /* Prefix Preferred Lifetime */ - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix_preferred_lifetime, tvb, opt_offset, 4, FALSE); - - switch(tvb_get_ntohl(tvb, opt_offset)){ - case 0xffffffff: - proto_item_append_text(ti_opt, " (Infinity)"); + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 6, FALSE); + opt_offset += 6; + + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_redirected_packet, tvb, opt_offset, -1, FALSE); + + dissect_contained_icmpv6(tvb, opt_offset, pinfo, icmp6opt_tree); break; - default: + case ND_OPT_MTU: /* MTU (5) */ + + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, FALSE); + opt_offset += 2; + + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_mtu, tvb, opt_offset, 4, FALSE); + proto_item_append_text(ti, " : %d", tvb_get_ntohl(tvb, opt_offset)); break; - } - opt_offset += 4; + case ND_OPT_NBMA: /* NBMA Shortcut Limit Option (6) */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, FALSE); - opt_offset += 4; - - /* Prefix */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix, tvb, opt_offset, 16, FALSE); - proto_item_append_text(ti, " : %s/%d", tvb_ip6_to_str(tvb, opt_offset), prefix_len); - opt_offset += 16; + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_nbma_shortcut_limit, tvb, opt_offset, 1, FALSE); + proto_item_append_text(ti, " : %d", tvb_get_guint8(tvb, opt_offset)); - break; - } - case ND_OPT_REDIRECTED_HEADER: /* Redirected Header (4) */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 1, FALSE); + opt_offset += 1; - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 6, FALSE); - opt_offset += 6; + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, FALSE); + opt_offset += 4; - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_redirected_packet, tvb, opt_offset, -1, FALSE); + break; + case ND_OPT_ADVINTERVAL: /* Advertisement Interval Option (7) */ - dissect_contained_icmpv6(tvb, opt_offset, pinfo, icmp6opt_tree); - break; - case ND_OPT_MTU: /* MTU (5) */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, FALSE); + opt_offset += 2; - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, FALSE); - opt_offset += 2; + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_advertisement_interval, tvb, opt_offset, 4, FALSE); + proto_item_append_text(ti, " : %d", tvb_get_ntohl(tvb, opt_offset)); - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_mtu, tvb, opt_offset, 4, FALSE); - proto_item_append_text(ti, " : %d", tvb_get_ntohl(tvb, opt_offset)); - break; - case ND_OPT_NBMA: /* NBMA Shortcut Limit Option (6) */ + break; + case ND_OPT_HOMEAGENT_INFO: /* Home Agent Information Option (8) */ + { - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_nbma_shortcut_limit, tvb, opt_offset, 1, FALSE); - proto_item_append_text(ti, " : %d", tvb_get_guint8(tvb, opt_offset)); + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, FALSE); + opt_offset += 2; - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 1, FALSE); - opt_offset += 1; + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_home_agent_preference, tvb, opt_offset, 2, FALSE); + opt_offset += 2; - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, FALSE); - opt_offset += 4; + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_home_agent_lifetime, tvb, opt_offset, 2, FALSE); + opt_offset += 2; + break; + } + case ND_OPT_SOURCE_ADDRLIST: /* Source Address List (9) */ + case ND_OPT_TARGET_ADDRLIST: /* Target Address List (10)*/ + { + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 6, FALSE); + opt_offset += 6; - break; - case ND_OPT_ADVINTERVAL: /* Advertisement Interval Option (7) */ + while(opt_offset < (offset + opt_len) ) { + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_ipv6_address, tvb, opt_offset, 16, FALSE); + proto_item_append_text(ti, " %s", tvb_ip6_to_str(tvb, opt_offset)); + opt_offset += 16; + } + break; + } + case ND_OPT_CGA: /* CGA option (11) */ + { + proto_tree *cga_tree; + proto_item *cga_item; + guint16 ext_data_len; + guint8 padd_length; + int par_len; + asn1_ctx_t asn1_ctx; + /* RFC 3971 5.1. CGA Option */ + + /* Pad Length */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_cga_pad_len, tvb, opt_offset, 1, FALSE); + padd_length = tvb_get_guint8(tvb, opt_offset); + opt_offset += 1; + + /* Reserved 8 bits */ + + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* CGA Parameters A variable-length field containing the CGA Parameters data + * structure described in Section 4 of + * "Cryptographically Generated Addresses (CGA)", RFC3972. + */ + par_len = opt_len -4 -padd_length; + cga_item = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_cga, tvb, opt_offset, par_len, FALSE); + par_len += opt_offset; - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, FALSE); - opt_offset += 2; + cga_tree = proto_item_add_subtree(cga_item, ett_icmpv6_cga_param_name); + proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_modifier, tvb, opt_offset, 16, FALSE); + opt_offset += 16; - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_advertisement_interval, tvb, opt_offset, 4, FALSE); - proto_item_append_text(ti, " : %d", tvb_get_ntohl(tvb, opt_offset)); + proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_subnet_prefix, tvb, opt_offset, 8, FALSE); + opt_offset += 8; - break; - case ND_OPT_HOMEAGENT_INFO: /* Home Agent Information Option (8) */ - { + proto_tree_add_item(cga_tree ,hf_icmpv6_opt_cga_count, tvb, opt_offset, 1, FALSE); + opt_offset++; - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, FALSE); - opt_offset += 2; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); + opt_offset = dissect_x509af_SubjectPublicKeyInfo(FALSE, tvb, opt_offset, &asn1_ctx, cga_tree, -1); - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_home_agent_preference, tvb, opt_offset, 2, FALSE); - opt_offset += 2; + /* Process RFC 4581*/ + while (opt_offset < par_len) { + proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_ext_type, tvb, opt_offset, 2, FALSE); + opt_offset += 2; - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_home_agent_lifetime, tvb, opt_offset, 2, FALSE); - opt_offset += 2; - break; - } - case ND_OPT_SOURCE_ADDRLIST: /* Source Address List (9) */ - case ND_OPT_TARGET_ADDRLIST: /* Target Address List (10)*/ - { - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 6, FALSE); - opt_offset += 6; - - while(opt_offset < (offset + opt_len) ) { - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_ipv6_address, tvb, opt_offset, 16, FALSE); - proto_item_append_text(ti, " %s", tvb_ip6_to_str(tvb, opt_offset)); - opt_offset += 16; - } - break; - } - case ND_OPT_CGA: /* CGA option (11) */ - { - proto_tree *cga_tree; - proto_item *cga_item; - guint16 ext_data_len; - guint8 padd_length; - int par_len; - asn1_ctx_t asn1_ctx; - /* RFC 3971 5.1. CGA Option */ - - /* Pad Length */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_cga_pad_len, tvb, opt_offset, 1, FALSE); - padd_length = tvb_get_guint8(tvb, opt_offset); - opt_offset += 1; - - /* Reserved 8 bits */ - - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* CGA Parameters A variable-length field containing the CGA Parameters data - * structure described in Section 4 of - * "Cryptographically Generated Addresses (CGA)", RFC3972. - */ - par_len = opt_len -4 -padd_length; - cga_item = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_cga, tvb, opt_offset, par_len, FALSE); - par_len += opt_offset; - - cga_tree = proto_item_add_subtree(cga_item, ett_icmpv6_cga_param_name); - proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_modifier, tvb, opt_offset, 16, FALSE); - opt_offset += 16; - - proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_subnet_prefix, tvb, opt_offset, 8, FALSE); - opt_offset += 8; - - proto_tree_add_item(cga_tree ,hf_icmpv6_opt_cga_count, tvb, opt_offset, 1, FALSE); - opt_offset++; - - asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); - opt_offset = dissect_x509af_SubjectPublicKeyInfo(FALSE, tvb, opt_offset, &asn1_ctx, cga_tree, -1); - - /* Process RFC 4581*/ - while (opt_offset < par_len) { - proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_ext_type, tvb, opt_offset, 2, FALSE); - opt_offset += 2; - - ext_data_len = tvb_get_ntohs(tvb, opt_offset); - proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_ext_length, tvb, opt_offset, 2, FALSE); - opt_offset += 2; - - proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_ext_data, tvb, opt_offset, ext_data_len, FALSE); - opt_offset += ext_data_len; - } - - /* Padding */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, FALSE); - break; - } - case ND_OPT_RSA: /* RSA Signature option (12) */ - { - int par_len; - /*5.2. RSA Signature Option */ - /* Reserved, A 16-bit field reserved for future use. */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, FALSE); - opt_offset = opt_offset + 2; - - /* Key Hash - * A 128-bit field containing the most significant (leftmost) 128 - * bits of a SHA-1 [14] hash of the public key used for constructing - * the signature. - */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_rsa_key_hash, tvb, opt_offset, 16, FALSE); - opt_offset = opt_offset + 16; - - /* Digital Signature */ - par_len = opt_len - 20; - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_digital_signature_padding , tvb, opt_offset, par_len, FALSE); - - /* Padding */ - /* TODO: Calculate padding length and exlude from the signature */ - break; - } - case ND_OPT_TIMESTAMP: /* Timestamp option (13) */ - /* Reserved A 48-bit field reserved for future use. */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 6, FALSE); - opt_offset += 6; - - /* Timestamp - * A 64-bit unsigned integer field containing a timestamp. The value - * indicates the number of seconds since January 1, 1970, 00:00 UTC, - * by using a fixed point format. In this format, the integer number - * of seconds is contained in the first 48 bits of the field, and the - * remaining 16 bits indicate the number of 1/64K fractions of a - * second. - */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_timestamp, tvb, opt_offset + 2, 4, FALSE); - break; - case ND_OPT_NONCE: /* Nonce option (14) */ - /* 5.3.2. Nonce Option */ - - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_nonce, tvb, opt_offset, opt_len - 2, FALSE); - /* Nonce */ - break; - case ND_OPT_TRUST_ANCHOR: /* Trust Anchor option (15) */ - { - proto_tree *name_tree; - proto_item *name_item; - guint8 name_type; - guint8 padd_length; - int par_len; - asn1_ctx_t asn1_ctx; - - /* Name Type */ - name_type = tvb_get_guint8(tvb, opt_offset); - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_name_type, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* Pad Length */ - padd_length = tvb_get_guint8(tvb, opt_offset); - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_cga_pad_len, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - par_len = opt_len - 4 - padd_length; - - switch (name_type){ - case 1: - /* DER Encoded X.501 Name */ - name_item = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_name_x501, tvb, opt_offset, par_len, FALSE); - name_tree = proto_item_add_subtree(name_item, ett_icmpv6_opt_name); - asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); - dissect_x509if_Name(FALSE, tvb, opt_offset, &asn1_ctx, name_tree, hf_icmpv6_x509if_Name); - break; - case 2: - /* FQDN */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_name_fqdn, tvb, opt_offset, par_len, FALSE); - break; - default: - break; - } - opt_offset = opt_offset + par_len; - - /* Padding */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, FALSE); - - break; - } - case ND_OPT_CERTIFICATE: /* Certificate option (16) */ - { - guint8 cert_type; - guint8 padd_length; - asn1_ctx_t asn1_ctx; - - /* Cert Type */ - cert_type = tvb_get_guint8(tvb, opt_offset); - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_cert_type, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* Reserved */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* Certificate */ - - if(cert_type == 1){ - asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); - opt_offset = dissect_x509af_Certificate(FALSE, tvb, opt_offset, &asn1_ctx, icmp6opt_tree, hf_icmpv6_x509af_Certificate); - padd_length = opt_len - (opt_offset - offset); - /* Padding */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, FALSE); - }else{ - padd_length = opt_len - 4; - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_certificate_padding, tvb, opt_offset, padd_length, FALSE); - } - break; - } - case ND_OPT_IP_ADDRESS_PREFIX: /* IP Address/Prefix Option (17) */ - { - guint8 prefix_len; - - /* Option-code */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_ipa_option_code, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* Prefix Len */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_ipa_prefix_len, tvb, opt_offset, 1, FALSE); - prefix_len = tvb_get_guint8(tvb, opt_offset); - opt_offset += 1; - - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, FALSE); - opt_offset += 4; - - /* IPv6 Address */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_ipa_ipv6_address, tvb, opt_offset, 16, FALSE); - opt_offset += 16; - - proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(tvb, opt_offset), prefix_len); - - break; - } - case ND_OPT_NEW_ROUTER_PREFIX_INFO: /* New Router Prefix Information Option (18) OBSO... */ - { - - guint8 prefix_len; - - /* Option-code */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_nrpi_option_code, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* Prefix Len */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_nrpi_prefix_len, tvb, opt_offset, 1, FALSE); - prefix_len = tvb_get_guint8(tvb, opt_offset); - opt_offset += 1; - - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, FALSE); - opt_offset += 4; - - /* Prefix */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_nrpi_prefix, tvb, opt_offset, 16, FALSE); - opt_offset += 16; - - proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(tvb, opt_offset), prefix_len); - break; - } - case ND_OPT_LINK_LAYER_ADDRESS: /* Link-layer Address Option (19) */ - { - /* Option-Code */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_lla_option_code, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* Link Layer Address */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_lla_bytes, tvb, opt_offset, opt_len-3, FALSE); - break; - } - - case ND_OPT_NEIGHBOR_ADV_ACK: /* Neighbor Advertisement Acknowledgment Option (20) */ - { - guint8 status; - - /* Option-Code */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_naack_option_code, tvb, opt_offset, 1, FALSE); - opt_offset += 1; + ext_data_len = tvb_get_ntohs(tvb, opt_offset); + proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_ext_length, tvb, opt_offset, 2, FALSE); + opt_offset += 2; - /* Status */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_naack_status, tvb, opt_offset, 1, FALSE); - status = tvb_get_guint8(tvb, opt_offset); - opt_offset += 1; - - if(status == 2){ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_naack_supplied_ncoa, tvb, opt_offset, 16, FALSE); - }else{ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, opt_len - 4, FALSE); + proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_ext_data, tvb, opt_offset, ext_data_len, FALSE); + opt_offset += ext_data_len; + } + + /* Padding */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, FALSE); + break; } - break; - } - case ND_OPT_MAP: /* MAP Option (23) */ - { - - /* Dist */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_map_dist, tvb, opt_offset, 1, FALSE); - - /* Pref */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_map_pref, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* Flags */ - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_map_flag, tvb, opt_offset, 1, FALSE); - flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_flag_map); + case ND_OPT_RSA: /* RSA Signature option (12) */ + { + int par_len; + /*5.2. RSA Signature Option */ + /* Reserved, A 16-bit field reserved for future use. */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, FALSE); + opt_offset = opt_offset + 2; + + /* Key Hash + * A 128-bit field containing the most significant (leftmost) 128 + * bits of a SHA-1 [14] hash of the public key used for constructing + * the signature. + */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_rsa_key_hash, tvb, opt_offset, 16, FALSE); + opt_offset = opt_offset + 16; - proto_tree_add_item(flag_tree, hf_icmpv6_opt_map_flag_r, tvb, opt_offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_opt_map_flag_reserved, tvb, opt_offset, 1, FALSE); - opt_offset += 1; + /* Digital Signature */ + par_len = opt_len - 20; + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_digital_signature_padding , tvb, opt_offset, par_len, FALSE); - /* Valid Lifetime */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_map_valid_lifetime, tvb, opt_offset, 4, FALSE); - opt_offset += 4; - - /* Global Address */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_map_global_address, tvb, opt_offset, 16, FALSE); - opt_offset += 16; - break; - } - case ND_OPT_ROUTE_INFO: /* Route Information Option (24) */ - { - /* RFC 4191 */ - guint8 prefix_len; - guint8 route_preference; - struct e_in6_addr prefix; - - /* Prefix Len */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix_len, tvb, opt_offset, 1, FALSE); - prefix_len = tvb_get_guint8(tvb, opt_offset); - opt_offset += 1; - - /* Flags */ - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_route_info_flag, tvb, opt_offset, 1, FALSE); - flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_flag_route_info); + /* Padding */ + /* TODO: Calculate padding length and exlude from the signature */ + break; + } + case ND_OPT_TIMESTAMP: /* Timestamp option (13) */ + /* Reserved A 48-bit field reserved for future use. */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 6, FALSE); + opt_offset += 6; + + /* Timestamp + * A 64-bit unsigned integer field containing a timestamp. The value + * indicates the number of seconds since January 1, 1970, 00:00 UTC, + * by using a fixed point format. In this format, the integer number + * of seconds is contained in the first 48 bits of the field, and the + * remaining 16 bits indicate the number of 1/64K fractions of a + * second. + */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_timestamp, tvb, opt_offset + 2, 4, FALSE); + break; + case ND_OPT_NONCE: /* Nonce option (14) */ + /* 5.3.2. Nonce Option */ - proto_tree_add_item(flag_tree, hf_icmpv6_opt_route_info_flag_route_preference, tvb, opt_offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_opt_route_info_flag_reserved, tvb, opt_offset, 1, FALSE); + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_nonce, tvb, opt_offset, opt_len - 2, FALSE); + /* Nonce */ + break; + case ND_OPT_TRUST_ANCHOR: /* Trust Anchor option (15) */ + { + proto_tree *name_tree; + proto_item *name_item; + guint8 name_type; + guint8 padd_length; + int par_len; + asn1_ctx_t asn1_ctx; + + /* Name Type */ + name_type = tvb_get_guint8(tvb, opt_offset); + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_name_type, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* Pad Length */ + padd_length = tvb_get_guint8(tvb, opt_offset); + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_cga_pad_len, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + par_len = opt_len - 4 - padd_length; + + switch (name_type){ + case 1: + /* DER Encoded X.501 Name */ + name_item = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_name_x501, tvb, opt_offset, par_len, FALSE); + name_tree = proto_item_add_subtree(name_item, ett_icmpv6_opt_name); + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); + dissect_x509if_Name(FALSE, tvb, opt_offset, &asn1_ctx, name_tree, hf_icmpv6_x509if_Name); + break; + case 2: + /* FQDN */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_name_fqdn, tvb, opt_offset, par_len, FALSE); + break; + default: + break; + } + opt_offset = opt_offset + par_len; - route_preference = tvb_get_guint8(tvb, opt_offset); - route_preference = (route_preference & ND_RA_FLAG_RTPREF_MASK) >> 3; - proto_item_append_text(ti, " : %s", val_to_str(route_preference, nd_flag_router_pref, "Unknown %d") ); - opt_offset += 1; + /* Padding */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, FALSE); - /* Route Lifetime */ - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_route_lifetime, tvb, opt_offset, 4, FALSE); - - switch(tvb_get_ntohl(tvb, opt_offset)){ - case 0xffffffff: - proto_item_append_text(ti_opt, " (Infinity)"); break; - default: + } + case ND_OPT_CERTIFICATE: /* Certificate option (16) */ + { + guint8 cert_type; + guint8 padd_length; + asn1_ctx_t asn1_ctx; + + /* Cert Type */ + cert_type = tvb_get_guint8(tvb, opt_offset); + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_cert_type, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* Reserved */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* Certificate */ + + if(cert_type == 1){ + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); + opt_offset = dissect_x509af_Certificate(FALSE, tvb, opt_offset, &asn1_ctx, icmp6opt_tree, hf_icmpv6_x509af_Certificate); + padd_length = opt_len - (opt_offset - offset); + /* Padding */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, FALSE); + }else{ + padd_length = opt_len - 4; + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_certificate_padding, tvb, opt_offset, padd_length, FALSE); + } break; } - opt_offset += 4; + case ND_OPT_IP_ADDRESS_PREFIX: /* IP Address/Prefix Option (17) */ + { + guint8 prefix_len; + + /* Option-code */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_ipa_option_code, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* Prefix Len */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_ipa_prefix_len, tvb, opt_offset, 1, FALSE); + prefix_len = tvb_get_guint8(tvb, opt_offset); + opt_offset += 1; + + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, FALSE); + opt_offset += 4; + + /* IPv6 Address */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_ipa_ipv6_address, tvb, opt_offset, 16, FALSE); + opt_offset += 16; + + proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(tvb, opt_offset), prefix_len); - /* Prefix */ - switch(opt_len){ - case 8: /* Default Option Length without prefix */ - proto_item_append_text(ti, " ::/%d", prefix_len); break; - case 16: - memset(&prefix, 0, sizeof(prefix)); - tvb_memcpy(tvb, (guint8 *)&prefix.bytes, opt_offset, 8); - proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_prefix, tvb, opt_offset, 8, prefix.bytes); - proto_item_append_text(ti, " %s/%d", ip6_to_str(&prefix), prefix_len); + } + case ND_OPT_NEW_ROUTER_PREFIX_INFO: /* New Router Prefix Information Option (18) OBSO... */ + { + + guint8 prefix_len; + + /* Option-code */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_nrpi_option_code, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* Prefix Len */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_nrpi_prefix_len, tvb, opt_offset, 1, FALSE); + prefix_len = tvb_get_guint8(tvb, opt_offset); + opt_offset += 1; + + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, FALSE); + opt_offset += 4; + + /* Prefix */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_nrpi_prefix, tvb, opt_offset, 16, FALSE); + opt_offset += 16; + + proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(tvb, opt_offset), prefix_len); break; - case 24: - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix, tvb, opt_offset, 16, FALSE); - proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(tvb, opt_offset), prefix_len); + } + case ND_OPT_LINK_LAYER_ADDRESS: /* Link-layer Address Option (19) */ + { + /* Option-Code */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_lla_option_code, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* Link Layer Address */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_lla_bytes, tvb, opt_offset, opt_len-3, FALSE); break; - default: - expert_add_info_format(pinfo, ti_opt_len, PI_MALFORMED, PI_ERROR, "Invalid Option Length"); - break; } - break; - } + case ND_OPT_NEIGHBOR_ADV_ACK: /* Neighbor Advertisement Acknowledgment Option (20) */ + { + guint8 status; - case ND_OPT_RECURSIVE_DNS_SERVER: /* Recursive DNS Server Option (25) */ - { - /* Reserved */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, FALSE); - opt_offset += 2; - - /* RDNSS Lifetime */ - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_rdnss_lifetime, tvb, opt_offset, 4, FALSE); - /* A value of all one bits (0xffffffff) represents infinity. A value of - * zero means that the RDNSS address MUST no longer be used. - */ - switch(tvb_get_ntohl(tvb, opt_offset)){ - case 0: - proto_item_append_text(ti_opt, " (RDNSS address MUST no longer be used)"); + /* Option-Code */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_naack_option_code, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* Status */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_naack_status, tvb, opt_offset, 1, FALSE); + status = tvb_get_guint8(tvb, opt_offset); + opt_offset += 1; + + if(status == 2){ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_naack_supplied_ncoa, tvb, opt_offset, 16, FALSE); + }else{ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, opt_len - 4, FALSE); + } break; - case 0xffffffff: - proto_item_append_text(ti_opt, " (Infinity)"); + } + case ND_OPT_MAP: /* MAP Option (23) */ + { + + /* Dist */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_map_dist, tvb, opt_offset, 1, FALSE); + + /* Pref */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_map_pref, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* Flags */ + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_map_flag, tvb, opt_offset, 1, FALSE); + flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_flag_map); + + proto_tree_add_item(flag_tree, hf_icmpv6_opt_map_flag_r, tvb, opt_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_opt_map_flag_reserved, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* Valid Lifetime */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_map_valid_lifetime, tvb, opt_offset, 4, FALSE); + opt_offset += 4; + + /* Global Address */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_map_global_address, tvb, opt_offset, 16, FALSE); + opt_offset += 16; break; - default: + } + case ND_OPT_ROUTE_INFO: /* Route Information Option (24) */ + { + /* RFC 4191 */ + guint8 prefix_len; + guint8 route_preference; + struct e_in6_addr prefix; + + /* Prefix Len */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix_len, tvb, opt_offset, 1, FALSE); + prefix_len = tvb_get_guint8(tvb, opt_offset); + opt_offset += 1; + + /* Flags */ + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_route_info_flag, tvb, opt_offset, 1, FALSE); + flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_flag_route_info); + + proto_tree_add_item(flag_tree, hf_icmpv6_opt_route_info_flag_route_preference, tvb, opt_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_opt_route_info_flag_reserved, tvb, opt_offset, 1, FALSE); + + route_preference = tvb_get_guint8(tvb, opt_offset); + route_preference = (route_preference & ND_RA_FLAG_RTPREF_MASK) >> 3; + proto_item_append_text(ti, " : %s", val_to_str(route_preference, nd_flag_router_pref, "Unknown %d") ); + opt_offset += 1; + + /* Route Lifetime */ + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_route_lifetime, tvb, opt_offset, 4, FALSE); + + switch(tvb_get_ntohl(tvb, opt_offset)){ + case 0xffffffff: + proto_item_append_text(ti_opt, " (Infinity)"); + break; + default: + break; + } + opt_offset += 4; + + /* Prefix */ + switch(opt_len){ + case 8: /* Default Option Length without prefix */ + proto_item_append_text(ti, " ::/%d", prefix_len); + break; + case 16: + memset(&prefix, 0, sizeof(prefix)); + tvb_memcpy(tvb, (guint8 *)&prefix.bytes, opt_offset, 8); + proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_prefix, tvb, opt_offset, 8, prefix.bytes); + proto_item_append_text(ti, " %s/%d", ip6_to_str(&prefix), prefix_len); + break; + case 24: + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix, tvb, opt_offset, 16, FALSE); + proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(tvb, opt_offset), prefix_len); + break; + default: + expert_add_info_format(pinfo, ti_opt_len, PI_MALFORMED, PI_ERROR, "Invalid Option Length"); + break; + } break; + } - opt_offset += 4; - - while(opt_offset < (offset + opt_len) ) { - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_rdnss, tvb, opt_offset, 16, FALSE); - proto_item_append_text(ti, " %s", tvb_ip6_to_str(tvb, opt_offset)); - opt_offset += 16; - } - break; - } - case ND_OPT_FLAGS_EXTENSION: /* RA Flags Extension Option (26) */ - { - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_efo, tvb, opt_offset, 6, FALSE); - flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_flag_efo); - - proto_tree_add_item(flag_tree, hf_icmpv6_opt_efo_m, tvb, opt_offset, 2, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_opt_efo_o, tvb, opt_offset, 2, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_opt_efo_h, tvb, opt_offset, 2, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_opt_efo_prf, tvb, opt_offset, 2, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_opt_efo_p, tvb, opt_offset, 2, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_opt_efo_rsv, tvb, opt_offset, 2, FALSE); - opt_offset += 2; - - proto_tree_add_item(flag_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, FALSE); - break; - } - case ND_OPT_HANDOVER_KEY_REQUEST: /* Handover Key Request Option (27) */ - { - int par_len; - guint padd_length; + case ND_OPT_RECURSIVE_DNS_SERVER: /* Recursive DNS Server Option (25) */ + { + /* Reserved */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, FALSE); + opt_offset += 2; - /* Pad Length */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_pad_length, tvb, opt_offset, 1, FALSE); - padd_length = tvb_get_guint8(tvb, opt_offset); - opt_offset += 1; + /* RDNSS Lifetime */ + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_rdnss_lifetime, tvb, opt_offset, 4, FALSE); + /* A value of all one bits (0xffffffff) represents infinity. A value of + * zero means that the RDNSS address MUST no longer be used. + */ + switch(tvb_get_ntohl(tvb, opt_offset)){ + case 0: + proto_item_append_text(ti_opt, " (RDNSS address MUST no longer be used)"); + break; + case 0xffffffff: + proto_item_append_text(ti_opt, " (Infinity)"); + break; + default: + break; + } + opt_offset += 4; - /* AT */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_at, tvb, opt_offset, 1, FALSE); + while(opt_offset < (offset + opt_len) ) { + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_rdnss, tvb, opt_offset, 16, FALSE); + proto_item_append_text(ti, " %s", tvb_ip6_to_str(tvb, opt_offset)); + opt_offset += 16; - /* Reserved */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_reserved, tvb, opt_offset, 1, FALSE); - opt_offset += 1; + } + break; + } + case ND_OPT_FLAGS_EXTENSION: /* RA Flags Extension Option (26) */ + { + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_efo, tvb, opt_offset, 6, FALSE); + flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_flag_efo); + + proto_tree_add_item(flag_tree, hf_icmpv6_opt_efo_m, tvb, opt_offset, 2, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_opt_efo_o, tvb, opt_offset, 2, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_opt_efo_h, tvb, opt_offset, 2, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_opt_efo_prf, tvb, opt_offset, 2, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_opt_efo_p, tvb, opt_offset, 2, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_opt_efo_rsv, tvb, opt_offset, 2, FALSE); + opt_offset += 2; + + proto_tree_add_item(flag_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, FALSE); + break; + } + case ND_OPT_HANDOVER_KEY_REQUEST: /* Handover Key Request Option (27) */ + { + int par_len; + guint padd_length; - /* Handover Key Encryption Public Key */ - par_len = opt_len-4-padd_length; - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_encryption_public_key, tvb, opt_offset, par_len, FALSE); - opt_offset += par_len; + /* Pad Length */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_pad_length, tvb, opt_offset, 1, FALSE); + padd_length = tvb_get_guint8(tvb, opt_offset); + opt_offset += 1; - /* Padding */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_padding, tvb, opt_offset, padd_length, FALSE); - opt_offset += 1; - break; - } - case ND_OPT_HANDOVER_KEY_REPLY: /* Handover Key Reply Option (28) */ - { - int par_len; - guint padd_length; + /* AT */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_at, tvb, opt_offset, 1, FALSE); - /* Pad Length */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_pad_length, tvb, opt_offset, 1, FALSE); - padd_length = tvb_get_guint8(tvb, opt_offset); - opt_offset += 1; + /* Reserved */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_reserved, tvb, opt_offset, 1, FALSE); + opt_offset += 1; - /* AT */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_at, tvb, opt_offset, 1, FALSE); + /* Handover Key Encryption Public Key */ + par_len = opt_len-4-padd_length; + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_encryption_public_key, tvb, opt_offset, par_len, FALSE); + opt_offset += par_len; - /* Reserved */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_reserved, tvb, opt_offset, 1, FALSE); - opt_offset += 1; + /* Padding */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_padding, tvb, opt_offset, padd_length, FALSE); + opt_offset += 1; + break; + } + case ND_OPT_HANDOVER_KEY_REPLY: /* Handover Key Reply Option (28) */ + { + int par_len; + guint padd_length; - /* Lifetime */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_lifetime, tvb, opt_offset, 2, FALSE); - opt_offset += 2; + /* Pad Length */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_pad_length, tvb, opt_offset, 1, FALSE); + padd_length = tvb_get_guint8(tvb, opt_offset); + opt_offset += 1; - /* Encrypted Handover Key */ - par_len = opt_len-6-padd_length; - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_encrypted_handover_key, tvb, opt_offset, par_len, FALSE); - opt_offset += par_len; + /* AT */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_at, tvb, opt_offset, 1, FALSE); - /* Padding */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_padding, tvb, opt_offset, padd_length, FALSE); - opt_offset += 1; - break; - } - case ND_OPT_HANDOVER_ASSIST_INFO: /* Handover Assist Information Option (29) */ - { - guint8 hai_len; - int padd_length; - /* Option-Code */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hai_option_code, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* HAI Length */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hai_length, tvb, opt_offset, 1, FALSE); - hai_len = tvb_get_guint8(tvb, opt_offset); - opt_offset += 1; - - /* HAI Value */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hai_value, tvb, opt_offset, hai_len, FALSE); - opt_offset += hai_len; - - /* Padding... */ - padd_length = opt_len - opt_offset; - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, FALSE); + /* Reserved */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_reserved, tvb, opt_offset, 1, FALSE); + opt_offset += 1; - break; - } - case ND_OPT_MOBILE_NODE_ID: /* Mobile Node Identifier Option (30) */ - { - guint8 mn_len; - int padd_length; - /* Option-Code */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_mn_option_code, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* MN Length */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_mn_length, tvb, opt_offset, 1, FALSE); - mn_len = tvb_get_guint8(tvb, opt_offset); - opt_offset += 1; - - /* MN Value */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_mn_value, tvb, opt_offset, mn_len, FALSE); - opt_offset += mn_len; - - /* Padding... */ - padd_length = opt_len - opt_offset; - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, FALSE); - break; - } - case ND_OPT_DNS_SEARCH_LIST: /* DNS Search List Option (31) */ - { - int dnssl_len; - const guchar *dnssl_name; + /* Lifetime */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_lifetime, tvb, opt_offset, 2, FALSE); + opt_offset += 2; - /* Reserved */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, FALSE); - opt_offset += 2; + /* Encrypted Handover Key */ + par_len = opt_len-6-padd_length; + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_encrypted_handover_key, tvb, opt_offset, par_len, FALSE); + opt_offset += par_len; - /* DNSSL Lifetime */ - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_dnssl_lifetime, tvb, opt_offset, 4, FALSE); - switch(tvb_get_ntohl(tvb, opt_offset)){ - case 0xffffffff: - proto_item_append_text(ti_opt, " (Infinity)"); + /* Padding */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_padding, tvb, opt_offset, padd_length, FALSE); + opt_offset += 1; break; - default: + } + case ND_OPT_HANDOVER_ASSIST_INFO: /* Handover Assist Information Option (29) */ + { + guint8 hai_len; + int padd_length; + /* Option-Code */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hai_option_code, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* HAI Length */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hai_length, tvb, opt_offset, 1, FALSE); + hai_len = tvb_get_guint8(tvb, opt_offset); + opt_offset += 1; + + /* HAI Value */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hai_value, tvb, opt_offset, hai_len, FALSE); + opt_offset += hai_len; + + /* Padding... */ + padd_length = opt_len - opt_offset; + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, FALSE); + break; } - opt_offset += 4; - while(opt_offset < (offset + opt_len) ) { - - if(tvb_get_guint8(tvb, opt_offset) == 0){ /* if Zero there is padding, skip the loop */ + case ND_OPT_MOBILE_NODE_ID: /* Mobile Node Identifier Option (30) */ + { + guint8 mn_len; + int padd_length; + /* Option-Code */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_mn_option_code, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* MN Length */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_mn_length, tvb, opt_offset, 1, FALSE); + mn_len = tvb_get_guint8(tvb, opt_offset); + opt_offset += 1; + + /* MN Value */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_mn_value, tvb, opt_offset, mn_len, FALSE); + opt_offset += mn_len; + + /* Padding... */ + padd_length = opt_len - opt_offset; + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, FALSE); break; + } + case ND_OPT_DNS_SEARCH_LIST: /* DNS Search List Option (31) */ + { + int dnssl_len; + const guchar *dnssl_name; + + /* Reserved */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, FALSE); + opt_offset += 2; + + /* DNSSL Lifetime */ + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_dnssl_lifetime, tvb, opt_offset, 4, FALSE); + switch(tvb_get_ntohl(tvb, opt_offset)){ + case 0xffffffff: + proto_item_append_text(ti_opt, " (Infinity)"); + break; + default: + break; } - dnssl_len = get_dns_name(tvb, opt_offset, 0, opt_offset, &dnssl_name); - proto_tree_add_string(icmp6opt_tree, hf_icmpv6_opt_dnssl, tvb, opt_offset, dnssl_len, dnssl_name); - proto_item_append_text(ti, " %s", dnssl_name); - opt_offset += dnssl_len; + opt_offset += 4; + while(opt_offset < (offset + opt_len) ) { - } - break; - } - case ND_OPT_6LOWPAN_CONTEXT: /* 6LoWPAN Context (32) */ - { - /* 6lowpan-ND */ - guint8 context_len; - struct e_in6_addr context_prefix; - - /* Context Length */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6co_context_length, tvb, opt_offset, 1, FALSE); - context_len = tvb_get_guint8(tvb, opt_offset); - opt_offset += 1; - - /* Flags & CID */ - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6co_flag, tvb, opt_offset, 1, FALSE); - flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_flag_6lowpan); - proto_tree_add_item(flag_tree, hf_icmpv6_opt_6co_flag_c, tvb, opt_offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_opt_6co_flag_cid, tvb, opt_offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_opt_6co_flag_reserved, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* Reserved */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, FALSE); - opt_offset += 2; - - /* Lifetime */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6co_valid_lifetime, tvb, opt_offset, 2, FALSE); - opt_offset += 2; - - /* Context */ - switch(opt_len){ - case 8: /* Default Option Length without context prefix */ - proto_item_append_text(ti, " ::/%d", context_len); - break; - case 16: - memset(&context_prefix, 0, sizeof(context_prefix)); - tvb_memcpy(tvb, (guint8 *)&context_prefix.bytes, opt_offset, 8); - proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_6co_context_prefix, tvb, opt_offset, 8, context_prefix.bytes); - proto_item_append_text(ti, " %s/%d", ip6_to_str(&context_prefix), context_len); - break; - case 24: - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6co_context_prefix, tvb, opt_offset, 16, FALSE); - proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(tvb, opt_offset), context_len); + if(tvb_get_guint8(tvb, opt_offset) == 0){ /* if Zero there is padding, skip the loop */ + break; + } + dnssl_len = get_dns_name(tvb, opt_offset, 0, opt_offset, &dnssl_name); + proto_tree_add_string(icmp6opt_tree, hf_icmpv6_opt_dnssl, tvb, opt_offset, dnssl_len, dnssl_name); + proto_item_append_text(ti, " %s", dnssl_name); + opt_offset += dnssl_len; + + } break; - default: - expert_add_info_format(pinfo, ti_opt_len, PI_MALFORMED, PI_ERROR, "Invalid Option Length"); - break; } - } - break; - case ND_OPT_ADDR_RESOLUTION: /* Address Registration (TBD2 Pending IANA...) */ - { - /* 6lowpan-ND */ - guint8 status; - gchar *eui64; - - /* Status */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_aro_status, tvb, opt_offset, 1, FALSE); - status = tvb_get_guint8(tvb, opt_offset); - opt_offset += 1; - - /* Reserved */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 3, FALSE); - opt_offset += 3; - - /* Lifetime */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_aro_registration_lifetime, tvb, opt_offset, 2, FALSE); - opt_offset += 2; - - /* EUI-64 */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_aro_eui64, tvb, opt_offset, 8, FALSE); - eui64 = tvb_bytes_to_str_punct(tvb, opt_offset, 8, ':'); - proto_item_append_text(ti, " : Register %s %s", eui64, val_to_str(status, nd_opt_6lowpannd_status_val, "Unknown %d")); - opt_offset += 8; - - } - break; - case ND_OPT_AUTH_BORDER_ROUTER: /* Authoritative Border Router (33) */ - { - guint16 version; - - /* Version */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_abro_version, tvb, opt_offset, 2, FALSE); - version = tvb_get_ntohs(tvb, opt_offset); - opt_offset += 2; + case ND_OPT_6LOWPAN_CONTEXT: /* 6LoWPAN Context (32) */ + { + /* 6lowpan-ND */ + guint8 context_len; + struct e_in6_addr context_prefix; + + /* Context Length */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6co_context_length, tvb, opt_offset, 1, FALSE); + context_len = tvb_get_guint8(tvb, opt_offset); + opt_offset += 1; + + /* Flags & CID */ + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6co_flag, tvb, opt_offset, 1, FALSE); + flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_flag_6lowpan); + proto_tree_add_item(flag_tree, hf_icmpv6_opt_6co_flag_c, tvb, opt_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_opt_6co_flag_cid, tvb, opt_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_opt_6co_flag_reserved, tvb, opt_offset, 1, FALSE); + opt_offset += 1; - /* Reserved */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, FALSE); - opt_offset += 4; + /* Reserved */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, FALSE); + opt_offset += 2; + + /* Lifetime */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6co_valid_lifetime, tvb, opt_offset, 2, FALSE); + opt_offset += 2; + + /* Context */ + switch(opt_len){ + case 8: /* Default Option Length without context prefix */ + proto_item_append_text(ti, " ::/%d", context_len); + break; + case 16: + memset(&context_prefix, 0, sizeof(context_prefix)); + tvb_memcpy(tvb, (guint8 *)&context_prefix.bytes, opt_offset, 8); + proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_6co_context_prefix, tvb, opt_offset, 8, context_prefix.bytes); + proto_item_append_text(ti, " %s/%d", ip6_to_str(&context_prefix), context_len); + break; + case 24: + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6co_context_prefix, tvb, opt_offset, 16, FALSE); + proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(tvb, opt_offset), context_len); + break; + default: + expert_add_info_format(pinfo, ti_opt_len, PI_MALFORMED, PI_ERROR, "Invalid Option Length"); + break; + } + } + break; + case ND_OPT_ADDR_RESOLUTION: /* Address Registration (TBD2 Pending IANA...) */ + { + /* 6lowpan-ND */ + guint8 status; + gchar *eui64; - /* 6LBR Address */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_abro_6lbr_address, tvb, opt_offset, 16, FALSE); - proto_item_append_text(ti, " : Version %d, 6LBR : %s", version, tvb_ip6_to_str(tvb, opt_offset)); - opt_offset += 16; + /* Status */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_aro_status, tvb, opt_offset, 1, FALSE); + status = tvb_get_guint8(tvb, opt_offset); + opt_offset += 1; - } - break; + /* Reserved */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 3, FALSE); + opt_offset += 3; - default : - expert_add_info_format(pinfo, ti, PI_UNDECODED, PI_NOTE, "Dissector for ICMPv6 Option (%d) code not implemented, Contact Wireshark developers if you want this supported", opt_type); - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_data, tvb, opt_offset, opt_len, FALSE); + /* Lifetime */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_aro_registration_lifetime, tvb, opt_offset, 2, FALSE); + opt_offset += 2; + + /* EUI-64 */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_aro_eui64, tvb, opt_offset, 8, FALSE); + eui64 = tvb_bytes_to_str_punct(tvb, opt_offset, 8, ':'); + proto_item_append_text(ti, " : Register %s %s", eui64, val_to_str(status, nd_opt_6lowpannd_status_val, "Unknown %d")); + opt_offset += 8; + + } + break; + case ND_OPT_AUTH_BORDER_ROUTER: /* Authoritative Border Router (33) */ + { + guint16 version; + + /* Version */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_abro_version, tvb, opt_offset, 2, FALSE); + version = tvb_get_ntohs(tvb, opt_offset); + opt_offset += 2; + + /* Reserved */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, FALSE); + opt_offset += 4; + + /* 6LBR Address */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_abro_6lbr_address, tvb, opt_offset, 16, FALSE); + proto_item_append_text(ti, " : Version %d, 6LBR : %s", version, tvb_ip6_to_str(tvb, opt_offset)); + opt_offset += 16; + + } break; - } /* switch (opt_type) */ + default : + expert_add_info_format(pinfo, ti, PI_UNDECODED, PI_NOTE, + "Dissector for ICMPv6 Option (%d)" + " code not implemented, Contact Wireshark developers" + " if you want this supported", opt_type); + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_data, tvb, opt_offset, opt_len, FALSE); + break; + + } /* switch (opt_type) */ offset += opt_len; - /* Close the ) to option root label */ - proto_item_append_text(ti, ")"); + /* Close the ) to option root label */ + proto_item_append_text(ti, ")"); } } @@ -1898,306 +1901,309 @@ dissect_icmpv6_rpl_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree int opt_offset; while ((int)tvb_reported_length(tvb) > offset) { - /* there are more options */ + /* there are more options */ - /* ICMPv6 RPL Option */ - ti = proto_tree_add_item(tree, hf_icmpv6_rpl_opt, tvb, offset, 1, FALSE); - icmp6opt_tree = proto_item_add_subtree(ti, ett_icmpv6_rpl_opt); + /* ICMPv6 RPL Option */ + ti = proto_tree_add_item(tree, hf_icmpv6_rpl_opt, tvb, offset, 1, FALSE); + icmp6opt_tree = proto_item_add_subtree(ti, ett_icmpv6_rpl_opt); opt_offset = offset; - /* Option type */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_type, tvb, opt_offset, 1, FALSE); + /* Option type */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_type, tvb, opt_offset, 1, FALSE); opt_type = tvb_get_guint8(tvb, opt_offset); opt_offset += 1; - /* Add option name to option root label */ - proto_item_append_text(ti, " (%s", val_to_str(opt_type, rpl_option_vals, "Unknown %d")); + /* Add option name to option root label */ + proto_item_append_text(ti, " (%s", val_to_str(opt_type, rpl_option_vals, "Unknown %d")); - /* The Pad1 option is a special case, and contains no data. */ - if (opt_type == RPL_OPT_PAD1) { - offset += 1; - proto_item_append_text(ti, ")"); - continue; - } + /* The Pad1 option is a special case, and contains no data. */ + if (opt_type == RPL_OPT_PAD1) { + offset += 1; + proto_item_append_text(ti, ")"); + continue; + } - /* Option length */ - ti_opt_len = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_length, tvb, opt_offset, 1, FALSE); - opt_len = tvb_get_guint8(tvb, opt_offset); - proto_item_set_len(ti, opt_len + 2); + /* Option length */ + ti_opt_len = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_length, tvb, opt_offset, 1, FALSE); + opt_len = tvb_get_guint8(tvb, opt_offset); + proto_item_set_len(ti, opt_len + 2); opt_offset += 1; - /* decode... */ - switch (opt_type) { - case RPL_OPT_PADN: - /* n-byte padding */ - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_padn, tvb, opt_offset, opt_len, FALSE); - proto_item_append_text(ti_opt, " (Length : %i bytes)", opt_len); - break; - - case RPL_OPT_METRIC: - /* DAG metric container */ - /* See draft-ietf-roll-routing-metrics for formatting. */ - break; - case RPL_OPT_ROUTING: { - guint8 prefix_len; - struct e_in6_addr prefix; - - /* Prefix length */ - prefix_len = tvb_get_guint8(tvb, opt_offset); - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_prefix_length, tvb, opt_offset, 1, FALSE); - opt_offset +=1; - - /* Flags */ - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_flag, tvb, opt_offset, 1, FALSE); - flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_rpl_flag_routing); - - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_route_pref, tvb, opt_offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_route_reserved, tvb, opt_offset, 1, FALSE); - opt_offset +=1; - - /* Prefix lifetime. */ - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_lifetime, tvb, opt_offset, 4, FALSE); - - switch(tvb_get_ntohl(tvb, opt_offset)){ - case 0xffffffff: - proto_item_append_text(ti_opt, " (Infinity)"); - break; - default: - break; - } - opt_offset += 4; - - switch(opt_len){ - case 6: /* Default Option Length without prefix */ - proto_item_append_text(ti, " ::/%d", prefix_len); + /* decode... */ + switch (opt_type) { + case RPL_OPT_PADN: + /* n-byte padding */ + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_padn, tvb, opt_offset, opt_len, FALSE); + proto_item_append_text(ti_opt, " (Length : %i bytes)", opt_len); break; - case 14: - memset(&prefix, 0, sizeof(prefix)); - tvb_memcpy(tvb, (guint8 *)&prefix.bytes, opt_offset, 8); - proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_rpl_opt_route_prefix, tvb, opt_offset, 8, prefix.bytes); - proto_item_append_text(ti, " %s/%d", ip6_to_str(&prefix), prefix_len); + + case RPL_OPT_METRIC: + /* DAG metric container */ + /* See draft-ietf-roll-routing-metrics for formatting. */ break; - case 22: - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_prefix, tvb, opt_offset, 16, FALSE); - proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(tvb, opt_offset), prefix_len); + case RPL_OPT_ROUTING: { + guint8 prefix_len; + struct e_in6_addr prefix; + + /* Prefix length */ + prefix_len = tvb_get_guint8(tvb, opt_offset); + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_prefix_length, tvb, opt_offset, 1, FALSE); + opt_offset +=1; + + /* Flags */ + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_flag, tvb, opt_offset, 1, FALSE); + flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_rpl_flag_routing); + + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_route_pref, tvb, opt_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_route_reserved, tvb, opt_offset, 1, FALSE); + opt_offset +=1; + + /* Prefix lifetime. */ + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_lifetime, tvb, opt_offset, 4, FALSE); + + switch(tvb_get_ntohl(tvb, opt_offset)){ + case 0xffffffff: + proto_item_append_text(ti_opt, " (Infinity)"); + break; + default: + break; + } + opt_offset += 4; + + switch(opt_len){ + case 6: /* Default Option Length without prefix */ + proto_item_append_text(ti, " ::/%d", prefix_len); + break; + case 14: + memset(&prefix, 0, sizeof(prefix)); + tvb_memcpy(tvb, (guint8 *)&prefix.bytes, opt_offset, 8); + proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_rpl_opt_route_prefix, tvb, opt_offset, 8, prefix.bytes); + proto_item_append_text(ti, " %s/%d", ip6_to_str(&prefix), prefix_len); + break; + case 22: + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_prefix, tvb, opt_offset, 16, FALSE); + proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(tvb, opt_offset), prefix_len); + break; + default: + expert_add_info_format(pinfo, ti_opt_len, PI_MALFORMED, PI_ERROR, "Invalid Option Length"); + break; + } break; - default: - expert_add_info_format(pinfo, ti_opt_len, PI_MALFORMED, PI_ERROR, "Invalid Option Length"); - break; - } - break; } - case RPL_OPT_CONFIG: { - - /* Flags */ - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_flag, tvb, opt_offset, 1, FALSE); - flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_rpl_flag_config); - - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_config_reserved, tvb, opt_offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_config_auth, tvb, opt_offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_config_pcs, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* DIOIntervalDoublings */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_doublings, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* DIOIntervalMin */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_min_interval, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* DIORedundancyConstant */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_redundancy, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* MaxRankIncrease */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_rank_incr, tvb, opt_offset, 2, FALSE); - opt_offset += 2; - - /* MinHopRankInc */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_hop_rank_inc, tvb, opt_offset, 2, FALSE); - opt_offset += 2; - - /* OCP */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_ocp, tvb, opt_offset, 2, FALSE); - opt_offset += 2; - - /* Reserved */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_rsv, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* Default Lifetime */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_def_lifetime, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* Lifetime Unit */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_lifetime_unit, tvb, opt_offset, 2, FALSE); - opt_offset += 2; - break; - } - case RPL_OPT_TARGET: { - guint8 prefix_len; - struct e_in6_addr target_prefix; + case RPL_OPT_CONFIG: { - /* Flag */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_target_flag, tvb, opt_offset, 1, FALSE); - opt_offset += 1; + /* Flags */ + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_flag, tvb, opt_offset, 1, FALSE); + flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_rpl_flag_config); - /* Prefix length */ - prefix_len = tvb_get_guint8(tvb, opt_offset); - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_target_prefix_length, tvb, opt_offset, 1, FALSE); - opt_offset += 1; + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_config_reserved, tvb, opt_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_config_auth, tvb, opt_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_config_pcs, tvb, opt_offset, 1, FALSE); + opt_offset += 1; - /* Target Prefix */ + /* DIOIntervalDoublings */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_doublings, tvb, opt_offset, 1, FALSE); + opt_offset += 1; - switch(opt_len){ - case 2: /* Default Option Length without prefix */ - proto_item_append_text(ti, " ::/%d", prefix_len); - break; - case 10: - memset(&target_prefix, 0, sizeof(target_prefix)); - tvb_memcpy(tvb, (guint8 *)&target_prefix.bytes, opt_offset, 8); - proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_rpl_opt_target_prefix, tvb, opt_offset, 8, target_prefix.bytes); - proto_item_append_text(ti, " %s/%d", ip6_to_str(&target_prefix), prefix_len); - break; - case 18: - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_target_prefix, tvb, opt_offset, 16, FALSE); - proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(tvb, opt_offset), prefix_len); + /* DIOIntervalMin */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_min_interval, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* DIORedundancyConstant */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_redundancy, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* MaxRankIncrease */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_rank_incr, tvb, opt_offset, 2, FALSE); + opt_offset += 2; + + /* MinHopRankInc */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_hop_rank_inc, tvb, opt_offset, 2, FALSE); + opt_offset += 2; + + /* OCP */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_ocp, tvb, opt_offset, 2, FALSE); + opt_offset += 2; + + /* Reserved */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_rsv, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* Default Lifetime */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_def_lifetime, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* Lifetime Unit */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_lifetime_unit, tvb, opt_offset, 2, FALSE); + opt_offset += 2; break; - default: - expert_add_info_format(pinfo, ti_opt_len, PI_MALFORMED, PI_ERROR, "Invalid Option Length"); - break; } - break; - } - case RPL_OPT_TRANSIT: { - /* Flags */ - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_transit_flag, tvb, opt_offset, 1, FALSE); - flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_rpl_flag_transit); - - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_transit_flag_e, tvb, opt_offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_transit_flag_rsv, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* Path Control */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_transit_pathctl, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* Path Sequence */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_transit_pathseq, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* Path Lifetime */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_transit_pathlifetime, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* Option contains parent */ - if(opt_len > 4) - { - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_transit_parent, tvb, opt_offset, 16, FALSE); - proto_item_append_text(ti, " %s", tvb_ip6_to_str(tvb, opt_offset)); - opt_offset += 16; - } - - break; - } - case RPL_OPT_SOLICITED: { - - /*Instance ID */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_solicited_instance, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* Flags */ - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_solicited_flag, tvb, opt_offset, 1, FALSE); - flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_rpl_flag_solicited); - - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_solicited_flag_v, tvb, opt_offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_solicited_flag_i, tvb, opt_offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_solicited_flag_d, tvb, opt_offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_solicited_flag_rsv, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* DODAG ID */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_solicited_dodagid, tvb, opt_offset, 16, FALSE); - opt_offset += 16; - - /* Version Number */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_solicited_version, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - break; - } - case RPL_OPT_PREFIX: { - /* Destination prefix option. */ - guint8 prefix_len; - - /* Prefix length */ - prefix_len = tvb_get_guint8(tvb, opt_offset); - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix_length, tvb, opt_offset, 1, FALSE); - opt_offset +=1; - - /* Flags */ - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix_flag, tvb, opt_offset, 1, FALSE); - flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_rpl_flag_prefix); - - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_prefix_flag_l, tvb, opt_offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_prefix_flag_a, tvb, opt_offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_prefix_flag_r, tvb, opt_offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_prefix_flag_rsv, tvb, opt_offset, 1, FALSE); - opt_offset += 1; - - /* Valid lifetime. */ - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix_vlifetime, tvb, opt_offset, 4, FALSE); - switch(tvb_get_ntohl(tvb, opt_offset)){ - case 0xffffffff: - proto_item_append_text(ti_opt, " (Infinity)"); - break; - default: + case RPL_OPT_TARGET: { + guint8 prefix_len; + struct e_in6_addr target_prefix; + + /* Flag */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_target_flag, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* Prefix length */ + prefix_len = tvb_get_guint8(tvb, opt_offset); + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_target_prefix_length, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* Target Prefix */ + + switch(opt_len){ + case 2: /* Default Option Length without prefix */ + proto_item_append_text(ti, " ::/%d", prefix_len); + break; + case 10: + memset(&target_prefix, 0, sizeof(target_prefix)); + tvb_memcpy(tvb, (guint8 *)&target_prefix.bytes, opt_offset, 8); + proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_rpl_opt_target_prefix, tvb, opt_offset, 8, target_prefix.bytes); + proto_item_append_text(ti, " %s/%d", ip6_to_str(&target_prefix), prefix_len); + break; + case 18: + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_target_prefix, tvb, opt_offset, 16, FALSE); + proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(tvb, opt_offset), prefix_len); + break; + default: + expert_add_info_format(pinfo, ti_opt_len, PI_MALFORMED, PI_ERROR, "Invalid Option Length"); + break; + } break; } - opt_offset += 4; + case RPL_OPT_TRANSIT: { + /* Flags */ + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_transit_flag, tvb, opt_offset, 1, FALSE); + flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_rpl_flag_transit); + + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_transit_flag_e, tvb, opt_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_transit_flag_rsv, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* Path Control */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_transit_pathctl, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* Path Sequence */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_transit_pathseq, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* Path Lifetime */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_transit_pathlifetime, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* Option contains parent */ + if(opt_len > 4) + { + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_transit_parent, tvb, opt_offset, 16, FALSE); + proto_item_append_text(ti, " %s", tvb_ip6_to_str(tvb, opt_offset)); + opt_offset += 16; + } - /* Preferrred Lifetime */ - ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix_plifetime, tvb, opt_offset, 4, FALSE); - switch(tvb_get_ntohl(tvb, opt_offset)){ - case 0xffffffff: - proto_item_append_text(ti_opt, " (Infinity)"); break; - default: + } + case RPL_OPT_SOLICITED: { + + /*Instance ID */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_solicited_instance, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* Flags */ + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_solicited_flag, tvb, opt_offset, 1, FALSE); + flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_rpl_flag_solicited); + + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_solicited_flag_v, tvb, opt_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_solicited_flag_i, tvb, opt_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_solicited_flag_d, tvb, opt_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_solicited_flag_rsv, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* DODAG ID */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_solicited_dodagid, tvb, opt_offset, 16, FALSE); + opt_offset += 16; + + /* Version Number */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_solicited_version, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + break; } - opt_offset += 4; + case RPL_OPT_PREFIX: { + /* Destination prefix option. */ + guint8 prefix_len; + + /* Prefix length */ + prefix_len = tvb_get_guint8(tvb, opt_offset); + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix_length, tvb, opt_offset, 1, FALSE); + opt_offset +=1; + + /* Flags */ + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix_flag, tvb, opt_offset, 1, FALSE); + flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_rpl_flag_prefix); + + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_prefix_flag_l, tvb, opt_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_prefix_flag_a, tvb, opt_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_prefix_flag_r, tvb, opt_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_prefix_flag_rsv, tvb, opt_offset, 1, FALSE); + opt_offset += 1; + + /* Valid lifetime. */ + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix_vlifetime, tvb, opt_offset, 4, FALSE); + switch(tvb_get_ntohl(tvb, opt_offset)){ + case 0xffffffff: + proto_item_append_text(ti_opt, " (Infinity)"); + break; + default: + break; + } + opt_offset += 4; + + /* Preferrred Lifetime */ + ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix_plifetime, tvb, opt_offset, 4, FALSE); + switch(tvb_get_ntohl(tvb, opt_offset)){ + case 0xffffffff: + proto_item_append_text(ti_opt, " (Infinity)"); + break; + default: + break; + } + opt_offset += 4; - /* 4 reserved bytes. */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_reserved, tvb, opt_offset, 4, FALSE); - opt_offset += 4; + /* 4 reserved bytes. */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_reserved, tvb, opt_offset, 4, FALSE); + opt_offset += 4; - /* Prefix */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix, tvb, opt_offset, 16, FALSE); - proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(tvb, opt_offset), prefix_len); - opt_offset += 16; + /* Prefix */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix, tvb, opt_offset, 16, FALSE); + proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(tvb, opt_offset), prefix_len); + opt_offset += 16; - break; - } + break; + } - case RPL_OPT_TARGETDESC: { + case RPL_OPT_TARGETDESC: { - /* Descriptor */ - proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_targetdesc, tvb, opt_offset, 4, FALSE); - opt_offset += 4; - break; - } - default : - expert_add_info_format(pinfo, ti, PI_UNDECODED, PI_NOTE, "Dissector for ICMPv6 RPL Option (%d) code not implemented, Contact Wireshark developers if you want this supported", opt_type); + /* Descriptor */ + proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_targetdesc, tvb, opt_offset, 4, FALSE); + opt_offset += 4; + break; + } + default : + expert_add_info_format(pinfo, ti, PI_UNDECODED, PI_NOTE, + "Dissector for ICMPv6 RPL Option" + " (%d) code not implemented, Contact" + " Wireshark developers if you want this supported", opt_type); proto_tree_add_item(icmp6opt_tree, hf_icmpv6_data, tvb, opt_offset, opt_len, FALSE); - break; - } /* switch (opt_type) */ + break; + } /* switch (opt_type) */ offset += opt_len + 2; - /* Close the ) to option root label */ - proto_item_append_text(ti, ")"); - } + /* Close the ) to option root label */ + proto_item_append_text(ti, ")"); + } /* while */ } static void @@ -2214,25 +2220,25 @@ dissect_rpl_control(tvbuff_t *tvb, int rpl_offset, packet_info *pinfo _U_, proto /* Flags */ ti = proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_secure_flag, tvb, rpl_offset, 1, FALSE); flag_tree = proto_item_add_subtree(ti, ett_icmpv6_flag_secure); - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_secure_flag_t, tvb, rpl_offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_secure_flag_rsv, tvb, rpl_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_secure_flag_t, tvb, rpl_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_secure_flag_rsv, tvb, rpl_offset, 1, FALSE); rpl_offset += 1; /* Algorithm */ ti = proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_secure_algorithm, tvb, rpl_offset, 1, FALSE); flag_tree = proto_item_add_subtree(ti, ett_icmpv6_flag_secure); - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_secure_algorithm_encryption, tvb, rpl_offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_secure_algorithm_signature, tvb, rpl_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_secure_algorithm_encryption, tvb, rpl_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_secure_algorithm_signature, tvb, rpl_offset, 1, FALSE); rpl_offset += 1; - /* KIM & LVL */ + /* KIM & LVL */ ti = proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_secure_flag, tvb, rpl_offset, 1, FALSE); flag_tree = proto_item_add_subtree(ti, ett_icmpv6_flag_secure); - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_secure_kim, tvb, rpl_offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_secure_lvl, tvb, rpl_offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_rpl_secure_rsv, tvb, rpl_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_secure_kim, tvb, rpl_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_secure_lvl, tvb, rpl_offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_rpl_secure_rsv, tvb, rpl_offset, 1, FALSE); kim = tvb_get_guint8(tvb, rpl_offset) & RPL_SECURE_KIM >> 6; - lvl = tvb_get_guint8(tvb, rpl_offset) & RPL_SECURE_LVL; + lvl = tvb_get_guint8(tvb, rpl_offset) & RPL_SECURE_LVL; rpl_offset += 1; /* Flags */ @@ -2323,7 +2329,7 @@ dissect_rpl_control(tvbuff_t *tvb, int rpl_offset, packet_info *pinfo _U_, proto proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dio_dtsn, tvb, rpl_offset, 1, FALSE); rpl_offset += 1; - /* Flags */ + /* Flags */ proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dio_flag, tvb, rpl_offset, 1, FALSE); rpl_offset += 1; @@ -2433,13 +2439,13 @@ dissect_rpl_control(tvbuff_t *tvb, int rpl_offset, packet_info *pinfo _U_, proto /* Destination Counter */ proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_cc_destination_counter, tvb, rpl_offset, 4, FALSE); - rpl_offset += 4; + rpl_offset += 4; /* Options */ dissect_icmpv6_rpl_opt(tvb, rpl_offset, pinfo, icmp6_tree); break; } - + } } /* RFC 4620 - IPv6 Node Information Queries */ @@ -2467,11 +2473,11 @@ dissect_nodeinfo(tvbuff_t *tvb, int ni_offset, packet_info *pinfo _U_, proto_tre proto_tree_add_item(flag_tree, hf_icmpv6_ni_flag_t, tvb, ni_offset, 2, FALSE); proto_tree_add_item(flag_tree, hf_icmpv6_ni_flag_rsv, tvb, ni_offset, 2, FALSE); ni_offset += 2; - + /* Nonce */ proto_tree_add_item(tree, hf_icmpv6_ni_nonce, tvb, ni_offset, 8, FALSE); ni_offset += 8; - + /* Data ? */ if(tvb_reported_length_remaining(tvb, ni_offset) == 0){ return; @@ -2479,73 +2485,73 @@ dissect_nodeinfo(tvbuff_t *tvb, int ni_offset, packet_info *pinfo _U_, proto_tre if(icmp6_type == ICMP6_NI_QUERY){ switch(icmp6_code){ - case ICMP6_NI_SUBJ_IPV6: { - proto_tree_add_item(tree, hf_icmpv6_ni_query_subject_ipv6, tvb, ni_offset, 16, FALSE); - ni_offset += 16; - break; - } - case ICMP6_NI_SUBJ_FQDN: { - int fqdn_len; - const guchar *fqdn_name; - fqdn_len = get_dns_name(tvb, ni_offset, 0, ni_offset, &fqdn_name); - proto_tree_add_string(tree, hf_icmpv6_ni_query_subject_fqdn, tvb, ni_offset, fqdn_len, fqdn_name); - ni_offset += fqdn_len; - break; - } - case ICMP6_NI_SUBJ_IPV4: { - proto_tree_add_item(tree, hf_icmpv6_ni_query_subject_ipv4, tvb, ni_offset, 4, FALSE); - ni_offset += 4; - break; - } - } - } else { /* It is ICMP6_NI_REPLY */ - switch(qtype){ - case NI_QTYPE_NOOP: - break; - case NI_QTYPE_NODENAME: { - int node_len; - const guchar *node_name; - /* TTL */ - proto_tree_add_item(tree, hf_icmpv6_ni_reply_node_ttl, tvb, ni_offset, 4, FALSE); - ni_offset += 4; - /* Data ? */ - if(tvb_reported_length_remaining(tvb, ni_offset) == 0){ - return; + case ICMP6_NI_SUBJ_IPV6: { + proto_tree_add_item(tree, hf_icmpv6_ni_query_subject_ipv6, tvb, ni_offset, 16, FALSE); + ni_offset += 16; + break; } - while(ni_offset < (int)tvb_reported_length(tvb) ) { - - if(tvb_get_guint8(tvb, ni_offset) == 0){ /* if Zero there is padding, skip the loop */ - break; - } - /* Node Name */ - node_len = get_dns_name(tvb, ni_offset, 0, ni_offset, &node_name); - proto_tree_add_string(tree, hf_icmpv6_ni_reply_node_name, tvb, ni_offset, node_len, node_name); - ni_offset += node_len; + case ICMP6_NI_SUBJ_FQDN: { + int fqdn_len; + const guchar *fqdn_name; + fqdn_len = get_dns_name(tvb, ni_offset, 0, ni_offset, &fqdn_name); + proto_tree_add_string(tree, hf_icmpv6_ni_query_subject_fqdn, tvb, ni_offset, fqdn_len, fqdn_name); + ni_offset += fqdn_len; + break; + } + case ICMP6_NI_SUBJ_IPV4: { + proto_tree_add_item(tree, hf_icmpv6_ni_query_subject_ipv4, tvb, ni_offset, 4, FALSE); + ni_offset += 4; + break; } - break; } - case NI_QTYPE_NODEADDR: { - while(ni_offset < (int)tvb_reported_length(tvb) ) { + } else { /* It is ICMP6_NI_REPLY */ + switch(qtype){ + case NI_QTYPE_NOOP: + break; + case NI_QTYPE_NODENAME: { + int node_len; + const guchar *node_name; /* TTL */ proto_tree_add_item(tree, hf_icmpv6_ni_reply_node_ttl, tvb, ni_offset, 4, FALSE); ni_offset += 4; - /* Node Addresses */ - proto_tree_add_item(tree, hf_icmpv6_ni_reply_node_address, tvb, ni_offset, 16, FALSE); - ni_offset += 16; + /* Data ? */ + if(tvb_reported_length_remaining(tvb, ni_offset) == 0){ + return; + } + while(ni_offset < (int)tvb_reported_length(tvb) ) { + + if(tvb_get_guint8(tvb, ni_offset) == 0){ /* if Zero there is padding, skip the loop */ + break; + } + /* Node Name */ + node_len = get_dns_name(tvb, ni_offset, 0, ni_offset, &node_name); + proto_tree_add_string(tree, hf_icmpv6_ni_reply_node_name, tvb, ni_offset, node_len, node_name); + ni_offset += node_len; + } + break; } - break; - } - case NI_QTYPE_IPV4ADDR: { - while(ni_offset < (int)tvb_reported_length(tvb) ) { - /* TTL */ - proto_tree_add_item(tree, hf_icmpv6_ni_reply_node_ttl, tvb, ni_offset, 4, FALSE); - ni_offset += 4; - /* IPv4 Address */ - proto_tree_add_item(tree, hf_icmpv6_ni_reply_ipv4_address, tvb, ni_offset, 4, FALSE); - ni_offset += 4; + case NI_QTYPE_NODEADDR: { + while(ni_offset < (int)tvb_reported_length(tvb) ) { + /* TTL */ + proto_tree_add_item(tree, hf_icmpv6_ni_reply_node_ttl, tvb, ni_offset, 4, FALSE); + ni_offset += 4; + /* Node Addresses */ + proto_tree_add_item(tree, hf_icmpv6_ni_reply_node_address, tvb, ni_offset, 16, FALSE); + ni_offset += 16; + } + break; + } + case NI_QTYPE_IPV4ADDR: { + while(ni_offset < (int)tvb_reported_length(tvb) ) { + /* TTL */ + proto_tree_add_item(tree, hf_icmpv6_ni_reply_node_ttl, tvb, ni_offset, 4, FALSE); + ni_offset += 4; + /* IPv4 Address */ + proto_tree_add_item(tree, hf_icmpv6_ni_reply_ipv4_address, tvb, ni_offset, 4, FALSE); + ni_offset += 4; + } + break; } - break; - } } } } @@ -2604,39 +2610,39 @@ dissect_rrenum(tvbuff_t *tvb, int rr_offset, packet_info *pinfo _U_, proto_tree /* OpLength */ proto_tree_add_item(mp_tree, hf_icmpv6_rr_pco_mp_oplength, tvb, rr_offset, 1, FALSE); oplength = tvb_get_guint8(tvb, rr_offset); - rr_offset += 1; + rr_offset += 1; /* Ordinal */ proto_tree_add_item(mp_tree, hf_icmpv6_rr_pco_mp_ordinal, tvb, rr_offset, 1, FALSE); - rr_offset += 1; + rr_offset += 1; /* MatchLen */ proto_tree_add_item(mp_tree, hf_icmpv6_rr_pco_mp_matchlen, tvb, rr_offset, 1, FALSE); matchlen = tvb_get_guint8(tvb, rr_offset); - rr_offset += 1; + rr_offset += 1; /* MinLen */ proto_tree_add_item(mp_tree, hf_icmpv6_rr_pco_mp_minlen, tvb, rr_offset, 1, FALSE); minlen = tvb_get_guint8(tvb, rr_offset); - rr_offset += 1; + rr_offset += 1; /* MaxLen */ proto_tree_add_item(mp_tree, hf_icmpv6_rr_pco_mp_maxlen, tvb, rr_offset, 1, FALSE); maxlen = tvb_get_guint8(tvb, rr_offset); - rr_offset += 1; + rr_offset += 1; /* Reserved */ proto_tree_add_item(mp_tree, hf_icmpv6_reserved, tvb, rr_offset, 2, FALSE); - rr_offset += 2; + rr_offset += 2; /* Match Prefix */ proto_tree_add_item(mp_tree, hf_icmpv6_rr_pco_mp_matchprefix, tvb, rr_offset, 16, FALSE); - rr_offset += 16; + rr_offset += 16; /* Add Info (Prefix, Length...) to Match Prefix Part label */ proto_item_append_text(ti_mp, ": %s %s/%u (%u-%u)", val_to_str(opcode, rr_pco_mp_opcode_val, "Unknown %d"), tvb_ip6_to_str(tvb, rr_offset), matchlen, minlen, maxlen); - while ((int)tvb_reported_length(tvb) > rr_offset) { + while ((int)tvb_reported_length(tvb) > rr_offset) { /* Use-Prefix Part */ guint8 uselen, keeplen; @@ -2651,7 +2657,7 @@ dissect_rrenum(tvbuff_t *tvb, int rr_offset, packet_info *pinfo _U_, proto_tree /* KeepLen */ proto_tree_add_item(up_tree, hf_icmpv6_rr_pco_up_keeplen, tvb, rr_offset, 1, FALSE); keeplen = tvb_get_guint8(tvb, rr_offset); - rr_offset += 1; + rr_offset += 1; /* FlagMask */ ti = proto_tree_add_item(up_tree, hf_icmpv6_rr_pco_up_flagmask, tvb, rr_offset, 1, FALSE); @@ -2659,7 +2665,7 @@ dissect_rrenum(tvbuff_t *tvb, int rr_offset, packet_info *pinfo _U_, proto_tree proto_tree_add_item(flag_tree, hf_icmpv6_rr_pco_up_flagmask_l, tvb, rr_offset, 1, FALSE); proto_tree_add_item(flag_tree, hf_icmpv6_rr_pco_up_flagmask_a, tvb, rr_offset, 1, FALSE); proto_tree_add_item(flag_tree, hf_icmpv6_rr_pco_up_flagmask_reserved, tvb, rr_offset, 1, FALSE); - rr_offset += 1; + rr_offset += 1; /* RaFlags */ ti = proto_tree_add_item(up_tree, hf_icmpv6_rr_pco_up_raflags, tvb, rr_offset, 1, FALSE); @@ -2667,13 +2673,13 @@ dissect_rrenum(tvbuff_t *tvb, int rr_offset, packet_info *pinfo _U_, proto_tree proto_tree_add_item(flag_tree, hf_icmpv6_rr_pco_up_raflags_l, tvb, rr_offset, 1, FALSE); proto_tree_add_item(flag_tree, hf_icmpv6_rr_pco_up_raflags_a, tvb, rr_offset, 1, FALSE); proto_tree_add_item(flag_tree, hf_icmpv6_rr_pco_up_raflags_reserved, tvb, rr_offset, 1, FALSE); - rr_offset += 1; + rr_offset += 1; /* Valid Lifetime */ ti = proto_tree_add_item(up_tree, hf_icmpv6_rr_pco_up_validlifetime, tvb, rr_offset, 4, FALSE); switch(tvb_get_ntohl(tvb, rr_offset)){ case 0xffffffff: - proto_item_append_text(ti, " (Infinity)"); + proto_item_append_text(ti, " (Infinity)"); break; default: break; @@ -2684,12 +2690,12 @@ dissect_rrenum(tvbuff_t *tvb, int rr_offset, packet_info *pinfo _U_, proto_tree ti = proto_tree_add_item(up_tree, hf_icmpv6_rr_pco_up_preferredlifetime, tvb, rr_offset, 4, FALSE); switch(tvb_get_ntohl(tvb, rr_offset)){ case 0xffffffff: - proto_item_append_text(ti, " (Infinity)"); + proto_item_append_text(ti, " (Infinity)"); break; default: break; } - rr_offset += 4; + rr_offset += 4; /* Flags */ ti = proto_tree_add_item(up_tree, hf_icmpv6_rr_pco_up_flag, tvb, rr_offset, 4, FALSE); @@ -2697,20 +2703,20 @@ dissect_rrenum(tvbuff_t *tvb, int rr_offset, packet_info *pinfo _U_, proto_tree proto_tree_add_item(flag_tree, hf_icmpv6_rr_pco_up_flag_v, tvb, rr_offset, 4, FALSE); proto_tree_add_item(flag_tree, hf_icmpv6_rr_pco_up_flag_p, tvb, rr_offset, 4, FALSE); proto_tree_add_item(flag_tree, hf_icmpv6_rr_pco_up_flag_reserved, tvb, rr_offset, 4, FALSE); - rr_offset += 4; + rr_offset += 4; /* UsePrefix */ proto_tree_add_item(up_tree, hf_icmpv6_rr_pco_up_useprefix, tvb, rr_offset, 16, FALSE); - rr_offset += 16; + rr_offset += 16; /* Add Info (Prefix, Length...) to Use Prefix Part label */ proto_item_append_text(ti_up, ": %s/%u (keep %u)", tvb_ip6_to_str(tvb, rr_offset), uselen, keeplen); } - + }else if(icmp6_code == ICMP6_ROUTER_RENUMBERING_RESULT){ - while ((int)tvb_reported_length(tvb) > rr_offset) { + while ((int)tvb_reported_length(tvb) > rr_offset) { guint8 matchlen; - guint32 interfaceindex; + guint32 interfaceindex; /* Result Message */ ti_rm = proto_tree_add_item(tree, hf_icmpv6_rr_rm, tvb, rr_offset, 24, FALSE); @@ -2724,21 +2730,21 @@ dissect_rrenum(tvbuff_t *tvb, int rr_offset, packet_info *pinfo _U_, proto_tree proto_tree_add_item(flag_tree, hf_icmpv6_rr_rm_flag_reserved, tvb, rr_offset, 2, FALSE); rr_offset +=2; - /* Ordinal */ + /* Ordinal */ proto_tree_add_item(rm_tree, hf_icmpv6_rr_rm_ordinal, tvb, rr_offset, 1, FALSE); rr_offset +=1; - /* MatchLen */ + /* MatchLen */ proto_tree_add_item(rm_tree, hf_icmpv6_rr_rm_matchedlen, tvb, rr_offset, 1, FALSE); matchlen = tvb_get_guint8(tvb, rr_offset); rr_offset +=1; - /* InterfaceIndex */ + /* InterfaceIndex */ proto_tree_add_item(rm_tree, hf_icmpv6_rr_rm_interfaceindex, tvb, rr_offset, 4, FALSE); interfaceindex = tvb_get_ntohl(tvb, rr_offset); rr_offset +=4; - /* MatchedPrefix */ + /* MatchedPrefix */ proto_tree_add_item(rm_tree, hf_icmpv6_rr_rm_matchedprefix, tvb, rr_offset, 16, FALSE); rr_offset +=16; @@ -2775,7 +2781,7 @@ dissect_mldrv2( tvbuff_t *tvb, guint32 offset, packet_info *pinfo _U_, proto_tre ti_mar = proto_tree_add_item(tree, hf_icmpv6_mldr_mar, tvb, mldr_offset, -1, FALSE); mar_tree = proto_item_add_subtree(ti_mar, ett_icmpv6_mar); - + /* Record Type */ proto_tree_add_item(mar_tree, hf_icmpv6_mldr_mar_record_type, tvb, mldr_offset, 1, FALSE); record_type = tvb_get_guint8(tvb, mldr_offset); @@ -2795,13 +2801,13 @@ dissect_mldrv2( tvbuff_t *tvb, guint32 offset, packet_info *pinfo _U_, proto_tre proto_tree_add_item(mar_tree, hf_icmpv6_mldr_mar_multicast_address, tvb, mldr_offset, 16, FALSE); tvb_get_ipv6(tvb, mldr_offset, &multicast_address); mldr_offset += 16; - + /* Source Address */ - for (i=1; i <= nb_sources; i++){ + for (i=1; i <= nb_sources; i++){ proto_tree_add_item(mar_tree, hf_icmpv6_mldr_mar_source_address, tvb, mldr_offset, 16, FALSE); mldr_offset += 16; } - + /* Auxiliary Data ? */ if(aux_data_len) { @@ -2840,7 +2846,7 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) ti = proto_tree_add_item(tree, proto_icmpv6, tvb, offset, -1, FALSE); icmp6_tree = proto_item_add_subtree(ti, ett_icmpv6); - /* Type */ + /* Type */ proto_tree_add_item(icmp6_tree, hf_icmpv6_type, tvb, offset, 1, FALSE); } icmp6_type = tvb_get_guint8(tvb, offset); @@ -2849,7 +2855,7 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_add_str(pinfo->cinfo, COL_INFO, val_to_str(icmp6_type, icmpv6_type_val, "Unknown (%d)")); if (tree) { - /* Code */ + /* Code */ code_item = proto_tree_add_item(icmp6_tree, hf_icmpv6_code, tvb, offset, 1, FALSE); } @@ -2857,27 +2863,27 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += 1; switch (icmp6_type) { - case ICMP6_DST_UNREACH: - code_name = val_to_str(icmp6_code, icmpv6_unreach_code_val, "Unknown"); - break; - case ICMP6_TIME_EXCEEDED: - code_name = val_to_str(icmp6_code, icmpv6_timeex_code_val, "Unknown (%d)"); - break; - case ICMP6_PARAM_PROB: - code_name = val_to_str(icmp6_code, icmpv6_paramprob_code_val, "Unknown (%d)"); - break; - case ICMP6_ROUTER_RENUMBERING: - code_name = val_to_str(icmp6_code, icmpv6_rr_code_val, "Unknown (%d)"); - break; - case ICMP6_NI_QUERY: - code_name = val_to_str(icmp6_code, ni_query_code_val, "Unknown (%d)"); - break; - case ICMP6_NI_REPLY: - code_name = val_to_str(icmp6_code, ni_reply_code_val, "Unknown (%d)"); - break; - case ICMP6_RPL_CONTROL: - code_name = val_to_str(icmp6_code, rpl_code_val, "Unknown (%d)"); - break; + case ICMP6_DST_UNREACH: + code_name = val_to_str(icmp6_code, icmpv6_unreach_code_val, "Unknown"); + break; + case ICMP6_TIME_EXCEEDED: + code_name = val_to_str(icmp6_code, icmpv6_timeex_code_val, "Unknown (%d)"); + break; + case ICMP6_PARAM_PROB: + code_name = val_to_str(icmp6_code, icmpv6_paramprob_code_val, "Unknown (%d)"); + break; + case ICMP6_ROUTER_RENUMBERING: + code_name = val_to_str(icmp6_code, icmpv6_rr_code_val, "Unknown (%d)"); + break; + case ICMP6_NI_QUERY: + code_name = val_to_str(icmp6_code, ni_query_code_val, "Unknown (%d)"); + break; + case ICMP6_NI_REPLY: + code_name = val_to_str(icmp6_code, ni_reply_code_val, "Unknown (%d)"); + break; + case ICMP6_RPL_CONTROL: + code_name = val_to_str(icmp6_code, rpl_code_val, "Unknown (%d)"); + break; } if(code_name) @@ -2928,456 +2934,460 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) PROTO_ITEM_SET_GENERATED(hidden_item); proto_item_append_text(checksum_item, " [incorrect, should be 0x%04x]", in_cksum_shouldbe(cksum, computed_cksum)); - expert_add_info_format(pinfo, checksum_item, PI_CHECKSUM, PI_WARN, "ICMPv6 Checksum Incorrect, should be 0x%04x",in_cksum_shouldbe(cksum, computed_cksum)); + expert_add_info_format(pinfo, checksum_item, PI_CHECKSUM, PI_WARN, + "ICMPv6 Checksum Incorrect, should be 0x%04x", in_cksum_shouldbe(cksum, computed_cksum)); } } - + offset +=2; /* decode... */ switch (icmp6_type) { - case ICMP6_DST_UNREACH: /* Destination Unreachable (1) */ - case ICMP6_TIME_EXCEEDED: /* Time Exceeded (3) */ - /* Reserved */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 4, FALSE); - offset += 4; - - dissect_contained_icmpv6(tvb, offset, pinfo, icmp6_tree); - break; - case ICMP6_PACKET_TOO_BIG: /* Packet Too Big (2) */ - /* MTU */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_mtu, tvb, offset, 4, FALSE); - offset += 4; + case ICMP6_DST_UNREACH: /* Destination Unreachable (1) */ + case ICMP6_TIME_EXCEEDED: /* Time Exceeded (3) */ + /* Reserved */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 4, FALSE); + offset += 4; - dissect_contained_icmpv6(tvb, offset, pinfo, icmp6_tree); - break; - case ICMP6_PARAM_PROB: /* Parameter Problem (4) */ - /* MTU */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_pointer, tvb, offset, 4, FALSE); - offset += 4; + dissect_contained_icmpv6(tvb, offset, pinfo, icmp6_tree); + break; + case ICMP6_PACKET_TOO_BIG: /* Packet Too Big (2) */ + /* MTU */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_mtu, tvb, offset, 4, FALSE); + offset += 4; - dissect_contained_icmpv6(tvb, offset, pinfo, icmp6_tree); - break; - case ICMP6_ECHO_REQUEST: /* Echo Request (128) */ - case ICMP6_ECHO_REPLY: /* Echo Reply (129) */ - { - guint16 identifier, sequence; - /* Identifier */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_echo_identifier, tvb, offset, 2, FALSE); - identifier = tvb_get_ntohs(tvb, offset); - offset += 2; - - /* Sequence Number */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_echo_sequence_number, tvb, offset, 2, FALSE); - sequence = tvb_get_ntohs(tvb, offset); - offset += 2; - - col_append_fstr(pinfo->cinfo, COL_INFO, " id=0x%04x, seq=%u", identifier, sequence); - - if (pinfo->destport == 0x0dd8 && icmp6_type == ICMP6_ECHO_REQUEST) { - /* RFC 4380 - * 5.2.9. Direct IPv6 Connectivity Test - */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_nonce, tvb, offset, 4, FALSE); + dissect_contained_icmpv6(tvb, offset, pinfo, icmp6_tree); + break; + case ICMP6_PARAM_PROB: /* Parameter Problem (4) */ + /* MTU */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_pointer, tvb, offset, 4, FALSE); offset += 4; - } else { - next_tvb = tvb_new_subset(tvb, offset, -1, -1); - call_dissector(data_handle,next_tvb, pinfo, icmp6_tree); - } - break; - } - case ICMP6_MEMBERSHIP_QUERY: /* Multicast Listener Query (130) */ - case ICMP6_MEMBERSHIP_REPORT: /* Multicast Listener Report (131) */ - case ICMP6_MEMBERSHIP_REDUCTION: /* Multicast Listener Done (132) */ - { - /* It is MLDv2 packet ? (the min length for a MLDv2 packet is 28) */ - if ((icmp6_type == ICMP6_MEMBERSHIP_QUERY) && (length >= MLDV2_PACKET_MINLEN)) { - guint32 mrc; - guint16 qqi, i, nb_sources; - - /* Maximum Response Code */ - mrc = tvb_get_ntohs(tvb, offset); - if (mrc >= 32768){ - mrc = ((mrc & 0x0fff) | 0x1000) << (((mrc & 0x7000) >> 12) + 3); - } - proto_tree_add_uint(icmp6_tree, hf_icmpv6_mld_mrc, tvb, offset, 2, mrc); - offset += 2; - /* Reserved */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, FALSE); + dissect_contained_icmpv6(tvb, offset, pinfo, icmp6_tree); + break; + case ICMP6_ECHO_REQUEST: /* Echo Request (128) */ + case ICMP6_ECHO_REPLY: /* Echo Reply (129) */ + { + guint16 identifier, sequence; + /* Identifier */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_echo_identifier, tvb, offset, 2, FALSE); + identifier = tvb_get_ntohs(tvb, offset); offset += 2; - /* Multicast Address */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_multicast_address, tvb, offset, 16, FALSE); - offset += 16; + /* Sequence Number */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_echo_sequence_number, tvb, offset, 2, FALSE); + sequence = tvb_get_ntohs(tvb, offset); + offset += 2; - /* Flag */ - ti_flag = proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_flag, tvb, offset, 1, FALSE); - flag_tree = proto_item_add_subtree(ti_flag, ett_icmpv6_flag_mld); - proto_tree_add_item(flag_tree, hf_icmpv6_mld_flag_s, tvb, offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_mld_flag_qrv, tvb, offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_mld_flag_rsv, tvb, offset, 1, FALSE); - offset += 1; - - /* QQI */ - qqi = tvb_get_guint8(tvb, offset); - if (qqi >= 128){ - qqi = ((qqi & 0x0f) | 0x10) << (((qqi & 0x70) >> 4) + 3); + col_append_fstr(pinfo->cinfo, COL_INFO, " id=0x%04x, seq=%u", identifier, sequence); + + if (pinfo->destport == 0x0dd8 && icmp6_type == ICMP6_ECHO_REQUEST) { + /* RFC 4380 + * 5.2.9. Direct IPv6 Connectivity Test + */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_nonce, tvb, offset, 4, FALSE); + offset += 4; + } else { + next_tvb = tvb_new_subset(tvb, offset, -1, -1); + call_dissector(data_handle,next_tvb, pinfo, icmp6_tree); } - proto_tree_add_uint(icmp6_tree, hf_icmpv6_mld_qqi, tvb, offset, 1, qqi); - offset += 1; + break; + } + case ICMP6_MEMBERSHIP_QUERY: /* Multicast Listener Query (130) */ + case ICMP6_MEMBERSHIP_REPORT: /* Multicast Listener Report (131) */ + case ICMP6_MEMBERSHIP_REDUCTION: /* Multicast Listener Done (132) */ + { + /* It is MLDv2 packet ? (the min length for a MLDv2 packet is 28) */ + if ((icmp6_type == ICMP6_MEMBERSHIP_QUERY) && (length >= MLDV2_PACKET_MINLEN)) { + guint32 mrc; + guint16 qqi, i, nb_sources; + + /* Maximum Response Code */ + mrc = tvb_get_ntohs(tvb, offset); + if (mrc >= 32768){ + mrc = ((mrc & 0x0fff) | 0x1000) << (((mrc & 0x7000) >> 12) + 3); + } + proto_tree_add_uint(icmp6_tree, hf_icmpv6_mld_mrc, tvb, offset, 2, mrc); + offset += 2; - /* Number of Sources */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_nb_sources, tvb, offset, 2, FALSE); - nb_sources = tvb_get_ntohs(tvb, offset); - offset += 2; + /* Reserved */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, FALSE); + offset += 2; - /* Source Address */ - for (i=1; i <= nb_sources; i++){ - proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_source_address, tvb, offset, 16, FALSE); + /* Multicast Address */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_multicast_address, tvb, offset, 16, FALSE); offset += 16; - } - - }else{ /* It is a MLDv1 Packet */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_mrd, tvb, offset, 2, FALSE); - offset += 2; + /* Flag */ + ti_flag = proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_flag, tvb, offset, 1, FALSE); + flag_tree = proto_item_add_subtree(ti_flag, ett_icmpv6_flag_mld); + proto_tree_add_item(flag_tree, hf_icmpv6_mld_flag_s, tvb, offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_mld_flag_qrv, tvb, offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_mld_flag_rsv, tvb, offset, 1, FALSE); + offset += 1; + + /* QQI */ + qqi = tvb_get_guint8(tvb, offset); + if (qqi >= 128){ + qqi = ((qqi & 0x0f) | 0x10) << (((qqi & 0x70) >> 4) + 3); + } + proto_tree_add_uint(icmp6_tree, hf_icmpv6_mld_qqi, tvb, offset, 1, qqi); + offset += 1; + + /* Number of Sources */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_nb_sources, tvb, offset, 2, FALSE); + nb_sources = tvb_get_ntohs(tvb, offset); + offset += 2; + + /* Source Address */ + for (i=1; i <= nb_sources; i++){ + proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_source_address, tvb, offset, 16, FALSE); + offset += 16; + } + + }else{ /* It is a MLDv1 Packet */ + + proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_mrd, tvb, offset, 2, FALSE); + offset += 2; - /* Reserved */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, FALSE); - offset += 2; + /* Reserved */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, FALSE); + offset += 2; - /* Multicast Address */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_multicast_address, tvb, offset, 16, FALSE); - offset += 16; + /* Multicast Address */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_multicast_address, tvb, offset, 16, FALSE); + offset += 16; + } + break; } - break; - } - case ICMP6_ND_ROUTER_SOLICIT: /* Router Solicitation (133) */ - { - /* Reserved */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 4, FALSE); - offset += 4; + case ICMP6_ND_ROUTER_SOLICIT: /* Router Solicitation (133) */ + { + /* Reserved */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 4, FALSE); + offset += 4; - /* Show options */ - dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree); - break; - } - case ICMP6_ND_ROUTER_ADVERT: /* Router Advertisement (134) */ - { + /* Show options */ + dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree); + break; + } + case ICMP6_ND_ROUTER_ADVERT: /* Router Advertisement (134) */ + { - /* Current hop limit */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_ra_cur_hop_limit, tvb, offset, 1, FALSE); - offset += 1; + /* Current hop limit */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_ra_cur_hop_limit, tvb, offset, 1, FALSE); + offset += 1; - /* Flags */ - ti_flag = proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_ra_flag, tvb, offset, 1, FALSE); - flag_tree = proto_item_add_subtree(ti_flag, ett_icmpv6_flag_ra); - - proto_tree_add_item(flag_tree, hf_icmpv6_nd_ra_flag_m, tvb, offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_nd_ra_flag_o, tvb, offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_nd_ra_flag_h, tvb, offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_nd_ra_flag_prf, tvb, offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_nd_ra_flag_p, tvb, offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_nd_ra_flag_rsv, tvb, offset, 1, FALSE); - offset += 1; + /* Flags */ + ti_flag = proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_ra_flag, tvb, offset, 1, FALSE); + flag_tree = proto_item_add_subtree(ti_flag, ett_icmpv6_flag_ra); - /* Router lifetime */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_ra_router_lifetime, tvb, offset, 2, FALSE); - offset += 2; + proto_tree_add_item(flag_tree, hf_icmpv6_nd_ra_flag_m, tvb, offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_nd_ra_flag_o, tvb, offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_nd_ra_flag_h, tvb, offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_nd_ra_flag_prf, tvb, offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_nd_ra_flag_p, tvb, offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_nd_ra_flag_rsv, tvb, offset, 1, FALSE); + offset += 1; - /* Reachable time */ - proto_tree_add_uint(icmp6_tree, hf_icmpv6_nd_ra_reachable_time, tvb, offset, 4, FALSE); - offset += 4; + /* Router lifetime */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_ra_router_lifetime, tvb, offset, 2, FALSE); + offset += 2; - /* Retrans timer */ - proto_tree_add_uint(icmp6_tree, hf_icmpv6_nd_ra_retrans_timer, tvb, offset, 4, FALSE); - offset += 4; + /* Reachable time */ + proto_tree_add_uint(icmp6_tree, hf_icmpv6_nd_ra_reachable_time, tvb, offset, 4, FALSE); + offset += 4; - /* Show options */ - dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree); - break; - } - case ICMP6_ND_NEIGHBOR_SOLICIT: /* Neighbor Solicitation (135) */ - { - /* Reserved */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 4, FALSE); - offset += 4; + /* Retrans timer */ + proto_tree_add_uint(icmp6_tree, hf_icmpv6_nd_ra_retrans_timer, tvb, offset, 4, FALSE); + offset += 4; - /* Target Address */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_ns_target_address, tvb, offset, 16, FALSE); - col_append_fstr(pinfo->cinfo, COL_INFO, " for %s", tvb_ip6_to_str(tvb, offset)); + /* Show options */ + dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree); + break; + } + case ICMP6_ND_NEIGHBOR_SOLICIT: /* Neighbor Solicitation (135) */ + { + /* Reserved */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 4, FALSE); + offset += 4; - offset += 16; + /* Target Address */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_ns_target_address, tvb, offset, 16, FALSE); + col_append_fstr(pinfo->cinfo, COL_INFO, " for %s", tvb_ip6_to_str(tvb, offset)); - /* Show options */ - dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree); - break; - } - case ICMP6_ND_NEIGHBOR_ADVERT: /* Neighbor Advertisement (136) */ - { - guint32 na_flags; - emem_strbuf_t *flags_strbuf = ep_strbuf_new_label(""); + offset += 16; - /* Flags */ - ti_flag = proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_na_flag, tvb, offset, 4, FALSE); - flag_tree = proto_item_add_subtree(ti_flag, ett_icmpv6_flag_na); - proto_tree_add_item(flag_tree, hf_icmpv6_nd_na_flag_r, tvb, offset, 4, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_nd_na_flag_s, tvb, offset, 4, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_nd_na_flag_o, tvb, offset, 4, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_nd_na_flag_rsv, tvb, offset, 4, FALSE); - na_flags = tvb_get_ntohl(tvb, offset); - offset += 4; + /* Show options */ + dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree); + break; + } + case ICMP6_ND_NEIGHBOR_ADVERT: /* Neighbor Advertisement (136) */ + { + guint32 na_flags; + emem_strbuf_t *flags_strbuf = ep_strbuf_new_label(""); + + /* Flags */ + ti_flag = proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_na_flag, tvb, offset, 4, FALSE); + flag_tree = proto_item_add_subtree(ti_flag, ett_icmpv6_flag_na); + proto_tree_add_item(flag_tree, hf_icmpv6_nd_na_flag_r, tvb, offset, 4, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_nd_na_flag_s, tvb, offset, 4, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_nd_na_flag_o, tvb, offset, 4, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_nd_na_flag_rsv, tvb, offset, 4, FALSE); + na_flags = tvb_get_ntohl(tvb, offset); + offset += 4; - /* Target Address */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_na_target_address, tvb, offset, 16, FALSE); + /* Target Address */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_na_target_address, tvb, offset, 16, FALSE); - if (na_flags & ND_NA_FLAG_R) { - ep_strbuf_append(flags_strbuf, "rtr, "); - } - if (na_flags & ND_NA_FLAG_S) { - ep_strbuf_append(flags_strbuf, "sol, "); - } - if (na_flags & ND_NA_FLAG_O) { - ep_strbuf_append(flags_strbuf, "ovr, "); - } - if (flags_strbuf->len > 2) { - ep_strbuf_truncate(flags_strbuf, flags_strbuf->len - 2); - } else { - ep_strbuf_printf(flags_strbuf, "none"); - } + if (na_flags & ND_NA_FLAG_R) { + ep_strbuf_append(flags_strbuf, "rtr, "); + } + if (na_flags & ND_NA_FLAG_S) { + ep_strbuf_append(flags_strbuf, "sol, "); + } + if (na_flags & ND_NA_FLAG_O) { + ep_strbuf_append(flags_strbuf, "ovr, "); + } + if (flags_strbuf->len > 2) { + ep_strbuf_truncate(flags_strbuf, flags_strbuf->len - 2); + } else { + ep_strbuf_printf(flags_strbuf, "none"); + } - col_append_fstr(pinfo->cinfo, COL_INFO, " %s (%s)", tvb_ip6_to_str(tvb, offset), flags_strbuf->str); - offset += 16; + col_append_fstr(pinfo->cinfo, COL_INFO, " %s (%s)", tvb_ip6_to_str(tvb, offset), flags_strbuf->str); + offset += 16; - /* Show options */ - dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree); - break; - } - case ICMP6_ND_REDIRECT: /* Redirect Message (137) */ - { - /* Reserved */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 4, FALSE); - offset += 4; + /* Show options */ + dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree); + break; + } + case ICMP6_ND_REDIRECT: /* Redirect Message (137) */ + { + /* Reserved */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 4, FALSE); + offset += 4; - /* Target Address */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_rd_target_address, tvb, offset, 16, FALSE); - offset += 16; + /* Target Address */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_rd_target_address, tvb, offset, 16, FALSE); + offset += 16; - /* Destination Address */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_rd_destination_address, tvb, offset, 16, FALSE); - offset += 16; + /* Destination Address */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_rd_destination_address, tvb, offset, 16, FALSE); + offset += 16; - /* Show options */ - dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree); - break; - } - case ICMP6_ROUTER_RENUMBERING: /* Router Renumbering (138) */ - { - dissect_rrenum(tvb, offset, pinfo, icmp6_tree, icmp6_type, icmp6_code); - break; - } - case ICMP6_NI_QUERY: /* ICMP Node Information Query (139) */ - case ICMP6_NI_REPLY: /* ICMP Node Information Response (140) */ - { - dissect_nodeinfo(tvb, offset, pinfo, icmp6_tree, icmp6_type, icmp6_code); - break; - } - case ICMP6_IND_SOLICIT: /* Inverse Neighbor Discovery Solicitation Message (141) */ - case ICMP6_IND_ADVERT: /* Inverse Neighbor Discovery Advertisement Message (142) */ - { - /* Reserved */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 4, FALSE); - offset += 4; + /* Show options */ + dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree); + break; + } + case ICMP6_ROUTER_RENUMBERING: /* Router Renumbering (138) */ + { + dissect_rrenum(tvb, offset, pinfo, icmp6_tree, icmp6_type, icmp6_code); + break; + } + case ICMP6_NI_QUERY: /* ICMP Node Information Query (139) */ + case ICMP6_NI_REPLY: /* ICMP Node Information Response (140) */ + { + dissect_nodeinfo(tvb, offset, pinfo, icmp6_tree, icmp6_type, icmp6_code); + break; + } + case ICMP6_IND_SOLICIT: /* Inverse Neighbor Discovery Solicitation Message (141) */ + case ICMP6_IND_ADVERT: /* Inverse Neighbor Discovery Advertisement Message (142) */ + { + /* Reserved */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 4, FALSE); + offset += 4; - /* Show options */ - dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree); - break; - } - case ICMP6_MLDV2_REPORT: /* Version 2 Multicast Listener Report (143) */ - { - dissect_mldrv2( tvb, offset, pinfo, icmp6_tree ); - break; - } - case ICMP6_MIP6_DHAAD_REQUEST: /* Home Agent Address Discovery Request Message (144) */ - { - /* Identifier */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_identifier, tvb, offset, 2, FALSE); - offset += 2; + /* Show options */ + dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree); + break; + } + case ICMP6_MLDV2_REPORT: /* Version 2 Multicast Listener Report (143) */ + { + dissect_mldrv2( tvb, offset, pinfo, icmp6_tree ); + break; + } + case ICMP6_MIP6_DHAAD_REQUEST: /* Home Agent Address Discovery Request Message (144) */ + { + /* Identifier */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_identifier, tvb, offset, 2, FALSE); + offset += 2; - /* Reserved */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, FALSE); - offset += 2; + /* Reserved */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, FALSE); + offset += 2; - break; - } - case ICMP6_MIP6_DHAAD_REPLY: /* Home Agent Address Discovery Reply Message (145) */ - { - /* Identifier */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_identifier, tvb, offset, 2, FALSE); - offset += 2; + break; + } + case ICMP6_MIP6_DHAAD_REPLY: /* Home Agent Address Discovery Reply Message (145) */ + { + /* Identifier */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_identifier, tvb, offset, 2, FALSE); + offset += 2; - /* Reserved */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, FALSE); - offset += 2; + /* Reserved */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, FALSE); + offset += 2; - /* Show all Home Agent Addresses */ - while((int)length > offset) - { - proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_home_agent_address, tvb, offset, 16, FALSE); - offset += 16; + /* Show all Home Agent Addresses */ + while((int)length > offset) + { + proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_home_agent_address, tvb, offset, 16, FALSE); + offset += 16; + } + break; } - break; - } - case ICMP6_MIP6_MPS: /* Mobile Prefix Solicitation (146) */ - { - /* Identifier */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_identifier, tvb, offset, 2, FALSE); - offset += 2; + case ICMP6_MIP6_MPS: /* Mobile Prefix Solicitation (146) */ + { + /* Identifier */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_identifier, tvb, offset, 2, FALSE); + offset += 2; - /* Reserved */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, FALSE); - offset += 2; - break; - } - case ICMP6_MIP6_MPA: /* Mobile Prefix Advertisement (147) */ - { - /* Identifier */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_identifier, tvb, offset, 2, FALSE); - offset += 2; - - /* Flag */ - ti_flag = proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_flag, tvb,offset, 6, FALSE); - flag_tree = proto_item_add_subtree(ti_flag, ett_icmpv6_flag_mip6); - proto_tree_add_item(flag_tree, hf_icmpv6_mip6_flag_m, tvb, offset, 2, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_mip6_flag_o, tvb, offset, 2, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_mip6_flag_rsv, tvb, offset, 2, FALSE); - offset += 2; - - /* Show options */ - dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree); - break; - } - case ICMP6_CERT_PATH_SOL: /* Certification Path Solicitation Message (148) */ - { + /* Reserved */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, FALSE); + offset += 2; + break; + } + case ICMP6_MIP6_MPA: /* Mobile Prefix Advertisement (147) */ + { + /* Identifier */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_identifier, tvb, offset, 2, FALSE); + offset += 2; - /* Identifier */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_send_identifier, tvb, offset, 2, FALSE); - offset += 2; + /* Flag */ + ti_flag = proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_flag, tvb,offset, 6, FALSE); + flag_tree = proto_item_add_subtree(ti_flag, ett_icmpv6_flag_mip6); + proto_tree_add_item(flag_tree, hf_icmpv6_mip6_flag_m, tvb, offset, 2, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_mip6_flag_o, tvb, offset, 2, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_mip6_flag_rsv, tvb, offset, 2, FALSE); + offset += 2; - /* Component */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_send_component, tvb, offset, 2, FALSE); - offset += 2; + /* Show options */ + dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree); + break; + } + case ICMP6_CERT_PATH_SOL: /* Certification Path Solicitation Message (148) */ + { - /* Show options */ - dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree); - break; - } - case ICMP6_CERT_PATH_AD: /* Certification Path Advertisement Message (149) */ - { + /* Identifier */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_send_identifier, tvb, offset, 2, FALSE); + offset += 2; - /* Identifier */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_send_identifier, tvb, offset, 2, FALSE); - offset += 2; + /* Component */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_send_component, tvb, offset, 2, FALSE); + offset += 2; - /* All Components */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_send_all_components, tvb, offset, 2, FALSE); - offset += 2; + /* Show options */ + dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree); + break; + } + case ICMP6_CERT_PATH_AD: /* Certification Path Advertisement Message (149) */ + { - /* Component */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_send_component, tvb, offset, 2, FALSE); - offset += 2; + /* Identifier */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_send_identifier, tvb, offset, 2, FALSE); + offset += 2; - /* Reserved */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, FALSE); - offset += 2; + /* All Components */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_send_all_components, tvb, offset, 2, FALSE); + offset += 2; - /* Show options */ - dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree); - break; - } - case ICMP6_EXPERIMENTAL_MOBILITY: /* ICMP messages utilized by experimental mobility protocols (150) */ - case ICMP6_FMIPV6_MESSAGES: /* FMIPv6 Messages (154)*/ - { - guint8 subtype; + /* Component */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_send_component, tvb, offset, 2, FALSE); + offset += 2; - /* Subtype */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_fmip6_subtype, tvb, offset, 1, FALSE); - subtype = tvb_get_guint8(tvb, offset); - col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", val_to_str(subtype, fmip6_subtype_val, "Unknown (%d)")); - offset += 1; + /* Reserved */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, FALSE); + offset += 2; - switch(subtype){ - case FMIP6_SUBTYPE_RTSOLPR: - { - /* Reserved */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 1, FALSE); - } + /* Show options */ + dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree); break; - case FMIP6_SUBTYPE_PRRTADV: - { - proto_item_append_text(code_item, " (%s)", val_to_str(icmp6_code, fmip6_prrtadv_code_val, "Unknown %d") ); - /* Reserved */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 1, FALSE); + } + case ICMP6_EXPERIMENTAL_MOBILITY: /* ICMP messages utilized by experimental mobility protocols (150) */ + case ICMP6_FMIPV6_MESSAGES: /* FMIPv6 Messages (154)*/ + { + guint8 subtype; + + /* Subtype */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_fmip6_subtype, tvb, offset, 1, FALSE); + subtype = tvb_get_guint8(tvb, offset); + col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", val_to_str(subtype, fmip6_subtype_val, "Unknown (%d)")); + offset += 1; + + switch(subtype){ + case FMIP6_SUBTYPE_RTSOLPR: + { + /* Reserved */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 1, FALSE); + } + break; + case FMIP6_SUBTYPE_PRRTADV: + { + proto_item_append_text(code_item, " (%s)", val_to_str(icmp6_code, fmip6_prrtadv_code_val, "Unknown %d") ); + /* Reserved */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 1, FALSE); + } + break; + case FMIP6_SUBTYPE_HI: + { + proto_item_append_text(code_item, " (%s)", val_to_str(icmp6_code, fmip6_hi_code_val, "Unknown %d") ); + /* Flags */ + ti_flag = proto_tree_add_item(icmp6_tree, hf_icmpv6_fmip6_hi_flag, tvb, offset, 1, FALSE); + flag_tree = proto_item_add_subtree(ti_flag, ett_icmpv6_flag_fmip6); + + proto_tree_add_item(flag_tree, hf_icmpv6_fmip6_hi_flag_s, tvb, offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_fmip6_hi_flag_u, tvb, offset, 1, FALSE); + proto_tree_add_item(flag_tree, hf_icmpv6_fmip6_hi_flag_reserved, tvb, offset, 1, FALSE); + } + break; + case FMIP6_SUBTYPE_HACK: + { + proto_item_append_text(code_item, " (%s)", val_to_str(icmp6_code, fmip6_hack_code_val, "Unknown %d") ); + /* Reserved */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 1, FALSE); + } + break; } + offset +=1; + + /* Identifier */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_fmip6_identifier, tvb, offset, 2, FALSE); + offset += 2; + + /* Show options */ + dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree); break; - case FMIP6_SUBTYPE_HI: - { - proto_item_append_text(code_item, " (%s)", val_to_str(icmp6_code, fmip6_hi_code_val, "Unknown %d") ); - /* Flags */ - ti_flag = proto_tree_add_item(icmp6_tree, hf_icmpv6_fmip6_hi_flag, tvb, offset, 1, FALSE); - flag_tree = proto_item_add_subtree(ti_flag, ett_icmpv6_flag_fmip6); - - proto_tree_add_item(flag_tree, hf_icmpv6_fmip6_hi_flag_s, tvb, offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_fmip6_hi_flag_u, tvb, offset, 1, FALSE); - proto_tree_add_item(flag_tree, hf_icmpv6_fmip6_hi_flag_reserved, tvb, offset, 1, FALSE); - } + } + case ICMP6_MCAST_ROUTER_ADVERT: /* Multicast Router Advertisement (151) */ + { + /* Query Interval */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_mcast_ra_query_interval, tvb, offset, 2, FALSE); + offset += 2; + + /* Robustness Variable */ + proto_tree_add_item(icmp6_tree, hf_icmpv6_mcast_ra_robustness_variable, tvb, offset, 2, FALSE); + offset += 2; + } + case ICMP6_MCAST_ROUTER_SOLICIT: /* Multicast Router Solicitation (152) */ + case ICMP6_MCAST_ROUTER_TERM: /* Multicast Router Termination (153) */ + { + /* No Action... */ break; - case FMIP6_SUBTYPE_HACK: - { - proto_item_append_text(code_item, " (%s)", val_to_str(icmp6_code, fmip6_hack_code_val, "Unknown %d") ); - /* Reserved */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 1, FALSE); - } + } + case ICMP6_RPL_CONTROL: /* RPL Control (155) */ + { + /* RPL: draft-ietf-roll-rpl-17.txt: Routing over Low-Power and Lossy Networks. */ + dissect_rpl_control(tvb, offset, pinfo, icmp6_tree, icmp6_type, icmp6_code); break; } - offset +=1; - - /* Identifier */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_fmip6_identifier, tvb, offset, 2, FALSE); - offset += 2; - - /* Show options */ - dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree); - break; - } - case ICMP6_MCAST_ROUTER_ADVERT: /* Multicast Router Advertisement (151) */ - { - /* Query Interval */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_mcast_ra_query_interval, tvb, offset, 2, FALSE); - offset += 2; - - /* Robustness Variable */ - proto_tree_add_item(icmp6_tree, hf_icmpv6_mcast_ra_robustness_variable, tvb, offset, 2, FALSE); - offset += 2; - } - case ICMP6_MCAST_ROUTER_SOLICIT: /* Multicast Router Solicitation (152) */ - case ICMP6_MCAST_ROUTER_TERM: /* Multicast Router Termination (153) */ - { - /* No Action... */ - break; - } - case ICMP6_RPL_CONTROL: /* RPL Control (155) */ - { - /* RPL: draft-ietf-roll-rpl-17.txt: Routing over Low-Power and Lossy Networks. */ - dissect_rpl_control(tvb, offset, pinfo, icmp6_tree, icmp6_type, icmp6_code); - break; - } - default: - expert_add_info_format(pinfo, ti, PI_UNDECODED, PI_NOTE, "Dissector for ICMPv6 Type (%d) code not implemented, Contact Wireshark developers if you want this supported", icmp6_type); - proto_tree_add_item(icmp6_tree, hf_icmpv6_data, tvb, offset, -1, FALSE); - break; + default: + expert_add_info_format(pinfo, ti, PI_UNDECODED, PI_NOTE, + "Dissector for ICMPv6 Type (%d)" + " code not implemented, Contact Wireshark" + " developers if you want this supported", icmp6_type); + proto_tree_add_item(icmp6_tree, hf_icmpv6_data, tvb, offset, -1, FALSE); + break; } /* switch (icmp6_type) */ } /* if (tree) */ } @@ -3419,7 +3429,7 @@ proto_register_icmpv6(void) { &hf_icmpv6_nonce, { "Nonce", "icmpv6.nonce", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, - /* RFC 2461/4861 : Neighbor Discovery for IP version 6 (IPv6) */ + /* RFC 2461/4861 : Neighbor Discovery for IP version 6 (IPv6) */ { &hf_icmpv6_nd_ra_cur_hop_limit, { "Cur hop limit", "icmpv6.nd.ra.cur_hop_limit", FT_UINT8, BASE_DEC, NULL, 0x0, "The default value that should be placed in the Hop Count field of the IP header for outgoing IP packets", HFILL }}, @@ -3513,28 +3523,28 @@ proto_register_icmpv6(void) { &hf_icmpv6_opt_target_linkaddr_mac, { "Target Link-layer address", "icmpv6.opt.target_linkaddr", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }}, - { &hf_icmpv6_opt_prefix_len, + { &hf_icmpv6_opt_prefix_len, { "Prefix Length", "icmpv6.opt.prefix.length", FT_UINT8, BASE_DEC, NULL, 0x0, "The number of leading bits in the Prefix that are valid", HFILL }}, - { &hf_icmpv6_opt_prefix_flag, + { &hf_icmpv6_opt_prefix_flag, { "Flag", "icmpv6.opt.prefix.flag", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL }}, - { &hf_icmpv6_opt_prefix_flag_l, + { &hf_icmpv6_opt_prefix_flag_l, { "On-link flag(L)", "icmpv6.opt.prefix.flag.l", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80, "When set, indicates that this prefix can be used for on-link determination", HFILL }}, - { &hf_icmpv6_opt_prefix_flag_a, + { &hf_icmpv6_opt_prefix_flag_a, { "Autonomous address-configuration flag(A)", "icmpv6.opt.prefix.flag.a", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40, "When set indicates that this prefix can be used for stateless address configuration", HFILL }}, - { &hf_icmpv6_opt_prefix_flag_reserved, + { &hf_icmpv6_opt_prefix_flag_reserved, { "Reserved", "icmpv6.opt.prefix.flag.reserved", FT_UINT8, BASE_DEC, NULL, 0x3f, NULL, HFILL }}, - { &hf_icmpv6_opt_prefix_valid_lifetime, + { &hf_icmpv6_opt_prefix_valid_lifetime, { "Valid Lifetime", "icmpv6.opt.prefix.valid_lifetime", FT_UINT32, BASE_DEC, NULL, 0x00, "The length of time in seconds that the prefix is valid for the purpose of on-link determination", HFILL }}, - { &hf_icmpv6_opt_prefix_preferred_lifetime, + { &hf_icmpv6_opt_prefix_preferred_lifetime, { "Preferred Lifetime", "icmpv6.opt.prefix.preferred_lifetime", FT_UINT32, BASE_DEC, NULL, 0x00, "The length of time in seconds that addresses generated from the prefix via stateless address autoconfiguration remain preferred", HFILL }}, - { &hf_icmpv6_opt_prefix, + { &hf_icmpv6_opt_prefix, { "Prefix", "icmpv6.opt.prefix", FT_IPv6, BASE_NONE, NULL, 0x00, "An IP address or a prefix of an IP address", HFILL }}, { &hf_icmpv6_opt_cga_pad_len, @@ -3576,39 +3586,39 @@ proto_register_icmpv6(void) { &hf_icmpv6_opt_certificate_padding, { "Certificat and Padding", "icmpv6.opt.certificate_padding", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, - { &hf_icmpv6_opt_ipa_option_code, + { &hf_icmpv6_opt_ipa_option_code, { "Option-code", "icmpv6.opt.ipa.option_code", FT_UINT8, BASE_DEC, VALS(nd_opt_ipa_option_code_val), 0x00, NULL, HFILL }}, - { &hf_icmpv6_opt_ipa_prefix_len, + { &hf_icmpv6_opt_ipa_prefix_len, { "Prefix Length", "icmpv6.opt.ipa.prefix_len", FT_UINT8, BASE_DEC, NULL, 0x00, "That indicates the length of the IPv6 Address Prefix", HFILL }}, - { &hf_icmpv6_opt_ipa_ipv6_address, + { &hf_icmpv6_opt_ipa_ipv6_address, { "IPv6 Address", "icmpv6.opt.ipa.ipv6_address", FT_IPv6, BASE_NONE, NULL, 0x00, "The IP address/prefix defined by the Option-Code field", HFILL }}, - { &hf_icmpv6_opt_nrpi_option_code, + { &hf_icmpv6_opt_nrpi_option_code, { "Option-code", "icmpv6.opt.nrpi.option_code", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }}, - { &hf_icmpv6_opt_nrpi_prefix_len, + { &hf_icmpv6_opt_nrpi_prefix_len, { "Prefix Length", "icmpv6.opt.nrpi.prefix_len", FT_UINT8, BASE_DEC, NULL, 0x00, "The number of leading bits in the Prefix that are valid", HFILL }}, - { &hf_icmpv6_opt_nrpi_prefix, + { &hf_icmpv6_opt_nrpi_prefix, { "Prefix", "icmpv6.opt.nrpi.prefix", FT_IPv6, BASE_NONE, NULL, 0x00, "An IP address or a prefix of an IP address", HFILL }}, - { &hf_icmpv6_opt_lla_option_code, + { &hf_icmpv6_opt_lla_option_code, { "Option-code", "icmpv6.opt.lla.option_code", FT_UINT8, BASE_DEC, VALS(nd_opt_lla_option_code_val), 0x00, NULL, HFILL }}, - { &hf_icmpv6_opt_lla_bytes, + { &hf_icmpv6_opt_lla_bytes, { "Link-Layer Address", "icmpv6.opt.lla.bytes", FT_BYTES, BASE_NONE, NULL, 0x00, "(in Bytes Format)", HFILL }}, - { &hf_icmpv6_opt_naack_option_code, + { &hf_icmpv6_opt_naack_option_code, { "Option-Code", "icmpv6.opt.naack.option_code", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }}, - { &hf_icmpv6_opt_naack_status, + { &hf_icmpv6_opt_naack_status, { "Status", "icmpv6.opt.naack.status", FT_UINT8, BASE_DEC, VALS(nd_opt_naack_status_val), 0x00, "Indicating the disposition of the Unsolicited Neighbor Advertisement message", HFILL }}, - { &hf_icmpv6_opt_naack_supplied_ncoa, + { &hf_icmpv6_opt_naack_supplied_ncoa, { "Supplied NCoA", "icmpv6.opt.naack.supplied_ncoa", FT_IPv6, BASE_NONE, NULL, 0x00, - NULL, HFILL }}, + NULL, HFILL }}, { &hf_icmpv6_opt_map_dist, { "Distance", "icmpv6.opt.map.distance", FT_UINT8, BASE_DEC, NULL, 0xF0, "Identifying the distance between MAP and the receiver of the advertisement (in the number of hops)", HFILL }}, @@ -3630,16 +3640,16 @@ proto_register_icmpv6(void) { &hf_icmpv6_opt_map_global_address, { "Global Address", "icmpv6.opt.map.global_address", FT_IPv6, BASE_NONE, NULL, 0x0, "TOne of the MAP's global addresses", HFILL }}, - { &hf_icmpv6_opt_route_info_flag, + { &hf_icmpv6_opt_route_info_flag, { "Flag", "icmpv6.opt.route_info.flag", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL }}, - { &hf_icmpv6_opt_route_info_flag_route_preference, + { &hf_icmpv6_opt_route_info_flag_route_preference, { "Route Preference", "icmpv6.opt.route_info.flag.route_preference", FT_UINT8, BASE_DEC, VALS(nd_flag_router_pref), ND_RA_FLAG_RTPREF_MASK, "The Route Preference indicates whether to prefer the router associated with this prefix over others", HFILL }}, - { &hf_icmpv6_opt_route_info_flag_reserved, + { &hf_icmpv6_opt_route_info_flag_reserved, { "Reserved", "icmpv6.opt.route_info.flag.reserved", FT_UINT8, BASE_DEC, NULL, ND_RA_FLAG_RESERV_MASK, "Must be 0", HFILL }}, - { &hf_icmpv6_opt_route_lifetime, + { &hf_icmpv6_opt_route_lifetime, { "Route Lifetime", "icmpv6.opt.route_lifetime", FT_UINT32, BASE_DEC, NULL, 0x00, "The length of time in seconds that the prefix is valid for the purpose of route determination", HFILL }}, { &hf_icmpv6_opt_name_type, @@ -3877,25 +3887,25 @@ proto_register_icmpv6(void) { "FlagMask", "icmpv6.rr.pco.up.flagmask", FT_UINT8, BASE_HEX, NULL, 0x0, "A 1 bit in any position means that the corresponding flag bit in a Router Advertisement (RA) Prefix Information Option for the New Prefix should be set from the RAFlags field in this Use-Prefix Part", HFILL }}, - { &hf_icmpv6_rr_pco_up_flagmask_l, + { &hf_icmpv6_rr_pco_up_flagmask_l, { "On-link flag(L)", "icmpv6.rr.pco.up.flagmask.l", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80, "When set, indicates the On-link (L) flag bit in a Router Advertisement (RA) Prefix Information Option for the New Prefix should be set from the RAFlags field in this Use-Prefix Part", HFILL }}, - { &hf_icmpv6_rr_pco_up_flagmask_a, + { &hf_icmpv6_rr_pco_up_flagmask_a, { "Autonomous address-configuration flag(A)", "icmpv6.rr.pco.up.flagmask.a", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40, "When set, indicates the Autonomous address-configuration (A) flag bit in a Router Advertisement (RA) Prefix Information Option for the New Prefix should be set from the RAFlags field in this Use-Prefix Part", HFILL }}, - { &hf_icmpv6_rr_pco_up_flagmask_reserved, + { &hf_icmpv6_rr_pco_up_flagmask_reserved, { "Reserved", "icmpv6.rr.pco.up.flagmask.reserved", FT_UINT8, BASE_DEC, NULL, 0x3f, NULL, HFILL }}, { &hf_icmpv6_rr_pco_up_raflags, { "RAFlags", "icmpv6.rr.pco.up.raflags", FT_UINT8, BASE_HEX, NULL, 0x0, "Under control of the FlagMask field, may be used to initialize the flags in Router Advertisement Prefix Information Options which advertise the New Prefix", HFILL }}, - { &hf_icmpv6_rr_pco_up_raflags_l, + { &hf_icmpv6_rr_pco_up_raflags_l, { "On-link flag(L)", "icmpv6.rr.pco.up.flagmask.l", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80, "When set, indicates that this prefix can be used for on-link determination", HFILL }}, - { &hf_icmpv6_rr_pco_up_raflags_a, + { &hf_icmpv6_rr_pco_up_raflags_a, { "Autonomous address-configuration flag(A)", "icmpv6.rr.pco.up.flagmask.a", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40, "When set indicates that this prefix can be used for stateless address configuration", HFILL }}, - { &hf_icmpv6_rr_pco_up_raflags_reserved, + { &hf_icmpv6_rr_pco_up_raflags_reserved, { "Reserved", "icmpv6.rr.pco.up.flagmask.reserved", FT_UINT8, BASE_DEC, NULL, 0x3f, NULL, HFILL }}, { &hf_icmpv6_rr_pco_up_validlifetime, @@ -3907,13 +3917,13 @@ proto_register_icmpv6(void) { &hf_icmpv6_rr_pco_up_flag, { "Flags", "icmpv6.rr.pco.up.flag", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_icmpv6_rr_pco_up_flag_v, + { &hf_icmpv6_rr_pco_up_flag_v, { "Decrement valid lifetime", "icmpv6.rr.pco.up.flag.v", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x80000000, "When set, indicating that the valid lifetime of the New Prefix MUST be effectively decremented in real time", HFILL }}, - { &hf_icmpv6_rr_pco_up_flag_p, + { &hf_icmpv6_rr_pco_up_flag_p, { "Decrement preferred lifetime", "icmpv6.rr.pco.up.flag.p", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x40000000, "When set, indicating that the preferred lifetime of the New Prefix MUST be effectively decremented in real time", HFILL }}, - { &hf_icmpv6_rr_pco_up_flag_reserved, + { &hf_icmpv6_rr_pco_up_flag_reserved, { "Reserved", "icmpv6.rr.pco.up.flag.reserved", FT_UINT32, BASE_DEC, NULL, 0x3FFFFFFF, NULL, HFILL }}, { &hf_icmpv6_rr_pco_up_useprefix, @@ -3925,13 +3935,13 @@ proto_register_icmpv6(void) { &hf_icmpv6_rr_rm_flag, { "Flags", "icmpv6.rr.rm.flag", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_icmpv6_rr_rm_flag_b, + { &hf_icmpv6_rr_rm_flag_b, { "Bounds", "icmpv6.rr.rm.flag.b", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0002, "When set, indicates that one or more fields in the associated PCO were out of bounds", HFILL }}, - { &hf_icmpv6_rr_rm_flag_f, + { &hf_icmpv6_rr_rm_flag_f, { "Forbidden", "icmpv6.rr.rm.flag.f", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0001, "When set, indicates that one or more Use-Prefix parts from the associated PCO were not honored by the router because of attempted formation of a forbidden prefix format, such as a multicast or loopback address", HFILL }}, - { &hf_icmpv6_rr_rm_flag_reserved, + { &hf_icmpv6_rr_rm_flag_reserved, { "Reserved", "icmpv6.rr.rm.flag.reserved", FT_UINT16, BASE_DEC, NULL, 0xFFFD, "Must be Zero", HFILL }}, { &hf_icmpv6_rr_rm_ordinal, @@ -4020,16 +4030,16 @@ proto_register_icmpv6(void) { &hf_icmpv6_fmip6_subtype, { "Subtype", "icmpv6.fmip6.subtype", FT_UINT8, BASE_DEC, VALS(fmip6_subtype_val), 0x0, "Designates the Subtype of information", HFILL }}, - { &hf_icmpv6_fmip6_hi_flag, + { &hf_icmpv6_fmip6_hi_flag, { "Flag", "icmpv6.fmip6.hi.flag", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL }}, - { &hf_icmpv6_fmip6_hi_flag_s, + { &hf_icmpv6_fmip6_hi_flag_s, { "Assigned address configuration", "icmpv6.fmip6.hi.flag.s", FT_BOOLEAN, 8, TFS(&tfs_set_notset), FMIP6_HI_FLAG_S, "When set, this message requests a new CoA to be returned by the destination", HFILL }}, - { &hf_icmpv6_fmip6_hi_flag_u, + { &hf_icmpv6_fmip6_hi_flag_u, { "Buffer", "icmpv6.fmip6.hi.flag.a", FT_BOOLEAN, 8, TFS(&tfs_set_notset), FMIP6_HI_FLAG_U, "When set, the destination SHOULD buffer any packets toward the node indicated in the options of this message", HFILL }}, - { &hf_icmpv6_fmip6_hi_flag_reserved, + { &hf_icmpv6_fmip6_hi_flag_reserved, { "Reserved", "icmpv6.fmip6.hi.flag.reserved", FT_UINT8, BASE_DEC, NULL, FMIP6_HI_FLAG_RSV, NULL, HFILL }}, { &hf_icmpv6_fmip6_identifier, diff --git a/epan/dissectors/packet-kink.c b/epan/dissectors/packet-kink.c index 8cf61e684f..fa3223f680 100644 --- a/epan/dissectors/packet-kink.c +++ b/epan/dissectors/packet-kink.c @@ -1,7 +1,7 @@ /* packet-kink.c - * Routines for KINK packet disassembly + * Routines for KINK packet disassembly * It is referrenced draft-ietf-kink-kink-jp-04.txt,v 1.14 2003/02/10 - * + * * Copyright 2004, Takeshi Nakashima <T.Nakashima@jp.yokogawa.com> * * $Id$ @@ -36,7 +36,7 @@ #include "packet-kerberos.h" #include "packet-isakmp.h" -#define KINK_PORT 57203 +#define KINK_PORT 57203 #define KINK_ISAKMP_PAYLOAD_BASE 14 @@ -55,7 +55,7 @@ static int hf_kink_next_payload = -1; /* Argument for making the subtree */ static gint ett_kink = -1; /*static gint ett_kink_version = -1;*/ -static gint ett_kink_payload = -1; +static gint ett_kink_payload = -1; static gint ett_payload_kink_ap_req = -1; static gint ett_payload_kink_ap_rep = -1; static gint ett_payload_kink_krb_error = -1; @@ -122,7 +122,7 @@ static const value_string kink_next_payload[]={ }; /* Define the magic number - * Using at the kink error + * Using at the kink error */ #define KINK_OK 0 #define KINK_PROTOERR 1 @@ -134,7 +134,7 @@ static const value_string kink_next_payload[]={ #define BOTTOM_RESERVED 7 #define TOP_RESERVED 8191 #define BOTTOM_PRIVATE_USE 8192 -#define TOP_PRIVATE_USE 16383 +#define TOP_PRIVATE_USE 16383 /* Using at the kink header */ #define IPSEC 1 @@ -176,9 +176,9 @@ static void dissect_payload_kink_not_defined(packet_info *pinfo, tvbuff_t *tvb, #ifdef HAVE_KERBEROS static void dissect_decrypt_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, int payload_length); #endif - + /* This function is dissecting the kink header. */ -static void +static void dissect_kink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){ proto_item *ti = NULL; proto_tree *kink_tree = NULL; @@ -190,13 +190,13 @@ dissect_kink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){ guint8 value_a_and_front_reserved; guint16 value_a_and_reserved; guint8 value_a; - guint16 value_reserved; + guint16 value_reserved; int offset=0; - + type = tvb_get_guint8(tvb,offset); col_set_str(pinfo->cinfo, COL_PROTOCOL, "KINK"); - + /* It shows kink type by the type value. */ if(check_col(pinfo->cinfo, COL_INFO)){ col_add_str(pinfo->cinfo, COL_INFO, val_to_str(type, kink_type_vals, "unknown")); @@ -206,11 +206,11 @@ dissect_kink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){ ti = proto_tree_add_item(tree, proto_kink, tvb, offset, -1, FALSE); kink_tree = proto_item_add_subtree(ti, ett_kink); } - + proto_tree_add_uint(kink_tree, hf_kink_type, tvb, offset, 1, type); offset++; - - /* This part is the version. Consider less than 1 octet value. + + /* This part is the version. Consider less than 1 octet value. * Major version and minor version is 4bit. Front half of 1octet * is major version, and second half of 1octet is minor version. * The calculation of major version is shown below. @@ -224,12 +224,12 @@ dissect_kink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){ minor_version = version & SECOND_FOUR_BIT; proto_tree_add_text(kink_tree, tvb, offset, 1, "version: %u.%u", major_version, minor_version); offset++; - + proto_tree_add_item(kink_tree, hf_kink_length, tvb, offset, 2, FALSE); offset += 2; - + doi = tvb_get_ntohl(tvb, offset); - + if(doi == IPSEC){ proto_tree_add_text(kink_tree, tvb, offset, 4, "Domain Of Interpretation: %s (%u)", "IPsec", doi); } @@ -237,18 +237,18 @@ dissect_kink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){ proto_tree_add_text(kink_tree, tvb, offset, 4, "Domain Of Interpretation: %s (%u)", "Not IPsec", doi); } offset += 4; - + proto_tree_add_item(kink_tree, hf_kink_transactionId, tvb, offset, 4, FALSE); offset += 4; - + chsumlen = tvb_get_guint8(tvb, offset); proto_tree_add_item(kink_tree, hf_kink_checkSumLength, tvb, offset, 1, FALSE); offset ++; - + next_payload = tvb_get_guint8(tvb, offset); proto_tree_add_uint(kink_tree, hf_kink_next_payload, tvb, offset, 1, next_payload); offset ++; - + /* A is 1bit field. The caluculation of A is shown below. * The logical product of 1octet value and 0x80 is performed. * And It is performed 7bit right shift. @@ -256,18 +256,18 @@ dissect_kink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){ value_a_and_front_reserved = tvb_get_guint8(tvb, offset); value_a = (value_a_and_front_reserved & FRONT_ONE_BIT) >> A_BIT_SHIFT; proto_tree_add_uint(kink_tree, hf_kink_A, tvb, offset, 1, value_a); - - /* The reserved field is 15bit. + + /* The reserved field is 15bit. * The logical product of 2octet value and 0x7fff is performed. */ value_a_and_reserved = tvb_get_ntohs(tvb, offset); value_reserved = value_a_and_reserved & SECOND_FIFTEEN_BIT; proto_tree_add_uint(kink_tree, hf_kink_reserved, tvb, offset, 2, value_reserved); offset += 2; - + proto_tree_add_item(kink_tree, hf_kink_checkSum, tvb, offset, chsumlen, FALSE); - - /* This part consider the padding. Chsumlen don't contain the padding. */ + + /* This part consider the padding. Chsumlen don't contain the padding. */ if((chsumlen % PADDING) != 0){ chsumlen += (PADDING - (chsumlen % PADDING)); offset += chsumlen; @@ -275,12 +275,12 @@ dissect_kink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){ else{ offset += chsumlen; } - + control_payload(pinfo, tvb, offset, next_payload, kink_tree); - + } -/* This part call the dissect payload function by next_payload value. +/* This part call the dissect payload function by next_payload value. * This function called by the respective function again. */ static void @@ -288,7 +288,7 @@ control_payload(packet_info *pinfo, tvbuff_t *tvb, int offset, guint8 next_paylo switch(next_payload){ case KINK_DONE: break; - case KINK_AP_REQ: + case KINK_AP_REQ: dissect_payload_kink_ap_req(pinfo, tvb, offset, kink_tree); break; case KINK_AP_REP: @@ -305,8 +305,8 @@ control_payload(packet_info *pinfo, tvbuff_t *tvb, int offset, guint8 next_paylo break; case KINK_ISAKMP: dissect_payload_kink_isakmp(pinfo, tvb, offset, kink_tree); - break; - case KINK_ENCRYPT: + break; + case KINK_ENCRYPT: dissect_payload_kink_encrypt(pinfo, tvb, offset, kink_tree); break; case KINK_ERROR: @@ -339,7 +339,7 @@ dissect_payload_kink_ap_req(packet_info *pinfo, tvbuff_t *tvb, int offset, proto next_payload = tvb_get_guint8(tvb, offset); proto_tree_add_uint(payload_kink_ap_req_tree, hf_kink_next_payload, tvb, offset, 1, next_payload); offset ++; - + reserved = tvb_get_guint8(tvb, offset); proto_tree_add_text(payload_kink_ap_req_tree, tvb, offset, 1, "RESERVED: %u", reserved); offset ++; @@ -354,10 +354,10 @@ dissect_payload_kink_ap_req(packet_info *pinfo, tvbuff_t *tvb, int offset, proto /* Show time as UTC, not local time. */ timer = tvb_get_ntohl(tvb, offset); - proto_tree_add_text(payload_kink_ap_req_tree, tvb, offset, 4, "EPOCH: %s", - abs_time_secs_to_str(timer, ABSOLUTE_TIME_UTC, TRUE)); + proto_tree_add_text(payload_kink_ap_req_tree, tvb, offset, 4, "EPOCH: %s", + abs_time_secs_to_str(timer, ABSOLUTE_TIME_UTC, TRUE)); offset += 4; - + if(payload_length > PAYLOAD_HEADER){ tvbuff_t *krb_tvb; @@ -416,8 +416,8 @@ dissect_payload_kink_ap_rep(packet_info *pinfo, tvbuff_t *tvb, int offset, proto /* Show time as UTC, not local time. */ timer = tvb_get_ntohl(tvb, offset); - proto_tree_add_text(payload_kink_ap_rep_tree, tvb, offset, 4, "EPOCH: %s", - abs_time_secs_to_str(timer, ABSOLUTE_TIME_UTC, TRUE)); + proto_tree_add_text(payload_kink_ap_rep_tree, tvb, offset, 4, "EPOCH: %s", + abs_time_secs_to_str(timer, ABSOLUTE_TIME_UTC, TRUE)); offset += 4; if(payload_length > PAYLOAD_HEADER){ @@ -462,7 +462,7 @@ dissect_payload_kink_krb_error(packet_info *pinfo, tvbuff_t *tvb, int offset, pr next_payload = tvb_get_guint8(tvb, offset); proto_tree_add_uint(payload_kink_krb_error_tree, hf_kink_next_payload, tvb, offset, 1, next_payload); offset ++; - + reserved = tvb_get_guint8(tvb, offset); proto_tree_add_text(payload_kink_krb_error_tree, tvb, offset, 1, "RESERVED: %u", reserved); offset ++; @@ -527,11 +527,11 @@ dissect_payload_kink_tgt_req(packet_info *pinfo, tvbuff_t *tvb, int offset, prot proto_tree_add_text(payload_kink_tgt_req_tree, tvb, offset, 2, "RealmNameLength: %u", realm_name_length); offset += 2; - - proto_tree_add_text(payload_kink_tgt_req_tree, tvb, offset, realm_name_length, "RealmName: %s", - tvb_format_text(tvb, offset, realm_name_length)); - offset += realm_name_length; - + + proto_tree_add_text(payload_kink_tgt_req_tree, tvb, offset, realm_name_length, "RealmName: %s", + tvb_format_text(tvb, offset, realm_name_length)); + offset += realm_name_length; + /* This part consider the padding. Payload_length don't contain the padding. */ if(payload_length % PADDING != 0){ payload_length += (PADDING - (payload_length % PADDING)); @@ -564,11 +564,11 @@ dissect_payload_kink_tgt_rep(packet_info *pinfo, tvbuff_t *tvb, int offset, prot next_payload = tvb_get_guint8(tvb, offset); proto_tree_add_uint(payload_kink_tgt_rep_tree, hf_kink_next_payload, tvb, offset, 1, next_payload); offset ++; - + reserved = tvb_get_guint8(tvb, offset); proto_tree_add_text(payload_kink_tgt_rep_tree, tvb, offset, 1, "RESERVED: %u", reserved); offset ++; - + proto_tree_add_text(payload_kink_tgt_rep_tree, tvb, offset, 2, "Payload Length: %u", payload_length); offset += 2; @@ -578,7 +578,7 @@ dissect_payload_kink_tgt_rep(packet_info *pinfo, tvbuff_t *tvb, int offset, prot proto_tree_add_text(payload_kink_tgt_rep_tree, tvb, offset, princ_name_length, "PrincName: %s", tvb_format_text(tvb, offset, princ_name_length)); - /* This part consider the padding. Princ_name_length don't contain the padding. */ + /* This part consider the padding. Princ_name_length don't contain the padding. */ if((princ_name_length + FRONT_TGT_REP_HEADER) % PADDING != 0){ offset += (princ_name_length + PADDING - ((princ_name_length + FRONT_TGT_REP_HEADER) % PADDING)); } @@ -618,7 +618,7 @@ dissect_payload_kink_isakmp(packet_info *pinfo, tvbuff_t *tvb, int offset, proto guint16 reserved2; int start_payload_offset = 0; /* Keep the begining of the payload offset */ tvbuff_t *isakmp_tvb; - + payload_length = tvb_get_ntohs(tvb, offset + TO_PAYLOAD_LENGTH); start_payload_offset = offset; @@ -633,7 +633,7 @@ dissect_payload_kink_isakmp(packet_info *pinfo, tvbuff_t *tvb, int offset, proto reserved = tvb_get_guint8(tvb, offset); proto_tree_add_text(payload_kink_isakmp_tree, tvb, offset, 1, "RESERVED: %u", reserved); offset ++; - + if(payload_length <= PAYLOAD_HEADER){ proto_tree_add_text(payload_kink_isakmp_tree, tvb, offset, 2, "This Payload Length is too small.: %u", payload_length); } @@ -661,7 +661,7 @@ dissect_payload_kink_isakmp(packet_info *pinfo, tvbuff_t *tvb, int offset, proto reserved2 = tvb_get_ntohs(tvb, offset); proto_tree_add_text(payload_kink_isakmp_tree, tvb, offset, 2, "RESERVED: %u", reserved2); offset += 2; - + if(payload_length > PAYLOAD_HEADER){ isakmp_length = payload_length - PAYLOAD_HEADER; length = tvb_length_remaining(tvb, offset); @@ -673,7 +673,7 @@ dissect_payload_kink_isakmp(packet_info *pinfo, tvbuff_t *tvb, int offset, proto isakmp_tvb = tvb_new_subset(tvb, offset, length, reported_length); isakmp_dissect_payloads(isakmp_tvb, payload_kink_isakmp_tree, 1, inner_next_pload, 0, isakmp_length, pinfo); } - + /* This part consider the padding. Payload_length don't contain the padding. */ if(payload_length % PADDING != 0){ payload_length += (PADDING - (payload_length % PADDING)); @@ -731,7 +731,7 @@ dissect_payload_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, int offset, prot guint8 *plaintext=NULL; next_tvb=tvb_new_subset(tvb, offset, MIN(tvb_length_remaining(tvb, offset), encrypt_length), encrypt_length); - plaintext=decrypt_krb5_data(tree, pinfo, 0, next_tvb, keytype, NULL); + plaintext=decrypt_krb5_data(tree, pinfo, 0, next_tvb, keytype, NULL); if(plaintext){ next_tvb=tvb_new_child_real_data(tvb, plaintext, encrypt_length, encrypt_length); tvb_set_free_cb(next_tvb, g_free); @@ -744,11 +744,11 @@ dissect_payload_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, int offset, prot inner_next_pload = tvb_get_guint8(tvb, offset); proto_tree_add_text(payload_kink_encrypt_tree, tvb, offset, 1, "InnerNextPload: %u", inner_next_pload); offset += 1; - + reserved2 = 65536*tvb_get_guint8(tvb, offset) + 256*tvb_get_guint8(tvb, offset+1) + tvb_get_guint8(tvb, offset+2); proto_tree_add_text(payload_kink_encrypt_tree, tvb, offset, 3, "RESERVED: %u", reserved2); offset += 3; - + if(payload_length > PAYLOAD_HEADER){ inner_payload_length = payload_length - PAYLOAD_HEADER; proto_tree_add_text(payload_kink_encrypt_tree, tvb, offset, inner_payload_length, "Payload"); @@ -769,7 +769,7 @@ dissect_payload_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, int offset, prot #ifdef HAVE_KERBEROS static void dissect_decrypt_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, int payload_length){ - + proto_tree *decrypt_kink_encrypt_tree; proto_item *ti; int offset=0; @@ -810,7 +810,7 @@ dissect_payload_kink_error(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_ "KINK_INTERR", "KINK_BADQMVERS" }; - + payload_length = tvb_get_ntohs(tvb,offset + TO_PAYLOAD_LENGTH); start_payload_offset = offset; @@ -835,7 +835,7 @@ dissect_payload_kink_error(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_ offset += 2; error_code = tvb_get_ntohl(tvb, offset); - + /* Choosed the error code by erro_code */ switch(error_code){ case KINK_OK: @@ -873,14 +873,14 @@ dissect_payload_kink_not_defined(packet_info *pinfo, tvbuff_t *tvb, int offset, guint payload_length; guint8 reserved; int start_payload_offset = 0; /* Keep the begining of the payload offset */ - + start_payload_offset = offset; payload_length = tvb_get_ntohs(tvb, offset + TO_PAYLOAD_LENGTH); - + /* Make the subtree */ ti = proto_tree_add_text(tree, tvb, offset, payload_length, "UNKNOWN PAYLOAD"); payload_kink_not_defined_tree = proto_item_add_subtree(ti, ett_payload_not_defined); - + next_payload = tvb_get_guint8(tvb, offset); proto_tree_add_uint(payload_kink_not_defined_tree, hf_kink_next_payload, tvb, offset, 1, next_payload); offset ++; @@ -888,10 +888,10 @@ dissect_payload_kink_not_defined(packet_info *pinfo, tvbuff_t *tvb, int offset, reserved = tvb_get_guint8(tvb, offset); proto_tree_add_text(payload_kink_not_defined_tree, tvb, offset, 1, "RESERVED: %u", reserved); offset ++; - + proto_tree_add_text(payload_kink_not_defined_tree, tvb, offset, 2, "Payload Length: %u", payload_length); offset += 2; - + /* This part consider the padding. Payload_length don't contain the padding. */ if(payload_length % PADDING != 0){ payload_length += (PADDING - (payload_length % PADDING)); @@ -905,42 +905,42 @@ dissect_payload_kink_not_defined(packet_info *pinfo, tvbuff_t *tvb, int offset, } /* Output part */ -void +void proto_register_kink(void) { static hf_register_info hf[] = { { &hf_kink_type, - { "Type", "kink.type", - FT_UINT8, BASE_DEC, VALS(kink_type_vals), 0x0, - "the type of the kink", HFILL }}, + { "Type", "kink.type", + FT_UINT8, BASE_DEC, VALS(kink_type_vals), 0x0, + "the type of the kink", HFILL }}, { &hf_kink_length, - { "Length", "kink.length", - FT_UINT16, BASE_DEC, NULL, 0x0, - "the length of the kink length", HFILL }}, + { "Length", "kink.length", + FT_UINT16, BASE_DEC, NULL, 0x0, + "the length of the kink length", HFILL }}, { &hf_kink_transactionId, - { "Transaction ID", "kink.transactionId", - FT_UINT32, BASE_DEC, NULL, 0x0, - "the transactionID of kink", HFILL }}, + { "Transaction ID", "kink.transactionId", + FT_UINT32, BASE_DEC, NULL, 0x0, + "the transactionID of kink", HFILL }}, { &hf_kink_checkSumLength, - { "Checksum Length", "kink.checkSumLength", - FT_UINT8, BASE_DEC, NULL, 0x0, - "the check sum length of kink", HFILL }}, + { "Checksum Length", "kink.checkSumLength", + FT_UINT8, BASE_DEC, NULL, 0x0, + "the check sum length of kink", HFILL }}, { &hf_kink_A, - { "A", "kink.A", - FT_UINT8, BASE_DEC, VALS(kink_A_vals), 0x0, - "the A of kink", HFILL }}, + { "A", "kink.A", + FT_UINT8, BASE_DEC, VALS(kink_A_vals), 0x0, + "the A of kink", HFILL }}, { &hf_kink_reserved, - { "Reserved", "kink.reserved", - FT_UINT16, BASE_DEC, NULL, 0x0, - "the reserved of kink", HFILL }}, + { "Reserved", "kink.reserved", + FT_UINT16, BASE_DEC, NULL, 0x0, + "the reserved of kink", HFILL }}, { &hf_kink_checkSum, - { "Checksum", "kink.checkSum", - FT_BYTES, BASE_NONE, NULL, 0x0, - "the checkSum of kink", HFILL }}, + { "Checksum", "kink.checkSum", + FT_BYTES, BASE_NONE, NULL, 0x0, + "the checkSum of kink", HFILL }}, { &hf_kink_next_payload, - { "Next Payload", "kink.nextPayload", - FT_UINT8, BASE_DEC, VALS(kink_next_payload), 0x0, - "the next payload of kink", HFILL }} + { "Next Payload", "kink.nextPayload", + FT_UINT8, BASE_DEC, VALS(kink_next_payload), 0x0, + "the next payload of kink", HFILL }} }; @@ -959,9 +959,9 @@ proto_register_kink(void) { &ett_payload_kink_error, &ett_payload_not_defined, &ett_decrypt_kink_encrypt, - + }; - + proto_kink = proto_register_protocol("Kerberized Internet Negotiation of Key", "KINK", "kink"); proto_register_field_array(proto_kink, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); @@ -969,9 +969,9 @@ proto_register_kink(void) { } void proto_reg_handoff_kink(void) { - + dissector_handle_t kink_handle = NULL; - + kink_handle = create_dissector_handle(dissect_kink, proto_kink); dissector_add_uint("udp.port", KINK_PORT, kink_handle); diff --git a/epan/dissectors/packet-nsip.c b/epan/dissectors/packet-nsip.c index e750b9bde8..76b3be8bc6 100644 --- a/epan/dissectors/packet-nsip.c +++ b/epan/dissectors/packet-nsip.c @@ -12,12 +12,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -29,8 +29,6 @@ # include "config.h" #endif -#include <stdlib.h> - #include <glib.h> #include <epan/packet.h> @@ -86,7 +84,7 @@ static gint ett_nsip_ip_element_list = -1; /* PDU type coding, v5.3.0, table 10.3.7.1, p 51 */ #define NSIP_PDU_NS_UNITDATA 0x00 -#define NSIP_PDU_NS_RESET 0x02 +#define NSIP_PDU_NS_RESET 0x02 #define NSIP_PDU_NS_RESET_ACK 0x03 #define NSIP_PDU_NS_BLOCK 0x04 #define NSIP_PDU_NS_BLOCK_ACK 0x05 @@ -106,7 +104,7 @@ static gint ett_nsip_ip_element_list = -1; static const value_string tab_nsip_pdu_types[] = { { NSIP_PDU_NS_UNITDATA, "NS_UNITDATA" }, - { NSIP_PDU_NS_RESET, "NS_RESET" }, + { NSIP_PDU_NS_RESET, "NS_RESET" }, { NSIP_PDU_NS_RESET_ACK, "NS_RESET_ACK" }, { NSIP_PDU_NS_BLOCK, "NS_BLOCK" }, { NSIP_PDU_NS_BLOCK_ACK, "NS_BLOCK_ACK" }, @@ -152,7 +150,7 @@ static const value_string tab_nsip_ieis[] = { { NSIP_IE_NUM_IP4_ENDPOINTS, "Number of IP4 Endpoints" }, { NSIP_IE_NUM_IP6_ENDPOINTS, "Number of IP6 Endpoints"}, { NSIP_IE_RESET_FLAG, "Reset Flag" }, - { NSIP_IE_IP_ADDRESS, "IP Address" }, + { NSIP_IE_IP_ADDRESS, "IP Address" }, { 0, NULL }, }; @@ -260,17 +258,17 @@ typedef struct { static nsip_ip_element_info_t ipv4_element = { NSIP_IP_VERSION_4, 4, 8 }; static nsip_ip_element_info_t ipv6_element = { NSIP_IP_VERSION_6, 16, 20 }; -static void +static void get_value_length(nsip_ie_t *ie, build_info_t *bi) { /* length indicator in bit 8, 0 => two bytes, 1 => one byte */ const guint8 MASK_LENGTH_INDICATOR = 0x80; const guint8 MASK_ONE_BYTE_LENGTH = 0x7f; guint8 length_len; guint16 length; - + length = tvb_get_guint8(bi->tvb, bi->offset); length_len = 1; - + if (length & MASK_LENGTH_INDICATOR) { length &= MASK_ONE_BYTE_LENGTH; } @@ -284,18 +282,18 @@ get_value_length(nsip_ie_t *ie, build_info_t *bi) { bi->offset += length_len; } -static int +static int check_correct_iei(nsip_ie_t *ie, build_info_t *bi) { guint8 fetched_iei = tvb_get_guint8(bi->tvb, bi->offset); #if NSIP_DEBUG if (fetched_iei != ie->iei) { - proto_tree_add_text(bi->nsip_tree, bi->tvb, bi->offset, 1, - "Tried IEI %s (%#02x), found IEI %s (%#02x)", - val_to_str(ie->iei, tab_nsip_ieis, "Unknown"), - ie->iei, - val_to_str(fetched_iei, tab_nsip_ieis, "Unknown"), - fetched_iei); + proto_tree_add_text(bi->nsip_tree, bi->tvb, bi->offset, 1, + "Tried IEI %s (%#02x), found IEI %s (%#02x)", + val_to_str(ie->iei, tab_nsip_ieis, "Unknown"), + ie->iei, + val_to_str(fetched_iei, tab_nsip_ieis, "Unknown"), + fetched_iei); } #endif return (fetched_iei == ie->iei); @@ -307,14 +305,14 @@ decode_iei_cause(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { if (bi->nsip_tree) { cause = tvb_get_guint8(bi->tvb, bi->offset); - proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_cause, - bi->tvb, ie_start_offset, ie->total_length, - cause, - "Cause: %s (%#02x)", - val_to_str(cause, tab_nsip_cause_values, - "Unknown"), cause); + proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_cause, + bi->tvb, ie_start_offset, ie->total_length, + cause, + "Cause: %s (%#02x)", + val_to_str(cause, tab_nsip_cause_values, + "Unknown"), cause); if (check_col(bi->pinfo->cinfo, COL_INFO)) { - col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, + col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, "Cause: %s", val_to_str(cause, tab_nsip_cause_values, "Unknown (0x%02x)")); } @@ -324,19 +322,19 @@ decode_iei_cause(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { bi->offset += ie->value_length; } -static void +static void decode_iei_ns_vci(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { guint16 ns_vci; if (bi->nsip_tree) { ns_vci = tvb_get_ntohs(bi->tvb, bi->offset); - - proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_ns_vci, - bi->tvb, ie_start_offset, ie->total_length, - ns_vci, - "NS VCI: %#04x", ns_vci); + + proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_ns_vci, + bi->tvb, ie_start_offset, ie->total_length, + ns_vci, + "NS VCI: %#04x", ns_vci); if (check_col(bi->pinfo->cinfo, COL_INFO)) { - col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, + col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, "NS VCI: %#04x", ns_vci); } proto_item_append_text(bi->ti, ", NS VCI: %#04x", ns_vci); @@ -344,14 +342,14 @@ decode_iei_ns_vci(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { bi->offset += ie->value_length; } -static void +static void decode_iei_ns_pdu(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { tvbuff_t * next_tvb; if (bi->nsip_tree) { - proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset, - ie->total_length, - "NS PDU (%u bytes)", ie->value_length); + proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset, + ie->total_length, + "NS PDU (%u bytes)", ie->value_length); } next_tvb = tvb_new_subset(bi->tvb, bi->offset, ie->value_length, -1); if (nsip_handle) { @@ -367,31 +365,31 @@ decode_iei_nsei(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { guint16 nsei = tvb_get_ntohs(bi->tvb, bi->offset); if (bi->nsip_tree) { - proto_tree_add_uint(bi->nsip_tree, hf_nsip_nsei, bi->tvb, - ie_start_offset, ie->total_length, nsei); + proto_tree_add_uint(bi->nsip_tree, hf_nsip_nsei, bi->tvb, + ie_start_offset, ie->total_length, nsei); } bi->offset += ie->value_length; - + if (check_col(bi->pinfo->cinfo, COL_INFO)) { - col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, - "NSEI %u", nsei); + col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, + "NSEI %u", nsei); } proto_item_append_text(bi->ti, ", NSEI %u", nsei); } -static void +static void decode_iei_bvci(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { guint16 bvci = tvb_get_ntohs(bi->tvb, bi->offset); if (bi->nsip_tree) { - proto_tree_add_uint(bi->nsip_tree, hf_nsip_bvci, bi->tvb, - ie_start_offset, ie->total_length, bvci); + proto_tree_add_uint(bi->nsip_tree, hf_nsip_bvci, bi->tvb, + ie_start_offset, ie->total_length, bvci); } bi->offset += ie->value_length; if (check_col(bi->pinfo->cinfo, COL_INFO)) { - col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, - "BVCI %u", bvci); + col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, + "BVCI %u", bvci); } proto_item_append_text(bi->ti, ", BVCI %u", bvci); } @@ -405,56 +403,56 @@ decode_ip_element(nsip_ip_element_info_t *element, build_info_t *bi, proto_tree proto_tree *field_tree = NULL; if (bi->nsip_tree) { - tf = proto_tree_add_text(element_tree, bi->tvb, bi->offset, - element->total_length, "IP Element"); + tf = proto_tree_add_text(element_tree, bi->tvb, bi->offset, + element->total_length, "IP Element"); field_tree = proto_item_add_subtree(tf, ett_nsip_ip_element); - + /* IP address */ switch (element->version) { case NSIP_IP_VERSION_4: ip4_addr = tvb_get_ipv4(bi->tvb, bi->offset); - proto_tree_add_item(field_tree, hf_nsip_ip_address_ipv4, - bi->tvb, bi->offset, element->address_length, - NSIP_LITTLE_ENDIAN); - proto_item_append_text(tf, ": IP address: %s", - ip_to_str((guint8 *)&ip4_addr)); + proto_tree_add_item(field_tree, hf_nsip_ip_address_ipv4, + bi->tvb, bi->offset, element->address_length, + NSIP_LITTLE_ENDIAN); + proto_item_append_text(tf, ": IP address: %s", + ip_to_str((guint8 *)&ip4_addr)); break; case NSIP_IP_VERSION_6: tvb_get_ipv6(bi->tvb, bi->offset, &ip6_addr); - proto_tree_add_item(field_tree, hf_nsip_ip_address_ipv6, bi->tvb, - bi->offset, element->address_length, - NSIP_LITTLE_ENDIAN); - proto_item_append_text(tf, ": IP address: %s", - ip6_to_str((struct e_in6_addr *)&ip6_addr)); + proto_tree_add_item(field_tree, hf_nsip_ip_address_ipv6, bi->tvb, + bi->offset, element->address_length, + NSIP_LITTLE_ENDIAN); + proto_item_append_text(tf, ": IP address: %s", + ip6_to_str((struct e_in6_addr *)&ip6_addr)); break; default: ; } } bi->offset += element->address_length; - + if (bi->nsip_tree) { /* UDP port value */ udp_port = tvb_get_ntohs(bi->tvb, bi->offset); - proto_tree_add_uint_format(field_tree, hf_nsip_ip_element_udp_port, - bi->tvb, bi->offset, 2, udp_port, - "UDP Port: %u", udp_port); + proto_tree_add_uint_format(field_tree, hf_nsip_ip_element_udp_port, + bi->tvb, bi->offset, 2, udp_port, + "UDP Port: %u", udp_port); proto_item_append_text(tf, ", UDP Port: %u", udp_port); } bi->offset += 2; - + if (bi->nsip_tree) { /* Signalling weight */ - proto_tree_add_item(field_tree, hf_nsip_ip_element_signalling_weight, - bi->tvb, bi->offset, 1, NSIP_LITTLE_ENDIAN); + proto_tree_add_item(field_tree, hf_nsip_ip_element_signalling_weight, + bi->tvb, bi->offset, 1, NSIP_LITTLE_ENDIAN); } bi->offset++; if (bi->nsip_tree) { /* Data weight */ - proto_tree_add_item(field_tree, hf_nsip_ip_element_data_weight, - bi->tvb, bi->offset, 1, NSIP_LITTLE_ENDIAN); + proto_tree_add_item(field_tree, hf_nsip_ip_element_data_weight, + bi->tvb, bi->offset, 1, NSIP_LITTLE_ENDIAN); } bi->offset++; return tf; @@ -466,11 +464,11 @@ decode_ip_elements(nsip_ip_element_info_t *element, nsip_ie_t *ie, build_info_t int num_elements = ie->value_length / element->total_length; proto_item *tf, *ti = NULL; proto_tree *field_tree; - - tf = proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset, - ie->total_length, - "List of IP%u Elements (%u Elements)", - element->version, num_elements); + + tf = proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset, + ie->total_length, + "List of IP%u Elements (%u Elements)", + element->version, num_elements); field_tree = proto_item_add_subtree(tf, ett_nsip_ip_element_list); for (i = 0; i < num_elements; i++) { @@ -479,52 +477,52 @@ decode_ip_elements(nsip_ip_element_info_t *element, nsip_ie_t *ie, build_info_t return tf; } -static void +static void decode_iei_max_num_ns_vc(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { guint16 num_ns_vc; if (bi->nsip_tree) { num_ns_vc = tvb_get_ntohs(bi->tvb, bi->offset); - - proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_max_num_ns_vc, - bi->tvb, ie_start_offset, ie->total_length, - num_ns_vc, - "Maximum Number of NS-VCs: %u", num_ns_vc); + + proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_max_num_ns_vc, + bi->tvb, ie_start_offset, ie->total_length, + num_ns_vc, + "Maximum Number of NS-VCs: %u", num_ns_vc); } bi->offset += 2; } -static void +static void decode_iei_num_ip4_endpoints(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { guint16 num_endpoints; - + if (bi->nsip_tree) { num_endpoints = tvb_get_ntohs(bi->tvb, bi->offset); - - proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_num_ip4_endpoints, - bi->tvb, ie_start_offset, ie->total_length, - num_endpoints, - "Number of IP4 Endpoints: %u", num_endpoints); + + proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_num_ip4_endpoints, + bi->tvb, ie_start_offset, ie->total_length, + num_endpoints, + "Number of IP4 Endpoints: %u", num_endpoints); } bi->offset += 2; } -static void +static void decode_iei_num_ip6_endpoints(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { guint16 num_endpoints; if (bi->nsip_tree) { num_endpoints = tvb_get_ntohs(bi->tvb, bi->offset); - - proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_num_ip6_endpoints, - bi->tvb, ie_start_offset, ie->total_length, - num_endpoints, - "Number of IP6 Endpoints: %u", num_endpoints); + + proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_num_ip6_endpoints, + bi->tvb, ie_start_offset, ie->total_length, + num_endpoints, + "Number of IP6 Endpoints: %u", num_endpoints); } bi->offset += 2; } -static void +static void decode_iei_reset_flag(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { guint8 flag; proto_item *tf; @@ -533,29 +531,29 @@ decode_iei_reset_flag(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { flag = tvb_get_guint8(bi->tvb, bi->offset); if (bi->nsip_tree) { - tf = proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset, - ie->total_length, + tf = proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset, + ie->total_length, "Reset Flag: %#02x", flag); field_tree = proto_item_add_subtree(tf, ett_nsip_reset_flag); - proto_tree_add_boolean(field_tree, hf_nsip_reset_flag, bi->tvb, - bi->offset, 1, - flag & NSIP_MASK_RESET_FLAG); + proto_tree_add_boolean(field_tree, hf_nsip_reset_flag, bi->tvb, + bi->offset, 1, + flag & NSIP_MASK_RESET_FLAG); if (flag & NSIP_MASK_RESET_FLAG) { if (check_col(bi->pinfo->cinfo, COL_INFO)) { - col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, + col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, "Reset"); } proto_item_append_text(bi->ti, ", Reset"); } - proto_tree_add_uint(field_tree, hf_nsip_reset_flag_spare, - bi->tvb, bi->offset, 1, - flag & NSIP_MASK_RESET_FLAG_SPARE); + proto_tree_add_uint(field_tree, hf_nsip_reset_flag_spare, + bi->tvb, bi->offset, 1, + flag & NSIP_MASK_RESET_FLAG_SPARE); } bi->offset += 1; } -static void +static void decode_iei_ip_address(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { guint8 addr_type; guint32 ip4_addr; @@ -563,24 +561,24 @@ decode_iei_ip_address(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { addr_type = tvb_get_guint8(bi->tvb, bi->offset); proto_tree_add_item(bi->nsip_tree, hf_nsip_ip_address_type, - bi->tvb, bi->offset, 1, FALSE); + bi->tvb, bi->offset, 1, FALSE); switch (addr_type) { case NSIP_IP_ADDRESS_TYPE_IPV4: ie->total_length = 2 + ipv4_element.address_length; ip4_addr = tvb_get_ipv4(bi->tvb, bi->offset+1); if (bi->nsip_tree) { - proto_tree_add_ipv4(bi->nsip_tree, hf_nsip_ip_address_ipv4, - bi->tvb, ie_start_offset, ie->total_length, - ip4_addr); + proto_tree_add_ipv4(bi->nsip_tree, hf_nsip_ip_address_ipv4, + bi->tvb, ie_start_offset, ie->total_length, + ip4_addr); } break; case NSIP_IP_ADDRESS_TYPE_IPV6: ie->total_length = 2 + ipv6_element.address_length; tvb_get_ipv6(bi->tvb, bi->offset+1, &ip6_addr); if (bi->nsip_tree) { - proto_tree_add_ipv6(bi->nsip_tree, hf_nsip_ip_address_ipv4, - bi->tvb, ie_start_offset, ie->total_length, - (guint8 *)&ip6_addr); + proto_tree_add_ipv6(bi->nsip_tree, hf_nsip_ip_address_ipv4, + bi->tvb, ie_start_offset, ie->total_length, + (guint8 *)&ip6_addr); } break; default: @@ -589,22 +587,22 @@ decode_iei_ip_address(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { bi->offset += ie->value_length; } -static void +static void decode_iei_transaction_id(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { guint8 id; if (bi->nsip_tree) { id = tvb_get_guint8(bi->tvb, bi->offset); - proto_tree_add_uint(bi->nsip_tree, hf_nsip_transaction_id, - bi->tvb, ie_start_offset, ie->total_length, id); + proto_tree_add_uint(bi->nsip_tree, hf_nsip_transaction_id, + bi->tvb, ie_start_offset, ie->total_length, id); if (check_col(bi->pinfo->cinfo, COL_INFO)) { - col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, + col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, "Transaction Id: %d", id); } } bi->offset += 1; } -static void +static void decode_iei_end_flag(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { guint8 flag; proto_item *tf; @@ -613,47 +611,47 @@ decode_iei_end_flag(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { if (bi->nsip_tree) { flag = tvb_get_guint8(bi->tvb, bi->offset); - tf = proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset, - ie->total_length, + tf = proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset, + ie->total_length, "End Flag: %#02x", flag); field_tree = proto_item_add_subtree(tf, ett_nsip_end_flag); - proto_tree_add_boolean(field_tree, hf_nsip_end_flag, bi->tvb, - bi->offset, 1, - flag & NSIP_MASK_END_FLAG); + proto_tree_add_boolean(field_tree, hf_nsip_end_flag, bi->tvb, + bi->offset, 1, + flag & NSIP_MASK_END_FLAG); if (flag & NSIP_MASK_END_FLAG) { proto_item_append_text(bi->ti, ", End"); } - proto_tree_add_uint(field_tree, hf_nsip_end_flag_spare, - bi->tvb, bi->offset, 1, - flag & NSIP_MASK_END_FLAG_SPARE); + proto_tree_add_uint(field_tree, hf_nsip_end_flag_spare, + bi->tvb, bi->offset, 1, + flag & NSIP_MASK_END_FLAG_SPARE); } bi->offset += 1; } -static void +static void decode_iei_control_bits(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { guint8 control_bits; proto_item *tf; proto_tree *field_tree; control_bits = tvb_get_guint8(bi->tvb, bi->offset); - + if (bi->nsip_tree) { - tf = proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset, - ie->total_length, - "NS SDU Control bits: %#02x", control_bits); + tf = proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset, + ie->total_length, + "NS SDU Control bits: %#02x", control_bits); field_tree = proto_item_add_subtree(tf, ett_nsip_control_bits); - proto_tree_add_boolean(field_tree, hf_nsip_control_bits_r, bi->tvb, - bi->offset, 1, - control_bits & NSIP_MASK_CONTROL_BITS_R); - proto_tree_add_boolean(field_tree, hf_nsip_control_bits_c, bi->tvb, - bi->offset, 1, - control_bits & NSIP_MASK_CONTROL_BITS_C); - proto_tree_add_uint(field_tree, hf_nsip_control_bits_spare, - bi->tvb, bi->offset, 1, - control_bits & NSIP_MASK_CONTROL_BITS_SPARE); + proto_tree_add_boolean(field_tree, hf_nsip_control_bits_r, bi->tvb, + bi->offset, 1, + control_bits & NSIP_MASK_CONTROL_BITS_R); + proto_tree_add_boolean(field_tree, hf_nsip_control_bits_c, bi->tvb, + bi->offset, 1, + control_bits & NSIP_MASK_CONTROL_BITS_C); + proto_tree_add_uint(field_tree, hf_nsip_control_bits_spare, + bi->tvb, bi->offset, 1, + control_bits & NSIP_MASK_CONTROL_BITS_SPARE); } bi->offset++; @@ -757,7 +755,7 @@ decode_pdu_ns_unitdata(build_info_t *bi) { nsip_ie_t ies[] = { { 0, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_V, 0, 1 }, /* Control bits */ { NSIP_IE_BVCI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_V, 0, 2 }, - { 0, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_V, 0, 0 }, + { 0, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_V, 0, 0 }, /* NS SDU, length unknown */ }; gint sdu_length; @@ -768,15 +766,15 @@ decode_pdu_ns_unitdata(build_info_t *bi) { next_tvb = tvb_new_subset_remaining(bi->tvb, bi->offset); if (bssgp_handle) { call_dissector(bssgp_handle, next_tvb, bi->pinfo, bi->parent_tree); - } + } else { sdu_length = tvb_length_remaining(bi->tvb, bi->offset); - proto_tree_add_text(bi->nsip_tree, bi->tvb, bi->offset, sdu_length, - "NS SDU (%u bytes)", sdu_length); + proto_tree_add_text(bi->nsip_tree, bi->tvb, bi->offset, sdu_length, + "NS SDU (%u bytes)", sdu_length); } } -static void +static void decode_pdu_ns_reset(build_info_t *bi) { nsip_ie_t ies[] = { { NSIP_IE_CAUSE, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 3 }, @@ -786,7 +784,7 @@ decode_pdu_ns_reset(build_info_t *bi) { decode_pdu_general(ies, 3, bi); } -static void +static void decode_pdu_ns_reset_ack(build_info_t *bi) { nsip_ie_t ies[] = { { NSIP_IE_NS_VCI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 4 }, @@ -795,7 +793,7 @@ decode_pdu_ns_reset_ack(build_info_t *bi) { decode_pdu_general(ies, 2, bi); } -static void +static void decode_pdu_ns_block(build_info_t *bi) { nsip_ie_t ies[] = { { NSIP_IE_CAUSE, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 3 }, @@ -804,36 +802,36 @@ decode_pdu_ns_block(build_info_t *bi) { decode_pdu_general(ies, 2, bi); } -static void +static void decode_pdu_ns_block_ack(build_info_t *bi) { nsip_ie_t ies[] = { { NSIP_IE_NS_VCI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, - 0, 1 }, }; + 0, 1 }, }; decode_pdu_general(ies, 1, bi); } -static void +static void decode_pdu_ns_status(build_info_t *bi) { - nsip_ie_t ies[] = { + nsip_ie_t ies[] = { { NSIP_IE_CAUSE, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 3 }, { NSIP_IE_NS_VCI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 4 }, - { NSIP_IE_NS_PDU, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 }, + { NSIP_IE_NS_PDU, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 }, /* Unknown length */ { NSIP_IE_BVCI, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 4 }, - { NSIP_IE_IP4_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 }, + { NSIP_IE_IP4_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 }, /* Unknown length */ - { NSIP_IE_IP6_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 }, + { NSIP_IE_IP6_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 }, /* Unknown length */ }; decode_pdu_general(ies, 6, bi); } -static void +static void decode_pdu_sns_ack(build_info_t *bi) { nsip_ie_t ies[] = { { NSIP_IE_NSEI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 4 }, { 0, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_V, 0, 1 }, /* Transaction id */ { NSIP_IE_CAUSE, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 3 }, - { NSIP_IE_IP_ADDRESS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TV, 0, 0 }, + { NSIP_IE_IP_ADDRESS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TV, 0, 0 }, /* Unknown length */ { NSIP_IE_IP4_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 }, { NSIP_IE_IP6_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 }, @@ -843,14 +841,14 @@ decode_pdu_sns_ack(build_info_t *bi) { decode_pdu_general(&ies[2], 4, bi); } -static void +static void decode_pdu_sns_add(build_info_t *bi) { nsip_ie_t ies[] = { { NSIP_IE_NSEI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 4 }, { 0, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_V, 0, 1 }, /* Transaction id */ { NSIP_IE_IP4_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 }, /* Unknown length */ - { NSIP_IE_IP6_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 }, + { NSIP_IE_IP6_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 }, /* Unknown length */ }; decode_pdu_general(ies, 1, bi); @@ -858,14 +856,14 @@ decode_pdu_sns_add(build_info_t *bi) { decode_pdu_general(&ies[2], 2, bi); } -static void +static void decode_pdu_sns_changeweight(build_info_t *bi) { nsip_ie_t ies[] = { { NSIP_IE_NSEI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 4 }, { 0, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_V, 0, 1 }, /* Transaction id */ - { NSIP_IE_IP4_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 }, + { NSIP_IE_IP4_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 }, /* Unknown length */ - { NSIP_IE_IP6_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 }, + { NSIP_IE_IP6_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 }, /* Unknown length */ }; decode_pdu_general(ies, 1, bi); @@ -873,13 +871,13 @@ decode_pdu_sns_changeweight(build_info_t *bi) { decode_pdu_general(&ies[2], 2, bi); } -static void +static void decode_pdu_sns_config(build_info_t *bi) { - nsip_ie_t ies[] = { + nsip_ie_t ies[] = { { 0, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_V, 0, 1 }, /* End flag */ { NSIP_IE_NSEI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 4 }, - { NSIP_IE_IP4_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 }, + { NSIP_IE_IP4_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 }, /* Unknown length */ { NSIP_IE_IP6_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 }, /* Unknown length */ @@ -888,7 +886,7 @@ decode_pdu_sns_config(build_info_t *bi) { decode_pdu_general(&ies[1], 3, bi); } -static void +static void decode_pdu_sns_config_ack(build_info_t *bi) { nsip_ie_t ies[] = { { NSIP_IE_NSEI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 4 }, @@ -897,12 +895,12 @@ decode_pdu_sns_config_ack(build_info_t *bi) { decode_pdu_general(ies, 2, bi); } -static void +static void decode_pdu_sns_delete(build_info_t *bi) { nsip_ie_t ies[] = { { NSIP_IE_NSEI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 4}, /* CR013 */ { 0, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_V, 0, 1 }, /* Transaction id */ - { NSIP_IE_IP_ADDRESS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TV, 0, 0 }, + { NSIP_IE_IP_ADDRESS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TV, 0, 0 }, /* Unknown length */ { NSIP_IE_IP4_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 }, { NSIP_IE_IP6_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 }, @@ -912,21 +910,21 @@ decode_pdu_sns_delete(build_info_t *bi) { decode_pdu_general(&ies[2], 3, bi); } -static void +static void decode_pdu_sns_size(build_info_t *bi) { nsip_ie_t ies[] = { { NSIP_IE_NSEI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 4 }, { NSIP_IE_RESET_FLAG, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TV, 0, 2 }, { NSIP_IE_MAX_NUM_NS_VC, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TV, 0, 3 }, - { NSIP_IE_NUM_IP4_ENDPOINTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TV, + { NSIP_IE_NUM_IP4_ENDPOINTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TV, 0, 3 }, - { NSIP_IE_NUM_IP6_ENDPOINTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TV, + { NSIP_IE_NUM_IP6_ENDPOINTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TV, 0, 3 }, }; decode_pdu_general(ies, 5, bi); } -static void +static void decode_pdu_sns_size_ack(build_info_t *bi) { nsip_ie_t ies[] = { { NSIP_IE_NSEI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 4 }, @@ -1002,136 +1000,136 @@ dissect_nsip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { pinfo->current_proto = "GPRS-NS"; col_set_str(pinfo->cinfo, COL_PROTOCOL, "GPRS-NS"); - + col_clear(pinfo->cinfo, COL_INFO); pdu_type = tvb_get_guint8(tvb, 0); bi.offset++; if (tree) { - bi.ti = proto_tree_add_item(tree, proto_nsip, tvb, 0, -1, - NSIP_LITTLE_ENDIAN); + bi.ti = proto_tree_add_item(tree, proto_nsip, tvb, 0, -1, + NSIP_LITTLE_ENDIAN); nsip_tree = proto_item_add_subtree(bi.ti, ett_nsip); - proto_tree_add_uint_format(nsip_tree, hf_nsip_pdu_type, tvb, 0, 1, - pdu_type, - "PDU type: %s (%#02x)", - val_to_str(pdu_type, tab_nsip_pdu_types, - "Unknown"), pdu_type); + proto_tree_add_uint_format(nsip_tree, hf_nsip_pdu_type, tvb, 0, 1, + pdu_type, + "PDU type: %s (%#02x)", + val_to_str(pdu_type, tab_nsip_pdu_types, + "Unknown"), pdu_type); proto_item_append_text(bi.ti, ", PDU type: %s", - val_to_str(pdu_type, tab_nsip_pdu_types, "Unknown")); + val_to_str(pdu_type, tab_nsip_pdu_types, "Unknown")); bi.nsip_tree = nsip_tree; } - + if (check_col(pinfo->cinfo, COL_INFO)) { - col_add_str(pinfo->cinfo, COL_INFO, - val_to_str(pdu_type, tab_nsip_pdu_types, "Unknown PDU type")); + col_add_str(pinfo->cinfo, COL_INFO, + val_to_str(pdu_type, tab_nsip_pdu_types, "Unknown PDU type")); } decode_pdu(pdu_type, &bi); } void proto_register_nsip(void) -{ +{ static hf_register_info hf[] = { { &hf_nsip_cause, { "Cause", "nsip.cause", - FT_UINT8, BASE_OCT, VALS(tab_nsip_cause_values), 0x0, - NULL, HFILL } + FT_UINT8, BASE_OCT, VALS(tab_nsip_cause_values), 0x0, + NULL, HFILL } }, { &hf_nsip_ns_vci, { "NS-VCI", "nsip.ns_vci", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Network Service Virtual Link Identifier", HFILL } + FT_UINT16, BASE_DEC, NULL, 0x0, + "Network Service Virtual Link Identifier", HFILL } }, { &hf_nsip_pdu_type, { "PDU type", "nsip.pdu_type", - FT_UINT8, BASE_OCT, VALS(tab_nsip_pdu_types), 0x0, - "PDU type information element", HFILL } + FT_UINT8, BASE_OCT, VALS(tab_nsip_pdu_types), 0x0, + "PDU type information element", HFILL } }, { &hf_nsip_bvci, { "BVCI", "nsip.bvci", - FT_UINT16, BASE_DEC, NULL, 0x0, - "BSSGP Virtual Connection Identifier", HFILL } + FT_UINT16, BASE_DEC, NULL, 0x0, + "BSSGP Virtual Connection Identifier", HFILL } }, { &hf_nsip_nsei, { "NSEI", "nsip.nsei", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Network Service Entity Identifier", HFILL } + FT_UINT16, BASE_DEC, NULL, 0x0, + "Network Service Entity Identifier", HFILL } }, { &hf_nsip_ip4_elements, { "IP4 elements", "nsip.ip4_elements", - FT_NONE, BASE_NONE, NULL, 0x0, - "List of IP4 elements", HFILL } + FT_NONE, BASE_NONE, NULL, 0x0, + "List of IP4 elements", HFILL } }, { &hf_nsip_ip6_elements, { "IP6 elements", "nsip.ip6_elements", - FT_NONE, BASE_NONE, NULL, 0x0, - "List of IP6 elements", HFILL } + FT_NONE, BASE_NONE, NULL, 0x0, + "List of IP6 elements", HFILL } }, { &hf_nsip_max_num_ns_vc, { "Maximum number of NS-VCs", "nsip.max_num_ns_vc", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL } + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } }, { &hf_nsip_num_ip4_endpoints, { "Number of IP4 endpoints", "nsip.num_ip4_endpoints", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL } + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } }, { &hf_nsip_num_ip6_endpoints, { "Number of IP6 endpoints", "nsip.num_ip6_endpoints", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL } + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } }, { &hf_nsip_reset_flag, { "Reset flag", "nsip.reset_flag.flag", - FT_BOOLEAN, 8, TFS(&tfs_set_notset), NSIP_MASK_RESET_FLAG, - NULL, HFILL } + FT_BOOLEAN, 8, TFS(&tfs_set_notset), NSIP_MASK_RESET_FLAG, + NULL, HFILL } }, { &hf_nsip_reset_flag_spare, { "Reset flag spare bits", "nsip.reset_flag.spare", - FT_UINT8, BASE_HEX, NULL, NSIP_MASK_RESET_FLAG_SPARE, - NULL, HFILL } + FT_UINT8, BASE_HEX, NULL, NSIP_MASK_RESET_FLAG_SPARE, + NULL, HFILL } }, { &hf_nsip_ip_address_type, { "IP Address Type", "nsip.ip_address_type", - FT_UINT8, BASE_DEC, VALS(ip_address_type_vals), 0x0, - NULL, HFILL } + FT_UINT8, BASE_DEC, VALS(ip_address_type_vals), 0x0, + NULL, HFILL } }, { &hf_nsip_ip_address_ipv4, { "IP Address", "nsip.ipv4_address", - FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL } + FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL } }, { &hf_nsip_ip_address_ipv6, { "IP Address", "nsip.ipv6_address", - FT_IPv6, BASE_NONE, NULL, 0x0, - NULL, HFILL } + FT_IPv6, BASE_NONE, NULL, 0x0, + NULL, HFILL } }, { &hf_nsip_end_flag, { "End flag", "nsip.end_flag.flag", - FT_BOOLEAN, 8, TFS(&tfs_set_notset), NSIP_MASK_END_FLAG, - NULL, HFILL } + FT_BOOLEAN, 8, TFS(&tfs_set_notset), NSIP_MASK_END_FLAG, + NULL, HFILL } }, { &hf_nsip_end_flag_spare, { "End flag spare bits", "nsip.end_flag.spare", - FT_UINT8, BASE_HEX, NULL, NSIP_MASK_END_FLAG_SPARE, - NULL, HFILL } + FT_UINT8, BASE_HEX, NULL, NSIP_MASK_END_FLAG_SPARE, + NULL, HFILL } }, { &hf_nsip_control_bits_r, { "Request change flow", "nsip.control_bits.r", - FT_BOOLEAN, 8, TFS(&tfs_set_notset), NSIP_MASK_CONTROL_BITS_R, - NULL, HFILL } + FT_BOOLEAN, 8, TFS(&tfs_set_notset), NSIP_MASK_CONTROL_BITS_R, + NULL, HFILL } }, { &hf_nsip_control_bits_c, { "Confirm change flow", "nsip.control_bits.c", - FT_BOOLEAN, 8, TFS(&tfs_set_notset), NSIP_MASK_CONTROL_BITS_C, - NULL, HFILL } + FT_BOOLEAN, 8, TFS(&tfs_set_notset), NSIP_MASK_CONTROL_BITS_C, + NULL, HFILL } }, { &hf_nsip_control_bits_spare, { "Spare bits", "nsip.control_bits.spare", - FT_UINT8, BASE_HEX, NULL, NSIP_MASK_CONTROL_BITS_SPARE, - NULL, HFILL } + FT_UINT8, BASE_HEX, NULL, NSIP_MASK_CONTROL_BITS_SPARE, + NULL, HFILL } }, { &hf_nsip_transaction_id, { "Transaction ID", "nsip.transaction_id", @@ -1140,28 +1138,28 @@ proto_register_nsip(void) }, { &hf_nsip_ip_element_ip_address_ipv4, { "IP Address", "nsip.ip_element.ipv4_address", - FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL } + FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL } }, { &hf_nsip_ip_element_ip_address_ipv6, { "IP Address", "nsip.ip_element.ipv6_address", - FT_IPv6, BASE_NONE, NULL, 0x0, - NULL, HFILL } + FT_IPv6, BASE_NONE, NULL, 0x0, + NULL, HFILL } }, { &hf_nsip_ip_element_udp_port, { "UDP Port", "nsip.ip_element.udp_port", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL } + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } }, { &hf_nsip_ip_element_signalling_weight, { "Signalling Weight", "nsip.ip_element.signalling_weight", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } }, { &hf_nsip_ip_element_data_weight, { "Data Weight", "nsip.ip_element.data_weight", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL } + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } }, }; @@ -1178,10 +1176,10 @@ proto_register_nsip(void) module_t *nsip_module; /* Register the protocol name and description */ - proto_nsip = proto_register_protocol("GPRS Network Service", - "GPRS-NS", "gprs-ns"); + proto_nsip = proto_register_protocol("GPRS Network Service", + "GPRS-NS", "gprs-ns"); - /* Required function calls to register the header fields and + /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_nsip, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); @@ -1196,9 +1194,9 @@ proto_register_nsip(void) prefs_register_obsolete_preference(nsip_module, "udp.port1"); prefs_register_obsolete_preference(nsip_module, "udp.port2"); prefs_register_range_preference(nsip_module, "udp.ports", "GPRS-NS UDP ports", - "UDP ports to be decoded as GPRS-NS (default: " - DEFAULT_NSIP_PORT_RANGE ")", - &global_nsip_udp_port_range, MAX_UDP_PORT); + "UDP ports to be decoded as GPRS-NS (default: " + DEFAULT_NSIP_PORT_RANGE ")", + &global_nsip_udp_port_range, MAX_UDP_PORT); } static void @@ -1230,5 +1228,5 @@ proto_reg_handoff_nsip(void) { nsip_udp_port_range = range_copy(global_nsip_udp_port_range); range_foreach(nsip_udp_port_range, range_add_callback); - + } diff --git a/epan/dissectors/packet-pw-atm.c b/epan/dissectors/packet-pw-atm.c index 47161624cf..0581b43c50 100644 --- a/epan/dissectors/packet-pw-atm.c +++ b/epan/dissectors/packet-pw-atm.c @@ -40,8 +40,6 @@ # include "config.h" #endif -#include <stdlib.h> -#include <string.h> #include <glib.h> #include <epan/packet.h> #include <epan/expert.h> @@ -248,10 +246,10 @@ int number_of_cells(const pwatm_mode_t mode ,const gint payload_size ,gint* const remainder_size) { - int cells; + int cells; DISSECTOR_ASSERT(payload_size >= 0); - + switch(mode) { case PWATM_MODE_N1_NOCW: @@ -280,7 +278,7 @@ int number_of_cells(const pwatm_mode_t mode *remainder_size = payload_size; return 0; } - + } @@ -300,7 +298,7 @@ void col_append_pw_info(packet_info * pinfo { col_append_str(pinfo->cinfo, COL_INFO, "CW:Bad"); } - + if (pd->props & PWC_PAY_SIZE_BAD) { if (pd->props & PWC_ANYOF_CW_BAD) @@ -312,7 +310,7 @@ void col_append_pw_info(packet_info * pinfo ,(int)payload_size ,plurality(payload_size,"","s")); } - + if (pd->props == 0) /*omit "atm cells" etc if something is wrong*/ { /* number of cells may be not known */ @@ -337,7 +335,7 @@ void col_append_pw_info(packet_info * pinfo if (pd->cumulative.clp >= 0) col_append_fstr(pinfo->cinfo, COL_INFO, ", CLP:%.1d", pd->cumulative.clp); } - + if (padding_size != 0) { col_append_fstr(pinfo->cinfo, COL_INFO, ", %d padding" @@ -345,7 +343,7 @@ void col_append_pw_info(packet_info * pinfo } } - + static void prepare_pseudo_header_atm( union wtap_pseudo_header * const ph, @@ -366,7 +364,7 @@ void prepare_pseudo_header_atm( ph->atm.channel = 0; /*unknown*//* link: 0 for DTE->DCE, 1 for DCE->DTE */ ph->atm.cells = 0; /*zero indicates that we do not have trailer info*/ /*user-to-user indicator & CPI*/ - ph->atm.aal5t_u2u = 0; /* all bits unknown except lsb of UU */ + ph->atm.aal5t_u2u = 0; /* all bits unknown except lsb of UU */ if (pdata->aal5_sdu_frame_relay_cr_bit) { /* Let's give Frame Relay C/R bit to ATM dissector.*/ ph->atm.aal5t_u2u |= (1<<8); /*UU octet is at << 8 in aal5t_u2u*/ @@ -399,9 +397,9 @@ void dissect_payload_and_padding( { tvb_2 = tvb_new_subset_remaining(tvb,dissected); dissected += call_dissector(dh_cell_header, tvb_2, pinfo, tree); - + tvb_2 = tvb_new_subset_remaining(tvb,dissected); - + /*dissect as oam for specific vci/pti, just like atm dissector does*/ if (pd->vci >= 0 && pd->pti >=0) { @@ -410,7 +408,7 @@ void dissect_payload_and_padding( pd->cell_mode_oam = TRUE; } } - + if (pd->cell_mode_oam) { union wtap_pseudo_header* pseudo_header_save; @@ -444,7 +442,7 @@ void dissect_payload_and_padding( dissected += call_dissector(dh_cell, tvb_2, pinfo, tree); } } - + if (padding_size != 0) { tvb_2 = tvb_new_subset(tvb @@ -552,8 +550,8 @@ void dissect_11_or_aal5_pdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr proto_name_tree = &longname_pw_atm_aal5_pdu[0]; } } - - + + /* check how "good" is this packet */ pd.props = PWC_PACKET_PROPERTIES_T_INITIALIZER; if (0 != (tvb_get_guint8(tvb, 0) & 0xf0 /*bits03*/)) @@ -564,12 +562,12 @@ void dissect_11_or_aal5_pdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr { pd.props |= PWC_CW_BAD_RSV; } - + /* * Do not dissect and validate atm-specific byte (3rd byte of CW). * It will be dissected/validated as pw cell header. */ - + /* * Decide about payload length and padding. * @@ -621,7 +619,7 @@ void dissect_11_or_aal5_pdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr proto_item* item; item = proto_tree_add_item(tree, proto_11_or_aal5_pdu, tvb, 0, -1, FALSE); /*overwrite heading line*/ - proto_item_set_text(item, proto_name_tree, 0/*-warn gcc 3.4.4*/); + proto_item_set_text(item, proto_name_tree, 0/*-warn gcc 3.4.4*/); pwc_item_append_text_n_items(item,cells,"good ATM cell"); { proto_tree* tree2; @@ -654,12 +652,12 @@ void dissect_11_or_aal5_pdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr } } } - + { tvbuff_t* tvb_2; tvb_2 = tvb_new_subset(tvb, 0, PWC_SIZEOF_CW, PWC_SIZEOF_CW); call_dissector(dh_control_word, tvb_2, pinfo, tree); - + tvb_2 = tvb_new_subset(tvb, (PWC_SIZEOF_CW-1), -1, -1); if (MODE_11(pd.mode)) { @@ -672,7 +670,7 @@ void dissect_11_or_aal5_pdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr tvbuff_t* tvb_3; union wtap_pseudo_header* pseudo_header_save; union wtap_pseudo_header ph; - + tvb_3 = tvb_new_subset_remaining(tvb_2, 1); /* prepare pseudo header for atm aal5 decoding */ pseudo_header_save = pinfo->pseudo_header; @@ -684,7 +682,7 @@ void dissect_11_or_aal5_pdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr } } } - + if (MODE_11(pd.mode)) { /* overwrite everything written by sub-dissectors in 1:1 modes*/ @@ -695,7 +693,7 @@ void dissect_11_or_aal5_pdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr col_append_pw_info(pinfo, payload_size, cells, 0); } } - + pinfo->private_data = pd_save; return; } @@ -733,7 +731,7 @@ void dissect_aal5_sdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { pd.submode = PWATM_SUBMODE_ADMIN_CELL; } - + if (! pref_aal5_sdu_extend_cw_length_with_rsvd) { if (0 != (tvb_get_guint8(tvb, 1) & 0xc0 /*preferred_cw.rsvd*/)) @@ -748,7 +746,7 @@ void dissect_aal5_sdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) * length field MUST be set to the packet's length. Otherwise, the * length field MUST be set to zero... Note that the length field * is not used in the N-to-one mode and MUST be set to 0. ] - * + * * Also we allow some "extensions"conducted by pref_xxx. */ gint payload_size_from_packet; @@ -763,14 +761,14 @@ void dissect_aal5_sdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { cw_len = tvb_get_guint8(tvb, 1) & 0x3f; } - + /* * Initial assumptions: no padding, * payload size derived from psn packet size. */ payload_size = payload_size_from_packet; padding_size = 0; - + if (0 == cw_len) { /*keep initial assumptions*/ @@ -820,7 +818,7 @@ void dissect_aal5_sdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) } } } - + if (PWATM_SUBMODE_ADMIN_CELL == pd.submode) { gint bad_padding_size; @@ -847,7 +845,7 @@ void dissect_aal5_sdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) col_append_str(pinfo->cinfo, COL_PROTOCOL, ", OAM cell"); } } - + if (check_col(pinfo->cinfo, COL_INFO)) { col_clear(pinfo->cinfo, COL_INFO); @@ -875,25 +873,25 @@ void dissect_aal5_sdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) ,(int)payload_size,(int)SIZEOF_N1_PW_CELL); } } - + { tvbuff_t* tvb_2; tvb_2 = tvb_new_subset(tvb, 0, PWC_SIZEOF_CW, PWC_SIZEOF_CW); call_dissector(dh_control_word, tvb_2, pinfo, tree); - + tvb_2 = tvb_new_subset_remaining(tvb, PWC_SIZEOF_CW); if (PWATM_SUBMODE_ADMIN_CELL == pd.submode) { dissect_payload_and_padding(tvb_2,pinfo,tree,payload_size,padding_size); } else /*AAL5 payload*/ - { + { if (payload_size != 0) { tvbuff_t* tvb_3; union wtap_pseudo_header* pseudo_header_save; union wtap_pseudo_header ph; - + tvb_3 = tvb_new_subset(tvb_2, 0, payload_size, payload_size); /* prepare pseudo header for atm aal5 decoding */ pseudo_header_save = pinfo->pseudo_header; @@ -962,7 +960,7 @@ void dissect_n1_cw(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) * length field MUST be set to the packet's length. Otherwise, the * length field MUST be set to zero... Note that the length field * is not used in the N-to-one mode and MUST be set to 0. ] - * + * * Also we allow some "extensions"conducted by pref_xxx. */ gint payload_size_from_packet; @@ -977,14 +975,14 @@ void dissect_n1_cw(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { cw_len = tvb_get_guint8(tvb, 1) & 0x3f; } - + /* * Initial assumptions: no padding, * payload size derived from psn packet size. */ payload_size = payload_size_from_packet; padding_size = 0; - + if (0 == cw_len) { /*keep initial assumptions*/ @@ -1058,12 +1056,12 @@ void dissect_n1_cw(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) ,(int)payload_size,(int)SIZEOF_N1_PW_CELL); } } - + { tvbuff_t* tvb_2; tvb_2 = tvb_new_subset(tvb, 0, PWC_SIZEOF_CW, PWC_SIZEOF_CW); call_dissector(dh_control_word, tvb_2, pinfo, tree); - + tvb_2 = tvb_new_subset_remaining(tvb, PWC_SIZEOF_CW); dissect_payload_and_padding(tvb_2,pinfo,tree,payload_size,padding_size); } @@ -1077,7 +1075,7 @@ void dissect_n1_cw(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) col_clear(pinfo->cinfo, COL_INFO); col_append_pw_info(pinfo, payload_size, cells, padding_size); } - + pinfo->private_data = pd_save; return; } @@ -1138,9 +1136,9 @@ void dissect_n1_nocw(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) ,(int)payload_size,(int)SIZEOF_N1_PW_CELL); } } - + dissect_payload_and_padding(tvb,pinfo,tree,payload_size,0); - + /* fill columns in Packet List */ /* overwrite everything written by sub-dissectors */ col_set_str(pinfo->cinfo, COL_PROTOCOL, proto_name_column); @@ -1175,7 +1173,7 @@ void proto_item_append_text_cwb3_fields(proto_item * item, const pwatm_private_d proto_item_append_text(item, "CLP:%.1u ", (unsigned)(pd->cwb3.clp)); return; } - + static void dissect_control_word(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) @@ -1210,7 +1208,7 @@ void dissect_control_word(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree proto_item* item_top; item_top = proto_tree_add_item(tree, proto_control_word, tvb, 0, -1, FALSE); pwc_item_append_cw(item_top,tvb_get_ntohl(tvb, 0),FALSE); - + { proto_tree* tree2; tree2 = proto_item_add_subtree(item_top, ett_cw); @@ -1228,7 +1226,7 @@ void dissect_control_word(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree { PROTO_ITEM_SET_HIDDEN(item); /* show only in error cases */ } - + /* flags */ if (MODE_N1(pd->mode)) { @@ -1259,7 +1257,7 @@ void dissect_control_word(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree (0 == (tvb_get_guint8(tvb, 0) & 0x01 /*preferred_cw.U*/)) ? FALSE : TRUE; } - + /* reserved bits */ if (MODE_11_OR_AAL5_PDU(pd->mode) || (MODE_N1(pd->mode) && !pref_n1_cw_extend_cw_length_with_rsvd) @@ -1288,7 +1286,7 @@ void dissect_control_word(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree PROTO_ITEM_SET_HIDDEN(item); /*...and show only in error cases */ } } - + /* length */ if (MODE_N1(pd->mode) || (PWATM_MODE_AAL5_SDU == pd->mode)) @@ -1331,11 +1329,11 @@ void dissect_control_word(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree ,(int)pd->packet_size); } } - + /* sequence number */ proto_tree_add_item(tree2, hf_cw_seq, tvb ,MODE_11_OR_AAL5_PDU(pd->mode) ? 1 : 2, 2, FALSE); - + /* atm-specific byte */ if (MODE_11(pd->mode)) { @@ -1355,7 +1353,7 @@ void dissect_control_word(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree * marked as "bad". */ } - + /*3rd byte of CW*/ if (PWATM_MODE_AAL5_PDU == pd->mode) { @@ -1381,12 +1379,12 @@ int dissect_cell_header(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) pwatm_private_data_t * pd; gboolean is_enough_data; int dissect_size; - + pd = pinfo->private_data; DISSECTOR_ASSERT (NULL != pd); pd->vpi = pd->vci = pd->pti = -1; pd->cwb3.clp = pd->cwb3.m = pd->cwb3.v = pd->cwb3.rsv = pd->cwb3.u = pd->cwb3.e = -1; - + if (PWATM_MODE_AAL5_PDU == pd->mode) { if (tvb_reported_length_remaining(tvb, 0) < 1) @@ -1420,7 +1418,7 @@ int dissect_cell_header(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) /* * NB: do not touch columns -- keep info from previous dissector */ - + /* Collect info for upper-level dissectors regardless of * the presence of the tree */ @@ -1484,11 +1482,11 @@ int dissect_cell_header(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) break; } } - + if (tree) { proto_item* item; - + item = proto_tree_add_item(tree, proto_cell_header, tvb ,0 ,dissect_size @@ -1510,8 +1508,8 @@ int dissect_cell_header(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_item_append_text(item, "PTI:%.1u ", (unsigned)(pd->pti)); proto_item_append_text_cwb3_fields(item,pd); } - - { + + { proto_tree* tree2; tree2 = proto_item_add_subtree(item, ett_cell_header); if (is_enough_data) @@ -1537,7 +1535,7 @@ int dissect_cell_header(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) " PTI field (%d) should be 4, 5 or 6.", pd->pti); } - + proto_tree_add_item(tree2, hf_cell_h_clp, tvb, 3, 1, FALSE); } else if (MODE_11_OR_AAL5_PDU(pd->mode)) @@ -1569,7 +1567,7 @@ int dissect_cell_header(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) ,"AAL5 PDU mode:" " V bit must be 0 to indicate that VCI is absent"); } - + item2 = proto_tree_add_item(tree2 ,(PWATM_MODE_AAL5_PDU == pd->mode) ? hf_aal5_pdu_rsv @@ -1584,7 +1582,7 @@ int dissect_cell_header(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { PROTO_ITEM_SET_HIDDEN(item2); /*...and show only in error cases */ } - + if (MODE_11(pd->mode)) { item2 = proto_tree_add_item(tree2, hf_cell_h_pti, tvb, 0, 1, FALSE); @@ -1600,9 +1598,9 @@ int dissect_cell_header(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_item(tree2, hf_aal5_pdu_u, tvb, 0, 1, FALSE); proto_tree_add_item(tree2, hf_aal5_pdu_e, tvb, 0, 1, FALSE); } - + proto_tree_add_item(tree2, hf_cell_h_clp, tvb, 0, 1, FALSE); - + if (PWATM_MODE_11_VPC == pd->mode) { proto_tree_add_uint(tree2, hf_cell_h_vci, tvb, 1, 2 @@ -1632,7 +1630,7 @@ int dissect_cell(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { gboolean is_enough_data; int dissect_size; - + { gint size; size = tvb_reported_length_remaining(tvb, 0); @@ -1651,7 +1649,7 @@ int dissect_cell(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) /* * NB: do not touch columns -- keep info from previous dissector */ - + if (tree) { proto_item* item; @@ -1671,7 +1669,7 @@ int dissect_cell(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) ,"Bad length of cell payload: must be == %d" ,(int)SIZEOF_ATM_CELL_PAYLOAD); } - + { proto_tree* tree2; tvbuff_t* tvb_d; @@ -1731,7 +1729,7 @@ void proto_register_pw_atm_ata(void) ,"Bit (M) of the control byte indicates whether the packet" " contains an ATM cell or a frame payload. If set to 0," " the packet contains an ATM cell. If set to 1, the PDU" - " contains an AAL5 payload." + " contains an AAL5 payload." ,HFILL }} ,{ &hf_cell_h_v ,{"VCI Present" ,"atm.pw_control_byte.v" ,FT_BOOLEAN ,8 ,TFS(&tfs_yes_no),0x40 @@ -1769,7 +1767,7 @@ static hf_register_info hfa_cell[] = { ,FT_INT32 ,BASE_DEC ,NULL ,0 ,NULL ,HFILL }} }; - + #define HF_INITIALIZER_NCELLS(hf_handle)\ {&(hf_handle) ,{"Number of good encapsulated cells","pw.atm.cells"\ ,FT_INT32 ,BASE_DEC ,NULL ,0\ @@ -1807,29 +1805,29 @@ static hf_register_info hfa_cell[] = { { 1, "ATM admin cell" }, { 0, NULL } }; - + static const value_string a5s_e_vals[] = { { 0, "No congestion" }, { 1, "Congestion experienced" }, { 0, NULL } }; - + static hf_register_info hfa_cw[] = { { &hf_cw_bits03 ,{"Bits 0 to 3" ,"pw.cw.bits03" - ,FT_UINT8 ,BASE_HEX ,NULL ,0xf0 + ,FT_UINT8 ,BASE_HEX ,NULL ,0xf0 ,NULL ,HFILL }} - ,{ &hf_pref_cw_flags ,{"Flags" ,"pw.cw.flags" + ,{ &hf_pref_cw_flags ,{"Flags" ,"pw.cw.flags" ,FT_UINT8 ,BASE_HEX ,NULL ,0x0f ,NULL ,HFILL }} - ,{ &hf_pref_cw_a5s_t ,{"Payload type" ,"atm.pt" + ,{ &hf_pref_cw_a5s_t ,{"Payload type" ,"atm.pt" ,FT_UINT8 ,BASE_DEC ,VALS(a5s_t_vals),0x08 ,"Bit (T) of the control word indicates whether the packet contains" " an ATM admin cell or an AAL5 payload. If T = 1, the packet" " contains an ATM admin cell, encapsulated according to the N:1" " cell relay encapsulation. If not set, the PDU" - " contains an AAL5 payload." + " contains an AAL5 payload." ,HFILL }} - ,{ &hf_pref_cw_a5s_e ,{"EFCI bit" ,"atm.efci" + ,{ &hf_pref_cw_a5s_e ,{"EFCI bit" ,"atm.efci" ,FT_UINT8 ,BASE_DEC ,VALS(a5s_e_vals),0x04 ,"The ingress router sets this bit to 1 if the EFCI bit" " of the final cell of those that transported the AAL5 CPCS-SDU is" @@ -1837,14 +1835,14 @@ static hf_register_info hfa_cell[] = { " transported in the packet is set to 1. Otherwise, this bit" " is set to 0." ,HFILL }} - ,{ &hf_pref_cw_a5s_c ,{"CLP bit" ,"atm.clp" + ,{ &hf_pref_cw_a5s_c ,{"CLP bit" ,"atm.clp" ,FT_UINT8 ,BASE_DEC ,VALS(clp_vals) ,0x02 ,"The ingress router sets this bit to 1 if the CLP bit" " of any of the ATM cells that transported the AAL5 CPCS-SDU is set" " to 1, or if the CLP bit of the single ATM cell to be transported" " in the packet is set to 1. Otherwise this bit is set to 0." ,HFILL }} - ,{ &hf_pref_cw_a5s_u ,{"U bit (Command/Response)" ,"pw.cw.aal5sdu.u" + ,{ &hf_pref_cw_a5s_u ,{"U bit (Command/Response)" ,"pw.cw.aal5sdu.u" ,FT_UINT8 ,BASE_DEC ,NULL ,0x01 ,"When FRF.8.1 Frame Relay/ATM PVC Service Interworking [RFC3916]" " traffic is being transported, the Least-Significant Bit of CPCS-UU" @@ -1864,10 +1862,10 @@ static hf_register_info hfa_cell[] = { ,FT_UINT8 ,BASE_DEC ,NULL ,0xff ,NULL ,HFILL }} ,{ &hf_cw_seq ,{"Sequence number" ,"pw.cw.seqno" - ,FT_UINT16 ,BASE_DEC ,NULL ,0 + ,FT_UINT16 ,BASE_DEC ,NULL ,0 ,NULL ,HFILL }} ,{ &hf_gen_cw_atmbyte ,{"ATM-specific byte" ,"pw.cw.3rd_byte" - ,FT_UINT8 ,BASE_HEX ,NULL ,0xFF + ,FT_UINT8 ,BASE_HEX ,NULL ,0xFF ,NULL ,HFILL }} }; static gint *ett_array[] = { @@ -1915,7 +1913,7 @@ static hf_register_info hfa_cell[] = { proto_register_field_array( proto_aal5_sdu ,hfa_aal5_sdu ,array_length(hfa_aal5_sdu)); proto_register_subtree_array(ett_array, array_length(ett_array)); - + register_dissector("mpls_pw_atm_aal5_sdu" ,dissect_aal5_sdu ,proto_aal5_sdu); register_dissector("mpls_pw_atm_11_or_aal5_pdu" ,dissect_11_or_aal5_pdu ,proto_11_or_aal5_pdu); register_dissector("mpls_pw_atm_n1_cw" ,dissect_n1_cw ,proto_n1_cw); @@ -1941,7 +1939,7 @@ static hf_register_info hfa_cell[] = { ; module_t * module_n1_cw; module_t * module_aal5_sdu; - + module_n1_cw = prefs_register_protocol(proto_n1_cw,NULL); prefs_register_bool_preference(module_n1_cw ,"allow_cw_length_nonzero" @@ -1953,7 +1951,7 @@ static hf_register_info hfa_cell[] = { ,"Use CW.Reserved as extension of CW.Length" ,&description_extend_cw_length_with_rsvd[0] ,&pref_n1_cw_extend_cw_length_with_rsvd); - + module_aal5_sdu = prefs_register_protocol(proto_aal5_sdu,NULL); prefs_register_bool_preference(module_aal5_sdu ,"allow_cw_length_nonzero_aal5" diff --git a/epan/dissectors/packet-rtps.c b/epan/dissectors/packet-rtps.c index 0bbab12eef..0c4eab7ea0 100644 --- a/epan/dissectors/packet-rtps.c +++ b/epan/dissectors/packet-rtps.c @@ -11,10 +11,10 @@ * Copyright 2003, LUKAS POKORNY <maskis@seznam.cz> * PETR SMOLIK <petr.smolik@wo.cz> * ZDENEK SEBEK <sebek@fel.cvut.cz> - * Czech Technical University in Prague + * Czech Technical University in Prague * Faculty of Electrical Engineering <www.fel.cvut.cz> - * Department of Control Engineering <dce.felk.cvut.cz> - * + * Department of Control Engineering <dce.felk.cvut.cz> + * * $Id$ * * Wireshark - Network traffic analyzer @@ -25,12 +25,12 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -39,12 +39,12 @@ * * The following file is part of the RTPS packet dissector for Wireshark. * - * RTPS protocol was developed by Real-Time Innovations, Inc. as wire + * RTPS protocol was developed by Real-Time Innovations, Inc. as wire * protocol for Data Distribution System. * Additional information at: - * Full OMG DDS Standard Specification: + * Full OMG DDS Standard Specification: * http://www.omg.org/cgi-bin/doc?ptc/2003-07-07 - * + * * NDDS and RTPS information: http://www.rti.com/resources.html * */ @@ -54,13 +54,10 @@ # include "config.h" #endif -#include <stdlib.h> -#include <string.h> #include <glib.h> #include <epan/packet.h> #include <epan/addr_resolv.h> - #include "packet-rtps.h" /* Size of the temp buffers used to format various part of the protocol. @@ -95,7 +92,7 @@ static const char * const SM_EXTRA_PMINUS = "(p-)"; static const char * const SM_EXTRA_TPLUS = "(t+)"; static const char * const SM_EXTRA_TMINUS = "(t-)"; -/* This structure is used to keep a list of submessages for the current +/* This structure is used to keep a list of submessages for the current * packet. The list is ordered by position of the submessage Id inside * the packet. * Submessages of the same kind are grouped together in one record. @@ -371,7 +368,7 @@ static const value_string durability_qos_vals[] = { { DURABILITY_PERSISTENT, "PERSISTENT_DURABILITY_QOS" }, { 0, NULL } }; - + static const value_string ownership_qos_vals[] = { { OWNERSHIP_SHARED, "SHARED_OWNERSHIP_QOS" }, { OWNERSHIP_EXCLUSIVE, "EXCLUSIVE_OWNERSHIP_QOS" }, @@ -554,9 +551,9 @@ static void sm_counter_free(struct SMCounterRecord *); /* Utility to add elements to the protocol tree */ static void rtps_util_format_ipv6(guint8 *, guint8 *, gint); static void rtps_util_add_protocol_version(proto_tree *, tvbuff_t *, gint); -static void rtps_util_add_vendor_id(proto_tree *, tvbuff_t *, +static void rtps_util_add_vendor_id(proto_tree *, tvbuff_t *, gint, guint8 *, gint); -static void rtps_util_add_locator_t(proto_tree *, tvbuff_t *, +static void rtps_util_add_locator_t(proto_tree *, tvbuff_t *, gint, int, const guint8 *, guint8 *, gint); static void rtps_util_add_locator_list(proto_tree *, tvbuff_t *, gint, const guint8 *, int); @@ -570,7 +567,7 @@ static void rtps_util_add_guid_prefix(proto_tree *, tvbuff_t *, static int rtps_util_add_entity_id(proto_tree *, tvbuff_t *, gint, int, int, int, int, const char *, guint32 *); static void rtps_util_add_generic_entity_id(proto_tree *, tvbuff_t *, - gint, const char *, + gint, const char *, guint8 *, gint); static void rtps_util_add_generic_guid(proto_tree *, tvbuff_t *, gint, const char *, guint8 *, gint); @@ -598,7 +595,7 @@ static gint rtps_util_add_seq_string(proto_tree *, tvbuff_t *, static void rtps_util_add_seq_octets(proto_tree *, tvbuff_t *, gint, int, int, int, guint8 *, gint); static int rtps_util_add_bitmap(proto_tree *, tvbuff_t *, - gint, int, const char *); + gint, int, const char *); static void rtps_util_decode_flags(proto_tree *, tvbuff_t *, gint, guint8, const struct Flag_definition *); static gint rtps_util_add_seq_ulong(proto_tree *, tvbuff_t *, @@ -667,7 +664,7 @@ static gboolean dissect_rtps(tvbuff_t *, packet_info *, proto_tree *); /* *********************************************************************** */ -/* Adds a new record to the SMCounterRecord archive +/* Adds a new record to the SMCounterRecord archive * It always inserts to the end of the list. Insert is not performed if * the last element is like the current one. * Parameters: @@ -678,7 +675,7 @@ static gboolean dissect_rtps(tvbuff_t *, packet_info *, proto_tree *); */ static struct SMCounterRecord * sm_counter_add( struct SMCounterRecord *last, - guint8 submessage, + guint8 submessage, const char * const extra) { /* Can be NULL */ #if 0 if ((last == NULL) || (last->id != submessage)) { @@ -700,7 +697,7 @@ static struct SMCounterRecord * sm_counter_add( last->counter++; #endif - + struct SMCounterRecord *ptr; ptr = (struct SMCounterRecord *)g_malloc(sizeof(struct SMCounterRecord)); if (ptr == NULL) { @@ -731,7 +728,7 @@ static void sm_counter_free(struct SMCounterRecord *head) { /* *********************************************************************** */ /* Format the given address (16 octects) as an IPv6 address */ -static void rtps_util_format_ipv6(guint8 *addr, +static void rtps_util_format_ipv6(guint8 *addr, guint8 *buffer, gint buffer_size) { guint32 i; @@ -773,23 +770,23 @@ static void rtps_util_add_protocol_version(proto_tree *tree, /* Can NOT be NULL major = tvb_get_guint8(tvb, offset); minor = tvb_get_guint8(tvb, offset+1); - ti = proto_tree_add_none_format(tree, + ti = proto_tree_add_none_format(tree, hf_rtps_protocol_version, - tvb, - offset, + tvb, + offset, 2, "Protocol version: %d.%d", tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1)); version_tree = proto_item_add_subtree(ti, ett_rtps_proto_version); - proto_tree_add_item(version_tree, + proto_tree_add_item(version_tree, hf_rtps_protocol_version_major, tvb, offset, 1, FALSE); - proto_tree_add_item(version_tree, + proto_tree_add_item(version_tree, hf_rtps_protocol_version_minor, tvb, offset+1, @@ -801,7 +798,7 @@ static void rtps_util_add_protocol_version(proto_tree *tree, /* Can NOT be NULL /* ------------------------------------------------------------------------- */ /* Interpret the next bytes as vendor ID. If proto_tree and field ID is - * provided, it can also set. + * provided, it can also set. */ static void rtps_util_add_vendor_id(proto_tree *tree, /* Can be NULL */ tvbuff_t * tvb, @@ -829,7 +826,7 @@ static void rtps_util_add_vendor_id(proto_tree *tree, /* Can be NULL */ } if (tree != NULL) { - proto_tree_add_uint_format(tree, + proto_tree_add_uint_format(tree, hf_rtps_vendor_id, tvb, offset, @@ -847,12 +844,12 @@ static void rtps_util_add_vendor_id(proto_tree *tree, /* Can be NULL */ /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next 8 bytes interpreted as Locator_t - * + * * Locator_t is a struct defined as: - * struct { - * long kind; // kind of locator - * unsigned long port; - * octet[16] address; + * struct { + * long kind; // kind of locator + * unsigned long port; + * octet[16] address; * } Locator_t; */ static void rtps_util_add_locator_t(proto_tree *tree, /* Can NOT be NULL */ @@ -898,7 +895,7 @@ static void rtps_util_add_locator_t(proto_tree *tree, /* Can NOT be NULL */ case LOCATOR_KIND_UDPV6: kind_string = "LOCATOR_KIND_UDPV6"; rtps_util_format_ipv6(addr, &addr_buff[0], MAX_IPV6_SIZE); - g_snprintf(temp_buff, MAX_LOCATOR_SIZE, + g_snprintf(temp_buff, MAX_LOCATOR_SIZE, "IPv6: { addr=%s, port=%d }", addr_buff, port); @@ -910,7 +907,7 @@ static void rtps_util_add_locator_t(proto_tree *tree, /* Can NOT be NULL */ case LOCATOR_KIND_RESERVED: if (!kind_string) /* Need to guard overrides (no break before) */ kind_string = "LOCATOR_KIND_RESERVED"; - + default: if (!kind_string) /* Need to guard overrides (no break before) */ kind_string = "(unknown)"; @@ -925,12 +922,12 @@ static void rtps_util_add_locator_t(proto_tree *tree, /* Can NOT be NULL */ addr[14], addr[15]); } - + ti = proto_tree_add_text(tree, tvb, offset, 24, - "%s: %s", + "%s: %s", label, temp_buff); @@ -985,7 +982,7 @@ static void rtps_util_add_locator_list(proto_tree *tree, tvb, offset, 4, - "%s: %d Locators", + "%s: %d Locators", label, num_locators); @@ -995,7 +992,7 @@ static void rtps_util_add_locator_list(proto_tree *tree, locator_tree = proto_item_add_subtree(ti, ett_rtps_locator_udp_v4); - + for (i = 0; i < num_locators; ++i) { g_snprintf(temp_buff, 20, "Locator[%d]", i); rtps_util_add_locator_t(tree, @@ -1007,11 +1004,11 @@ static void rtps_util_add_locator_list(proto_tree *tree, 0); } } -} +} /* ------------------------------------------------------------------------- */ -/* Insert in the protocol tree the next 4 bytes interpreted as IPV4Address_t +/* Insert in the protocol tree the next 4 bytes interpreted as IPV4Address_t */ static void rtps_util_add_ipv4_address_t(proto_tree *tree, /* Can be NULL */ tvbuff_t * tvb, @@ -1020,7 +1017,7 @@ static void rtps_util_add_ipv4_address_t(proto_tree *tree, /* Can be NULL */ const guint8 * label, guint8 * buffer, /* Can be NULL */ gint buffer_size) { /* Can be 0 */ - + guint32 addr; addr = NEXT_guint32(tvb, offset, little_endian); @@ -1033,7 +1030,7 @@ static void rtps_util_add_ipv4_address_t(proto_tree *tree, /* Can be NULL */ tvb, offset, 4, - "%s: %s", + "%s: %s", label, IPADDRESS_INVALID_STRING); } @@ -1051,7 +1048,7 @@ static void rtps_util_add_ipv4_address_t(proto_tree *tree, /* Can be NULL */ tvb, offset, 4, - "%s: %d.%d.%d.%d", + "%s: %d.%d.%d.%d", label, (addr >> 24) & 0xff, (addr >> 16) & 0xff, @@ -1065,11 +1062,11 @@ static void rtps_util_add_ipv4_address_t(proto_tree *tree, /* Can be NULL */ /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next 8 bytes interpreted as LocatorUDPv4 - * + * * LocatorUDPv4 is a struct defined as: - * struct { - * unsigned long address; - * unsigned long port; + * struct { + * unsigned long address; + * unsigned long port; * } LocatorUDPv4_t; * */ @@ -1113,7 +1110,7 @@ static void rtps_util_add_locator_udp_v4(proto_tree *tree, /* Can NOT be NULL */ "port: %s", portLabel); - proto_item_set_text(ti, "%s: { address=%s, port=%s }", + proto_item_set_text(ti, "%s: { address=%s, port=%s }", label, addr, portLabel); @@ -1128,7 +1125,7 @@ static void rtps_util_add_locator_udp_v4(proto_tree *tree, /* Can NOT be NULL */ * - hf_rtps_app_id * - hf_rtps_app_id_instance_id * - hf_rtps_app_id_app_kind - * + * * If buffer is specified, it returns in it a string representation of the * data read. */ @@ -1249,7 +1246,7 @@ static void rtps_util_add_guid_prefix(proto_tree *tree, /* Can be NULL */ /* ------------------------------------------------------------------------- */ - /* Insert the entityId from the next 4 bytes. Since there are more than + /* Insert the entityId from the next 4 bytes. Since there are more than * one entityId, we need to specify also the IDs of the entityId (and its * sub-components), as well as the label identifying it. * Returns true if the entityKind is one of the NDDS built-in entities. @@ -1279,24 +1276,24 @@ static int rtps_util_add_entity_id(proto_tree *tree, if (str_predef == NULL) { /* entityId is not a predefined value, format it */ - ti = proto_tree_add_uint_format(tree, + ti = proto_tree_add_uint_format(tree, hf_item, - tvb, - offset, + tvb, + offset, 4, entity_id, "%s: 0x%08x (%s: 0x%06x)", label, entity_id, - val_to_str(entity_kind, entity_kind_vals, + val_to_str(entity_kind, entity_kind_vals, "unknown (%02x)"), entity_key); } else { /* entityId is a predefined value */ - ti = proto_tree_add_uint_format(tree, + ti = proto_tree_add_uint_format(tree, hf_item, - tvb, - offset, + tvb, + offset, 4, entity_id, "%s: %s (0x%08x)", label, str_predef, entity_id); @@ -1305,20 +1302,20 @@ static int rtps_util_add_entity_id(proto_tree *tree, entity_tree = proto_item_add_subtree(ti, subtree_entity_id); - proto_tree_add_item(entity_tree, + proto_tree_add_item(entity_tree, hf_item_entity_key, tvb, offset, 3, FALSE); - proto_tree_add_item(entity_tree, + proto_tree_add_item(entity_tree, hf_item_entity_kind, tvb, offset+3, 1, FALSE); - + } /* is a built-in entity if the bit M and R (5 and 6) of the entityKind are set */ @@ -1355,21 +1352,21 @@ static void rtps_util_add_generic_entity_id(proto_tree *tree, g_snprintf(temp_buffer, MAX_GUID_SIZE, "0x%08x (%s: 0x%06x)", entity_id, - val_to_str(entity_kind, entity_kind_vals, + val_to_str(entity_kind, entity_kind_vals, "unknown kind (%02x)"), entity_key); } else { /* entityId is a predefined value */ g_snprintf(temp_buffer, MAX_GUID_SIZE, - "%s (0x%08x)", - str_predef, + "%s (0x%08x)", + str_predef, entity_id); } if (tree != NULL) { - proto_tree_add_text(tree, - tvb, - offset, + proto_tree_add_text(tree, + tvb, + offset, 4, "%s: %s", label, @@ -1461,7 +1458,7 @@ static guint64 rtps_util_add_seq_number(proto_tree *tree, guint64 all = (hi << 32) | lo; if (tree != NULL) { - proto_tree_add_int64_format(tree, + proto_tree_add_int64_format(tree, hf_rtps_sm_seq_number, tvb, offset, @@ -1511,13 +1508,13 @@ static void rtps_util_add_ntp_time(proto_tree *tree, /* Can be NULL */ label, tempBuffer); time_tree = proto_item_add_subtree(ti, ett_rtps_ntp_time); - proto_tree_add_item(time_tree, + proto_tree_add_item(time_tree, hf_rtps_param_ntpt_sec, tvb, offset, 4, little_endian); - proto_tree_add_item(time_tree, + proto_tree_add_item(time_tree, hf_rtps_param_ntpt_fraction, tvb, offset+4, @@ -1546,12 +1543,12 @@ static gint rtps_util_add_string(proto_tree *tree, /* Can be NULL */ if (size > 0) { retVal = tvb_get_ephemeral_string(tvb, offset+4, size); - } + } if (tree != NULL) { if (hf_item != -1) { proto_item * hidden_item; - hidden_item = proto_tree_add_string(tree, + hidden_item = proto_tree_add_string(tree, hf_item, tvb, offset, @@ -1563,8 +1560,8 @@ static gint rtps_util_add_string(proto_tree *tree, /* Can be NULL */ tvb, offset, size+4, - "%s: \"%s\"", - ((label != NULL) ? label : (const guint8 *)"value") , + "%s: \"%s\"", + ((label != NULL) ? label : (const guint8 *)"value") , (size == 0) ? (guint8 *)"" : retVal); } if (buffer != NULL) { @@ -1603,12 +1600,12 @@ static void rtps_util_add_long(proto_tree *tree, /* Can be NULL */ char temp_buff[16]; - g_snprintf(temp_buff, 16, - (is_hex ? "0x%08x" : (is_signed ? "%d" : "%u")), + g_snprintf(temp_buff, 16, + (is_hex ? "0x%08x" : (is_signed ? "%d" : "%u")), NEXT_guint32(tvb, offset, little_endian)); if (tree != NULL) { if (hf_item != -1) { - proto_tree_add_item(tree, + proto_tree_add_item(tree, hf_item, tvb, offset, @@ -1619,7 +1616,7 @@ static void rtps_util_add_long(proto_tree *tree, /* Can be NULL */ tvb, offset, 4, - "%s: %s", + "%s: %s", label, temp_buff); } @@ -1654,7 +1651,7 @@ static void rtps_util_add_port(proto_tree *tree, /* Can be NULL */ tvb, offset, 4, - "%s: %s", + "%s: %s", label, tempBuffer); } @@ -1665,8 +1662,8 @@ static void rtps_util_add_port(proto_tree *tree, /* Can be NULL */ /* ------------------------------------------------------------------------- */ -/* Insert in the protocol tree the next data interpreted as a boolean - * Returns the pointer to a dynamically allocated buffer containing the +/* Insert in the protocol tree the next data interpreted as a boolean + * Returns the pointer to a dynamically allocated buffer containing the * formatted version of the value. */ static void rtps_util_add_boolean(proto_tree *tree, /* Can be NULL */ @@ -1689,7 +1686,7 @@ static void rtps_util_add_boolean(proto_tree *tree, /* Can be NULL */ tvb, offset, 1, - "%s: %s", + "%s: %s", label, str); } @@ -1697,7 +1694,7 @@ static void rtps_util_add_boolean(proto_tree *tree, /* Can be NULL */ /* ------------------------------------------------------------------------- */ -/* Insert in the protocol tree the next bytes interpreted as +/* Insert in the protocol tree the next bytes interpreted as * DurabilityServiceQosPolicy */ static void rtps_util_add_durability_service_qos(proto_tree *tree, @@ -1721,10 +1718,10 @@ static void rtps_util_add_durability_service_qos(proto_tree *tree, temp_buffer, MAX_NTP_TIME_SIZE); - g_snprintf(buffer, buffer_size, + g_snprintf(buffer, buffer_size, "{ service_cleanup_delay=%s, history_kind='%s', " "history_depth=%d, max_samples=%d, max_instances=%d, " - "max_samples_per_instances=%d }", + "max_samples_per_instances=%d }", temp_buffer, val_to_str(kind, history_qos_vals, "0x%08x"), history_depth, @@ -1793,8 +1790,8 @@ static void rtps_util_add_liveliness_qos(proto_tree *tree, temp_buffer, MAX_NTP_TIME_SIZE); - g_snprintf(buffer, buffer_size, - "{ kind=%s, lease_duration=%s }", + g_snprintf(buffer, buffer_size, + "{ kind=%s, lease_duration=%s }", val_to_str(kind, liveliness_qos_vals, "0x%08x"), temp_buffer); @@ -1873,17 +1870,17 @@ static gint rtps_util_add_seq_string(proto_tree *tree, /* Can NOT be NULL */ offset += 4; /* Create the string node with a fake string, the replace it later */ - ti = proto_tree_add_text(tree, + ti = proto_tree_add_text(tree, tvb, offset, param_length-8, "Strings"); string_tree = proto_item_add_subtree(ti, ett_rtps_seq_string); - + overview_buffer[0] = '\0'; for (i = 0; i < num_strings; ++i) { - g_snprintf(temp_buff, MAX_LABEL_SIZE, + g_snprintf(temp_buff, MAX_LABEL_SIZE, "%s[%d]", label, i); @@ -1931,17 +1928,17 @@ static gint rtps_util_add_seq_ulong(proto_tree *tree, /* Can NOT be NULL */ offset += 4; /* Create the string node with an empty string, the replace it later */ - ti = proto_tree_add_text(tree, + ti = proto_tree_add_text(tree, tvb, offset, param_length-8, "Seq"); string_tree = proto_item_add_subtree(ti, ett_rtps_seq_ulong); - + overview_buff[0] = '\0'; for (i = 0; i < num_elem; ++i) { - g_snprintf(temp_buff, MAX_LABEL_SIZE, + g_snprintf(temp_buff, MAX_LABEL_SIZE, "%s[%d]", label, i); @@ -1961,7 +1958,7 @@ static gint rtps_util_add_seq_ulong(proto_tree *tree, /* Can NOT be NULL */ "%s: %s", label, overview_buff); - + return offset; } @@ -2006,7 +2003,7 @@ static const char * rtps_util_typecode_id_to_string(guint32 typecode_id) { /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next bytes interpreted as typecode info - * Returns the number of bytes parsed + * Returns the number of bytes parsed */ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t * tvb, @@ -2028,7 +2025,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, char indent_string[40]; gint retVal; char type_name[40]; - + /* Structure of the typecode data: * Offset | Size | Field | Notes * ----------|-------|------------------------------|--------------------- @@ -2040,12 +2037,12 @@ static gint rtps_util_add_typecode(proto_tree *tree, /* Calc indent string */ memset(indent_string, ' ', 40); indent_string[indent_level*2] = '\0'; - + /* Gets TK ID */ LONG_ALIGN(offset); tk_id = NEXT_guint32(tvb, offset, little_endian); offset += 4; - + /* Gets TK size */ tk_size = NEXT_guint16(tvb, offset, little_endian); offset += 2; @@ -2055,10 +2052,10 @@ static gint rtps_util_add_typecode(proto_tree *tree, /* The first bit of typecode is set to 1, clear it */ tk_id &= 0x7fffffff; - /* HACK: NDDS 4.0 and NDDS 4.1 has different typecode ID list. + /* HACK: NDDS 4.0 and NDDS 4.1 has different typecode ID list. * The ID listed in the RTI_CDR_TK_XXXXX are the one from NDDS 4.1 - * In order to correctly dissect NDDS 4.0 packets containing typecode - * information, we check if the ID of the element at level zero is a + * In order to correctly dissect NDDS 4.0 packets containing typecode + * information, we check if the ID of the element at level zero is a * struct or union. If not, it means we are dissecting a ndds 4.0 packet * (and we can decrement the ID to match the correct values). */ @@ -2100,14 +2097,14 @@ static gint rtps_util_add_typecode(proto_tree *tree, * <string> ::= <length>char+<eol> * <length> ::= unsigned long * <eol> ::= (char)0 - * + * * <union_member_detail> ::= <is_pointer> - * <labels_count> + * <labels_count> * <label>+ - * <type_code> + * <type_code> * <labels_count> ::= unsigned long * <label> ::= long - * + * */ case RTI_CDR_TK_UNION: { guint32 struct_name_len; @@ -2156,20 +2153,19 @@ static gint rtps_util_add_typecode(proto_tree *tree, disc_id &= 0x7fffffff; discriminator_name = rtps_util_typecode_id_to_string(disc_id); if (disc_id == RTI_CDR_TK_ENUM) { - /* Enums has also a name that we should print */ - LONG_ALIGN(offset); - discriminator_enum_name_length = NEXT_guint32(tvb, offset, little_endian); - discriminator_enum_name = tvb_get_ephemeral_string(tvb, offset+4, discriminator_enum_name_length); - } + /* Enums has also a name that we should print */ + LONG_ALIGN(offset); + discriminator_enum_name_length = NEXT_guint32(tvb, offset, little_endian); + discriminator_enum_name = tvb_get_ephemeral_string(tvb, offset+4, discriminator_enum_name_length); + } offset = disc_offset_begin + disc_size; -/* - field_offset_begin = offset; - offset += rtps_util_add_typecode( +#if 0 + field_offset_begin = offset; + offset += rtps_util_add_typecode( tree, - tvb, next_offset = offset; - - offset, - little_endian, + tvb, + offset, + little_endian, indent_level+1, 0, 0, @@ -2179,8 +2175,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, -1, NULL, ndds_40_hack); -*/ - +#endif /* Add the entry of the union in the tree */ proto_tree_add_text(tree, @@ -2204,7 +2199,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, LONG_ALIGN(offset); num_members = NEXT_guint32(tvb, offset, little_endian); offset += 4; - + /* - - - - - - - <union_member>+ - - - - - - - */ next_offset = offset; @@ -2236,7 +2231,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, LONG_ALIGN(offset); member_label_count = NEXT_guint32(tvb, offset, little_endian); offset += 4; - + for (j = 0; j < member_label_count; ++j) { /* Label count */ LONG_ALIGN(offset); @@ -2255,9 +2250,9 @@ static gint rtps_util_add_typecode(proto_tree *tree, offset += rtps_util_add_typecode( tree, - tvb, - offset, - little_endian, + tvb, + offset, + little_endian, indent_level+2, member_is_pointer, 0, @@ -2298,10 +2293,10 @@ static gint rtps_util_add_typecode(proto_tree *tree, * <length> ::= unsigned long * <eol> ::= (char)0 * <member_count> ::= unsigned long - * + * * STRUCT / UNION: * Foreach member { - * - A2: 2: member length + * - A2: 2: member length * - A4: 4: member name length * - n: member name * - 1: isPointer? @@ -2317,7 +2312,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, * - A4: 4: member name length * - n: member name * - A4: 4: ordinal number - * + * * -> ----------------------------------------------------- <- * -> The alignment pad bytes belong to the FOLLOWING field <- * -> A4 = 4 bytes alignment, A2 = 2 bytes alignment <- @@ -2350,9 +2345,9 @@ static gint rtps_util_add_typecode(proto_tree *tree, if (tk_id == RTI_CDR_TK_ENUM) { - typecode_name = "enum"; + typecode_name = "enum"; } else { - typecode_name = "struct"; + typecode_name = "struct"; } if (seq_max_len != -1) { @@ -2423,16 +2418,16 @@ static gint rtps_util_add_typecode(proto_tree *tree, SHORT_ALIGN(offset); member_bitfield = NEXT_guint16(tvb, offset, little_endian); offset += 2; /* pad will be added by typecode dissector */ - + /* is Key ? */ member_is_key = tvb_get_guint8(tvb, offset); offset++; offset += rtps_util_add_typecode( tree, - tvb, - offset, - little_endian, + tvb, + offset, + little_endian, indent_level+1, member_is_pointer, member_bitfield, @@ -2482,9 +2477,9 @@ static gint rtps_util_add_typecode(proto_tree *tree, /* Recursive decode seq typecode */ offset += rtps_util_add_typecode( tree, - tvb, - offset, - little_endian, + tvb, + offset, + little_endian, indent_level, is_pointer, bitfield, @@ -2523,9 +2518,9 @@ static gint rtps_util_add_typecode(proto_tree *tree, /* Recursive decode seq typecode */ offset += rtps_util_add_typecode( tree, - tvb, - offset, - little_endian, + tvb, + offset, + little_endian, indent_level, is_pointer, bitfield, @@ -2566,7 +2561,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, * - A2: type modifier * - A4: base type code * - A4: number of members - * Foreach member: (it's just like a struct) + * Foreach member: (it's just like a struct) * */ case RTI_CDR_TK_VALUE: { @@ -2604,7 +2599,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, is_key ? KEY_COMMENT : ""); return retVal; } - + /* Array print */ if (arr_dimension != NULL) { /* Printing an array */ @@ -2689,8 +2684,8 @@ static void rtps_util_add_seq_octets(proto_tree *tree, "RTPS PROTOCOL ERROR: parameter value too small", buffer_size); proto_tree_add_text(tree, - tvb, - offset, + tvb, + offset, param_length, "%s", buffer); return ; @@ -2701,9 +2696,9 @@ static void rtps_util_add_seq_octets(proto_tree *tree, seq_length = MAX_SEQ_OCTETS_PRINTED; } for (i = 0; i < seq_length; ++i) { - idx += g_snprintf(&buffer[idx], + idx += g_snprintf(&buffer[idx], buffer_size - idx - 1, - "%02x", + "%02x", tvb_get_guint8(tvb, offset++)); if (idx >= buffer_size) { break; @@ -2740,7 +2735,7 @@ static void rtps_util_add_seq_octets(proto_tree *tree, * SequenceNumber_t bitmapBase; * sequence<long, 8> bitmap; * } SequenceNumberSet; - * + * * Returns the new offset after reading the bitmap. */ static int rtps_util_add_bitmap(proto_tree *tree, @@ -2842,20 +2837,20 @@ static void rtps_util_decode_flags(proto_tree * tree, proto_tree * flags_tree; int i, j; char flags_str[MAX_FLAG_SIZE]; - + flags_str[0] = '\0'; for (i = 0; i < 8; ++i) { g_snprintf(flags_str + (2 * i), MAX_FLAG_SIZE - (2 * i), "%c ", ((flags & (1<<(7-i))) ? flag_def[i].letter : RESERVEDFLAG_CHAR)); } - ti = proto_tree_add_uint_format(tree, + ti = proto_tree_add_uint_format(tree, hf_rtps_sm_flags, - tvb, - offset, - 1, + tvb, + offset, + 1, flags, - "Flags: 0x%02x (%s)", + "Flags: 0x%02x (%s)", flags, flags_str); @@ -2869,7 +2864,7 @@ static void rtps_util_decode_flags(proto_tree * tree, flags_str[j] = (i == j) ? (is_set ? '1' : '0') : '.'; } flags_str[8] = '\0'; - + proto_tree_add_text(flags_tree, tvb, offset, @@ -2879,7 +2874,7 @@ static void rtps_util_decode_flags(proto_tree * tree, flag_def[i].description, is_set ? "Set" : "Not set"); } - + } @@ -2920,17 +2915,17 @@ static gint dissect_parameter_sequence(proto_tree *tree, guint16 parameter, param_length; guint8 buffer[MAX_PARAM_SIZE]; gint max_param_section = offset + octects_to_next_header; - + buffer[0] = '\0'; - ti = proto_tree_add_text(tree, - tvb, - offset, + ti = proto_tree_add_text(tree, + tvb, + offset, -1, "%s:", label); rtps_parameter_sequence_tree = proto_item_add_subtree(ti, ett_rtps_parameter_sequence); - + /* Loop through all the parameters defined until PID_SENTINEL is found */ do { @@ -2949,9 +2944,9 @@ static gint dissect_parameter_sequence(proto_tree *tree, * be set later... */ parameter = NEXT_guint16(tvb, offset, little_endian); - ti = proto_tree_add_text(rtps_parameter_sequence_tree, - tvb, - offset, + ti = proto_tree_add_text(rtps_parameter_sequence_tree, + tvb, + offset, -1, "%s", val_to_str(parameter, parameter_id_vals, @@ -2967,7 +2962,7 @@ static gint dissect_parameter_sequence(proto_tree *tree, parameter, val_to_str(parameter, parameter_id_vals, "unknown %04x")); - + offset += 2; /* parameter length */ @@ -2998,8 +2993,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, switch(parameter) { /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_PARTICIPANT_LEASE_DURATION| 0x0008 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_PARTICIPANT_LEASE_DURATION| 0x0008 | * +---------------+---------------+---------------+---------------+ * | long NtpTime.seconds | * +---------------+---------------+---------------+---------------+ @@ -3016,11 +3011,11 @@ static gint dissect_parameter_sequence(proto_tree *tree, buffer, MAX_PARAM_SIZE); break; - + /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_TIME_BASED_FILTER | 0x0008 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_TIME_BASED_FILTER | 0x0008 | * +---------------+---------------+---------------+---------------+ * | long NtpTime.seconds | * +---------------+---------------+---------------+---------------+ @@ -3039,8 +3034,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_TOPIC_NAME | length | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_TOPIC_NAME | length | * +---------------+---------------+---------------+---------------+ * | unsigned long String.length | * +---------------+---------------+---------------+---------------+ @@ -3062,8 +3057,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_OWNERSHIP_STRENGTH | 0x0004 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_OWNERSHIP_STRENGTH | 0x0004 | * +---------------+---------------+---------------+---------------+ * | long strength | * +---------------+---------------+---------------+---------------+ @@ -3079,12 +3074,12 @@ static gint dissect_parameter_sequence(proto_tree *tree, TRUE, /* Is Signed ? */ NULL, /* No Label, use the protocol item ID */ buffer, - MAX_PARAM_SIZE); + MAX_PARAM_SIZE); break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_TYPE_NAME | length | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_TYPE_NAME | length | * +---------------+---------------+---------------+---------------+ * | unsigned long String.length | * +---------------+---------------+---------------+---------------+ @@ -3107,8 +3102,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_XXXXXXXXXXX | 0x0004 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_XXXXXXXXXXX | 0x0004 | * +---------------+---------------+---------------+---------------+ * | long port | * +---------------+---------------+---------------+---------------+ @@ -3120,17 +3115,17 @@ static gint dissect_parameter_sequence(proto_tree *tree, rtps_util_add_port(rtps_parameter_tree, tvb, offset, - little_endian, + little_endian, "port", buffer, MAX_PARAM_SIZE); break; - - + + /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_DEFAULT_EXPECTS_INLINE_QOS| 0x0004 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_DEFAULT_EXPECTS_INLINE_QOS| 0x0004 | * +---------------+---------------+---------------+---------------+ * | boolean | N O T U S E D | * +---------------+---------------+---------------+---------------+ @@ -3146,8 +3141,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_XXXXXXXXXXX | length | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_XXXXXXXXXXX | length | * +---------------+---------------+---------------+---------------+ * | unsigned long ip_address | * +---------------+---------------+---------------+---------------+ @@ -3168,8 +3163,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_PROTOCOL_VERSION | 0x0004 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_PROTOCOL_VERSION | 0x0004 | * +---------------+---------------+---------------+---------------+ * | uint8 major | uint8 minor | N O T U S E D | * +---------------+---------------+---------------+---------------+ @@ -3186,14 +3181,14 @@ static gint dissect_parameter_sequence(proto_tree *tree, tvb, offset, param_length, - "protocolVersion: %s", + "protocolVersion: %s", buffer); break; } /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_VENDOR_ID | 0x0004 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_VENDOR_ID | 0x0004 | * +---------------+---------------+---------------+---------------+ * | uint8 major | uint8 minor | N O T U S E D | * +---------------+---------------+---------------+---------------+ @@ -3209,15 +3204,15 @@ static gint dissect_parameter_sequence(proto_tree *tree, tvb, offset, 2, - "vendorId: %s", + "vendorId: %s", buffer); break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_RELIABILITY | 0x0004 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_RELIABILITY | 0x0004 | * +---------------+---------------+---------------+---------------+ * | unsigned long kind | * +---------------+---------------+---------------+---------------+ @@ -3233,7 +3228,7 @@ static gint dissect_parameter_sequence(proto_tree *tree, reliability_qos_vals, buffer, MAX_PARAM_SIZE); - + /* Older version of the protocol (and for PID_RELIABILITY_OFFERED) * this parameter was carrying also a NtpTime called * 'maxBlockingTime'. @@ -3251,8 +3246,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_LIVELINESS | 0x000c | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_LIVELINESS | 0x000c | * +---------------+---------------+---------------+---------------+ * | unsigned long kind | * +---------------+---------------+---------------+---------------+ @@ -3261,7 +3256,7 @@ static gint dissect_parameter_sequence(proto_tree *tree, * | unsigned long NtpTime.fraction | * +---------------+---------------+---------------+---------------+ * NDDS 3.1 sends only 'kind' on the wire. - * + * */ case PID_LIVELINESS_OFFERED: /* Deprecated */ case PID_LIVELINESS: @@ -3276,8 +3271,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_DURABILITY | 0x0004 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_DURABILITY | 0x0004 | * +---------------+---------------+---------------+---------------+ * | unsigned long kind | * +---------------+---------------+---------------+---------------+ @@ -3295,8 +3290,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_DURABILITY_SERVICE | 0x0004 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_DURABILITY_SERVICE | 0x0004 | * +---------------+---------------+---------------+---------------+ * | long NtpTime.seconds | * +---------------+---------------+---------------+---------------+ @@ -3325,8 +3320,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_OWNERSHIP | 0x0004 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_OWNERSHIP | 0x0004 | * +---------------+---------------+---------------+---------------+ * | unsigned long kind | * +---------------+---------------+---------------+---------------+ @@ -3346,8 +3341,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_PRESENTATION | 0x0008 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_PRESENTATION | 0x0008 | * +---------------+---------------+---------------+---------------+ * | unsigned long kind | * +---------------+---------------+---------------+---------------+ @@ -3385,8 +3380,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_DEADLINE | 0x0008 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_DEADLINE | 0x0008 | * +---------------+---------------+---------------+---------------+ * | long NtpTime.seconds | * +---------------+---------------+---------------+---------------+ @@ -3406,8 +3401,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_DESTINATION_ORDER | 0x0004 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_DESTINATION_ORDER | 0x0004 | * +---------------+---------------+---------------+---------------+ * | unsigned long kind | * +---------------+---------------+---------------+---------------+ @@ -3427,8 +3422,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_LATENCY_BUDGET | 0x0008 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_LATENCY_BUDGET | 0x0008 | * +---------------+---------------+---------------+---------------+ * | long NtpTime.seconds | * +---------------+---------------+---------------+---------------+ @@ -3449,8 +3444,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_PARTITION | length | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_PARTITION | length | * +---------------+---------------+---------------+---------------+ * | unsigned long sequence_size | * +---------------+---------------+---------------+---------------+ @@ -3463,7 +3458,7 @@ static gint dissect_parameter_sequence(proto_tree *tree, * The value is a sequence of strings. */ case PID_PARTITION_OFFERED: /* Deprecated */ - case PID_PARTITION: + case PID_PARTITION: ENSURE_LENGTH(4); rtps_util_add_seq_string(rtps_parameter_tree, tvb, @@ -3476,8 +3471,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_LIFESPAN | 0x0008 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_LIFESPAN | 0x0008 | * +---------------+---------------+---------------+---------------+ * | long NtpTime.seconds | * +---------------+---------------+---------------+---------------+ @@ -3497,8 +3492,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_USER_DATA | length | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_USER_DATA | length | * +---------------+---------------+---------------+---------------+ * | unsigned long sequence_size | * +---------------+---------------+---------------+---------------+ @@ -3508,7 +3503,7 @@ static gint dissect_parameter_sequence(proto_tree *tree, * +---------------+---------------+---------------+---------------+ */ case PID_USER_DATA: - ENSURE_LENGTH(4); + ENSURE_LENGTH(4); rtps_util_add_seq_octets(rtps_parameter_tree, tvb, offset, @@ -3521,8 +3516,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_GROUP_DATA | length | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_GROUP_DATA | length | * +---------------+---------------+---------------+---------------+ * | unsigned long sequence_size | * +---------------+---------------+---------------+---------------+ @@ -3531,7 +3526,7 @@ static gint dissect_parameter_sequence(proto_tree *tree, * | ... | * +---------------+---------------+---------------+---------------+ */ - case PID_GROUP_DATA: + case PID_GROUP_DATA: ENSURE_LENGTH(4); rtps_util_add_seq_octets(rtps_parameter_tree, tvb, @@ -3544,8 +3539,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_TOPIC_DATA | length | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_TOPIC_DATA | length | * +---------------+---------------+---------------+---------------+ * | unsigned long sequence_size | * +---------------+---------------+---------------+---------------+ @@ -3554,7 +3549,7 @@ static gint dissect_parameter_sequence(proto_tree *tree, * | ... | * +---------------+---------------+---------------+---------------+ */ - case PID_TOPIC_DATA: + case PID_TOPIC_DATA: ENSURE_LENGTH(4); rtps_util_add_seq_octets(rtps_parameter_tree, tvb, @@ -3567,8 +3562,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_UNICAST_LOCATOR | 0x0018 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_UNICAST_LOCATOR | 0x0018 | * +---------------+---------------+---------------+---------------+ * | long kind | * +---------------+---------------+---------------+---------------+ @@ -3583,7 +3578,7 @@ static gint dissect_parameter_sequence(proto_tree *tree, * | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] | * +---------------+---------------+---------------+---------------+ */ - case PID_UNICAST_LOCATOR: + case PID_UNICAST_LOCATOR: ENSURE_LENGTH(24); rtps_util_add_locator_t(rtps_parameter_tree, tvb, @@ -3596,8 +3591,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_MULTICAST_LOCATOR | 0x0018 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_MULTICAST_LOCATOR | 0x0018 | * +---------------+---------------+---------------+---------------+ * | long kind | * +---------------+---------------+---------------+---------------+ @@ -3612,7 +3607,7 @@ static gint dissect_parameter_sequence(proto_tree *tree, * | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] | * +---------------+---------------+---------------+---------------+ */ - case PID_MULTICAST_LOCATOR: + case PID_MULTICAST_LOCATOR: ENSURE_LENGTH(24); rtps_util_add_locator_t(rtps_parameter_tree, tvb, @@ -3625,8 +3620,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_DEFAULT_UNICAST_LOCATOR | 0x0018 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_DEFAULT_UNICAST_LOCATOR | 0x0018 | * +---------------+---------------+---------------+---------------+ * | long kind | * +---------------+---------------+---------------+---------------+ @@ -3641,7 +3636,7 @@ static gint dissect_parameter_sequence(proto_tree *tree, * | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] | * +---------------+---------------+---------------+---------------+ */ - case PID_DEFAULT_UNICAST_LOCATOR: + case PID_DEFAULT_UNICAST_LOCATOR: ENSURE_LENGTH(24); rtps_util_add_locator_t(rtps_parameter_tree, tvb, @@ -3654,8 +3649,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_METATRAFFIC_UNICAST_LOC...| 0x0018 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_METATRAFFIC_UNICAST_LOC...| 0x0018 | * +---------------+---------------+---------------+---------------+ * | long kind | * +---------------+---------------+---------------+---------------+ @@ -3670,7 +3665,7 @@ static gint dissect_parameter_sequence(proto_tree *tree, * | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] | * +---------------+---------------+---------------+---------------+ */ - case PID_METATRAFFIC_UNICAST_LOCATOR: + case PID_METATRAFFIC_UNICAST_LOCATOR: ENSURE_LENGTH(24); rtps_util_add_locator_t(rtps_parameter_tree, tvb, @@ -3683,8 +3678,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_METATRAFFIC_MULTICAST_L...| 0x0018 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_METATRAFFIC_MULTICAST_L...| 0x0018 | * +---------------+---------------+---------------+---------------+ * | long kind | * +---------------+---------------+---------------+---------------+ @@ -3699,7 +3694,7 @@ static gint dissect_parameter_sequence(proto_tree *tree, * | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] | * +---------------+---------------+---------------+---------------+ */ - case PID_METATRAFFIC_MULTICAST_LOCATOR: + case PID_METATRAFFIC_MULTICAST_LOCATOR: ENSURE_LENGTH(24); rtps_util_add_locator_t(rtps_parameter_tree, tvb, @@ -3712,8 +3707,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_PARTICIPANT_MANUAL_LIVE...| 0x0004 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_PARTICIPANT_MANUAL_LIVE...| 0x0004 | * +---------------+---------------+---------------+---------------+ * | long livelinessEpoch | * +---------------+---------------+---------------+---------------+ @@ -3734,8 +3729,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_HISTORY | 0x0004 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_HISTORY | 0x0004 | * +---------------+---------------+---------------+---------------+ * | long kind | * +---------------+---------------+---------------+---------------+ @@ -3754,7 +3749,7 @@ static gint dissect_parameter_sequence(proto_tree *tree, buffer+strlen(buffer), MAX_PARAM_SIZE-strlen(buffer)); g_strlcat(buffer, ", ", MAX_PARAM_SIZE); - + rtps_util_add_long(rtps_parameter_tree, tvb, offset+4, @@ -3770,8 +3765,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_RESOURCE_LIMIT | 0x0004 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_RESOURCE_LIMIT | 0x0004 | * +---------------+---------------+---------------+---------------+ * | long max_samples | * +---------------+---------------+---------------+---------------+ @@ -3805,7 +3800,7 @@ static gint dissect_parameter_sequence(proto_tree *tree, buffer + strlen(buffer), MAX_PARAM_SIZE-strlen(buffer)); g_strlcat(buffer, ", ", MAX_PARAM_SIZE); - + rtps_util_add_long(rtps_parameter_tree, tvb, offset+8, @@ -3821,8 +3816,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_CONTENT_FILTER_PROPERTY | length | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_CONTENT_FILTER_PROPERTY | length | * +---------------+---------------+---------------+---------------+ * | unsigned long String1.length | * +---------------+---------------+---------------+---------------+ @@ -3852,7 +3847,7 @@ static gint dissect_parameter_sequence(proto_tree *tree, * | Filter Parameters | * | ... | * +---------------+---------------+---------------+---------------+ - * + * * String1: ContentFilterName * String2: RelatedTopicName * String3: FilterName @@ -3908,8 +3903,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, } /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_PROPERTY_LIST | length | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_PROPERTY_LIST | length | * +---------------+---------------+---------------+---------------+ * | unsigned long Seq.Length | * +---------------+---------------+---------------+---------------+ @@ -3925,7 +3920,7 @@ static gint dissect_parameter_sequence(proto_tree *tree, * | Property n | * | ... | * +---------------+---------------+---------------+---------------+ - * + * * IDL: * struct PROPERTY { * String Name; @@ -3984,7 +3979,7 @@ static gint dissect_parameter_sequence(proto_tree *tree, tvb, prev_offset, temp_offset - prev_offset, - "%-29s | %-29s", + "%-29s | %-29s", tempName, tempValue); } @@ -3993,12 +3988,12 @@ static gint dissect_parameter_sequence(proto_tree *tree, break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_FILTER_SIGNATURE | length | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_FILTER_SIGNATURE | length | * +---------------+---------------+---------------+---------------+ * | ... | * +---------------+---------------+---------------+---------------+ - * + * * IDL: * struct CONTENT_FILTER_SIGNATURE { * sequence<long> filterBitmap; @@ -4016,7 +4011,7 @@ static gint dissect_parameter_sequence(proto_tree *tree, guint32 fs_elem; guint32 fs[4]; ENSURE_LENGTH(8); - + /* Dissect filter bitmap */ temp_offset = rtps_util_add_seq_ulong(rtps_parameter_tree, tvb, @@ -4026,7 +4021,7 @@ static gint dissect_parameter_sequence(proto_tree *tree, TRUE, /* is_hex */ FALSE, /* filterSignature: is_signed */ "filterBitmap"); - + /* Dissect sequence of FILTER_SIGNATURE */ fs_elem = NEXT_guint32(tvb, temp_offset, little_endian); temp_offset += 4; @@ -4048,14 +4043,14 @@ static gint dissect_parameter_sequence(proto_tree *tree, "filterSignature: %08x %08x %08x %08x", fs[0], fs[1], fs[2], fs[3]); } - + break; } /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_COHERENT_SET | length | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_COHERENT_SET | length | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber seqNumber + @@ -4072,8 +4067,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_TYPECODE | length | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_TYPECODE | length | * +---------------+---------------+---------------+---------------+ * | | * + Type code description + @@ -4097,8 +4092,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_PARTICIPANT_GUID | 0x000c | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_PARTICIPANT_GUID | 0x000c | * +---------------+---------------+---------------+---------------+ * | guid[0] | guid[1] | guid[2] | guid[3] | * +---------------+---------------+---------------+---------------+ @@ -4115,12 +4110,12 @@ static gint dissect_parameter_sequence(proto_tree *tree, "Participant GUID", buffer, MAX_PARAM_SIZE); - + break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_PARTICIPANT_ENTITY_ID | 0x0004 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_PARTICIPANT_ENTITY_ID | 0x0004 | * +---------------+---------------+---------------+---------------+ * | entity[0] | entity[1] | entity[2] | entity[3] | * +---------------+---------------+---------------+---------------+ @@ -4136,8 +4131,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_GROUP_GUID | 0x000c | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_GROUP_GUID | 0x000c | * +---------------+---------------+---------------+---------------+ * | guid[0] | guid[1] | guid[2] | guid[3] | * +---------------+---------------+---------------+---------------+ @@ -4154,17 +4149,17 @@ static gint dissect_parameter_sequence(proto_tree *tree, "Group GUID", buffer, MAX_PARAM_SIZE); - + break; /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PID_GROUP_ENTITY_ID | 0x0004 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PID_GROUP_ENTITY_ID | 0x0004 | * +---------------+---------------+---------------+---------------+ * | entity[0] | entity[1] | entity[2] | entity[3] | * +---------------+---------------+---------------+---------------+ */ - case PID_GROUP_ENTITY_ID: + case PID_GROUP_ENTITY_ID: ENSURE_LENGTH(4); rtps_util_add_generic_entity_id(rtps_parameter_tree, @@ -4173,7 +4168,7 @@ static gint dissect_parameter_sequence(proto_tree *tree, "Group entity ID", buffer, MAX_PARAM_SIZE); - + break; @@ -4229,9 +4224,9 @@ static gint dissect_parameter_sequence(proto_tree *tree, "%c 0x%08x", sep, manager_key); - proto_tree_add_text(rtps_parameter_tree, - tvb, - offset, + proto_tree_add_text(rtps_parameter_tree, + tvb, + offset, param_length, "Key[%d]: 0x%X", i, manager_key); ++i; @@ -4279,8 +4274,8 @@ static gint dissect_parameter_sequence(proto_tree *tree, * parameters. */ /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | <pid_id> | 0x0000 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | <pid_id> | 0x0000 | * +---------------+---------------+---------------+---------------+ */ case PID_IS_RELIABLE: @@ -4317,15 +4312,15 @@ static gint dissect_parameter_sequence(proto_tree *tree, /* *********************************************************************** */ /* * P A D * */ /* *********************************************************************** */ -static void dissect_PAD(tvbuff_t *tvb, - gint offset, - guint8 flags, +static void dissect_PAD(tvbuff_t *tvb, + gint offset, + guint8 flags, gboolean little_endian, - int octects_to_next_header, + int octects_to_next_header, proto_tree *tree) { /* 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | PAD |X|X|X|X|X|X|X|E| octetsToNextHeader | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | PAD |X|X|X|X|X|X|X|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ */ rtps_util_decode_flags(tree, tvb, offset + 1, flags, PAD_FLAGS); @@ -4333,8 +4328,8 @@ static void dissect_PAD(tvbuff_t *tvb, if (octects_to_next_header != 0) { proto_tree_add_uint_format(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset + 2, + tvb, + offset + 2, 2, octects_to_next_header, "octectsToNextHeader: %u (Error: should be ZERO)", @@ -4342,11 +4337,11 @@ static void dissect_PAD(tvbuff_t *tvb, return; } - proto_tree_add_item(tree, + proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset + 2, - 2, + tvb, + offset + 2, + 2, little_endian); } @@ -4357,17 +4352,17 @@ static void dissect_PAD(tvbuff_t *tvb, /* *********************************************************************** */ /* * D A T A * */ /* *********************************************************************** */ -static void dissect_DATA(tvbuff_t *tvb, - gint offset, - guint8 flags, +static void dissect_DATA(tvbuff_t *tvb, + gint offset, + guint8 flags, gboolean little_endian, - int octects_to_next_header, + int octects_to_next_header, proto_tree *tree, const char ** sm_data) { /* May be set to some known values */ /* RTPS 1.0/1.1: * 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | DATA |X|X|X|U|H|A|P|E| octetsToNextHeader | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | DATA |X|X|X|U|H|A|P|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | ObjectId readerObjectId | * +---------------+---------------+---------------+---------------+ @@ -4375,7 +4370,7 @@ static void dissect_DATA(tvbuff_t *tvb, * +---------------+---------------+---------------+---------------+ * | HostId hostId (iff H==1) | * +---------------+---------------+---------------+---------------+ - * | AppId appId (iff H==1) | + * | AppId appId (iff H==1) | * +---------------+---------------+---------------+---------------+ * | ObjectId objectId | * +---------------+---------------+---------------+---------------+ @@ -4391,8 +4386,8 @@ static void dissect_DATA(tvbuff_t *tvb, * * RTPS 1.2: * 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | DATA |X|X|U|Q|H|A|D|E| octetsToNextHeader | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | DATA |X|X|U|Q|H|A|D|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ @@ -4412,7 +4407,7 @@ static void dissect_DATA(tvbuff_t *tvb, * ~ ParameterList inlineQos [only if Q==1] ~ * | | * +---------------+---------------+---------------+---------------+ - * | | + * | | * ~ SerializedData serializedData [only if D==1] ~ * | | * +---------------+---------------+---------------+---------------+ @@ -4434,22 +4429,22 @@ static void dissect_DATA(tvbuff_t *tvb, if ((flags & FLAG_DATA_D) != 0) min_len += 4; if (octects_to_next_header < min_len) { - proto_tree_add_uint_format(tree, + proto_tree_add_uint_format(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset+2, - 2, + tvb, + offset+2, + 2, octects_to_next_header, "octectsToNextHeader: %u (Error: should be >= %u)", - octects_to_next_header, + octects_to_next_header, min_len); return; } - proto_tree_add_item(tree, + proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset + 2, - 2, + tvb, + offset + 2, + 2, little_endian); offset += 4; @@ -4491,7 +4486,7 @@ static void dissect_DATA(tvbuff_t *tvb, * ENTITYID_BUILTIN_TOPIC_WRITER | 1 | t+ (*) * ENTITYID_BUILTIN_TOPIC_WRITER | 0 | t- (*) * - * Note (*): Currently NDDS does not publish those values + * Note (*): Currently NDDS does not publish those values */ if (wid == ENTITYID_BUILTIN_PUBLICATIONS_WRITER && (flags & FLAG_DATA_A) != 0) { *sm_data = SM_EXTRA_WPLUS; @@ -4552,10 +4547,10 @@ static void dissect_DATA(tvbuff_t *tvb, /* InlineQos */ if ((flags & FLAG_DATA_Q) != 0) { - offset = dissect_parameter_sequence(tree, - tvb, - offset, - little_endian, + offset = dissect_parameter_sequence(tree, + tvb, + offset, + little_endian, octects_to_next_header, "inlineQos"); } @@ -4563,10 +4558,10 @@ static void dissect_DATA(tvbuff_t *tvb, /* SerializedData */ if ((flags & FLAG_DATA_D) != 0) { if (is_builtin_entity) { - offset = dissect_parameter_sequence(tree, - tvb, - offset, - little_endian, + offset = dissect_parameter_sequence(tree, + tvb, + offset, + little_endian, octects_to_next_header, "serializedData"); } else { @@ -4583,16 +4578,16 @@ static void dissect_DATA(tvbuff_t *tvb, /* *********************************************************************** */ /* * N O K E Y _ D A T A * */ /* *********************************************************************** */ -static void dissect_NOKEY_DATA(tvbuff_t *tvb, - gint offset, - guint8 flags, +static void dissect_NOKEY_DATA(tvbuff_t *tvb, + gint offset, + guint8 flags, gboolean little_endian, - int octects_to_next_header, + int octects_to_next_header, proto_tree *tree) { /* RTPS 1.0/1.1: * 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | ISSUE |X|X|X|X|X|X|P|E| octetsToNextHeader | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | ISSUE |X|X|X|X|X|X|P|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | ObjectId readerObjectId | * +---------------+---------------+---------------+---------------+ @@ -4613,8 +4608,8 @@ static void dissect_NOKEY_DATA(tvbuff_t *tvb, * * RTPS 1.2: * 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | NOKEY_DATA |X|X|X|X|X|D|Q|E| octetsToNextHeader | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | NOKEY_DATA |X|X|X|X|X|D|Q|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ @@ -4647,22 +4642,22 @@ static void dissect_NOKEY_DATA(tvbuff_t *tvb, if ((flags & FLAG_NOKEY_DATA_Q) != 0) min_len += 4; if (octects_to_next_header < min_len) { - proto_tree_add_uint_format(tree, + proto_tree_add_uint_format(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset+2, - 2, + tvb, + offset+2, + 2, octects_to_next_header, "octectsToNextHeader: %u (Error: should be >= %u)", - octects_to_next_header, + octects_to_next_header, min_len); return; } - proto_tree_add_item(tree, + proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset + 2, - 2, + tvb, + offset + 2, + 2, little_endian); offset += 4; @@ -4700,13 +4695,13 @@ static void dissect_NOKEY_DATA(tvbuff_t *tvb, /* Parameters */ if ((flags & FLAG_NOKEY_DATA_Q) != 0) { - offset = dissect_parameter_sequence(tree, - tvb, - offset, - little_endian, + offset = dissect_parameter_sequence(tree, + tvb, + offset, + little_endian, octects_to_next_header, "inlineQos"); - + } /* Issue Data */ @@ -4724,16 +4719,16 @@ static void dissect_NOKEY_DATA(tvbuff_t *tvb, /* *********************************************************************** */ /* * A C K N A C K * */ /* *********************************************************************** */ -static void dissect_ACKNACK(tvbuff_t *tvb, - gint offset, - guint8 flags, +static void dissect_ACKNACK(tvbuff_t *tvb, + gint offset, + guint8 flags, gboolean little_endian, - int octects_to_next_header, + int octects_to_next_header, proto_tree *tree) { /* RTPS 1.0/1.1: * 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | ACK |X|X|X|X|X|X|F|E| octetsToNextHeader | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | ACK |X|X|X|X|X|X|F|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | ObjectId readerObjectId | * +---------------+---------------+---------------+---------------+ @@ -4745,11 +4740,11 @@ static void dissect_ACKNACK(tvbuff_t *tvb, * +---------------+---------------+---------------+---------------+ * | Counter count | * +---------------+---------------+---------------+---------------+ - * + * * RTPS 1.2: * 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | ACKNACK |X|X|X|X|X|X|F|E| octetsToNextHeader | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | ACKNACK |X|X|X|X|X|X|F|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ @@ -4767,21 +4762,21 @@ static void dissect_ACKNACK(tvbuff_t *tvb, rtps_util_decode_flags(tree, tvb, offset + 1, flags, ACKNACK_FLAGS); if (octects_to_next_header < 20) { - proto_tree_add_uint_format(tree, + proto_tree_add_uint_format(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset + 2, - 2, + tvb, + offset + 2, + 2, octects_to_next_header, "octectsToNextHeader: %u (Error: should be >= 20)", octects_to_next_header); return; } - proto_tree_add_item(tree, + proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset + 2, - 2, + tvb, + offset + 2, + 2, little_endian); offset += 4; original_offset = offset; @@ -4832,26 +4827,26 @@ static void dissect_ACKNACK(tvbuff_t *tvb, TRUE, /* Is Signed ? */ "counter", /* No Label, use the protocol item ID */ NULL, - 0); + 0); } else if (offset < original_offset + octects_to_next_header) { /* In this case there must be something wrong in the bitmap: there * are some extra bytes that we don't know how to decode */ - proto_tree_add_text(tree, - tvb, - offset, - octects_to_next_header - offset, + proto_tree_add_text(tree, + tvb, + offset, + octects_to_next_header - offset, "Packet malformed: don't know how to decode those " - "extra bytes: %d", + "extra bytes: %d", octects_to_next_header - offset); } else if (offset > original_offset + octects_to_next_header) { /* Decoding the bitmap went over the end of this submessage. * Enter an item in the protocol tree that spans over the entire * submessage. */ - proto_tree_add_text(tree, - tvb, - original_offset, + proto_tree_add_text(tree, + tvb, + original_offset, octects_to_next_header + original_offset, "Packet malformed: not enough bytes to decode"); } @@ -4861,18 +4856,18 @@ static void dissect_ACKNACK(tvbuff_t *tvb, /* *********************************************************************** */ -/* * H E A R T B E A T * */ +/* * H E A R T B E A T * */ /* *********************************************************************** */ -static void dissect_HEARTBEAT(tvbuff_t *tvb, - gint offset, - guint8 flags, +static void dissect_HEARTBEAT(tvbuff_t *tvb, + gint offset, + guint8 flags, gboolean little_endian, - int octects_to_next_header, + int octects_to_next_header, proto_tree *tree) { /* RTPS 1.0/1.1: * 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | HEARTBEAT |X|X|X|X|X|L|F|E| octetsToNextHeader | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | HEARTBEAT |X|X|X|X|X|L|F|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | ObjectId readerObjectId | * +---------------+---------------+---------------+---------------+ @@ -4889,14 +4884,14 @@ static void dissect_HEARTBEAT(tvbuff_t *tvb, * | long counter | * +---------------+---------------+---------------+---------------+ * - * Notes: + * Notes: * - on RTPS 1.0, counter is not present * - on RTPS 1.0, L flag is not present * * RTPS 1.2: * 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | HEARTBEAT |X|X|X|X|X|X|F|E| octetsToNextHeader | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | HEARTBEAT |X|X|X|X|X|X|F|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ @@ -4919,21 +4914,21 @@ static void dissect_HEARTBEAT(tvbuff_t *tvb, if (octects_to_next_header < 24) { - proto_tree_add_uint_format(tree, + proto_tree_add_uint_format(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset+2, - 2, + tvb, + offset+2, + 2, octects_to_next_header, "octectsToNextHeader: %u (Error: should be >= 24)", octects_to_next_header); return; } - proto_tree_add_item(tree, + proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset + 2, - 2, + tvb, + offset + 2, + 2, little_endian); offset += 4; @@ -4993,16 +4988,16 @@ static void dissect_HEARTBEAT(tvbuff_t *tvb, /* *********************************************************************** */ /* * G A P * */ /* *********************************************************************** */ -static void dissect_GAP(tvbuff_t *tvb, - gint offset, - guint8 flags, +static void dissect_GAP(tvbuff_t *tvb, + gint offset, + guint8 flags, gboolean little_endian, - int octects_to_next_header, + int octects_to_next_header, proto_tree *tree) { /* RTPS 1.0/1.1: * 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | GAP |X|X|X|X|X|X|X|E| octetsToNextHeader | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | GAP |X|X|X|X|X|X|X|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | ObjectId readerObjectId | * +---------------+---------------+---------------+---------------+ @@ -5018,8 +5013,8 @@ static void dissect_GAP(tvbuff_t *tvb, * +---------------+---------------+---------------+---------------+ * * 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | GAP |X|X|X|X|X|X|F|E| octetsToNextHeader | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | GAP |X|X|X|X|X|X|F|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ @@ -5038,21 +5033,21 @@ static void dissect_GAP(tvbuff_t *tvb, rtps_util_decode_flags(tree, tvb, offset + 1, flags, GAP_FLAGS); if (octects_to_next_header < 24) { - proto_tree_add_uint_format(tree, + proto_tree_add_uint_format(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset + 2, - 2, + tvb, + offset + 2, + 2, octects_to_next_header, "octectsToNextHeader: %u (Error: should be >= 24)", octects_to_next_header); return; } - proto_tree_add_item(tree, + proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset + 2, - 2, + tvb, + offset + 2, + 2, little_endian); offset += 4; @@ -5101,16 +5096,16 @@ static void dissect_GAP(tvbuff_t *tvb, /* *********************************************************************** */ /* * I N F O _ T S * */ /* *********************************************************************** */ -static void dissect_INFO_TS(tvbuff_t *tvb, - gint offset, - guint8 flags, +static void dissect_INFO_TS(tvbuff_t *tvb, + gint offset, + guint8 flags, gboolean little_endian, - int octects_to_next_header, + int octects_to_next_header, proto_tree *tree) { /* RTPS 1.0/1.1: * 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | INFO_TS |X|X|X|X|X|X|I|E| octetsToNextHeader | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | INFO_TS |X|X|X|X|X|X|I|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | | * + NtpTime ntpTimestamp [only if I==0] + @@ -5119,8 +5114,8 @@ static void dissect_INFO_TS(tvbuff_t *tvb, * * RTPS 1.2: * 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | INFO_TS |X|X|X|X|X|X|T|E| octetsToNextHeader | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | INFO_TS |X|X|X|X|X|X|T|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | | * + Timestamp timestamp [only if T==1] + @@ -5135,23 +5130,23 @@ static void dissect_INFO_TS(tvbuff_t *tvb, if ((flags & FLAG_INFO_TS_T) == 0) min_len += 8; if (octects_to_next_header != min_len) { - proto_tree_add_uint_format(tree, + proto_tree_add_uint_format(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset+2, - 2, + tvb, + offset+2, + 2, octects_to_next_header, "octectsToNextHeader: %u (Error: should be == %u)", - octects_to_next_header, + octects_to_next_header, min_len); return; } - proto_tree_add_item(tree, + proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset + 2, - 2, + tvb, + offset + 2, + 2, little_endian); offset += 4; @@ -5170,16 +5165,16 @@ static void dissect_INFO_TS(tvbuff_t *tvb, /* *********************************************************************** */ /* * I N F O _ S R C * */ /* *********************************************************************** */ -static void dissect_INFO_SRC(tvbuff_t *tvb, - gint offset, - guint8 flags, +static void dissect_INFO_SRC(tvbuff_t *tvb, + gint offset, + guint8 flags, gboolean little_endian, - int octects_to_next_header, + int octects_to_next_header, proto_tree *tree) { /* RTPS 1.0/1.1: * 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | INFO_SRC |X|X|X|X|X|X|X|E| octetsToNextHeader | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | INFO_SRC |X|X|X|X|X|X|X|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | IPAddress appIpAddress | * +---------------+---------------+---------------+---------------+ @@ -5187,13 +5182,13 @@ static void dissect_INFO_SRC(tvbuff_t *tvb, * +---------------+---------------+---------------+---------------+ * | HostId hostId | * +---------------+---------------+---------------+---------------+ - * | AppId appId | + * | AppId appId | * +---------------+---------------+---------------+---------------+ * * RTPS 1.2: * 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | INFO_SRC |X|X|X|X|X|X|X|E| octetsToNextHeader | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | INFO_SRC |X|X|X|X|X|X|X|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | long unused | * +---------------+---------------+---------------+---------------+ @@ -5208,22 +5203,22 @@ static void dissect_INFO_SRC(tvbuff_t *tvb, rtps_util_decode_flags(tree, tvb, offset + 1, flags, INFO_SRC_FLAGS); if (octects_to_next_header != 16) { - proto_tree_add_uint_format(tree, + proto_tree_add_uint_format(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset+2, - 2, + tvb, + offset+2, + 2, octects_to_next_header, "octectsToNextHeader: %u (Error: should be == 16)", octects_to_next_header); return; } - proto_tree_add_item(tree, + proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset + 2, - 2, + tvb, + offset + 2, + 2, little_endian); offset += 4; @@ -5255,7 +5250,7 @@ static void dissect_INFO_SRC(tvbuff_t *tvb, offset, 2, "version: %d.%d", - major, + major, minor); offset += 2; } @@ -5265,8 +5260,8 @@ static void dissect_INFO_SRC(tvbuff_t *tvb, guint8 vendor[MAX_VENDOR_ID_SIZE]; rtps_util_add_vendor_id(NULL, tvb, - offset, - vendor, + offset, + vendor, MAX_VENDOR_ID_SIZE); proto_tree_add_text(tree, tvb, @@ -5276,8 +5271,8 @@ static void dissect_INFO_SRC(tvbuff_t *tvb, vendor); offset += 2; } - - { + + { /* guint8 temp_buffer[MAX_GUID_PREFIX_SIZE]; */ rtps_util_add_guid_prefix(tree, tvb, @@ -5290,7 +5285,16 @@ static void dissect_INFO_SRC(tvbuff_t *tvb, NULL, /* Use default 'guidPrefix' */ NULL, 0); -/* +#if 0 + rtps_util_add_guid_prefix(tree, + tvb, + offset, + hf_rtps_sm_guid_prefix, + hf_rtps_sm_host_id, + hf_rtps_sm_app_id, + hf_rtps_sm_instance_id, + hf_rtps_sm_app_kind, + NULL, /* Use default 'guidPrefix' */ &temp_buffer[0], MAX_GUID_PREFIX_SIZE); proto_tree_add_text(tree, @@ -5298,7 +5302,7 @@ static void dissect_INFO_SRC(tvbuff_t *tvb, offset, 8, temp_buffer); -*/ +#endif } } @@ -5307,16 +5311,16 @@ static void dissect_INFO_SRC(tvbuff_t *tvb, /* *********************************************************************** */ /* * I N F O _ R E P L Y _ I P 4 * */ /* *********************************************************************** */ -static void dissect_INFO_REPLY_IP4(tvbuff_t *tvb, - gint offset, - guint8 flags, +static void dissect_INFO_REPLY_IP4(tvbuff_t *tvb, + gint offset, + guint8 flags, gboolean little_endian, - int octects_to_next_header, + int octects_to_next_header, proto_tree *tree) { /* RTPS 1.0/1.1: * 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | INFO_REPLY |X|X|X|X|X|X|M|E| octetsToNextHeader | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | INFO_REPLY |X|X|X|X|X|X|M|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | IPAddress unicastReplyIpAddress | * +---------------+---------------+---------------+---------------+ @@ -5324,13 +5328,13 @@ static void dissect_INFO_REPLY_IP4(tvbuff_t *tvb, * +---------------+---------------+---------------+---------------+ * | IPAddress multicastReplyIpAddress [ only if M==1 ] | * +---------------+---------------+---------------+---------------+ - * | Port multicastReplyPort [ only if M==1 ] | + * | Port multicastReplyPort [ only if M==1 ] | * +---------------+---------------+---------------+---------------+ * * RTPS 1.2: * 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * |INFO_REPLY_IP4 |X|X|X|X|X|X|M|E| octetsToNextHeader | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * |INFO_REPLY_IP4 |X|X|X|X|X|X|M|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | | * + LocatorUDPv4 unicastReplyLocator + @@ -5350,11 +5354,11 @@ static void dissect_INFO_REPLY_IP4(tvbuff_t *tvb, if (octects_to_next_header != min_len) { - proto_tree_add_uint_format(tree, + proto_tree_add_uint_format(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset+2, - 2, + tvb, + offset+2, + 2, octects_to_next_header, "octectsToNextHeader: %u (Error: should be == %u)", octects_to_next_header, @@ -5362,11 +5366,11 @@ static void dissect_INFO_REPLY_IP4(tvbuff_t *tvb, return; } - proto_tree_add_item(tree, + proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset + 2, - 2, + tvb, + offset + 2, + 2, little_endian); offset += 4; @@ -5394,26 +5398,26 @@ static void dissect_INFO_REPLY_IP4(tvbuff_t *tvb, /* *********************************************************************** */ /* * I N F O _ D S T * */ /* *********************************************************************** */ -static void dissect_INFO_DST(tvbuff_t *tvb, - gint offset, - guint8 flags, +static void dissect_INFO_DST(tvbuff_t *tvb, + gint offset, + guint8 flags, gboolean little_endian, - int octects_to_next_header, + int octects_to_next_header, proto_tree *tree) { /* RTPS 1.0/1.1: * 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | INFO_DST |X|X|X|X|X|X|X|E| octetsToNextHeader | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | INFO_DST |X|X|X|X|X|X|X|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | HostId hostId | * +---------------+---------------+---------------+---------------+ - * | AppId appId | + * | AppId appId | * +---------------+---------------+---------------+---------------+ * * RTPS 1.2: * 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | INFO_DST |X|X|X|X|X|X|X|E| octetsToNextHeader | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | INFO_DST |X|X|X|X|X|X|X|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | | * + GuidPrefix guidPrefix + @@ -5424,26 +5428,26 @@ static void dissect_INFO_DST(tvbuff_t *tvb, rtps_util_decode_flags(tree, tvb, offset + 1, flags, INFO_DST_FLAGS); if (octects_to_next_header != 8) { - proto_tree_add_uint_format(tree, + proto_tree_add_uint_format(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset+2, - 2, + tvb, + offset+2, + 2, octects_to_next_header, "octectsToNextHeader: %u (Error: should be == 8)", octects_to_next_header); return; } - proto_tree_add_item(tree, + proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset + 2, - 2, + tvb, + offset + 2, + 2, little_endian); offset += 4; - { + { rtps_util_add_guid_prefix(tree, tvb, offset, @@ -5463,19 +5467,19 @@ static void dissect_INFO_DST(tvbuff_t *tvb, /* *********************************************************************** */ /* * I N F O _ R E P L Y * */ /* *********************************************************************** */ -static void dissect_INFO_REPLY(tvbuff_t *tvb, - gint offset, - guint8 flags, +static void dissect_INFO_REPLY(tvbuff_t *tvb, + gint offset, + guint8 flags, gboolean little_endian, - int octects_to_next_header, + int octects_to_next_header, proto_tree *tree) { /* RTPS 1.0/1.1: * INFO_REPLY is *NOT* the same thing as the old INFO_REPLY. * * RTPS 1.2: * 0...2...........7...............15.............23...............31 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | INFO_REPLY |X|X|X|X|X|X|M|E| octetsToNextHeader | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | INFO_REPLY |X|X|X|X|X|X|M|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | | * ~ LocatorList unicastReplyLocatorList ~ @@ -5495,11 +5499,11 @@ static void dissect_INFO_REPLY(tvbuff_t *tvb, if (octects_to_next_header != min_len) { - proto_tree_add_uint_format(tree, + proto_tree_add_uint_format(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset+2, - 2, + tvb, + offset+2, + 2, octects_to_next_header, "octectsToNextHeader: %u (Error: should be == %u)", octects_to_next_header, @@ -5507,11 +5511,11 @@ static void dissect_INFO_REPLY(tvbuff_t *tvb, return; } - proto_tree_add_item(tree, + proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, - tvb, - offset + 2, - 2, + tvb, + offset + 2, + 2, little_endian); offset += 4; @@ -5543,8 +5547,8 @@ static void dissect_INFO_REPLY(tvbuff_t *tvb, /***************************************************************************/ /* The main packet dissector function */ -static gboolean dissect_rtps(tvbuff_t *tvb, - packet_info *pinfo, +static gboolean dissect_rtps(tvbuff_t *tvb, + packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_tree *rtps_tree=NULL; @@ -5567,9 +5571,9 @@ static gboolean dissect_rtps(tvbuff_t *tvb, */ offset = 4; } - - /* Check 'RTPS' signature: - * A header is invalid if it has less than 16 octets + + /* Check 'RTPS' signature: + * A header is invalid if it has less than 16 octets */ if (!tvb_bytes_exist(tvb, offset, 16)) return FALSE; if (tvb_get_guint8(tvb,offset) != 'R') return FALSE; @@ -5608,9 +5612,9 @@ static gboolean dissect_rtps(tvbuff_t *tvb, nddsPing[7] == 'G') { is_ping = TRUE; } - + if (!is_ping) { - rtps_util_add_guid_prefix(rtps_tree, + rtps_util_add_guid_prefix(rtps_tree, tvb, offset+8, hf_rtps_guid_prefix, @@ -5677,18 +5681,18 @@ static gboolean dissect_rtps(tvbuff_t *tvb, /* Creates the subtree 'Submessage: XXXX' */ if (submessageId & 0x80) { - ti = proto_tree_add_text(rtps_tree, - tvb, - offset, - -1, + ti = proto_tree_add_text(rtps_tree, + tvb, + offset, + -1, "Submessage: %s", val_to_str(submessageId, submessage_id_vals, "Vendor-specific (0x%02x)")); } else { - ti = proto_tree_add_text(rtps_tree, - tvb, - offset, - -1, + ti = proto_tree_add_text(rtps_tree, + tvb, + offset, + -1, "Submessage: %s", val_to_str(submessageId, submessage_id_vals, "Unknown (0x%02x)")); @@ -5697,11 +5701,11 @@ static gboolean dissect_rtps(tvbuff_t *tvb, /* Decode the submessage ID */ if (submessageId & 0x80) { - proto_tree_add_uint_format(rtps_submessage_tree, + proto_tree_add_uint_format(rtps_submessage_tree, hf_rtps_sm_id, - tvb, - offset, - 1, + tvb, + offset, + 1, submessageId, "submessageId: Vendor-specific (0x%02x)", submessageId); @@ -5715,29 +5719,29 @@ static gboolean dissect_rtps(tvbuff_t *tvb, /* Gets the E (Little endian) flag */ little_endian = ((flags & FLAG_E) != 0); - + /* Octect-to-next-header */ octects_to_next_header = NEXT_guint16(tvb, offset + 2, little_endian); next_submsg = offset + octects_to_next_header + 4; /* Set length of this item */ - proto_item_set_len(ti, octects_to_next_header + 4); + proto_item_set_len(ti, octects_to_next_header + 4); /* Now decode each single submessage */ - /* Note: if tree==NULL, we don't care about the details, so each + /* Note: if tree==NULL, we don't care about the details, so each * sub-message dissector is not invoked. We still need to go * through this switch to count the number of each submessage IDs - * The offset passed to the dissectors points to the start of the + * The offset passed to the dissectors points to the start of the * submessage (at the ID byte). */ switch (submessageId) { case PAD: if (tree) { - dissect_PAD(tvb, - offset, - flags, - little_endian, + dissect_PAD(tvb, + offset, + flags, + little_endian, octects_to_next_header, rtps_submessage_tree); } @@ -5745,10 +5749,10 @@ static gboolean dissect_rtps(tvbuff_t *tvb, case DATA: if (tree) { - dissect_DATA(tvb, - offset, - flags, - little_endian, + dissect_DATA(tvb, + offset, + flags, + little_endian, octects_to_next_header, rtps_submessage_tree, &sm_extra); @@ -5757,10 +5761,10 @@ static gboolean dissect_rtps(tvbuff_t *tvb, case NOKEY_DATA: if (tree) { - dissect_NOKEY_DATA(tvb, - offset, - flags, - little_endian, + dissect_NOKEY_DATA(tvb, + offset, + flags, + little_endian, octects_to_next_header, rtps_submessage_tree); } @@ -5768,10 +5772,10 @@ static gboolean dissect_rtps(tvbuff_t *tvb, case ACKNACK: if (tree) { - dissect_ACKNACK(tvb, - offset, - flags, - little_endian, + dissect_ACKNACK(tvb, + offset, + flags, + little_endian, octects_to_next_header, rtps_submessage_tree); } @@ -5779,10 +5783,10 @@ static gboolean dissect_rtps(tvbuff_t *tvb, case HEARTBEAT: if (tree) { - dissect_HEARTBEAT(tvb, - offset, - flags, - little_endian, + dissect_HEARTBEAT(tvb, + offset, + flags, + little_endian, octects_to_next_header, rtps_submessage_tree); } @@ -5790,10 +5794,10 @@ static gboolean dissect_rtps(tvbuff_t *tvb, case GAP: if (tree) { - dissect_GAP(tvb, - offset, - flags, - little_endian, + dissect_GAP(tvb, + offset, + flags, + little_endian, octects_to_next_header, rtps_submessage_tree); } @@ -5801,10 +5805,10 @@ static gboolean dissect_rtps(tvbuff_t *tvb, case INFO_TS: if (tree) { - dissect_INFO_TS(tvb, - offset, - flags, - little_endian, + dissect_INFO_TS(tvb, + offset, + flags, + little_endian, octects_to_next_header, rtps_submessage_tree); } @@ -5812,10 +5816,10 @@ static gboolean dissect_rtps(tvbuff_t *tvb, case INFO_SRC: if (tree) { - dissect_INFO_SRC(tvb, - offset, - flags, - little_endian, + dissect_INFO_SRC(tvb, + offset, + flags, + little_endian, octects_to_next_header, rtps_submessage_tree); } @@ -5823,10 +5827,10 @@ static gboolean dissect_rtps(tvbuff_t *tvb, case INFO_REPLY_IP4: if (tree) { - dissect_INFO_REPLY_IP4(tvb, - offset, - flags, - little_endian, + dissect_INFO_REPLY_IP4(tvb, + offset, + flags, + little_endian, octects_to_next_header, rtps_submessage_tree); } @@ -5834,10 +5838,10 @@ static gboolean dissect_rtps(tvbuff_t *tvb, case INFO_DST: if (tree) { - dissect_INFO_DST(tvb, - offset, - flags, - little_endian, + dissect_INFO_DST(tvb, + offset, + flags, + little_endian, octects_to_next_header, rtps_submessage_tree); } @@ -5845,10 +5849,10 @@ static gboolean dissect_rtps(tvbuff_t *tvb, case INFO_REPLY: if (tree) { - dissect_INFO_REPLY(tvb, - offset, - flags, - little_endian, + dissect_INFO_REPLY(tvb, + offset, + flags, + little_endian, octects_to_next_header, rtps_submessage_tree); } @@ -5858,7 +5862,7 @@ static gboolean dissect_rtps(tvbuff_t *tvb, if (tree) { proto_tree_add_uint(rtps_submessage_tree, hf_rtps_sm_flags, tvb, offset + 1, 1, flags); - proto_tree_add_uint(rtps_submessage_tree, + proto_tree_add_uint(rtps_submessage_tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, next_submsg); } @@ -5876,7 +5880,7 @@ static gboolean dissect_rtps(tvbuff_t *tvb, } /* Compose the content of the 'summary' column */ - if ((pinfo != NULL) && (pinfo->cinfo != NULL) && + if ((pinfo != NULL) && (pinfo->cinfo != NULL) && (check_col(pinfo->cinfo, COL_INFO))) { emem_strbuf_t *info_buf = ep_strbuf_new_label(NULL); struct SMCounterRecord *smcr_ptr = smcr_head; @@ -5890,24 +5894,11 @@ static gboolean dissect_rtps(tvbuff_t *tvb, if (info_buf->len > 0) { ep_strbuf_append(info_buf, ", "); } -/* - if (smcr_ptr->counter > 1) { - ep_strbuf_append_printf(info_buf, "%s(%d)", - val_to_str(smcr_ptr->id, - submessage_id_vals, - "Unknown[%02x]"), - smcr_ptr->counter); - } else { -*/ - ep_strbuf_append_printf(info_buf, "%s%s", - val_to_str(smcr_ptr->id, - submessage_id_vals, - "Unknown[%02x]"), - smcr_ptr->extra ? smcr_ptr->extra : ""); - /* XXX - Ellipsis code removed when we converted to a strbuf. */ -/* - } -*/ + ep_strbuf_append_printf(info_buf, "%s%s", + val_to_str(smcr_ptr->id, + submessage_id_vals, + "Unknown[%02x]"), + smcr_ptr->extra ? smcr_ptr->extra : ""); smcr_ptr = smcr_ptr->next; } } @@ -5926,7 +5917,7 @@ static gboolean dissect_rtps(tvbuff_t *tvb, /*************************************************************************** - * Register the protocol with Wireshark + * Register the protocol with Wireshark * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ void proto_register_rtps(void) { @@ -5935,7 +5926,7 @@ void proto_register_rtps(void) { * This section declares all the protocol items that are parsed in the * dissectors. * Structure of each element: - * { + * { * item_id, { * name, // As appears in the GUI tree * abbrev, // Referenced by filters (rtps.xxxx[.yyyy]) @@ -5961,7 +5952,7 @@ void proto_register_rtps(void) { "RTPS protocol version number", HFILL } }, - { &hf_rtps_protocol_version_major, { + { &hf_rtps_protocol_version_major, { "major", "rtps.version.major", FT_INT8, @@ -6028,7 +6019,7 @@ void proto_register_rtps(void) { }, /* Guid Prefix for the Packet ------------------------------------------ */ - { &hf_rtps_guid_prefix, { + { &hf_rtps_guid_prefix, { "guidPrefix", "rtps.guidPrefix", FT_BYTES, @@ -6086,38 +6077,38 @@ void proto_register_rtps(void) { /* Submessage ID ------------------------------------------------------- */ - { &hf_rtps_sm_id, { - "submessageId", + { &hf_rtps_sm_id, { + "submessageId", "rtps.sm.id", - FT_UINT8, - BASE_HEX, - VALS(submessage_id_vals), + FT_UINT8, + BASE_HEX, + VALS(submessage_id_vals), 0, - "defines the type of submessage", + "defines the type of submessage", HFILL } }, /* Submessage flags ---------------------------------------------------- */ - { &hf_rtps_sm_flags, { - "flags", + { &hf_rtps_sm_flags, { + "flags", "rtps.sm.flags", - FT_UINT8, - BASE_HEX, - NULL, + FT_UINT8, + BASE_HEX, + NULL, 0, - "bitmask representing the flags associated with a submessage", + "bitmask representing the flags associated with a submessage", HFILL } }, /* Octects to next header ---------------------------------------------- */ - { &hf_rtps_sm_octets_to_next_header, { - "octetsToNextHeader", + { &hf_rtps_sm_octets_to_next_header, { + "octetsToNextHeader", "rtps.sm.octetsToNextHeader", - FT_UINT16, - BASE_DEC, - NULL, + FT_UINT16, + BASE_DEC, + NULL, 0, - "Size of the submessage payload", + "Size of the submessage payload", HFILL } }, @@ -6133,7 +6124,7 @@ void proto_register_rtps(void) { HFILL } }, - { &hf_rtps_sm_host_id, { + { &hf_rtps_sm_host_id, { "host_id", "rtps.sm.guidPrefix.hostId", FT_UINT32, @@ -6144,7 +6135,7 @@ void proto_register_rtps(void) { HFILL } }, - { &hf_rtps_sm_app_id, { + { &hf_rtps_sm_app_id, { "appId", "rtps.sm.guidPrefix.appId", FT_UINT32, @@ -6164,7 +6155,7 @@ void proto_register_rtps(void) { "instanceId component of the AppId of the rtps.sm.guidPrefix", HFILL } }, - { &hf_rtps_sm_app_kind, { + { &hf_rtps_sm_app_kind, { "appKind", "rtps.sm.guidPrefix.appId.appKind", FT_UINT8, @@ -6187,7 +6178,7 @@ void proto_register_rtps(void) { "Object entity ID as it appears in a DATA submessage (keyHashSuffix)", HFILL } }, - { &hf_rtps_sm_entity_id_key, { + { &hf_rtps_sm_entity_id_key, { "entityKey", "rtps.sm.entityId.entityKey", FT_UINT24, @@ -6285,55 +6276,55 @@ void proto_register_rtps(void) { }, /* Parameter Id -------------------------------------------------------- */ - { &hf_rtps_parameter_id, { - "parameterId", + { &hf_rtps_parameter_id, { + "parameterId", "rtps.param.id", - FT_UINT16, - BASE_HEX, - VALS(parameter_id_vals), + FT_UINT16, + BASE_HEX, + VALS(parameter_id_vals), 0, - "Parameter Id", + "Parameter Id", HFILL } }, /* Parameter Length ---------------------------------------------------- */ - { &hf_rtps_parameter_length, { - "parameterLength", + { &hf_rtps_parameter_length, { + "parameterLength", "rtps.param.length", - FT_UINT16, - BASE_DEC, - NULL, + FT_UINT16, + BASE_DEC, + NULL, 0, - "Parameter Length", + "Parameter Length", HFILL } }, /* Parameter / NtpTime ------------------------------------------------- */ - { &hf_rtps_param_ntpt, { - "ntpTime", + { &hf_rtps_param_ntpt, { + "ntpTime", "rtps.param.ntpTime", - FT_NONE, - BASE_NONE, + FT_NONE, + BASE_NONE, NULL, 0, - "Time using the NTP standard format", + "Time using the NTP standard format", HFILL } }, - { &hf_rtps_param_ntpt_sec, { - "seconds", + { &hf_rtps_param_ntpt_sec, { + "seconds", "rtps.param.ntpTime.sec", - FT_INT32, - BASE_DEC, + FT_INT32, + BASE_DEC, NULL, 0, - "The 'second' component of a NTP time", + "The 'second' component of a NTP time", HFILL } }, - { &hf_rtps_param_ntpt_fraction, { - "fraction", + { &hf_rtps_param_ntpt_fraction, { + "fraction", "rtps.param.ntpTime.fraction", - FT_UINT32, - BASE_DEC, + FT_UINT32, + BASE_DEC, NULL, 0, "The 'fraction' component of a NTP time", @@ -6342,120 +6333,120 @@ void proto_register_rtps(void) { /* Parameter / Topic --------------------------------------------------- */ - { &hf_rtps_param_topic_name, { - "topic", + { &hf_rtps_param_topic_name, { + "topic", "rtps.param.topicName", - FT_STRINGZ, - BASE_NONE, + FT_STRINGZ, + BASE_NONE, NULL, 0, - "String representing the value value of a PID_TOPIC parameter", + "String representing the value value of a PID_TOPIC parameter", HFILL } }, /* Parameter / Strength ------------------------------------------------ */ - { &hf_rtps_param_strength, { - "strength", + { &hf_rtps_param_strength, { + "strength", "rtps.param.strength", - FT_INT32, - BASE_DEC, + FT_INT32, + BASE_DEC, NULL, 0, - "Decimal value representing the value of a PID_OWNERSHIP_STRENGTH parameter", + "Decimal value representing the value of a PID_OWNERSHIP_STRENGTH parameter", HFILL } }, /* Parameter / Type Name ----------------------------------------------- */ - { &hf_rtps_param_type_name, { - "typeName", + { &hf_rtps_param_type_name, { + "typeName", "rtps.param.typeName", - FT_STRINGZ, - BASE_NONE, + FT_STRINGZ, + BASE_NONE, NULL, 0, - "String representing the value of a PID_TYPE_NAME parameter", + "String representing the value of a PID_TYPE_NAME parameter", HFILL } }, /* Parameter / User Data ----------------------------------------------- */ - { &hf_rtps_param_user_data, { - "userData", + { &hf_rtps_param_user_data, { + "userData", "rtps.param.userData", - FT_BYTES, - BASE_NONE, - NULL, + FT_BYTES, + BASE_NONE, + NULL, 0, - "The user data sent in a PID_USER_DATA parameter", + "The user data sent in a PID_USER_DATA parameter", HFILL } }, /* Parameter / Group Data ---------------------------------------------- */ - { &hf_rtps_param_group_data, { - "groupData", + { &hf_rtps_param_group_data, { + "groupData", "rtps.param.groupData", - FT_BYTES, - BASE_NONE, - NULL, + FT_BYTES, + BASE_NONE, + NULL, 0, - "The user data sent in a PID_GROUP_DATA parameter", + "The user data sent in a PID_GROUP_DATA parameter", HFILL } }, /* Parameter / Topic Data ---------------------------------------------- */ - { &hf_rtps_param_topic_data, { - "topicData", + { &hf_rtps_param_topic_data, { + "topicData", "rtps.param.topicData", - FT_BYTES, - BASE_NONE, - NULL, + FT_BYTES, + BASE_NONE, + NULL, 0, - "The user data sent in a PID_TOPIC_DATA parameter", + "The user data sent in a PID_TOPIC_DATA parameter", HFILL } }, /* Parameter / Content Filter Name ------------------------------------- */ - { &hf_rtps_param_content_filter_name, { - "contentFilterName", + { &hf_rtps_param_content_filter_name, { + "contentFilterName", "rtps.param.contentFilterName", - FT_STRINGZ, - BASE_NONE, + FT_STRINGZ, + BASE_NONE, NULL, 0, - "Value of the content filter name as sent in a PID_CONTENT_FILTER_PROPERTY parameter", + "Value of the content filter name as sent in a PID_CONTENT_FILTER_PROPERTY parameter", HFILL } }, - { &hf_rtps_param_related_topic_name, { - "relatedTopicName", + { &hf_rtps_param_related_topic_name, { + "relatedTopicName", "rtps.param.relatedTopicName", - FT_STRINGZ, - BASE_NONE, + FT_STRINGZ, + BASE_NONE, NULL, 0, - "Value of the related topic name as sent in a PID_CONTENT_FILTER_PROPERTY parameter", + "Value of the related topic name as sent in a PID_CONTENT_FILTER_PROPERTY parameter", HFILL } }, - { &hf_rtps_param_filter_name, { - "filterName", + { &hf_rtps_param_filter_name, { + "filterName", "rtps.param.filterName", - FT_STRINGZ, - BASE_NONE, + FT_STRINGZ, + BASE_NONE, NULL, 0, - "Value of the filter name as sent in a PID_CONTENT_FILTER_PROPERTY parameter", + "Value of the filter name as sent in a PID_CONTENT_FILTER_PROPERTY parameter", HFILL } }, /* Finally the raw issue data ------------------------------------------ */ - { &hf_rtps_issue_data, { - "serializedData", + { &hf_rtps_issue_data, { + "serializedData", "rtps.issueData", - FT_BYTES, - BASE_NONE, - NULL, + FT_BYTES, + BASE_NONE, + NULL, 0, - "The user data transferred in a ISSUE submessage", + "The user data transferred in a ISSUE submessage", HFILL } }, }; @@ -6484,7 +6475,7 @@ void proto_register_rtps(void) { proto_rtps = proto_register_protocol( "Real-Time Publish-Subscribe Wire Protocol", - "RTPS", + "RTPS", "rtps"); proto_register_field_array(proto_rtps, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); diff --git a/epan/dissectors/packet-sbus.c b/epan/dissectors/packet-sbus.c index 34d6651569..e297c2d0b0 100644 --- a/epan/dissectors/packet-sbus.c +++ b/epan/dissectors/packet-sbus.c @@ -159,42 +159,42 @@ #define SBUS_WEB_SERVER_SERIAL_COMM 0xAF /* Bitfield in the arithmetic flags and accu*/ -#define F_ACCU (1<<0) /* Accumulator of PCD */ -#define F_ERROR (1<<1) /* Error flag of PCD */ -#define F_NEGATIVE (1<<2) /* Negative arithmetic status flag*/ -#define F_ZERO (1<<3) /* Zero arithmetic status flag */ +#define F_ACCU (1<<0) /* Accumulator of PCD */ +#define F_ERROR (1<<1) /* Error flag of PCD */ +#define F_NEGATIVE (1<<2) /* Negative arithmetic status flag */ +#define F_ZERO (1<<3) /* Zero arithmetic status flag */ /* Bitfield in the system information*/ -/*#define F_EMPTY (1<<0) always 0 */ -#define F_MEMSIZE (1<<1) /* Memory size information*/ -#define F_TRACE (1<<2) /* Trace buffer feature */ -#define F_INFO_B1 (1<<3) /* EEPROM information of slot B1*/ -#define F_INFO_B2 (1<<4) /* EEPROM information of slot B2*/ -#define F_PGU_BAUD (1<<5) /* PGU baudrate can be switched*/ +/*#define F_EMPTY (1<<0) always 0 */ +#define F_MEMSIZE (1<<1) /* Memory size information */ +#define F_TRACE (1<<2) /* Trace buffer feature */ +#define F_INFO_B1 (1<<3) /* EEPROM information of slot B1 */ +#define F_INFO_B2 (1<<4) /* EEPROM information of slot B2 */ +#define F_PGU_BAUD (1<<5) /* PGU baudrate can be switched */ /* Read/write block command codes*/ -#define SBUS_WR_START_OF_STREAM 0x00 -#define SBUS_WR_BLOCK_DATA_STREAM 0x01 -#define SBUS_WR_BLOCK_END_OF_STREAM 0x02 -#define SBUS_WR_ABORT_BLOCK_STREAM 0x07 -#define SBUS_WR_BLOCK_DATA_BYTES 0x08 +#define SBUS_WR_START_OF_STREAM 0x00 +#define SBUS_WR_BLOCK_DATA_STREAM 0x01 +#define SBUS_WR_BLOCK_END_OF_STREAM 0x02 +#define SBUS_WR_ABORT_BLOCK_STREAM 0x07 +#define SBUS_WR_BLOCK_DATA_BYTES 0x08 #define SBUS_RD_BLOCK_START_OF_STREAM 0X10 -#define SBUS_RD_BLOCK_DATA_STREAM 0x11 -#define SBUS_RD_ABORT_BLOCK_STREAM 0x17 -#define SBUS_RD_BLOCK_DATA_BYTES 0x18 -#define SBUS_DELETE_BLOCK 0x20 -#define SBUS_GET_BLOCK_SIZE 0x21 -#define SBUS_GET_PROGRAM_BLOCK_LIST 0x22 +#define SBUS_RD_BLOCK_DATA_STREAM 0x11 +#define SBUS_RD_ABORT_BLOCK_STREAM 0x17 +#define SBUS_RD_BLOCK_DATA_BYTES 0x18 +#define SBUS_DELETE_BLOCK 0x20 +#define SBUS_GET_BLOCK_SIZE 0x21 +#define SBUS_GET_PROGRAM_BLOCK_LIST 0x22 /* Read/write block types*/ -#define SBUS_RD_WR_CONFIGURATION_FILE 0x20 -#define SBUS_RD_WR_PROGRAM_BLOCK_FILE 0x21 +#define SBUS_RD_WR_CONFIGURATION_FILE 0x20 +#define SBUS_RD_WR_PROGRAM_BLOCK_FILE 0x21 #define SBUS_RD_WR_UNKNOWN_BLOCK_TYPE 0x83 /* Read/write block error codes*/ -#define SBUS_RD_WR_NAK 0x80 -#define SBUS_RD_WR_NAK_INVALID_SIZE 0x8A +#define SBUS_RD_WR_NAK 0x80 +#define SBUS_RD_WR_NAK_INVALID_SIZE 0x8A /* Initialize the protocol and registered fields */ static int proto_sbus = -1; @@ -467,47 +467,47 @@ static const value_string webserver_aid_vals[] = { {0, NULL} }; static const value_string rdwrblock_vals[] = { - {0x00, "WR block start of stream"}, - {0x01, "WR block data stream"}, - {0x02, "WR block end of stream"}, - {0x07, "Abort block WR stream"}, - {0x08, "WR block data"}, - {0x10, "RD block start of stream"}, - {0x11, "RD block data stream"}, - {0x17, "Abort block RD stream"}, - {0x18, "RD block data"}, - {0x20, "Delete block"}, - {0x21, "Get block size"}, - {0x22, "Get program block list"}, - {0, NULL} + {0x00, "WR block start of stream"}, + {0x01, "WR block data stream"}, + {0x02, "WR block end of stream"}, + {0x07, "Abort block WR stream"}, + {0x08, "WR block data"}, + {0x10, "RD block start of stream"}, + {0x11, "RD block data stream"}, + {0x17, "Abort block RD stream"}, + {0x18, "RD block data"}, + {0x20, "Delete block"}, + {0x21, "Get block size"}, + {0x22, "Get program block list"}, + {0, NULL} }; static const value_string rdwrblock_sts[] = { - {0x00, "ACK (Acknowledged)"}, - {0x01, "Data"}, - {0x02, "Busy"}, - {0x03, "End of stream"}, - {0x04, "Data EOF reached"}, - {0x80, "NAK"}, - {0x81, "NAK, unknown Tlg_Type"}, - {0x82, "NAK, not supported Tlg_Type"}, - {0x83, "NAK, unknown Block Type"}, - {0x84, "NAK, out of sequence"}, - {0x85, "NAK, not supported Block number"}, - {0x86, "NAK, Block Size invalid (to big)"}, - {0x87, "NAK, Block Address invalid"}, - {0x88, "NAK, CRC invalid"}, - {0x89, "NAK, invalid status"}, - {0x8A, "NAK, invalid command size (w-count)"}, - {0xFF, "Abort (stream)"}, - {0, NULL} + {0x00, "ACK (Acknowledged)"}, + {0x01, "Data"}, + {0x02, "Busy"}, + {0x03, "End of stream"}, + {0x04, "Data EOF reached"}, + {0x80, "NAK"}, + {0x81, "NAK, unknown Tlg_Type"}, + {0x82, "NAK, not supported Tlg_Type"}, + {0x83, "NAK, unknown Block Type"}, + {0x84, "NAK, out of sequence"}, + {0x85, "NAK, not supported Block number"}, + {0x86, "NAK, Block Size invalid (to big)"}, + {0x87, "NAK, Block Address invalid"}, + {0x88, "NAK, CRC invalid"}, + {0x89, "NAK, invalid status"}, + {0x8A, "NAK, invalid command size (w-count)"}, + {0xFF, "Abort (stream)"}, + {0, NULL} }; static const value_string rdwrblock_list_type_vals[] = { - {0x40, "Start request of program block"}, - {0x41, "Get next program block"}, - {0xFF, "Abort get list"}, - {0, NULL} + {0x40, "Start request of program block"}, + {0x41, "Get next program block"}, + {0xFF, "Abort get list"}, + {0, NULL} }; static const guint crc_table[] = { @@ -597,44 +597,44 @@ static void sbus_init_protocol(void){ static gboolean is_sbus_pdu(tvbuff_t *tvb) { - guint32 length; - - /* we need at least 8 bytes to determine whether this is sbus or - not*/ - if(tvb_length(tvb)<8){ - return FALSE; - } - - /* the length must be >= 8 bytes to accomodate the header, - it also must be <65536 to fit inside a udp packet - */ - length=tvb_get_ntohl(tvb, 0); - if ( (length<8) || (length>65535) ) { - return FALSE; - } - if (tvb_reported_length(tvb) != length) { - return FALSE; - } - /* First four byte indicate the length which must be at least 12 bytes*/ - if (tvb_get_ntohl(tvb, 0) < 12) { - return (FALSE); - } - /* Fifth byte indicates protocol version which can be 0 or 1*/ - if (tvb_get_guint8(tvb, 4) > 0x01) { - return (FALSE); - } - /* Sixth byte indicates protocol type and must be 0*/ - if ( tvb_get_guint8(tvb, 5) > 0x01 ) { - return (FALSE); - } - /* Seventh and eigth byte indicates the packet sequence number and can - be 0 to 65565 (--> check does not make sense)*/ - /* Ninth byte the "attributes character" and must be either 0, 1 or 2 - (request, response or ACK/NAK)*/ - if (tvb_get_guint8(tvb, 8) > 0x02 ) { - return (FALSE); - } - return TRUE; + guint32 length; + + /* we need at least 8 bytes to determine whether this is sbus or + not*/ + if(tvb_length(tvb)<8){ + return FALSE; + } + + /* the length must be >= 8 bytes to accomodate the header, + it also must be <65536 to fit inside a udp packet + */ + length=tvb_get_ntohl(tvb, 0); + if ( (length<8) || (length>65535) ) { + return FALSE; + } + if (tvb_reported_length(tvb) != length) { + return FALSE; + } + /* First four byte indicate the length which must be at least 12 bytes*/ + if (tvb_get_ntohl(tvb, 0) < 12) { + return (FALSE); + } + /* Fifth byte indicates protocol version which can be 0 or 1*/ + if (tvb_get_guint8(tvb, 4) > 0x01) { + return (FALSE); + } + /* Sixth byte indicates protocol type and must be 0*/ + if ( tvb_get_guint8(tvb, 5) > 0x01 ) { + return (FALSE); + } + /* Seventh and eigth byte indicates the packet sequence number and can + be 0 to 65565 (--> check does not make sense)*/ + /* Ninth byte the "attributes character" and must be either 0, 1 or 2 + (request, response or ACK/NAK)*/ + if (tvb_get_guint8(tvb, 8) > 0x02 ) { + return (FALSE); + } + return TRUE; } /*Dissect the telegram*/ @@ -699,14 +699,14 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) *also in case this is no retry*/ sbus_attribut = tvb_get_guint8(tvb,8); if (request_val && sbus_attribut == SBUS_REQUEST) { - if (request_val->req_frame < pinfo->fd->num){ /*a retry; req_frame smaller this frame*/ - request_val->retry_count +=1; - } - else { /*we have a conversation but this is not a retry so we store the packet info*/ - request_val->retry_count = 0; - request_val->req_frame = pinfo->fd->num; /*store actual frame nr.*/ - request_val->req_time = pinfo->fd->abs_ts; - } + if (request_val->req_frame < pinfo->fd->num){ /*a retry; req_frame smaller this frame*/ + request_val->retry_count +=1; + } + else { /*we have a conversation but this is not a retry so we store the packet info*/ + request_val->retry_count = 0; + request_val->req_frame = pinfo->fd->num; /*store actual frame nr.*/ + request_val->req_time = pinfo->fd->abs_ts; + } } if (request_val && (sbus_attribut == SBUS_RESPONSE || sbus_attribut == SBUS_ACKNAK)) { /*a response*/ @@ -721,7 +721,7 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) request_val = se_alloc(sizeof(sbus_request_val)); request_val->cmd_code=tvb_get_guint8(tvb,10); - request_val->retry_count=0; + request_val->retry_count=0; request_val->req_frame = pinfo->fd->num; /*store actual frame nr.*/ request_val->req_time = pinfo->fd->abs_ts; request_val->resp_frame = 0; /*response frame is not known yet*/ @@ -760,68 +760,68 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case SBUS_REQUEST: sbus_cmd_code = tvb_get_guint8(tvb,10); switch (sbus_cmd_code){ - case SBUS_WEB_SERVER_SERIAL_COMM: - /* Special treatment of web server request - * as is is very helpful to see more information in the packetlist */ - sbus_web_aid = tvb_get_guint8(tvb,12); - sbus_web_seq = tvb_get_guint8(tvb,13); - col_add_fstr(pinfo->cinfo, COL_INFO, - "Web Server Request: %s (Seq No: %d)", - val_to_str(sbus_web_aid, - webserver_aid_vals, "Unknown Request!"), - sbus_web_seq); - break; - case SBUS_RD_WR_PCD_BLOCK: - sbus_rdwr_type = tvb_get_guint8(tvb, 12); - col_add_fstr( pinfo->cinfo, COL_INFO, - "Request: %s", val_to_str( sbus_rdwr_type, rdwrblock_vals, - "This RD/WR block telegram is not implemented")); - /* Add name of file to be written in case of start of file stream */ - if (sbus_rdwr_type == SBUS_WR_START_OF_STREAM) { - sbus_rdwr_block_type = tvb_get_guint8(tvb, 14); - if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) || - (sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) { - sbus_quint8_helper0=0; - for (i=19; i<43; i++) { /*max length is 24 chars*/ - /*find zero-termination of string*/ - if ((tvb_get_guint8(tvb, i)) == 0x00) { - break; - } - sbus_quint8_helper0 += 1; - } - tmp_string = tvb_get_ephemeral_string(tvb , 19, - sbus_quint8_helper0); - col_append_fstr(pinfo->cinfo, COL_INFO, - ": (File: %s)", tmp_string); - } - } else if (sbus_rdwr_type == SBUS_RD_BLOCK_START_OF_STREAM) { - sbus_rdwr_block_type = tvb_get_guint8(tvb, 14); - if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) || - (sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) { - sbus_quint8_helper0=0; - for (i=15; i<39; i++) { /*max length is 24 chars*/ - /*find zero-termination of string*/ - if ((tvb_get_guint8(tvb, i)) == 0x00) { - break; - } - sbus_quint8_helper0 += 1; - } - tmp_string = tvb_get_ephemeral_string(tvb , 15, - sbus_quint8_helper0); - col_append_fstr(pinfo->cinfo, COL_INFO, - ": (File: %s)", tmp_string); - } - } - - break; - - - default: - /* All other requests */ - col_add_fstr(pinfo->cinfo, COL_INFO, - "Request: %s", val_to_str(sbus_cmd_code, - sbus_command_vals, "Unknown Command!")); - break; + case SBUS_WEB_SERVER_SERIAL_COMM: + /* Special treatment of web server request + * as is is very helpful to see more information in the packetlist */ + sbus_web_aid = tvb_get_guint8(tvb,12); + sbus_web_seq = tvb_get_guint8(tvb,13); + col_add_fstr(pinfo->cinfo, COL_INFO, + "Web Server Request: %s (Seq No: %d)", + val_to_str(sbus_web_aid, + webserver_aid_vals, "Unknown Request!"), + sbus_web_seq); + break; + case SBUS_RD_WR_PCD_BLOCK: + sbus_rdwr_type = tvb_get_guint8(tvb, 12); + col_add_fstr( pinfo->cinfo, COL_INFO, + "Request: %s", val_to_str( sbus_rdwr_type, rdwrblock_vals, + "This RD/WR block telegram is not implemented")); + /* Add name of file to be written in case of start of file stream */ + if (sbus_rdwr_type == SBUS_WR_START_OF_STREAM) { + sbus_rdwr_block_type = tvb_get_guint8(tvb, 14); + if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) || + (sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) { + sbus_quint8_helper0=0; + for (i=19; i<43; i++) { /*max length is 24 chars*/ + /*find zero-termination of string*/ + if ((tvb_get_guint8(tvb, i)) == 0x00) { + break; + } + sbus_quint8_helper0 += 1; + } + tmp_string = tvb_get_ephemeral_string(tvb , 19, + sbus_quint8_helper0); + col_append_fstr(pinfo->cinfo, COL_INFO, + ": (File: %s)", tmp_string); + } + } else if (sbus_rdwr_type == SBUS_RD_BLOCK_START_OF_STREAM) { + sbus_rdwr_block_type = tvb_get_guint8(tvb, 14); + if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) || + (sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) { + sbus_quint8_helper0=0; + for (i=15; i<39; i++) { /*max length is 24 chars*/ + /*find zero-termination of string*/ + if ((tvb_get_guint8(tvb, i)) == 0x00) { + break; + } + sbus_quint8_helper0 += 1; + } + tmp_string = tvb_get_ephemeral_string(tvb , 15, + sbus_quint8_helper0); + col_append_fstr(pinfo->cinfo, COL_INFO, + ": (File: %s)", tmp_string); + } + } + + break; + + + default: + /* All other requests */ + col_add_fstr(pinfo->cinfo, COL_INFO, + "Request: %s", val_to_str(sbus_cmd_code, + sbus_command_vals, "Unknown Command!")); + break; } /*mark retries*/ if (request_val->retry_count>0) { @@ -846,28 +846,28 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) " (Seq No: %d)", sbus_web_seq); } - } else if (request_val && ((request_val->cmd_code) == SBUS_RD_WR_PCD_BLOCK)) { - /* Treat the ACK/NAK telgrams in a special way*/ - switch (request_val->block_tlg) { - case SBUS_WR_START_OF_STREAM: - case SBUS_WR_BLOCK_DATA_STREAM: - case SBUS_WR_BLOCK_END_OF_STREAM: - case SBUS_WR_ABORT_BLOCK_STREAM: - case SBUS_WR_BLOCK_DATA_BYTES: - case SBUS_DELETE_BLOCK: - case SBUS_RD_ABORT_BLOCK_STREAM: - sbus_rdwr_ack_nak = tvb_get_guint8(tvb, 10); - col_add_fstr( pinfo->cinfo, COL_INFO, - "Response: %s", val_to_str(sbus_rdwr_ack_nak, - rdwrblock_sts, "Unknown response!")); - break; - default: - sbus_rdwr_type = tvb_get_guint8(tvb, 9); - col_add_fstr( pinfo->cinfo, COL_INFO, - "Response: (%d byte)", sbus_rdwr_type); - break; - } - + } else if (request_val && ((request_val->cmd_code) == SBUS_RD_WR_PCD_BLOCK)) { + /* Treat the ACK/NAK telgrams in a special way*/ + switch (request_val->block_tlg) { + case SBUS_WR_START_OF_STREAM: + case SBUS_WR_BLOCK_DATA_STREAM: + case SBUS_WR_BLOCK_END_OF_STREAM: + case SBUS_WR_ABORT_BLOCK_STREAM: + case SBUS_WR_BLOCK_DATA_BYTES: + case SBUS_DELETE_BLOCK: + case SBUS_RD_ABORT_BLOCK_STREAM: + sbus_rdwr_ack_nak = tvb_get_guint8(tvb, 10); + col_add_fstr( pinfo->cinfo, COL_INFO, + "Response: %s", val_to_str(sbus_rdwr_ack_nak, + rdwrblock_sts, "Unknown response!")); + break; + default: + sbus_rdwr_type = tvb_get_guint8(tvb, 9); + col_add_fstr( pinfo->cinfo, COL_INFO, + "Response: (%d byte)", sbus_rdwr_type); + break; + } + } else { col_set_str(pinfo->cinfo, COL_INFO, "Response"); } @@ -876,9 +876,9 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case SBUS_ACKNAK: sbus_ack_code = tvb_get_ntohs(tvb,9); col_add_fstr(pinfo->cinfo, COL_INFO, - "%s", val_to_str(sbus_ack_code, - sbus_ack_nak_vals, - "Unknown NAK response code!")); + "%s", val_to_str(sbus_ack_code, + sbus_ack_nak_vals, + "Unknown NAK response code!")); break; default: @@ -900,593 +900,593 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* add an item to the subtree*/ sbus_eth_len = tvb_get_ntohl(tvb,offset); proto_tree_add_item(ethsbus_tree, - hf_sbus_length, tvb, offset, 4, FALSE); - offset += 4; + hf_sbus_length, tvb, offset, 4, FALSE); + offset += 4; sbus_version = tvb_get_guint8(tvb,offset); proto_tree_add_item(ethsbus_tree, - hf_sbus_version, tvb, offset, 1, FALSE); - offset += 1; + hf_sbus_version, tvb, offset, 1, FALSE); + offset += 1; proto_tree_add_item(ethsbus_tree, - hf_sbus_protocol, tvb, offset, 1, FALSE); - offset += 1; + hf_sbus_protocol, tvb, offset, 1, FALSE); + offset += 1; proto_tree_add_item(ethsbus_tree, - hf_sbus_sequence, tvb, offset, 2, FALSE); - offset += 2; + hf_sbus_sequence, tvb, offset, 2, FALSE); + offset += 2; /* Continue adding stuff to the main tree*/ sbus_attribut = tvb_get_guint8(tvb,offset); proto_tree_add_item(sbus_tree, - hf_sbus_attribut, tvb, offset, 1, FALSE); - offset += 1; + hf_sbus_attribut, tvb, offset, 1, FALSE); + offset += 1; if (sbus_attribut == SBUS_REQUEST) { proto_tree_add_item(sbus_tree, - hf_sbus_dest, tvb, offset, 1, FALSE); - offset += 1; + hf_sbus_dest, tvb, offset, 1, FALSE); + offset += 1; sbus_cmd_code = tvb_get_guint8(tvb,offset); proto_tree_add_item(sbus_tree, - hf_sbus_command, tvb, offset, 1, FALSE); - offset += 1; + hf_sbus_command, tvb, offset, 1, FALSE); + offset += 1; if (request_val && request_val->retry_count > 0) {/*this is a retry telegram*/ - hi = proto_tree_add_boolean(sbus_tree, - hf_sbus_retry, tvb, 0, 0, TRUE); - PROTO_ITEM_SET_GENERATED(hi); - expert_add_info_format(pinfo, hi, PI_SEQUENCE, PI_NOTE, - "Repeated telegram (due to timeout?)"); - nstime_delta(&ns, &pinfo->fd->abs_ts, &request_val->req_time); - proto_tree_add_time(sbus_tree, hf_sbus_timeout, - tvb, 0, 0, &ns); - proto_tree_add_uint(sbus_tree, hf_sbus_request_in, tvb, 0, 0, - request_val->req_frame); + hi = proto_tree_add_boolean(sbus_tree, + hf_sbus_retry, tvb, 0, 0, TRUE); + PROTO_ITEM_SET_GENERATED(hi); + expert_add_info_format(pinfo, hi, PI_SEQUENCE, PI_NOTE, + "Repeated telegram (due to timeout?)"); + nstime_delta(&ns, &pinfo->fd->abs_ts, &request_val->req_time); + proto_tree_add_time(sbus_tree, hf_sbus_timeout, + tvb, 0, 0, &ns); + proto_tree_add_uint(sbus_tree, hf_sbus_request_in, tvb, 0, 0, + request_val->req_frame); } if (request_val && request_val->resp_frame > pinfo->fd->num){ - proto_tree_add_uint(sbus_tree, hf_sbus_response_in, tvb, 0, 0, - request_val->resp_frame); + proto_tree_add_uint(sbus_tree, hf_sbus_response_in, tvb, 0, 0, + request_val->resp_frame); } switch (sbus_cmd_code) { - /*Read Counter, Register or Timer*/ - case SBUS_RD_COUNTER: - case SBUS_RD_REGISTER: - case SBUS_RD_TIMER: - sbus_media_cnt = (tvb_get_guint8(tvb,offset))+1; - proto_tree_add_uint(sbus_tree, - hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt); - offset += 1; - proto_tree_add_item(sbus_tree, - hf_sbus_addr_rtc, tvb, offset, 2, FALSE); - offset += 2; - break; - - /*Read Flag, Input or Output*/ - case SBUS_RD_FLAG: - case SBUS_RD_INPUT: - case SBUS_RD_OUTPUT: - sbus_media_cnt = (tvb_get_guint8(tvb,offset))+1; - proto_tree_add_uint(sbus_tree, - hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt); - offset += 1; - proto_tree_add_item(sbus_tree, - hf_sbus_addr_iof, tvb, offset, 2, FALSE); - offset += 2; - break; - - /*Write Register Timer Counter*/ - case SBUS_WR_COUNTER: - case SBUS_WR_REGISTER: - case SBUS_WR_TIMER: - sbus_media_cnt = (tvb_get_guint8(tvb,offset)); - sbus_media_cnt = ((sbus_media_cnt - 1)/4); - proto_tree_add_uint(sbus_tree, - hf_sbus_wcount_calculated, tvb, offset, - 1, sbus_media_cnt); - proto_tree_add_item(sbus_tree, - hf_sbus_wcount, tvb, offset, 1, FALSE); - offset += 1; - proto_tree_add_item(sbus_tree, - hf_sbus_addr_rtc, tvb, offset, 2, FALSE); - offset += 2; - /*Add subtree for Data*/ - dt = proto_tree_add_text(sbus_tree, tvb, offset, - ((sbus_media_cnt) * 4),"Data"); - - sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); - for (i=((sbus_media_cnt)); i>0; i--) { - proto_tree_add_item(sbusdata_tree, - hf_sbus_data_rtc, tvb, offset, - 4, FALSE); - offset += 4; - } - break; + /*Read Counter, Register or Timer*/ + case SBUS_RD_COUNTER: + case SBUS_RD_REGISTER: + case SBUS_RD_TIMER: + sbus_media_cnt = (tvb_get_guint8(tvb,offset))+1; + proto_tree_add_uint(sbus_tree, + hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt); + offset += 1; + proto_tree_add_item(sbus_tree, + hf_sbus_addr_rtc, tvb, offset, 2, FALSE); + offset += 2; + break; + + /*Read Flag, Input or Output*/ + case SBUS_RD_FLAG: + case SBUS_RD_INPUT: + case SBUS_RD_OUTPUT: + sbus_media_cnt = (tvb_get_guint8(tvb,offset))+1; + proto_tree_add_uint(sbus_tree, + hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt); + offset += 1; + proto_tree_add_item(sbus_tree, + hf_sbus_addr_iof, tvb, offset, 2, FALSE); + offset += 2; + break; + + /*Write Register Timer Counter*/ + case SBUS_WR_COUNTER: + case SBUS_WR_REGISTER: + case SBUS_WR_TIMER: + sbus_media_cnt = (tvb_get_guint8(tvb,offset)); + sbus_media_cnt = ((sbus_media_cnt - 1)/4); + proto_tree_add_uint(sbus_tree, + hf_sbus_wcount_calculated, tvb, offset, + 1, sbus_media_cnt); + proto_tree_add_item(sbus_tree, + hf_sbus_wcount, tvb, offset, 1, FALSE); + offset += 1; + proto_tree_add_item(sbus_tree, + hf_sbus_addr_rtc, tvb, offset, 2, FALSE); + offset += 2; + /*Add subtree for Data*/ + dt = proto_tree_add_text(sbus_tree, tvb, offset, + ((sbus_media_cnt) * 4),"Data"); - /* Write flags and outputs*/ - case SBUS_WR_FLAG: - case SBUS_WR_OUTPUT: - sbus_media_cnt = (tvb_get_guint8(tvb,offset)); - sbus_media_cnt = (sbus_media_cnt - 2); - proto_tree_add_uint(sbus_tree, - hf_sbus_wcount_calculated, tvb, offset, - 1, sbus_media_cnt); - proto_tree_add_item(sbus_tree, - hf_sbus_wcount, tvb, offset, 1, FALSE); - offset += 1; - proto_tree_add_item(sbus_tree, - hf_sbus_addr_iof, tvb, offset, 2, FALSE); - offset += 2; - sbus_fio_cnt = (tvb_get_guint8(tvb,offset)); - sbus_fio_cnt = ((sbus_fio_cnt + 1)); - proto_tree_add_uint(sbus_tree, - hf_sbus_fio_count, tvb, offset, 1, sbus_fio_cnt); - offset += 1; - /*Add subtree for Data*/ - dt = proto_tree_add_text(sbus_tree, tvb, offset, - sbus_media_cnt,"Data"); - - sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); - for (i=sbus_media_cnt; i>0; i--) { - sbus_helper = 1; - sbus_show_bin = 0; - sbus_binarymasked = 0x01; - sbus_binaries = tvb_get_guint8(tvb, offset); - for (j=0; j<8; j++) { - if ((sbus_binarymasked & sbus_binaries) != 0) { - sbus_show_bin = (sbus_show_bin + sbus_helper); - } - sbus_binarymasked = sbus_binarymasked<<1; - sbus_helper = 10 * sbus_helper; + sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); + for (i=((sbus_media_cnt)); i>0; i--) { + proto_tree_add_item(sbusdata_tree, + hf_sbus_data_rtc, tvb, offset, + 4, FALSE); + offset += 4; } - - proto_tree_add_uint_format(sbusdata_tree, - hf_sbus_data_iof, tvb, offset, 1, sbus_show_bin, - "Binary data: %08u", sbus_show_bin); + break; + + /* Write flags and outputs*/ + case SBUS_WR_FLAG: + case SBUS_WR_OUTPUT: + sbus_media_cnt = (tvb_get_guint8(tvb,offset)); + sbus_media_cnt = (sbus_media_cnt - 2); + proto_tree_add_uint(sbus_tree, + hf_sbus_wcount_calculated, tvb, offset, + 1, sbus_media_cnt); + proto_tree_add_item(sbus_tree, + hf_sbus_wcount, tvb, offset, 1, FALSE); offset += 1; - } - break; + proto_tree_add_item(sbus_tree, + hf_sbus_addr_iof, tvb, offset, 2, FALSE); + offset += 2; + sbus_fio_cnt = (tvb_get_guint8(tvb,offset)); + sbus_fio_cnt = ((sbus_fio_cnt + 1)); + proto_tree_add_uint(sbus_tree, + hf_sbus_fio_count, tvb, offset, 1, sbus_fio_cnt); + offset += 1; + /*Add subtree for Data*/ + dt = proto_tree_add_text(sbus_tree, tvb, offset, + sbus_media_cnt,"Data"); - /* Request: Write Real time clock*/ - case SBUS_WR_RTC: - sbus_helper = tvb_get_guint8(tvb, (offset +5)); /*hours*/ - sbus_helper1 = tvb_get_guint8(tvb, (offset +6)); /*minutes*/ - sbus_helper2 = tvb_get_guint8(tvb, (offset +7)); /*seconds*/ - proto_tree_add_text(sbus_tree, tvb, (offset +5), 3, - "Time (HH:MM:SS): %02x:%02x:%02x", sbus_helper, sbus_helper1, sbus_helper2); - sbus_helper = tvb_get_guint8(tvb, (offset +2)); /*year*/ - sbus_helper1 = tvb_get_guint8(tvb, (offset +3)); /*month*/ - sbus_helper2 = tvb_get_guint8(tvb, (offset +4)); /*day*/ - proto_tree_add_text(sbus_tree, tvb, (offset +2), 3, - "Date (YY/MM/DD): %02x/%02x/%02x", sbus_helper, sbus_helper1, sbus_helper2); - sbus_helper = tvb_get_guint8(tvb, (offset)); /*year-week*/ - sbus_helper1 = tvb_get_guint8(tvb, (offset +1)); /*week-day*/ - proto_tree_add_text(sbus_tree, tvb, offset, 2, - "Calendar week: %x, Week day: %x", sbus_helper, sbus_helper1); - /*Add subtree for Data*/ - dt = proto_tree_add_text(sbus_tree, tvb, offset, - 8, "Clock data"); - sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); - - proto_tree_add_item(sbusdata_tree, - hf_sbus_week_day, tvb, offset, 2, FALSE); - offset += 2; - proto_tree_add_item(sbusdata_tree, - hf_sbus_date, tvb, offset, 3, FALSE); - offset += 3; - proto_tree_add_item(sbusdata_tree, - hf_sbus_time, tvb, offset, 3, FALSE); - offset += 3; - break; + sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); + for (i=sbus_media_cnt; i>0; i--) { + sbus_helper = 1; + sbus_show_bin = 0; + sbus_binarymasked = 0x01; + sbus_binaries = tvb_get_guint8(tvb, offset); + for (j=0; j<8; j++) { + if ((sbus_binarymasked & sbus_binaries) != 0) { + sbus_show_bin = (sbus_show_bin + sbus_helper); + } + sbus_binarymasked = sbus_binarymasked<<1; + sbus_helper = 10 * sbus_helper; + } - /* Read user memory or program line*/ - case SBUS_RD_USER_MEMORY: - case SBUS_RD_PROGRAM_LINE: - sbus_media_cnt = (tvb_get_guint8(tvb,offset))+1; - proto_tree_add_uint(sbus_tree, - hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt); - offset += 1; - proto_tree_add_item(sbus_tree, - hf_sbus_addr_prog, tvb, offset, 3, FALSE); - offset += 3; - break; + proto_tree_add_uint_format(sbusdata_tree, + hf_sbus_data_iof, tvb, offset, 1, sbus_show_bin, + "Binary data: %08u", sbus_show_bin); + offset += 1; + } + break; + + /* Request: Write Real time clock*/ + case SBUS_WR_RTC: + sbus_helper = tvb_get_guint8(tvb, (offset +5)); /*hours*/ + sbus_helper1 = tvb_get_guint8(tvb, (offset +6)); /*minutes*/ + sbus_helper2 = tvb_get_guint8(tvb, (offset +7)); /*seconds*/ + proto_tree_add_text(sbus_tree, tvb, (offset +5), 3, + "Time (HH:MM:SS): %02x:%02x:%02x", sbus_helper, sbus_helper1, sbus_helper2); + sbus_helper = tvb_get_guint8(tvb, (offset +2)); /*year*/ + sbus_helper1 = tvb_get_guint8(tvb, (offset +3)); /*month*/ + sbus_helper2 = tvb_get_guint8(tvb, (offset +4)); /*day*/ + proto_tree_add_text(sbus_tree, tvb, (offset +2), 3, + "Date (YY/MM/DD): %02x/%02x/%02x", sbus_helper, sbus_helper1, sbus_helper2); + sbus_helper = tvb_get_guint8(tvb, (offset)); /*year-week*/ + sbus_helper1 = tvb_get_guint8(tvb, (offset +1)); /*week-day*/ + proto_tree_add_text(sbus_tree, tvb, offset, 2, + "Calendar week: %x, Week day: %x", sbus_helper, sbus_helper1); + /*Add subtree for Data*/ + dt = proto_tree_add_text(sbus_tree, tvb, offset, + 8, "Clock data"); + sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); - /*Write user memory*/ - case SBUS_WR_USER_MEMORY: - sbus_media_cnt = (tvb_get_guint8(tvb,offset)); - sbus_media_cnt = ((sbus_media_cnt - 2)/4); - proto_tree_add_uint(sbus_tree, - hf_sbus_wcount_calculated, tvb, offset, - 1, sbus_media_cnt); - proto_tree_add_item(sbus_tree, - hf_sbus_wcount, tvb, offset, 1, FALSE); - offset += 1; - proto_tree_add_item(sbus_tree, - hf_sbus_addr_68k, tvb, offset, 3, FALSE); - offset += 3; - /*Add subtree for Data*/ - dt = proto_tree_add_text(sbus_tree, tvb, offset, - ((sbus_media_cnt) * 4),"Program lines"); - - sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); - for (i=((sbus_media_cnt)); i>0; i--) { proto_tree_add_item(sbusdata_tree, - hf_sbus_data_rtc, tvb, offset, - 4, FALSE); - offset += 4; - - } - break; - - /* Read byte*/ - case SBUS_RD_BYTE: - sbus_media_cnt = (tvb_get_guint8(tvb,offset))+1; - proto_tree_add_uint(sbus_tree, - hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt); - offset += 1; - proto_tree_add_item(sbus_tree, - hf_sbus_addr_68k, tvb, offset, 3, FALSE); - offset += 3; - break; - - /* Write byte */ - case SBUS_WR_BYTE: - sbus_media_cnt = (tvb_get_guint8(tvb,offset)); - sbus_media_cnt = (sbus_media_cnt - 2); - proto_tree_add_uint(sbus_tree, - hf_sbus_wcount_calculated, tvb, offset, - 1, sbus_media_cnt); - proto_tree_add_item(sbus_tree, - hf_sbus_wcount, tvb, offset, 1, FALSE); - offset += 1; - proto_tree_add_item(sbus_tree, - hf_sbus_addr_68k, tvb, offset, 3, FALSE); - offset += 3; - /*Add subtree for Data*/ - dt = proto_tree_add_text(sbus_tree, tvb, offset, - ((sbus_media_cnt) * 4),"Data (bytes)"); - - sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); - for (i=sbus_media_cnt; i>0; i--) { + hf_sbus_week_day, tvb, offset, 2, FALSE); + offset += 2; + proto_tree_add_item(sbusdata_tree, + hf_sbus_date, tvb, offset, 3, FALSE); + offset += 3; proto_tree_add_item(sbusdata_tree, - hf_sbus_data_byte, tvb, offset, - 1, FALSE); + hf_sbus_time, tvb, offset, 3, FALSE); + offset += 3; + break; + + /* Read user memory or program line*/ + case SBUS_RD_USER_MEMORY: + case SBUS_RD_PROGRAM_LINE: + sbus_media_cnt = (tvb_get_guint8(tvb,offset))+1; + proto_tree_add_uint(sbus_tree, + hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt); offset += 1; - } - break; + proto_tree_add_item(sbus_tree, + hf_sbus_addr_prog, tvb, offset, 3, FALSE); + offset += 3; + break; + + /*Write user memory*/ + case SBUS_WR_USER_MEMORY: + sbus_media_cnt = (tvb_get_guint8(tvb,offset)); + sbus_media_cnt = ((sbus_media_cnt - 2)/4); + proto_tree_add_uint(sbus_tree, + hf_sbus_wcount_calculated, tvb, offset, + 1, sbus_media_cnt); + proto_tree_add_item(sbus_tree, + hf_sbus_wcount, tvb, offset, 1, FALSE); + offset += 1; + proto_tree_add_item(sbus_tree, + hf_sbus_addr_68k, tvb, offset, 3, FALSE); + offset += 3; + /*Add subtree for Data*/ + dt = proto_tree_add_text(sbus_tree, tvb, offset, + ((sbus_media_cnt) * 4),"Program lines"); - /*Read EEPROM register*/ - case SBUS_RD_USER_EEPROM_REGISTER: - proto_tree_add_item(sbus_tree, - hf_sbus_command_extension, tvb, offset, 1, FALSE); - offset += 1; - sbus_media_cnt = (tvb_get_guint8(tvb,offset))+1; - proto_tree_add_uint(sbus_tree, - hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt); - offset += 1; - proto_tree_add_item(sbus_tree, - hf_sbus_addr_eeprom, tvb, offset, 2, FALSE); - offset += 2; - break; + sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); + for (i=((sbus_media_cnt)); i>0; i--) { + proto_tree_add_item(sbusdata_tree, + hf_sbus_data_rtc, tvb, offset, + 4, FALSE); + offset += 4; - /*Request for reading system info*/ - /*Syinfo 05 is not implemented as no serial baud is possible*/ - case SBUS_RD_SYSTEM_INFORMATION: - sbus_sysinfo_number = (tvb_get_guint8(tvb,13)); - proto_tree_add_item(sbus_tree, - hf_sbus_sysinfo_nr, tvb, offset, 1, FALSE); - offset += 1; - sbus_sysinfo_number = (tvb_get_guint8(tvb,14)); - proto_tree_add_item(sbus_tree, - hf_sbus_sysinfo_nr, tvb, offset, 1, FALSE); - offset += 1; - break; + } + break; - /* WebServer Request */ - case SBUS_WEB_SERVER_SERIAL_COMM: - sbus_web_size = tvb_get_guint8(tvb,offset); - proto_tree_add_item(sbus_tree, - hf_sbus_web_size, tvb, offset, - 1, sbus_web_size); - offset += 1; - - sbus_web_aid = tvb_get_guint8(tvb,offset); - proto_tree_add_item(sbus_tree, - hf_sbus_web_aid, tvb, offset, - 1, sbus_web_aid); - offset += 1; - - sbus_web_seq = tvb_get_guint8(tvb,offset); - proto_tree_add_item(sbus_tree, - hf_sbus_web_seq, tvb, offset, - 1, sbus_web_seq); - offset += 1; - - if (sbus_web_size > 1) { + /* Read byte*/ + case SBUS_RD_BYTE: + sbus_media_cnt = (tvb_get_guint8(tvb,offset))+1; + proto_tree_add_uint(sbus_tree, + hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt); + offset += 1; + proto_tree_add_item(sbus_tree, + hf_sbus_addr_68k, tvb, offset, 3, FALSE); + offset += 3; + break; + + /* Write byte */ + case SBUS_WR_BYTE: + sbus_media_cnt = (tvb_get_guint8(tvb,offset)); + sbus_media_cnt = (sbus_media_cnt - 2); + proto_tree_add_uint(sbus_tree, + hf_sbus_wcount_calculated, tvb, offset, + 1, sbus_media_cnt); + proto_tree_add_item(sbus_tree, + hf_sbus_wcount, tvb, offset, 1, FALSE); + offset += 1; + proto_tree_add_item(sbus_tree, + hf_sbus_addr_68k, tvb, offset, 3, FALSE); + offset += 3; + /*Add subtree for Data*/ dt = proto_tree_add_text(sbus_tree, tvb, offset, - (sbus_web_size - 1),"Data (bytes)"); + ((sbus_media_cnt) * 4),"Data (bytes)"); sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); - for (i=sbus_web_size -1 ; i>0; i--) { + for (i=sbus_media_cnt; i>0; i--) { proto_tree_add_item(sbusdata_tree, - hf_sbus_data_byte, tvb, offset, - 1, FALSE); + hf_sbus_data_byte, tvb, offset, + 1, FALSE); offset += 1; } - } - break; - /* Read/write block request */ - case SBUS_RD_WR_PCD_BLOCK: - if (tvb_get_guint8(tvb,offset) == 0xff){ - sbus_rdwr_length = ((tvb_get_ntohl(tvb,0))-15); - proto_tree_add_uint(sbus_tree, - hf_sbus_rdwr_block_length_ext, tvb, 0, 4, sbus_rdwr_length); - offset += 1; - } else { - sbus_rdwr_length = tvb_get_guint8(tvb,offset); - proto_tree_add_uint(sbus_tree, - hf_sbus_rdwr_block_length, tvb, offset, - 1, sbus_rdwr_length); - offset += 1; - } - sbus_rdwr_type = tvb_get_guint8(tvb,offset); - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_telegram_type, tvb, offset, - 1, sbus_rdwr_type); - offset += 1; - switch(sbus_rdwr_type) { - case SBUS_WR_START_OF_STREAM: - sbus_rdwr_block_type = tvb_get_guint8(tvb, 14); - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_telegram_sequence, tvb, offset, - 1, FALSE); - offset += 1; - proto_tree_add_item(sbus_tree, - hf_sbus_block_type, tvb, offset, - 1, FALSE); - offset += 1; - - /* Check for file or block download */ - if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) || - (sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) { - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_block_size, tvb, offset, - 4, FALSE); - offset += 4; - sbus_quint8_helper0=0; - /*find zero-termination of string*/ - for (i=19; i<43; i++) { /*max length string is 24 char*/ - if ((tvb_get_guint8(tvb, i)) == 0x00) { - break; - } - sbus_quint8_helper0 += 1; - } - tmp_string = tvb_get_ephemeral_string(tvb , 19, sbus_quint8_helper0); - proto_tree_add_string(sbus_tree, - hf_sbus_rdwr_file_name, tvb, offset, - sbus_quint8_helper0, tmp_string); - offset += sbus_quint8_helper0; - /*do not display a field for block data (skip)*/ - offset += (sbus_rdwr_length-6-sbus_quint8_helper0); - } else { /* block write telegram, no file write*/ - proto_tree_add_item(sbus_tree, - hf_sbus_block_nr, tvb, offset, - 2, FALSE); - offset += 2; - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_block_size, tvb, offset, - 4, FALSE); - offset += 4; - /*do not display a field for block data (skip)*/ - offset += (sbus_rdwr_length-8); - } - break; - case SBUS_WR_BLOCK_DATA_STREAM: - sbus_rdwr_sequence = tvb_get_guint8(tvb,offset); - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_telegram_sequence, tvb, offset, - 1, sbus_rdwr_sequence); - offset += 1; - /*do not display a field for block data (skip)*/ - offset += (sbus_rdwr_length-1); - break; - case SBUS_WR_BLOCK_END_OF_STREAM: - sbus_rdwr_sequence = tvb_get_guint8(tvb,offset); - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_telegram_sequence, tvb, offset, - 1, sbus_rdwr_sequence); - offset += 1; - /*do not display a field for block data (skip it)*/ - offset += (sbus_rdwr_length-5); - /*do not display a field for block CRC (skip it)*/ - offset += 4; - break; - case SBUS_WR_ABORT_BLOCK_STREAM: - case SBUS_RD_ABORT_BLOCK_STREAM: - break; - case SBUS_WR_BLOCK_DATA_BYTES: - sbus_rdwr_block_type = tvb_get_guint8(tvb, 14); - proto_tree_add_item(sbus_tree, - hf_sbus_block_type, tvb, offset, - 1, FALSE); - offset += 1; - - /* Check for file or block download */ - if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) || - (sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) { - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_block_addr, tvb, offset, - 4, FALSE); - offset += 4; - sbus_quint8_helper0=0; - /*find zero-termination of string*/ - for (i=19; i<43; i++) { /*max length string is 24 char*/ - if ((tvb_get_guint8(tvb, i)) == 0x00) { - break; - } - sbus_quint8_helper0 += 1; - } - tmp_string = tvb_get_ephemeral_string(tvb, 19, sbus_quint8_helper0); - proto_tree_add_string(sbus_tree, - hf_sbus_rdwr_file_name, tvb, offset, - sbus_quint8_helper0, tmp_string); - offset += sbus_quint8_helper0; - /*do not display a field for block data (skip)*/ - offset += (sbus_rdwr_length-6-sbus_quint8_helper0); - } else { /* block write telegram, no file write*/ - proto_tree_add_item(sbus_tree, - hf_sbus_block_nr, tvb, offset, - 2, FALSE); - offset += 2; - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_block_addr, tvb, offset, - 4, FALSE); - offset += 4; - /*do not display a field for block data (skip)*/ - offset += (sbus_rdwr_length-8); - } - break; - case SBUS_RD_BLOCK_START_OF_STREAM: - sbus_rdwr_block_type = tvb_get_guint8(tvb, 14); - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_telegram_sequence, tvb, offset, - 1, FALSE); - offset += 1; - proto_tree_add_item(sbus_tree, - hf_sbus_block_type, tvb, offset, - 1, FALSE); - offset += 1; - - /* Check for file or block download */ - if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) || - (sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) { - sbus_quint8_helper0=0; - /*find zero-termination of string*/ - for (i=14; i<38; i++) { /*max length string is 24 char*/ - if ((tvb_get_guint8(tvb, i)) == 0x00) { - break; - } - sbus_quint8_helper0 += 1; - } - tmp_string = tvb_get_ephemeral_string(tvb, 14, sbus_quint8_helper0); - proto_tree_add_string(sbus_tree, - hf_sbus_rdwr_file_name, tvb, offset, - sbus_quint8_helper0, tmp_string); - offset += sbus_quint8_helper0; - } else { /* block write telegram, no file write*/ - proto_tree_add_item(sbus_tree, - hf_sbus_block_nr, tvb, offset, - 2, FALSE); - offset += 2; - } - break; - case SBUS_RD_BLOCK_DATA_STREAM: - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_telegram_sequence, tvb, offset, - 1, FALSE); - offset += 1; - break; - case SBUS_RD_BLOCK_DATA_BYTES: - sbus_rdwr_block_type = tvb_get_guint8(tvb, 13); - proto_tree_add_item(sbus_tree, - hf_sbus_block_type, tvb, offset, - 1, FALSE); - offset += 1; - /* Check for file or block read */ - if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) || - (sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) { - /*reading from a file*/ - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_block_addr, tvb, offset, - 4, FALSE); - offset += 4; - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_block_size, tvb, offset, - 4, FALSE); - offset += 4; - sbus_quint8_helper0=0; - /*find zero-termination of string*/ - for (i=22; i<46; i++) { /*max length string is 24 char*/ - if ((tvb_get_guint8(tvb, i)) == 0x00) { - break; - } - sbus_quint8_helper0 += 1; - } - tmp_string = tvb_get_ephemeral_string(tvb, 22, sbus_quint8_helper0); - proto_tree_add_string(sbus_tree, - hf_sbus_rdwr_file_name, tvb, offset, - sbus_quint8_helper0, tmp_string); - offset += sbus_quint8_helper0 + 1; - } else { /* block read telegram, no file read*/ - proto_tree_add_item(sbus_tree, - hf_sbus_block_nr, tvb, offset, - 2, FALSE); - offset += 2; - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_block_addr, tvb, offset, - 4, FALSE); - offset += 4; - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_block_size, tvb, offset, - 4, FALSE); - offset += 4; - } - break; - case SBUS_DELETE_BLOCK: - case SBUS_GET_BLOCK_SIZE: - sbus_rdwr_block_type = tvb_get_guint8(tvb, 13); - proto_tree_add_item(sbus_tree, - hf_sbus_block_type, tvb, offset, - 1, FALSE); - offset += 1; - /* Check for file or block deletion */ - if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) || - (sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) { - /*delete a file*/ - sbus_quint8_helper0=0; - /*find zero-termination of string*/ - for (i=14; i<38; i++) { /*max length string is 24 char*/ - if ((tvb_get_guint8(tvb, i)) == 0x00) { - break; - } - sbus_quint8_helper0 += 1; - } - tmp_string = tvb_get_ephemeral_string(tvb, 14, sbus_quint8_helper0); - proto_tree_add_string(sbus_tree, - hf_sbus_rdwr_file_name, tvb, offset, - sbus_quint8_helper0, tmp_string); - offset += sbus_quint8_helper0 + 1; - } else { /* delete a block*/ - proto_tree_add_item(sbus_tree, - hf_sbus_block_nr, tvb, offset, - 2, FALSE); - offset += 2; - } - break; - case SBUS_GET_PROGRAM_BLOCK_LIST: - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_list_type, tvb, offset, - 1, FALSE); - offset += 1; - break; + break; - default: - break; - } + /*Read EEPROM register*/ + case SBUS_RD_USER_EEPROM_REGISTER: + proto_tree_add_item(sbus_tree, + hf_sbus_command_extension, tvb, offset, 1, FALSE); + offset += 1; + sbus_media_cnt = (tvb_get_guint8(tvb,offset))+1; + proto_tree_add_uint(sbus_tree, + hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt); + offset += 1; + proto_tree_add_item(sbus_tree, + hf_sbus_addr_eeprom, tvb, offset, 2, FALSE); + offset += 2; + break; + + /*Request for reading system info*/ + /*Syinfo 05 is not implemented as no serial baud is possible*/ + case SBUS_RD_SYSTEM_INFORMATION: + sbus_sysinfo_number = (tvb_get_guint8(tvb,13)); + proto_tree_add_item(sbus_tree, + hf_sbus_sysinfo_nr, tvb, offset, 1, FALSE); + offset += 1; + sbus_sysinfo_number = (tvb_get_guint8(tvb,14)); + proto_tree_add_item(sbus_tree, + hf_sbus_sysinfo_nr, tvb, offset, 1, FALSE); + offset += 1; + break; - break; + /* WebServer Request */ + case SBUS_WEB_SERVER_SERIAL_COMM: + sbus_web_size = tvb_get_guint8(tvb,offset); + proto_tree_add_item(sbus_tree, + hf_sbus_web_size, tvb, offset, + 1, sbus_web_size); + offset += 1; -/*Inform that command was not dissected and add remaining length*/ - default: - if (sbus_eth_len > 13) { /*13 bytes is the minimal length of a request telegram...*/ - sbus_helper = sbus_eth_len - (offset + 2); - proto_tree_add_text(sbus_tree, tvb, offset, sbus_helper, - "This telegram isn't implemented in the dissector."); - offset = offset + sbus_helper; - } - break; + sbus_web_aid = tvb_get_guint8(tvb,offset); + proto_tree_add_item(sbus_tree, + hf_sbus_web_aid, tvb, offset, + 1, sbus_web_aid); + offset += 1; + + sbus_web_seq = tvb_get_guint8(tvb,offset); + proto_tree_add_item(sbus_tree, + hf_sbus_web_seq, tvb, offset, + 1, sbus_web_seq); + offset += 1; + + if (sbus_web_size > 1) { + dt = proto_tree_add_text(sbus_tree, tvb, offset, + (sbus_web_size - 1),"Data (bytes)"); + + sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); + for (i=sbus_web_size -1 ; i>0; i--) { + proto_tree_add_item(sbusdata_tree, + hf_sbus_data_byte, tvb, offset, + 1, FALSE); + offset += 1; + } + } + break; + /* Read/write block request */ + case SBUS_RD_WR_PCD_BLOCK: + if (tvb_get_guint8(tvb,offset) == 0xff){ + sbus_rdwr_length = ((tvb_get_ntohl(tvb,0))-15); + proto_tree_add_uint(sbus_tree, + hf_sbus_rdwr_block_length_ext, tvb, 0, 4, sbus_rdwr_length); + offset += 1; + } else { + sbus_rdwr_length = tvb_get_guint8(tvb,offset); + proto_tree_add_uint(sbus_tree, + hf_sbus_rdwr_block_length, tvb, offset, + 1, sbus_rdwr_length); + offset += 1; + } + sbus_rdwr_type = tvb_get_guint8(tvb,offset); + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_telegram_type, tvb, offset, + 1, sbus_rdwr_type); + offset += 1; + switch(sbus_rdwr_type) { + case SBUS_WR_START_OF_STREAM: + sbus_rdwr_block_type = tvb_get_guint8(tvb, 14); + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_telegram_sequence, tvb, offset, + 1, FALSE); + offset += 1; + proto_tree_add_item(sbus_tree, + hf_sbus_block_type, tvb, offset, + 1, FALSE); + offset += 1; + + /* Check for file or block download */ + if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) || + (sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) { + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_block_size, tvb, offset, + 4, FALSE); + offset += 4; + sbus_quint8_helper0=0; + /*find zero-termination of string*/ + for (i=19; i<43; i++) { /*max length string is 24 char*/ + if ((tvb_get_guint8(tvb, i)) == 0x00) { + break; + } + sbus_quint8_helper0 += 1; + } + tmp_string = tvb_get_ephemeral_string(tvb , 19, sbus_quint8_helper0); + proto_tree_add_string(sbus_tree, + hf_sbus_rdwr_file_name, tvb, offset, + sbus_quint8_helper0, tmp_string); + offset += sbus_quint8_helper0; + /*do not display a field for block data (skip)*/ + offset += (sbus_rdwr_length-6-sbus_quint8_helper0); + } else { /* block write telegram, no file write*/ + proto_tree_add_item(sbus_tree, + hf_sbus_block_nr, tvb, offset, + 2, FALSE); + offset += 2; + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_block_size, tvb, offset, + 4, FALSE); + offset += 4; + /*do not display a field for block data (skip)*/ + offset += (sbus_rdwr_length-8); + } + break; + case SBUS_WR_BLOCK_DATA_STREAM: + sbus_rdwr_sequence = tvb_get_guint8(tvb,offset); + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_telegram_sequence, tvb, offset, + 1, sbus_rdwr_sequence); + offset += 1; + /*do not display a field for block data (skip)*/ + offset += (sbus_rdwr_length-1); + break; + case SBUS_WR_BLOCK_END_OF_STREAM: + sbus_rdwr_sequence = tvb_get_guint8(tvb,offset); + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_telegram_sequence, tvb, offset, + 1, sbus_rdwr_sequence); + offset += 1; + /*do not display a field for block data (skip it)*/ + offset += (sbus_rdwr_length-5); + /*do not display a field for block CRC (skip it)*/ + offset += 4; + break; + case SBUS_WR_ABORT_BLOCK_STREAM: + case SBUS_RD_ABORT_BLOCK_STREAM: + break; + case SBUS_WR_BLOCK_DATA_BYTES: + sbus_rdwr_block_type = tvb_get_guint8(tvb, 14); + proto_tree_add_item(sbus_tree, + hf_sbus_block_type, tvb, offset, + 1, FALSE); + offset += 1; + + /* Check for file or block download */ + if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) || + (sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) { + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_block_addr, tvb, offset, + 4, FALSE); + offset += 4; + sbus_quint8_helper0=0; + /*find zero-termination of string*/ + for (i=19; i<43; i++) { /*max length string is 24 char*/ + if ((tvb_get_guint8(tvb, i)) == 0x00) { + break; + } + sbus_quint8_helper0 += 1; + } + tmp_string = tvb_get_ephemeral_string(tvb, 19, sbus_quint8_helper0); + proto_tree_add_string(sbus_tree, + hf_sbus_rdwr_file_name, tvb, offset, + sbus_quint8_helper0, tmp_string); + offset += sbus_quint8_helper0; + /*do not display a field for block data (skip)*/ + offset += (sbus_rdwr_length-6-sbus_quint8_helper0); + } else { /* block write telegram, no file write*/ + proto_tree_add_item(sbus_tree, + hf_sbus_block_nr, tvb, offset, + 2, FALSE); + offset += 2; + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_block_addr, tvb, offset, + 4, FALSE); + offset += 4; + /*do not display a field for block data (skip)*/ + offset += (sbus_rdwr_length-8); + } + break; + case SBUS_RD_BLOCK_START_OF_STREAM: + sbus_rdwr_block_type = tvb_get_guint8(tvb, 14); + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_telegram_sequence, tvb, offset, + 1, FALSE); + offset += 1; + proto_tree_add_item(sbus_tree, + hf_sbus_block_type, tvb, offset, + 1, FALSE); + offset += 1; + + /* Check for file or block download */ + if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) || + (sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) { + sbus_quint8_helper0=0; + /*find zero-termination of string*/ + for (i=14; i<38; i++) { /*max length string is 24 char*/ + if ((tvb_get_guint8(tvb, i)) == 0x00) { + break; + } + sbus_quint8_helper0 += 1; + } + tmp_string = tvb_get_ephemeral_string(tvb, 14, sbus_quint8_helper0); + proto_tree_add_string(sbus_tree, + hf_sbus_rdwr_file_name, tvb, offset, + sbus_quint8_helper0, tmp_string); + offset += sbus_quint8_helper0; + } else { /* block write telegram, no file write*/ + proto_tree_add_item(sbus_tree, + hf_sbus_block_nr, tvb, offset, + 2, FALSE); + offset += 2; + } + break; + case SBUS_RD_BLOCK_DATA_STREAM: + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_telegram_sequence, tvb, offset, + 1, FALSE); + offset += 1; + break; + case SBUS_RD_BLOCK_DATA_BYTES: + sbus_rdwr_block_type = tvb_get_guint8(tvb, 13); + proto_tree_add_item(sbus_tree, + hf_sbus_block_type, tvb, offset, + 1, FALSE); + offset += 1; + /* Check for file or block read */ + if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) || + (sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) { + /*reading from a file*/ + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_block_addr, tvb, offset, + 4, FALSE); + offset += 4; + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_block_size, tvb, offset, + 4, FALSE); + offset += 4; + sbus_quint8_helper0=0; + /*find zero-termination of string*/ + for (i=22; i<46; i++) { /*max length string is 24 char*/ + if ((tvb_get_guint8(tvb, i)) == 0x00) { + break; + } + sbus_quint8_helper0 += 1; + } + tmp_string = tvb_get_ephemeral_string(tvb, 22, sbus_quint8_helper0); + proto_tree_add_string(sbus_tree, + hf_sbus_rdwr_file_name, tvb, offset, + sbus_quint8_helper0, tmp_string); + offset += sbus_quint8_helper0 + 1; + } else { /* block read telegram, no file read*/ + proto_tree_add_item(sbus_tree, + hf_sbus_block_nr, tvb, offset, + 2, FALSE); + offset += 2; + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_block_addr, tvb, offset, + 4, FALSE); + offset += 4; + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_block_size, tvb, offset, + 4, FALSE); + offset += 4; + } + break; + case SBUS_DELETE_BLOCK: + case SBUS_GET_BLOCK_SIZE: + sbus_rdwr_block_type = tvb_get_guint8(tvb, 13); + proto_tree_add_item(sbus_tree, + hf_sbus_block_type, tvb, offset, + 1, FALSE); + offset += 1; + /* Check for file or block deletion */ + if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) || + (sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) { + /*delete a file*/ + sbus_quint8_helper0=0; + /*find zero-termination of string*/ + for (i=14; i<38; i++) { /*max length string is 24 char*/ + if ((tvb_get_guint8(tvb, i)) == 0x00) { + break; + } + sbus_quint8_helper0 += 1; + } + tmp_string = tvb_get_ephemeral_string(tvb, 14, sbus_quint8_helper0); + proto_tree_add_string(sbus_tree, + hf_sbus_rdwr_file_name, tvb, offset, + sbus_quint8_helper0, tmp_string); + offset += sbus_quint8_helper0 + 1; + } else { /* delete a block*/ + proto_tree_add_item(sbus_tree, + hf_sbus_block_nr, tvb, offset, + 2, FALSE); + offset += 2; + } + break; + case SBUS_GET_PROGRAM_BLOCK_LIST: + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_list_type, tvb, offset, + 1, FALSE); + offset += 1; + break; + + default: + break; + } + + break; + + /*Inform that command was not dissected and add remaining length*/ + default: + if (sbus_eth_len > 13) { /*13 bytes is the minimal length of a request telegram...*/ + sbus_helper = sbus_eth_len - (offset + 2); + proto_tree_add_text(sbus_tree, tvb, offset, sbus_helper, + "This telegram isn't implemented in the dissector."); + offset = offset + sbus_helper; + } + break; } } -/* Response dissection*/ + /* Response dissection*/ if (sbus_attribut == SBUS_RESPONSE && request_val) { /*add response time*/ nstime_delta(&ns, &pinfo->fd->abs_ts, &request_val->req_time); @@ -1497,359 +1497,359 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) request_val->req_frame); switch (request_val->cmd_code) { - /* Response: 32 bit values*/ - case SBUS_RD_COUNTER: - case SBUS_RD_REGISTER: - case SBUS_RD_TIMER: - case SBUS_RD_USER_MEMORY: - case SBUS_RD_PROGRAM_LINE: - case SBUS_RD_USER_EEPROM_REGISTER: - /*Add subtree for Data*/ - dt = proto_tree_add_text(sbus_tree, tvb, offset, - ((request_val->count) * 4),"Data"); - sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); - for (i=(request_val->count); i>0; i--) { - proto_tree_add_item(sbusdata_tree, - hf_sbus_data_rtc, tvb, offset, - 4, FALSE); - offset += 4; - } - break; - - /* Response: PCD Display register*/ - case SBUS_RD_DISPLAY_REGISTER: - proto_tree_add_item(sbus_tree, - hf_sbus_display_register, tvb, offset, 4, FALSE); - offset += 4; - break; - - /* Add binary data I, O, F*/ - case SBUS_RD_FLAG: - case SBUS_RD_INPUT: - case SBUS_RD_OUTPUT: - /*Add subtree for Data*/ - dt = proto_tree_add_text(sbus_tree, tvb, offset, - (((request_val->count) + 7) / 8), "Data"); - sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); - - for (i=(((request_val->count) + 7) / 8); i>0; i--) { - sbus_helper = 1; - sbus_show_bin = 0; - sbus_binarymasked = 0x01; - sbus_binaries = tvb_get_guint8(tvb, offset); - for (j=0; j<8; j++){ - if ((sbus_binarymasked & sbus_binaries) != 0) { - sbus_show_bin = (sbus_show_bin + sbus_helper); - } - sbus_binarymasked = sbus_binarymasked<<1; - sbus_helper = 10 * sbus_helper; + /* Response: 32 bit values*/ + case SBUS_RD_COUNTER: + case SBUS_RD_REGISTER: + case SBUS_RD_TIMER: + case SBUS_RD_USER_MEMORY: + case SBUS_RD_PROGRAM_LINE: + case SBUS_RD_USER_EEPROM_REGISTER: + /*Add subtree for Data*/ + dt = proto_tree_add_text(sbus_tree, tvb, offset, + ((request_val->count) * 4),"Data"); + sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); + for (i=(request_val->count); i>0; i--) { + proto_tree_add_item(sbusdata_tree, + hf_sbus_data_rtc, tvb, offset, + 4, FALSE); + offset += 4; } + break; - proto_tree_add_uint_format(sbusdata_tree, - hf_sbus_data_iof, tvb, offset, 1, sbus_show_bin, - "Binary data: %08u", sbus_show_bin); - offset += 1; - } - break; - - /* Response: Real time clock value*/ - case SBUS_RD_RTC: - sbus_helper = tvb_get_guint8(tvb, (offset +5)); /*hours*/ - sbus_helper1 = tvb_get_guint8(tvb, (offset +6)); /*minutes*/ - sbus_helper2 = tvb_get_guint8(tvb, (offset +7)); /*seconds*/ - proto_tree_add_text(sbus_tree, tvb, (offset +5), 3, - "Time (HH:MM:SS): %02x:%02x:%02x", sbus_helper, sbus_helper1, sbus_helper2); - sbus_helper = tvb_get_guint8(tvb, (offset +2)); /*year*/ - sbus_helper1 = tvb_get_guint8(tvb, (offset +3)); /*month*/ - sbus_helper2 = tvb_get_guint8(tvb, (offset +4)); /*day*/ - proto_tree_add_text(sbus_tree, tvb, (offset +2), 3, - "Date (YY/MM/DD): %02x/%02x/%02x", sbus_helper, sbus_helper1, sbus_helper2); - sbus_helper = tvb_get_guint8(tvb, (offset)); /*year-week*/ - sbus_helper1 = tvb_get_guint8(tvb, (offset +1)); /*week-day*/ - proto_tree_add_text(sbus_tree, tvb, offset, 2, - "Calendar week: %x, Week day: %x", sbus_helper, sbus_helper1); - /*Add subtree for Data*/ - dt = proto_tree_add_text(sbus_tree, tvb, offset, - 8, "Clock data"); - sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); - - proto_tree_add_item(sbusdata_tree, - hf_sbus_week_day, tvb, offset, 2, FALSE); - offset += 2; - proto_tree_add_item(sbusdata_tree, - hf_sbus_date, tvb, offset, 3, FALSE); - offset += 3; - proto_tree_add_item(sbusdata_tree, - hf_sbus_time, tvb, offset, 3, FALSE); - offset += 3; - break; - - /* Response: CPU status, the command codes 14..1B are concerned*/ - case SBUS_RD_PCD_STATUS_CPU0: - case SBUS_RD_PCD_STATUS_CPU1: - case SBUS_RD_PCD_STATUS_CPU2: - case SBUS_RD_PCD_STATUS_CPU3: - case SBUS_RD_PCD_STATUS_CPU4: - case SBUS_RD_PCD_STATUS_CPU5: - case SBUS_RD_PCD_STATUS_CPU6: - case SBUS_RD_PCD_STATUS_OWN: - proto_tree_add_item(sbus_tree, - hf_sbus_cpu_status, tvb, offset, 1, FALSE); - offset += 1; - break; - - /* Response: Station address*/ - case SBUS_RD_SBUS_STN_NBR: - proto_tree_add_item(sbus_tree, - hf_sbus_address, tvb, offset, 1, FALSE); - offset += 1; - break; + /* Response: PCD Display register*/ + case SBUS_RD_DISPLAY_REGISTER: + proto_tree_add_item(sbus_tree, + hf_sbus_display_register, tvb, offset, 4, FALSE); + offset += 4; + break; - /* Response: Firmware version */ - case SBUS_RD_PROGRAM_VERSION: - /*PCD type*/ - tmp_string = tvb_get_ephemeral_string(tvb , offset, 5); - proto_tree_add_string(sbus_tree, - hf_sbus_cpu_type, tvb, offset, 5, tmp_string); - offset += 5; - /*FW version*/ - tmp_string = tvb_get_ephemeral_string(tvb , offset, 3); - proto_tree_add_string(sbus_tree, - hf_sbus_fw_version, tvb, offset, 3, tmp_string); - offset += 4; - break; + /* Add binary data I, O, F*/ + case SBUS_RD_FLAG: + case SBUS_RD_INPUT: + case SBUS_RD_OUTPUT: + /*Add subtree for Data*/ + dt = proto_tree_add_text(sbus_tree, tvb, offset, + (((request_val->count) + 7) / 8), "Data"); + sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); - /* Response for Status Flags*/ - case SBUS_RD_STATUSFLAG_ACCU: - /*Add subtree for Data*/ - dt = proto_tree_add_text(sbus_tree, tvb, offset, - 1,"ACCU and arithmetic status"); - sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); - - proto_tree_add_item(sbusdata_tree, hf_sbus_flags_accu, - tvb, offset, 1, FALSE); - proto_tree_add_item(sbusdata_tree, hf_sbus_flags_error, - tvb, offset, 1, FALSE); - proto_tree_add_item(sbusdata_tree, hf_sbus_flags_negative, - tvb, offset, 1, FALSE); - proto_tree_add_item(sbusdata_tree, hf_sbus_flags_zero, - tvb, offset, 1, FALSE); - offset +=1; - break; + for (i=(((request_val->count) + 7) / 8); i>0; i--) { + sbus_helper = 1; + sbus_show_bin = 0; + sbus_binarymasked = 0x01; + sbus_binaries = tvb_get_guint8(tvb, offset); + for (j=0; j<8; j++){ + if ((sbus_binarymasked & sbus_binaries) != 0) { + sbus_show_bin = (sbus_show_bin + sbus_helper); + } + sbus_binarymasked = sbus_binarymasked<<1; + sbus_helper = 10 * sbus_helper; + } - /* Response for Read byte */ - case SBUS_RD_BYTE: - /*Add subtree for Data*/ - dt = proto_tree_add_text(sbus_tree, tvb, offset, - (request_val->count),"Data (bytes)"); + proto_tree_add_uint_format(sbusdata_tree, + hf_sbus_data_iof, tvb, offset, 1, sbus_show_bin, + "Binary data: %08u", sbus_show_bin); + offset += 1; + } + break; + + /* Response: Real time clock value*/ + case SBUS_RD_RTC: + sbus_helper = tvb_get_guint8(tvb, (offset +5)); /*hours*/ + sbus_helper1 = tvb_get_guint8(tvb, (offset +6)); /*minutes*/ + sbus_helper2 = tvb_get_guint8(tvb, (offset +7)); /*seconds*/ + proto_tree_add_text(sbus_tree, tvb, (offset +5), 3, + "Time (HH:MM:SS): %02x:%02x:%02x", sbus_helper, sbus_helper1, sbus_helper2); + sbus_helper = tvb_get_guint8(tvb, (offset +2)); /*year*/ + sbus_helper1 = tvb_get_guint8(tvb, (offset +3)); /*month*/ + sbus_helper2 = tvb_get_guint8(tvb, (offset +4)); /*day*/ + proto_tree_add_text(sbus_tree, tvb, (offset +2), 3, + "Date (YY/MM/DD): %02x/%02x/%02x", sbus_helper, sbus_helper1, sbus_helper2); + sbus_helper = tvb_get_guint8(tvb, (offset)); /*year-week*/ + sbus_helper1 = tvb_get_guint8(tvb, (offset +1)); /*week-day*/ + proto_tree_add_text(sbus_tree, tvb, offset, 2, + "Calendar week: %x, Week day: %x", sbus_helper, sbus_helper1); + /*Add subtree for Data*/ + dt = proto_tree_add_text(sbus_tree, tvb, offset, + 8, "Clock data"); + sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); - sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); - for (i=(request_val->count); i>0; i--) { proto_tree_add_item(sbusdata_tree, - hf_sbus_data_byte, tvb, offset, - 1, FALSE); + hf_sbus_week_day, tvb, offset, 2, FALSE); + offset += 2; + proto_tree_add_item(sbusdata_tree, + hf_sbus_date, tvb, offset, 3, FALSE); + offset += 3; + proto_tree_add_item(sbusdata_tree, + hf_sbus_time, tvb, offset, 3, FALSE); + offset += 3; + break; + + /* Response: CPU status, the command codes 14..1B are concerned*/ + case SBUS_RD_PCD_STATUS_CPU0: + case SBUS_RD_PCD_STATUS_CPU1: + case SBUS_RD_PCD_STATUS_CPU2: + case SBUS_RD_PCD_STATUS_CPU3: + case SBUS_RD_PCD_STATUS_CPU4: + case SBUS_RD_PCD_STATUS_CPU5: + case SBUS_RD_PCD_STATUS_CPU6: + case SBUS_RD_PCD_STATUS_OWN: + proto_tree_add_item(sbus_tree, + hf_sbus_cpu_status, tvb, offset, 1, FALSE); offset += 1; - } - break; + break; - /* Response for Read Index register */ - case SBUS_RD_INDEX_REGISTER: - /*Add subtree for Data*/ - dt = proto_tree_add_text(sbus_tree, tvb, offset, - 2,"Data (hex bytes)"); - - sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); - for (i=0; i<2; i++) { /*2 bytes*/ - proto_tree_add_item(sbusdata_tree, - hf_sbus_data_byte_hex, tvb, offset, - 1, FALSE); + /* Response: Station address*/ + case SBUS_RD_SBUS_STN_NBR: + proto_tree_add_item(sbus_tree, + hf_sbus_address, tvb, offset, 1, FALSE); offset += 1; - } - break; + break; + + /* Response: Firmware version */ + case SBUS_RD_PROGRAM_VERSION: + /*PCD type*/ + tmp_string = tvb_get_ephemeral_string(tvb , offset, 5); + proto_tree_add_string(sbus_tree, + hf_sbus_cpu_type, tvb, offset, 5, tmp_string); + offset += 5; + /*FW version*/ + tmp_string = tvb_get_ephemeral_string(tvb , offset, 3); + proto_tree_add_string(sbus_tree, + hf_sbus_fw_version, tvb, offset, 3, tmp_string); + offset += 4; + break; - /* Response: Instruction pointer*/ - case SBUS_RD_INSTRUCTION_POINTER: - proto_tree_add_item(sbus_tree, - hf_sbus_addr_prog, tvb, offset, 3, FALSE); - offset += 3; - break; + /* Response for Status Flags*/ + case SBUS_RD_STATUSFLAG_ACCU: + /*Add subtree for Data*/ + dt = proto_tree_add_text(sbus_tree, tvb, offset, + 1,"ACCU and arithmetic status"); + sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); - /*Response for Find History*/ - case SBUS_FIND_HISTORY: - proto_tree_add_item(sbus_tree, - hf_sbus_addr_68k, tvb, offset, 3, FALSE); - offset += 3; - proto_tree_add_item(sbus_tree, - hf_sbus_nbr_elements, tvb, offset, 2, FALSE); - offset += 2; - break; + proto_tree_add_item(sbusdata_tree, hf_sbus_flags_accu, + tvb, offset, 1, FALSE); + proto_tree_add_item(sbusdata_tree, hf_sbus_flags_error, + tvb, offset, 1, FALSE); + proto_tree_add_item(sbusdata_tree, hf_sbus_flags_negative, + tvb, offset, 1, FALSE); + proto_tree_add_item(sbusdata_tree, hf_sbus_flags_zero, + tvb, offset, 1, FALSE); + offset +=1; + break; + + /* Response for Read byte */ + case SBUS_RD_BYTE: + /*Add subtree for Data*/ + dt = proto_tree_add_text(sbus_tree, tvb, offset, + (request_val->count),"Data (bytes)"); - /* Response: Read current block*/ - case SBUS_RD_CURRENT_BLOCK: - proto_tree_add_item(sbus_tree, - hf_sbus_block_type, tvb, offset, 1, FALSE); - offset += 1; - proto_tree_add_item(sbus_tree, - hf_sbus_block_nr, tvb, offset, 2, FALSE); - offset += 2; - break; + sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); + for (i=(request_val->count); i>0; i--) { + proto_tree_add_item(sbusdata_tree, + hf_sbus_data_byte, tvb, offset, + 1, FALSE); + offset += 1; + } + break; - /* Response: Read system infomation (without interpretation of module info)*/ - case SBUS_RD_SYSTEM_INFORMATION: - if (((request_val->sysinfo) == 0x00)){ /*sysinfo 0*/ - offset += 1; /* this byte is always 0x01*/ + /* Response for Read Index register */ + case SBUS_RD_INDEX_REGISTER: /*Add subtree for Data*/ dt = proto_tree_add_text(sbus_tree, tvb, offset, - 1,"System info"); + 2,"Data (hex bytes)"); + sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); + for (i=0; i<2; i++) { /*2 bytes*/ + proto_tree_add_item(sbusdata_tree, + hf_sbus_data_byte_hex, tvb, offset, + 1, FALSE); + offset += 1; + } + break; - proto_tree_add_item(sbusdata_tree, hf_sbus_sysinfo0_1, - tvb, offset, 1, FALSE); - proto_tree_add_item(sbusdata_tree, hf_sbus_sysinfo0_2, - tvb, offset, 1, FALSE); - proto_tree_add_item(sbusdata_tree, hf_sbus_sysinfo0_3, - tvb, offset, 1, FALSE); - proto_tree_add_item(sbusdata_tree, hf_sbus_sysinfo0_4, - tvb, offset, 1, FALSE); - proto_tree_add_item(sbusdata_tree, hf_sbus_sysinfo0_5, - tvb, offset, 1, FALSE); + /* Response: Instruction pointer*/ + case SBUS_RD_INSTRUCTION_POINTER: + proto_tree_add_item(sbus_tree, + hf_sbus_addr_prog, tvb, offset, 3, FALSE); + offset += 3; + break; + + /*Response for Find History*/ + case SBUS_FIND_HISTORY: + proto_tree_add_item(sbus_tree, + hf_sbus_addr_68k, tvb, offset, 3, FALSE); + offset += 3; + proto_tree_add_item(sbus_tree, + hf_sbus_nbr_elements, tvb, offset, 2, FALSE); + offset += 2; + break; + + /* Response: Read current block*/ + case SBUS_RD_CURRENT_BLOCK: + proto_tree_add_item(sbus_tree, + hf_sbus_block_type, tvb, offset, 1, FALSE); offset += 1; - } else { - /*do not dissect all system info telegrams as there is no need*/ - offset = (tvb_get_guint8(tvb,9) + 10); - } - break; + proto_tree_add_item(sbus_tree, + hf_sbus_block_nr, tvb, offset, 2, FALSE); + offset += 2; + break; + + /* Response: Read system infomation (without interpretation of module info)*/ + case SBUS_RD_SYSTEM_INFORMATION: + if (((request_val->sysinfo) == 0x00)){ /*sysinfo 0*/ + offset += 1; /* this byte is always 0x01*/ + /*Add subtree for Data*/ + dt = proto_tree_add_text(sbus_tree, tvb, offset, + 1,"System info"); + sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); + + proto_tree_add_item(sbusdata_tree, hf_sbus_sysinfo0_1, + tvb, offset, 1, FALSE); + proto_tree_add_item(sbusdata_tree, hf_sbus_sysinfo0_2, + tvb, offset, 1, FALSE); + proto_tree_add_item(sbusdata_tree, hf_sbus_sysinfo0_3, + tvb, offset, 1, FALSE); + proto_tree_add_item(sbusdata_tree, hf_sbus_sysinfo0_4, + tvb, offset, 1, FALSE); + proto_tree_add_item(sbusdata_tree, hf_sbus_sysinfo0_5, + tvb, offset, 1, FALSE); + offset += 1; + } else { + /*do not dissect all system info telegrams as there is no need*/ + offset = (tvb_get_guint8(tvb,9) + 10); + } + break; - /* Response: Webserver request */ - case SBUS_WEB_SERVER_SERIAL_COMM: - sbus_web_size = tvb_get_guint8(tvb,offset); - proto_tree_add_item(sbus_tree, - hf_sbus_web_size, tvb, offset, - 1, sbus_web_size); - offset += 1; - - sbus_web_aid = tvb_get_guint8(tvb,offset); - proto_tree_add_item(sbus_tree, - hf_sbus_web_aid, tvb, offset, - 1, sbus_web_aid); - offset += 1; - - if (sbus_web_size > 1) { - sbus_web_seq = tvb_get_guint8(tvb,offset); + /* Response: Webserver request */ + case SBUS_WEB_SERVER_SERIAL_COMM: + sbus_web_size = tvb_get_guint8(tvb,offset); proto_tree_add_item(sbus_tree, - hf_sbus_web_seq, tvb, offset, - 1, sbus_web_seq); + hf_sbus_web_size, tvb, offset, + 1, sbus_web_size); offset += 1; - dt = proto_tree_add_text(sbus_tree, tvb, offset, - (sbus_web_size - 2),"Data (bytes)"); + sbus_web_aid = tvb_get_guint8(tvb,offset); + proto_tree_add_item(sbus_tree, + hf_sbus_web_aid, tvb, offset, + 1, sbus_web_aid); + offset += 1; - sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); - for (i=sbus_web_size - 2; i>0; i--) { - proto_tree_add_item(sbusdata_tree, - hf_sbus_data_byte, tvb, offset, - 1, FALSE); + if (sbus_web_size > 1) { + sbus_web_seq = tvb_get_guint8(tvb,offset); + proto_tree_add_item(sbus_tree, + hf_sbus_web_seq, tvb, offset, + 1, sbus_web_seq); offset += 1; + + dt = proto_tree_add_text(sbus_tree, tvb, offset, + (sbus_web_size - 2),"Data (bytes)"); + + sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data); + for (i=sbus_web_size - 2; i>0; i--) { + proto_tree_add_item(sbusdata_tree, + hf_sbus_data_byte, tvb, offset, + 1, FALSE); + offset += 1; + } } - } - break; - /* Response: Read/Write block data */ - case SBUS_RD_WR_PCD_BLOCK: - sbus_rdwr_block_tlg = request_val->block_tlg; - sbus_rdwr_length = tvb_get_guint8(tvb,offset); - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_block_length, tvb, offset, - 1, sbus_rdwr_length); - offset += 1; - hi = proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_acknakcode, tvb, offset, - 1, FALSE); - if ((tvb_get_guint8(tvb, offset) >= SBUS_RD_WR_NAK)&& - (tvb_get_guint8(tvb, offset) <= SBUS_RD_WR_NAK_INVALID_SIZE)) { - expert_add_info_format(pinfo, hi, PI_RESPONSE_CODE, PI_CHAT, - "Telegram not acknowledged by PCD"); - } - offset += 1; - switch(sbus_rdwr_block_tlg) { - case SBUS_WR_START_OF_STREAM: - case SBUS_WR_BLOCK_DATA_STREAM: - case SBUS_WR_BLOCK_END_OF_STREAM: - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_telegram_sequence, tvb, offset, - 1, FALSE); - offset += 1; - break; - case SBUS_WR_ABORT_BLOCK_STREAM: - case SBUS_RD_ABORT_BLOCK_STREAM: - case SBUS_WR_BLOCK_DATA_BYTES: - case SBUS_DELETE_BLOCK: - break; - case SBUS_RD_BLOCK_START_OF_STREAM: - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_telegram_sequence, tvb, offset, - 1, FALSE); - offset += 1; - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_block_size, tvb, offset, - 4, FALSE); - offset += 4; - /*do not display a field for block data (skip)*/ - offset += (sbus_rdwr_length-6); - break; - case SBUS_RD_BLOCK_DATA_STREAM: - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_telegram_sequence, tvb, offset, - 1, FALSE); - offset += 1; - /*do not display a field for block data (skip)*/ - offset += (sbus_rdwr_length-2); - break; - case SBUS_RD_BLOCK_DATA_BYTES: - /*do not display a field for block data (skip)*/ - offset += (sbus_rdwr_length-1); - break; - case SBUS_GET_BLOCK_SIZE: - sbus_rdwr_block_type = tvb_get_guint8(tvb, 10); - /* Check for unknown block type */ - if (sbus_rdwr_block_type == SBUS_RD_WR_UNKNOWN_BLOCK_TYPE) { - /*unknown block, no more data follows*/ - } else { /* add block size and CRC32 in case of known block*/ - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_block_size, tvb, offset, - 4, FALSE); - offset += 4; - /*Now the CRC32 follows, but I don't bother calculating it*/ - offset += 4; - } - break; - case SBUS_GET_PROGRAM_BLOCK_LIST: - proto_tree_add_item(sbus_tree, - hf_sbus_block_type, tvb, offset, - 1, FALSE); - offset += 1; - proto_tree_add_item(sbus_tree, - hf_sbus_block_nr, tvb, offset, - 2, FALSE); - offset += 2; - proto_tree_add_item(sbus_tree, - hf_sbus_rdwr_block_size, tvb, offset, - 4, FALSE); - offset += 4; - /*do not display block_timestamp as no description is available*/ - offset += (sbus_rdwr_length-8); - break; - default: - break; - } - break; + break; + /* Response: Read/Write block data */ + case SBUS_RD_WR_PCD_BLOCK: + sbus_rdwr_block_tlg = request_val->block_tlg; + sbus_rdwr_length = tvb_get_guint8(tvb,offset); + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_block_length, tvb, offset, + 1, sbus_rdwr_length); + offset += 1; + hi = proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_acknakcode, tvb, offset, + 1, FALSE); + if ((tvb_get_guint8(tvb, offset) >= SBUS_RD_WR_NAK)&& + (tvb_get_guint8(tvb, offset) <= SBUS_RD_WR_NAK_INVALID_SIZE)) { + expert_add_info_format(pinfo, hi, PI_RESPONSE_CODE, PI_CHAT, + "Telegram not acknowledged by PCD"); + } + offset += 1; + switch(sbus_rdwr_block_tlg) { + case SBUS_WR_START_OF_STREAM: + case SBUS_WR_BLOCK_DATA_STREAM: + case SBUS_WR_BLOCK_END_OF_STREAM: + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_telegram_sequence, tvb, offset, + 1, FALSE); + offset += 1; + break; + case SBUS_WR_ABORT_BLOCK_STREAM: + case SBUS_RD_ABORT_BLOCK_STREAM: + case SBUS_WR_BLOCK_DATA_BYTES: + case SBUS_DELETE_BLOCK: + break; + case SBUS_RD_BLOCK_START_OF_STREAM: + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_telegram_sequence, tvb, offset, + 1, FALSE); + offset += 1; + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_block_size, tvb, offset, + 4, FALSE); + offset += 4; + /*do not display a field for block data (skip)*/ + offset += (sbus_rdwr_length-6); + break; + case SBUS_RD_BLOCK_DATA_STREAM: + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_telegram_sequence, tvb, offset, + 1, FALSE); + offset += 1; + /*do not display a field for block data (skip)*/ + offset += (sbus_rdwr_length-2); + break; + case SBUS_RD_BLOCK_DATA_BYTES: + /*do not display a field for block data (skip)*/ + offset += (sbus_rdwr_length-1); + break; + case SBUS_GET_BLOCK_SIZE: + sbus_rdwr_block_type = tvb_get_guint8(tvb, 10); + /* Check for unknown block type */ + if (sbus_rdwr_block_type == SBUS_RD_WR_UNKNOWN_BLOCK_TYPE) { + /*unknown block, no more data follows*/ + } else { /* add block size and CRC32 in case of known block*/ + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_block_size, tvb, offset, + 4, FALSE); + offset += 4; + /*Now the CRC32 follows, but I don't bother calculating it*/ + offset += 4; + } + break; + case SBUS_GET_PROGRAM_BLOCK_LIST: + proto_tree_add_item(sbus_tree, + hf_sbus_block_type, tvb, offset, + 1, FALSE); + offset += 1; + proto_tree_add_item(sbus_tree, + hf_sbus_block_nr, tvb, offset, + 2, FALSE); + offset += 2; + proto_tree_add_item(sbus_tree, + hf_sbus_rdwr_block_size, tvb, offset, + 4, FALSE); + offset += 4; + /*do not display block_timestamp as no description is available*/ + offset += (sbus_rdwr_length-8); + break; + default: + break; + } + break; - /*Inform that response was not dissected and add remaining length*/ - default: - sbus_helper = sbus_eth_len - (offset + 2); - proto_tree_add_text(sbus_tree, tvb, offset, sbus_helper, - "This telegram isn't implemented in the dissector."); - offset = offset + sbus_helper; - break; + /*Inform that response was not dissected and add remaining length*/ + default: + sbus_helper = sbus_eth_len - (offset + 2); + proto_tree_add_text(sbus_tree, tvb, offset, sbus_helper, + "This telegram isn't implemented in the dissector."); + offset = offset + sbus_helper; + break; } } else if (sbus_attribut == SBUS_RESPONSE && (!request_val)) { /*calculate the offset in case the request telegram was not found or was broadcasted*/ @@ -1865,16 +1865,16 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (request_val) { nstime_delta(&ns, &pinfo->fd->abs_ts, &request_val->req_time); proto_tree_add_time(sbus_tree, hf_sbus_response_time, - tvb, 0, 0, &ns); + tvb, 0, 0, &ns); /*add reference to request telegram*/ - proto_tree_add_uint(sbus_tree, hf_sbus_response_to, tvb, 0, 0, - request_val->req_frame); + proto_tree_add_uint(sbus_tree, hf_sbus_response_to, tvb, 0, 0, + request_val->req_frame); } hi = proto_tree_add_item(sbus_tree, hf_sbus_acknackcode, tvb, offset, 2, FALSE); if (tvb_get_guint8(tvb, (offset+1)) > 0) { - expert_add_info_format(pinfo, hi, PI_RESPONSE_CODE, PI_CHAT, - "Telegram not acknowledged by PCD"); + expert_add_info_format(pinfo, hi, PI_RESPONSE_CODE, PI_CHAT, + "Telegram not acknowledged by PCD"); } offset += 2; } @@ -1887,16 +1887,16 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) sbus_helper = tvb_get_ntohs(tvb, offset); if (sbus_helper == sbus_crc_calc) { proto_tree_add_uint_format(sbus_tree, - hf_sbus_crc, tvb, offset, 2, sbus_helper, - "Checksum: 0x%04x (correct)", sbus_helper); + hf_sbus_crc, tvb, offset, 2, sbus_helper, + "Checksum: 0x%04x (correct)", sbus_helper); } else { cs = proto_tree_add_uint_format(sbus_tree, - hf_sbus_crc, tvb, offset, 2, sbus_helper, - "Checksum: 0x%04x (NOT correct)", sbus_helper); + hf_sbus_crc, tvb, offset, 2, sbus_helper, + "Checksum: 0x%04x (NOT correct)", sbus_helper); expert_add_info_format(pinfo, cs, PI_CHECKSUM, PI_ERROR, - "Bad checksum"); + "Bad checksum"); hi = proto_tree_add_boolean(sbus_tree, - hf_sbus_crc_bad, tvb, offset, 2, TRUE); + hf_sbus_crc_bad, tvb, offset, 2, TRUE); PROTO_ITEM_SET_HIDDEN(hi); PROTO_ITEM_SET_GENERATED(hi); } @@ -2191,7 +2191,7 @@ proto_register_sbus(void) { &hf_sbus_rdwr_block_length, { "Read/write block telegram length", "sbus.block.length", - FT_UINT8, BASE_DEC, NULL, 0, + FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, @@ -2203,25 +2203,25 @@ proto_register_sbus(void) { &hf_sbus_rdwr_telegram_type, { "Read/write block telegram type", "sbus.block.tlgtype", - FT_UINT8, BASE_HEX, VALS(rdwrblock_vals), 0, + FT_UINT8, BASE_HEX, VALS(rdwrblock_vals), 0, "Type of RD/WR block telegram", HFILL } }, { &hf_sbus_rdwr_telegram_sequence, { "Sequence", "sbus.block.seq", - FT_UINT8, BASE_DEC, NULL, 0, + FT_UINT8, BASE_DEC, NULL, 0, "Sequence number of block data stream telegram", HFILL } }, { &hf_sbus_rdwr_block_size, { "Block size in bytes", "sbus.block.size", - FT_UINT32, BASE_DEC, NULL, 0, + FT_UINT32, BASE_DEC, NULL, 0, "The size of the block in bytes", HFILL } }, { &hf_sbus_rdwr_block_addr, { "Address inside block", "sbus.block.addr", - FT_UINT32, BASE_DEC, NULL, 0, + FT_UINT32, BASE_DEC, NULL, 0, "The address inside a block", HFILL } }, @@ -2234,13 +2234,13 @@ proto_register_sbus(void) { &hf_sbus_rdwr_list_type, { "Get program block list, command type", "sbus.block.getlisttype", - FT_UINT8, BASE_HEX, VALS(rdwrblock_list_type_vals), 0, + FT_UINT8, BASE_HEX, VALS(rdwrblock_list_type_vals), 0, "Type of the Get Program Block list request", HFILL } }, { &hf_sbus_rdwr_acknakcode, { "ACK/NAK code", "sbus.block.nakcode", - FT_UINT8, BASE_HEX, VALS(rdwrblock_sts), 0, + FT_UINT8, BASE_HEX, VALS(rdwrblock_sts), 0, "ACK/NAK response for block write requests", HFILL } }, @@ -2255,7 +2255,7 @@ proto_register_sbus(void) FT_BOOLEAN, BASE_NONE, NULL, 0x0, "A bad checksum in the telegram", HFILL }}, - { &hf_sbus_retry, + { &hf_sbus_retry, { "Retry", "sbus.retry", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Repeated request telegram (due to wrong or missing answer)", HFILL }}, diff --git a/epan/dissectors/packet-sigcomp.c b/epan/dissectors/packet-sigcomp.c index e35f944e39..670c9a3675 100644 --- a/epan/dissectors/packet-sigcomp.c +++ b/epan/dissectors/packet-sigcomp.c @@ -12,12 +12,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -34,7 +34,6 @@ # include "config.h" #endif -#include <stdlib.h> #include <math.h> #include <glib.h> @@ -46,77 +45,77 @@ #include <epan/sigcomp_state_hdlr.h> /* Initialize the protocol and registered fields */ -static int proto_sigcomp = -1; -static int proto_raw_sigcomp = -1; -static int hf_sigcomp_t_bit = -1; -static int hf_sigcomp_len = -1; -static int hf_sigcomp_returned_feedback_item = -1; -static int hf_sigcomp_returned_feedback_item_len = -1; -static int hf_sigcomp_code_len = -1; -static int hf_sigcomp_destination = -1; -static int hf_sigcomp_partial_state = -1; -static int hf_sigcomp_remaining_message_bytes = -1; -static int hf_sigcomp_compression_ratio = -1; -static int hf_sigcomp_udvm_bytecode = -1; -static int hf_sigcomp_udvm_instr = -1; -static int hf_udvm_multitype_bytecode = -1; -static int hf_udvm_reference_bytecode = -1; -static int hf_udvm_literal_bytecode = -1; -static int hf_udvm_operand = -1; -static int hf_udvm_length = -1; -static int hf_udvm_addr_length = -1; -static int hf_udvm_destination = -1; -static int hf_udvm_addr_destination = -1; -static int hf_udvm_at_address = -1; -static int hf_udvm_address = -1; -static int hf_udvm_literal_num = -1; -static int hf_udvm_value = -1; -static int hf_udvm_addr_value = -1; -static int hf_partial_identifier_start = -1; -static int hf_partial_identifier_length = -1; -static int hf_state_begin = -1; -static int hf_udvm_state_length = -1; -static int hf_udvm_state_length_addr = -1; -static int hf_udvm_state_address = -1; -static int hf_udvm_state_address_addr = -1; -static int hf_udvm_state_instr = -1; -static int hf_udvm_operand_1 = -1; -static int hf_udvm_operand_2 = -1; -static int hf_udvm_operand_2_addr = -1; -static int hf_udvm_j = -1; -static int hf_udvm_addr_j = -1; -static int hf_udvm_output_start = -1; -static int hf_udvm_addr_output_start = -1; -static int hf_udvm_output_length = -1; -static int hf_udvm_output_length_addr = -1; -static int hf_udvm_req_feedback_loc = -1; -static int hf_udvm_min_acc_len = -1; -static int hf_udvm_state_ret_pri = -1; -static int hf_udvm_ret_param_loc = -1; -static int hf_udvm_position = -1; -static int hf_udvm_ref_dest = -1; -static int hf_udvm_bits = -1; -static int hf_udvm_lower_bound = -1; -static int hf_udvm_upper_bound = -1; -static int hf_udvm_uncompressed = -1; -static int hf_udvm_offset = -1; -static int hf_udvm_addr_offset = -1; -static int hf_udvm_start_value = -1; -static int hf_udvm_execution_trace = -1; -static int hf_sigcomp_nack_ver = -1; -static int hf_sigcomp_nack_reason_code = -1; -static int hf_sigcomp_nack_failed_op_code = -1; -static int hf_sigcomp_nack_pc = -1; -static int hf_sigcomp_nack_sha1 = -1; -static int hf_sigcomp_nack_state_id = -1; -static int hf_sigcomp_nack_memory_size = -1; -static int hf_sigcomp_nack_cycles_per_bit = -1; +static int proto_sigcomp = -1; +static int proto_raw_sigcomp = -1; +static int hf_sigcomp_t_bit = -1; +static int hf_sigcomp_len = -1; +static int hf_sigcomp_returned_feedback_item = -1; +static int hf_sigcomp_returned_feedback_item_len = -1; +static int hf_sigcomp_code_len = -1; +static int hf_sigcomp_destination = -1; +static int hf_sigcomp_partial_state = -1; +static int hf_sigcomp_remaining_message_bytes = -1; +static int hf_sigcomp_compression_ratio = -1; +static int hf_sigcomp_udvm_bytecode = -1; +static int hf_sigcomp_udvm_instr = -1; +static int hf_udvm_multitype_bytecode = -1; +static int hf_udvm_reference_bytecode = -1; +static int hf_udvm_literal_bytecode = -1; +static int hf_udvm_operand = -1; +static int hf_udvm_length = -1; +static int hf_udvm_addr_length = -1; +static int hf_udvm_destination = -1; +static int hf_udvm_addr_destination = -1; +static int hf_udvm_at_address = -1; +static int hf_udvm_address = -1; +static int hf_udvm_literal_num = -1; +static int hf_udvm_value = -1; +static int hf_udvm_addr_value = -1; +static int hf_partial_identifier_start = -1; +static int hf_partial_identifier_length = -1; +static int hf_state_begin = -1; +static int hf_udvm_state_length = -1; +static int hf_udvm_state_length_addr = -1; +static int hf_udvm_state_address = -1; +static int hf_udvm_state_address_addr = -1; +static int hf_udvm_state_instr = -1; +static int hf_udvm_operand_1 = -1; +static int hf_udvm_operand_2 = -1; +static int hf_udvm_operand_2_addr = -1; +static int hf_udvm_j = -1; +static int hf_udvm_addr_j = -1; +static int hf_udvm_output_start = -1; +static int hf_udvm_addr_output_start = -1; +static int hf_udvm_output_length = -1; +static int hf_udvm_output_length_addr = -1; +static int hf_udvm_req_feedback_loc = -1; +static int hf_udvm_min_acc_len = -1; +static int hf_udvm_state_ret_pri = -1; +static int hf_udvm_ret_param_loc = -1; +static int hf_udvm_position = -1; +static int hf_udvm_ref_dest = -1; +static int hf_udvm_bits = -1; +static int hf_udvm_lower_bound = -1; +static int hf_udvm_upper_bound = -1; +static int hf_udvm_uncompressed = -1; +static int hf_udvm_offset = -1; +static int hf_udvm_addr_offset = -1; +static int hf_udvm_start_value = -1; +static int hf_udvm_execution_trace = -1; +static int hf_sigcomp_nack_ver = -1; +static int hf_sigcomp_nack_reason_code = -1; +static int hf_sigcomp_nack_failed_op_code = -1; +static int hf_sigcomp_nack_pc = -1; +static int hf_sigcomp_nack_sha1 = -1; +static int hf_sigcomp_nack_state_id = -1; +static int hf_sigcomp_nack_memory_size = -1; +static int hf_sigcomp_nack_cycles_per_bit = -1; /* Initialize the subtree pointers */ -static gint ett_sigcomp = -1; -static gint ett_sigcomp_udvm = -1; -static gint ett_sigcomp_udvm_exe = -1; -static gint ett_raw_text = -1; +static gint ett_sigcomp = -1; +static gint ett_sigcomp_udvm = -1; +static gint ett_sigcomp_udvm_exe = -1; +static gint ett_raw_text = -1; static dissector_handle_t sip_handle; /* set the udp ports */ @@ -134,7 +133,7 @@ static gboolean dissect_udvm_code = TRUE; static gboolean display_raw_txt = FALSE; /* Default preference whether to decompress the message or not */ static gboolean decompress = TRUE; -/* Default preference whether to print debug info at execution of UDVM +/* Default preference whether to print debug info at execution of UDVM * 0 = No printout * 1 = details level 1 * 2 = details level 2 @@ -145,100 +144,100 @@ static gint udvm_print_detail_level = 0; /* Value strings */ static const value_string length_encoding_vals[] = { - { 0x00, "No partial state (Message type 2)" }, - { 0x01, "(6 bytes)" }, - { 0x02, "(9 bytes)" }, - { 0x03, "(12 bytes)" }, - { 0, NULL } + { 0x00, "No partial state (Message type 2)" }, + { 0x01, "(6 bytes)" }, + { 0x02, "(9 bytes)" }, + { 0x03, "(12 bytes)" }, + { 0, NULL } }; static const value_string destination_address_encoding_vals[] = { - { 0x00, "Reserved" }, - { 0x01, "128" }, - { 0x02, "192" }, - { 0x03, "256" }, - { 0x04, "320" }, - { 0x05, "384" }, - { 0x06, "448" }, - { 0x07, "512" }, - { 0x08, "576" }, - { 0x09, "640" }, - { 0x0a, "704" }, - { 0x0b, "768" }, - { 0x0c, "832" }, - { 0x0d, "896" }, - { 0x0e, "960" }, - { 0x0F, "1024" }, - { 0, NULL } + { 0x00, "Reserved" }, + { 0x01, "128" }, + { 0x02, "192" }, + { 0x03, "256" }, + { 0x04, "320" }, + { 0x05, "384" }, + { 0x06, "448" }, + { 0x07, "512" }, + { 0x08, "576" }, + { 0x09, "640" }, + { 0x0a, "704" }, + { 0x0b, "768" }, + { 0x0c, "832" }, + { 0x0d, "896" }, + { 0x0e, "960" }, + { 0x0F, "1024" }, + { 0, NULL } }; static const value_string udvm_instruction_code_vals[] = { - { 0, "DECOMPRESSION-FAILURE" }, - { 1, "AND" }, - { 2, "OR" }, - { 3, "NOT" }, - { 4, "LSHIFT" }, - { 5, "RSHIFT" }, - { 6, "ADD" }, - { 7, "SUBTRACT" }, - { 8, "MULTIPLY" }, - { 9, "DIVIDE" }, - { 10, "REMAINDER" }, - { 11, "SORT-ASCENDING" }, - { 12, "SORT-DESCENDING" }, - { 13, "SHA-1" }, - { 14, "LOAD" }, - { 15, "MULTILOAD" }, - { 16, "PUSH" }, - { 17, "POP" }, - { 18, "COPY" }, - { 19, "COPY-LITERAL" }, - { 20, "COPY-OFFSET" }, - { 21, "MEMSET" }, - { 22, "JUMP" }, - { 23, "COMPARE" }, - { 24, "CALL" }, - { 25, "RETURN" }, - { 26, "SWITCH" }, - { 27, "CRC" }, - { 28, "INPUT-BYTES" }, - { 29, "INPUT-BITS" }, - { 30, "INPUT-HUFFMAN" }, - { 31, "STATE-ACCESS" }, - { 32, "STATE-CREATE" }, - { 33, "STATE-FREE" }, - { 34, "OUTPUT" }, - { 35, "END-MESSAGE" }, - { 0, NULL } + { 0, "DECOMPRESSION-FAILURE" }, + { 1, "AND" }, + { 2, "OR" }, + { 3, "NOT" }, + { 4, "LSHIFT" }, + { 5, "RSHIFT" }, + { 6, "ADD" }, + { 7, "SUBTRACT" }, + { 8, "MULTIPLY" }, + { 9, "DIVIDE" }, + { 10, "REMAINDER" }, + { 11, "SORT-ASCENDING" }, + { 12, "SORT-DESCENDING" }, + { 13, "SHA-1" }, + { 14, "LOAD" }, + { 15, "MULTILOAD" }, + { 16, "PUSH" }, + { 17, "POP" }, + { 18, "COPY" }, + { 19, "COPY-LITERAL" }, + { 20, "COPY-OFFSET" }, + { 21, "MEMSET" }, + { 22, "JUMP" }, + { 23, "COMPARE" }, + { 24, "CALL" }, + { 25, "RETURN" }, + { 26, "SWITCH" }, + { 27, "CRC" }, + { 28, "INPUT-BYTES" }, + { 29, "INPUT-BITS" }, + { 30, "INPUT-HUFFMAN" }, + { 31, "STATE-ACCESS" }, + { 32, "STATE-CREATE" }, + { 33, "STATE-FREE" }, + { 34, "OUTPUT" }, + { 35, "END-MESSAGE" }, + { 0, NULL } }; - /* RFC3320 - * Figure 10: Bytecode for a multitype (%) operand - * Bytecode: Operand value: Range: HEX val - * 00nnnnnn N 0 - 63 0x00 - * 01nnnnnn memory[2 * N] 0 - 65535 0x40 - * 1000011n 2 ^ (N + 6) 64 , 128 0x86 - * 10001nnn 2 ^ (N + 8) 256 , ... , 32768 0x88 - * 111nnnnn N + 65504 65504 - 65535 0xe0 - * 1001nnnn nnnnnnnn N + 61440 61440 - 65535 0x90 - * 101nnnnn nnnnnnnn N 0 - 8191 0xa0 - * 110nnnnn nnnnnnnn memory[N] 0 - 65535 0xc0 - * 10000000 nnnnnnnn nnnnnnnn N 0 - 65535 0x80 - * 10000001 nnnnnnnn nnnnnnnn memory[N] 0 - 65535 0x81 - */ + /* RFC3320 + * Figure 10: Bytecode for a multitype (%) operand + * Bytecode: Operand value: Range: HEX val + * 00nnnnnn N 0 - 63 0x00 + * 01nnnnnn memory[2 * N] 0 - 65535 0x40 + * 1000011n 2 ^ (N + 6) 64 , 128 0x86 + * 10001nnn 2 ^ (N + 8) 256 , ... , 32768 0x88 + * 111nnnnn N + 65504 65504 - 65535 0xe0 + * 1001nnnn nnnnnnnn N + 61440 61440 - 65535 0x90 + * 101nnnnn nnnnnnnn N 0 - 8191 0xa0 + * 110nnnnn nnnnnnnn memory[N] 0 - 65535 0xc0 + * 10000000 nnnnnnnn nnnnnnnn N 0 - 65535 0x80 + * 10000001 nnnnnnnn nnnnnnnn memory[N] 0 - 65535 0x81 + */ static const value_string display_bytecode_vals[] = { - { 0x00, "00nnnnnn, N, 0 - 63" }, - { 0x40, "01nnnnnn, memory[2 * N],0 - 65535" }, - { 0x86, "1000011n, 2 ^ (N + 6), 64 , 128" }, - { 0x88, "10001nnn, 2 ^ (N + 8), 256,..., 32768" }, - { 0xe0, "111nnnnn N + 65504, 65504 - 65535" }, - { 0x90, "1001nnnn nnnnnnnn, N + 61440, 61440 - 65535" }, - { 0xa0, "101nnnnn nnnnnnnn, N, 0 - 8191" }, - { 0xc0, "110nnnnn nnnnnnnn, memory[N], 0 - 65535" }, - { 0x80, "10000000 nnnnnnnn nnnnnnnn, N, 0 - 65535" }, - { 0x81, "10000001 nnnnnnnn nnnnnnnn, memory[N], 0 - 65535" }, - { 0, NULL } + { 0x00, "00nnnnnn, N, 0 - 63" }, + { 0x40, "01nnnnnn, memory[2 * N],0 - 65535" }, + { 0x86, "1000011n, 2 ^ (N + 6), 64 , 128" }, + { 0x88, "10001nnn, 2 ^ (N + 8), 256,..., 32768" }, + { 0xe0, "111nnnnn N + 65504, 65504 - 65535" }, + { 0x90, "1001nnnn nnnnnnnn, N + 61440, 61440 - 65535" }, + { 0xa0, "101nnnnn nnnnnnnn, N, 0 - 8191" }, + { 0xc0, "110nnnnn nnnnnnnn, memory[N], 0 - 65535" }, + { 0x80, "10000000 nnnnnnnn nnnnnnnn, N, 0 - 65535" }, + { 0x81, "10000001 nnnnnnnn nnnnnnnn, memory[N], 0 - 65535" }, + { 0, NULL } }; /* RFC3320 * 0nnnnnnn memory[2 * N] 0 - 65535 @@ -246,10 +245,10 @@ static const value_string display_bytecode_vals[] = { * 11000000 nnnnnnnn nnnnnnnn memory[N] 0 - 65535 */ static const value_string display_ref_bytecode_vals[] = { - { 0x00, "0nnnnnnn memory[2 * N] 0 - 65535" }, - { 0x80, "10nnnnnn nnnnnnnn memory[2 * N] 0 - 65535" }, - { 0xc0, "11000000 nnnnnnnn nnnnnnnn memory[N] 0 - 65535" }, - { 0, NULL } + { 0x00, "0nnnnnnn memory[2 * N] 0 - 65535" }, + { 0x80, "10nnnnnn nnnnnnnn memory[2 * N] 0 - 65535" }, + { 0xc0, "11000000 nnnnnnnn nnnnnnnn memory[N] 0 - 65535" }, + { 0, NULL } }; /* The simplest operand type is the literal (#), which encodes a * constant integer from 0 to 65535 inclusive. A literal operand may @@ -264,59 +263,59 @@ static const value_string display_ref_bytecode_vals[] = { */ static const value_string display_lit_bytecode_vals[] = { - { 0x00, "0nnnnnnn N 0 - 127" }, - { 0x80, "10nnnnnn nnnnnnnn N 0 - 16383" }, - { 0xc0, "11000000 nnnnnnnn nnnnnnnn N 0 - 65535" }, - { 0, NULL } + { 0x00, "0nnnnnnn N 0 - 127" }, + { 0x80, "10nnnnnn nnnnnnnn N 0 - 16383" }, + { 0xc0, "11000000 nnnnnnnn nnnnnnnn N 0 - 65535" }, + { 0, NULL } }; #define SIGCOMP_NACK_STATE_NOT_FOUND 1 #define SIGCOMP_NACK_CYCLES_EXHAUSTED 2 -#define SIGCOMP_NACK_BYTECODES_TOO_LARGE 18 -#define SIGCOMP_NACK_ID_NOT_UNIQUE 21 -#define SIGCOMP_NACK_STATE_TOO_SHORT 23 +#define SIGCOMP_NACK_BYTECODES_TOO_LARGE 18 +#define SIGCOMP_NACK_ID_NOT_UNIQUE 21 +#define SIGCOMP_NACK_STATE_TOO_SHORT 23 static const value_string sigcomp_nack_reason_code_vals[] = { - { 1, "STATE_NOT_FOUND" }, /*1 State ID (6 - 20 bytes) */ - { 2, "CYCLES_EXHAUSTED" }, /*2 Cycles Per Bit (1 byte) */ - { 3, "USER_REQUESTED" }, - { 4, "SEGFAULT" }, - { 5, "TOO_MANY_STATE_REQUESTS" }, - { 6, "INVALID_STATE_ID_LENGTH" }, - { 7, "INVALID_STATE_PRIORITY" }, - { 8, "OUTPUT_OVERFLOW" }, - { 9, "STACK_UNDERFLOW" }, - { 10, "BAD_INPUT_BITORDER" }, - { 11, "DIV_BY_ZERO" }, - { 12, "SWITCH_VALUE_TOO_HIGH" }, - { 13, "TOO_MANY_BITS_REQUESTED" }, - { 14, "INVALID_OPERAND" }, - { 15, "HUFFMAN_NO_MATCH" }, - { 16, "MESSAGE_TOO_SHORT" }, - { 17, "INVALID_CODE_LOCATION" }, - { 18, "BYTECODES_TOO_LARGE" }, /*18 Memory size (2 bytes) */ - { 19, "INVALID_OPCODE" }, - { 20, "INVALID_STATE_PROBE" }, - { 21, "ID_NOT_UNIQUE" }, /*21 State ID (6 - 20 bytes) */ - { 22, "MULTILOAD_OVERWRITTEN" }, - { 23, "STATE_TOO_SHORT" }, /*23 State ID (6 - 20 bytes) */ - { 24, "INTERNAL_ERROR" }, - { 25, "FRAMING_ERROR" }, - { 0, NULL } + { 1, "STATE_NOT_FOUND" }, /*1 State ID (6 - 20 bytes) */ + { 2, "CYCLES_EXHAUSTED" }, /*2 Cycles Per Bit (1 byte) */ + { 3, "USER_REQUESTED" }, + { 4, "SEGFAULT" }, + { 5, "TOO_MANY_STATE_REQUESTS" }, + { 6, "INVALID_STATE_ID_LENGTH" }, + { 7, "INVALID_STATE_PRIORITY" }, + { 8, "OUTPUT_OVERFLOW" }, + { 9, "STACK_UNDERFLOW" }, + { 10, "BAD_INPUT_BITORDER" }, + { 11, "DIV_BY_ZERO" }, + { 12, "SWITCH_VALUE_TOO_HIGH" }, + { 13, "TOO_MANY_BITS_REQUESTED" }, + { 14, "INVALID_OPERAND" }, + { 15, "HUFFMAN_NO_MATCH" }, + { 16, "MESSAGE_TOO_SHORT" }, + { 17, "INVALID_CODE_LOCATION" }, + { 18, "BYTECODES_TOO_LARGE" }, /*18 Memory size (2 bytes) */ + { 19, "INVALID_OPCODE" }, + { 20, "INVALID_STATE_PROBE" }, + { 21, "ID_NOT_UNIQUE" }, /*21 State ID (6 - 20 bytes) */ + { 22, "MULTILOAD_OVERWRITTEN" }, + { 23, "STATE_TOO_SHORT" }, /*23 State ID (6 - 20 bytes) */ + { 24, "INTERNAL_ERROR" }, + { 25, "FRAMING_ERROR" }, + { 0, NULL } }; static void dissect_udvm_bytecode(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree, guint destination); -static int dissect_udvm_multitype_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree, - gint offset,gboolean is_addr,gint *start_offset, - guint16 *value, gboolean *is_memory_address ); +static int dissect_udvm_multitype_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree, + gint offset,gboolean is_addr,gint *start_offset, + guint16 *value, gboolean *is_memory_address ); -static int dissect_udvm_literal_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree, - gint offset, gint *start_offset, guint16 *value); +static int dissect_udvm_literal_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree, + gint offset, gint *start_offset, guint16 *value); -static int dissect_udvm_reference_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree, - gint offset, gint *start_offset, guint16 *value); +static int dissect_udvm_reference_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree, + gint offset, gint *start_offset, guint16 *value); static void tvb_raw_text_add(tvbuff_t *tvb, proto_tree *tree); static int dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); @@ -329,9 +328,9 @@ static proto_tree *top_tree; static void sigcomp_init_protocol(void) { - sigcomp_init_udvm(); -} -/* Sigcomp over TCP record marking used + sigcomp_init_udvm(); +} +/* Sigcomp over TCP record marking used * RFC 3320 * 4.2.2. Record Marking * @@ -346,7 +345,7 @@ sigcomp_init_protocol(void) * : : * 0xFF 7F same, but the next 127 bytes are quoted * 0xFF 80 to 0xFF FE (reserved for future standardization) - * 0xFF FF end of SigComp message + * 0xFF FF end of SigComp message * : * In UDVM version 0x01, any occurrence of the combinations 0xFF80 to * 0xFFFE that are not protected by quoting causes decompression @@ -361,181 +360,181 @@ sigcomp_init_protocol(void) static int dissect_sigcomp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - proto_item *ti; - proto_tree *sigcomp_tree; - tvbuff_t *unescaped_tvb; - - guint8 *buff; - int offset = 0; - int length; - guint8 octet; - guint16 data; - int i; - int n; - gboolean end_off_message; - - top_tree = tree; - - /* Is this SIGCOMP ? */ - data = tvb_get_ntohs(tvb, offset); - if(data == 0xffff){ - /* delimiter */ - offset = offset + 2; - octet = tvb_get_guint8(tvb,offset); - }else{ - octet = tvb_get_guint8(tvb,offset); - } - if ((octet & 0xf8) != 0xf8) - return offset; - - /* Search for delimiter 0xffff in the remain tvb buffer */ - length = tvb_ensure_length_remaining(tvb, offset); - for(i=0; i<(length-1); ++i){ - /* Loop end criteria is (length-1) because we take 2 bytes each loop */ - data = tvb_get_ntohs(tvb, offset+i); - if (0xffff == data) break; - } - if (i >= (length-1)){ - /* SIGCOMP may be subdissector of SIP, so we use - * pinfo->saved_can_desegment to determine whether do desegment - * as well as pinfo->can_desegment */ - if (pinfo->can_desegment || pinfo->saved_can_desegment){ - /* Delimiter oxffff was not found, not a complete SIGCOMP PDU */ - pinfo->desegment_offset = offset; - pinfo->desegment_len=DESEGMENT_ONE_MORE_SEGMENT; - return -1; - } - } - - /* Make entries in Protocol column and Info column on summary display */ - col_set_str(pinfo->cinfo, COL_PROTOCOL, "SIGCOMP"); - - col_clear(pinfo->cinfo, COL_INFO); - - length = tvb_length_remaining(tvb,offset); + proto_item *ti; + proto_tree *sigcomp_tree; + tvbuff_t *unescaped_tvb; + + guint8 *buff; + int offset = 0; + int length; + guint8 octet; + guint16 data; + int i; + int n; + gboolean end_off_message; + + top_tree = tree; + + /* Is this SIGCOMP ? */ + data = tvb_get_ntohs(tvb, offset); + if(data == 0xffff){ + /* delimiter */ + offset = offset + 2; + octet = tvb_get_guint8(tvb,offset); + }else{ + octet = tvb_get_guint8(tvb,offset); + } + if ((octet & 0xf8) != 0xf8) + return offset; + + /* Search for delimiter 0xffff in the remain tvb buffer */ + length = tvb_ensure_length_remaining(tvb, offset); + for(i=0; i<(length-1); ++i){ + /* Loop end criteria is (length-1) because we take 2 bytes each loop */ + data = tvb_get_ntohs(tvb, offset+i); + if (0xffff == data) break; + } + if (i >= (length-1)){ + /* SIGCOMP may be subdissector of SIP, so we use + * pinfo->saved_can_desegment to determine whether do desegment + * as well as pinfo->can_desegment */ + if (pinfo->can_desegment || pinfo->saved_can_desegment){ + /* Delimiter oxffff was not found, not a complete SIGCOMP PDU */ + pinfo->desegment_offset = offset; + pinfo->desegment_len=DESEGMENT_ONE_MORE_SEGMENT; + return -1; + } + } + + /* Make entries in Protocol column and Info column on summary display */ + col_set_str(pinfo->cinfo, COL_PROTOCOL, "SIGCOMP"); + + col_clear(pinfo->cinfo, COL_INFO); + + length = tvb_length_remaining(tvb,offset); try_again: - /* create display subtree for the protocol */ - ti = proto_tree_add_item(tree, proto_sigcomp, tvb, 0, -1, FALSE); - sigcomp_tree = proto_item_add_subtree(ti, ett_sigcomp); - i=0; - end_off_message = FALSE; - buff = g_malloc(length-offset); - if (udvm_print_detail_level>2) - proto_tree_add_text(sigcomp_tree, tvb, offset, -1,"Starting to remove escape digits"); - while ((offset < length) && (end_off_message == FALSE)){ - octet = tvb_get_guint8(tvb,offset); - if ( octet == 0xff ){ - if ( offset +1 >= length ){ - /* if the tvb is short dont check for the second escape digit */ - offset++; - continue; - } - if (udvm_print_detail_level>2) - proto_tree_add_text(sigcomp_tree, tvb, offset, 2, - " Escape digit found (0xFF)"); - octet = tvb_get_guint8(tvb, offset+1); - if ( octet == 0){ - buff[i] = 0xff; - offset = offset +2; - i++; - continue; - } - if ((octet > 0x7f) && (octet < 0xff )){ - if (udvm_print_detail_level>2) - proto_tree_add_text(sigcomp_tree, tvb, offset, 2, - " Illegal escape code"); - offset = offset + tvb_length_remaining(tvb,offset); - return offset; - } - if ( octet == 0xff){ - if (udvm_print_detail_level>2) - proto_tree_add_text(sigcomp_tree, tvb, offset, 2, - " End of SigComp message indication found (0xFFFF)"); - end_off_message = TRUE; - offset = offset+2; - continue; - } - buff[i] = 0xff; - if (udvm_print_detail_level>2) - proto_tree_add_text(sigcomp_tree, tvb, offset, 1, - " Addr: %u tvb value(0x%0x) ", i, buff[i]); - i++; - offset = offset+2; - if (udvm_print_detail_level>2) - proto_tree_add_text(sigcomp_tree, tvb, offset, octet, - " Copying %u bytes literally",octet); - if( offset+octet >= length) - /* if the tvb is short dont copy further than the end */ - octet = length - offset; - for ( n=0; n < octet; n++ ){ - buff[i] = tvb_get_guint8(tvb, offset); - if (udvm_print_detail_level>2) - proto_tree_add_text(sigcomp_tree, tvb, offset, 1, - " Addr: %u tvb value(0x%0x) ", i, buff[i]); - i++; - offset++; - } - continue; - } - buff[i] = octet; - if (udvm_print_detail_level>2) - proto_tree_add_text(sigcomp_tree, tvb, offset, 1, - " Addr: %u tvb value(0x%0x) ", i, buff[i]); - - i++; - offset++; - } - unescaped_tvb = tvb_new_child_real_data(tvb, buff,i,i); - /* Arrange that the allocated packet data copy be freed when the - * tvbuff is freed. - */ - tvb_set_free_cb( unescaped_tvb, g_free ); - - add_new_data_source(pinfo, unescaped_tvb, "Unescaped Data handed to the SigComp dissector"); - - proto_tree_add_text(sigcomp_tree, unescaped_tvb, 0, -1,"Data handed to the Sigcomp dissector"); - if (end_off_message == TRUE){ - dissect_sigcomp_common(unescaped_tvb, pinfo, sigcomp_tree); - }else{ - proto_tree_add_text(sigcomp_tree, unescaped_tvb, 0, -1,"TCP Fragment, no end mark found"); - } - if ( offset < length){ - goto try_again; - } - - return offset; + /* create display subtree for the protocol */ + ti = proto_tree_add_item(tree, proto_sigcomp, tvb, 0, -1, FALSE); + sigcomp_tree = proto_item_add_subtree(ti, ett_sigcomp); + i=0; + end_off_message = FALSE; + buff = g_malloc(length-offset); + if (udvm_print_detail_level>2) + proto_tree_add_text(sigcomp_tree, tvb, offset, -1,"Starting to remove escape digits"); + while ((offset < length) && (end_off_message == FALSE)){ + octet = tvb_get_guint8(tvb,offset); + if ( octet == 0xff ){ + if ( offset +1 >= length ){ + /* if the tvb is short dont check for the second escape digit */ + offset++; + continue; + } + if (udvm_print_detail_level>2) + proto_tree_add_text(sigcomp_tree, tvb, offset, 2, + " Escape digit found (0xFF)"); + octet = tvb_get_guint8(tvb, offset+1); + if ( octet == 0){ + buff[i] = 0xff; + offset = offset +2; + i++; + continue; + } + if ((octet > 0x7f) && (octet < 0xff )){ + if (udvm_print_detail_level>2) + proto_tree_add_text(sigcomp_tree, tvb, offset, 2, + " Illegal escape code"); + offset = offset + tvb_length_remaining(tvb,offset); + return offset; + } + if ( octet == 0xff){ + if (udvm_print_detail_level>2) + proto_tree_add_text(sigcomp_tree, tvb, offset, 2, + " End of SigComp message indication found (0xFFFF)"); + end_off_message = TRUE; + offset = offset+2; + continue; + } + buff[i] = 0xff; + if (udvm_print_detail_level>2) + proto_tree_add_text(sigcomp_tree, tvb, offset, 1, + " Addr: %u tvb value(0x%0x) ", i, buff[i]); + i++; + offset = offset+2; + if (udvm_print_detail_level>2) + proto_tree_add_text(sigcomp_tree, tvb, offset, octet, + " Copying %u bytes literally",octet); + if( offset+octet >= length) + /* if the tvb is short dont copy further than the end */ + octet = length - offset; + for ( n=0; n < octet; n++ ){ + buff[i] = tvb_get_guint8(tvb, offset); + if (udvm_print_detail_level>2) + proto_tree_add_text(sigcomp_tree, tvb, offset, 1, + " Addr: %u tvb value(0x%0x) ", i, buff[i]); + i++; + offset++; + } + continue; + } + buff[i] = octet; + if (udvm_print_detail_level>2) + proto_tree_add_text(sigcomp_tree, tvb, offset, 1, + " Addr: %u tvb value(0x%0x) ", i, buff[i]); + + i++; + offset++; + } + unescaped_tvb = tvb_new_child_real_data(tvb, buff,i,i); + /* Arrange that the allocated packet data copy be freed when the + * tvbuff is freed. + */ + tvb_set_free_cb( unescaped_tvb, g_free ); + + add_new_data_source(pinfo, unescaped_tvb, "Unescaped Data handed to the SigComp dissector"); + + proto_tree_add_text(sigcomp_tree, unescaped_tvb, 0, -1,"Data handed to the Sigcomp dissector"); + if (end_off_message == TRUE){ + dissect_sigcomp_common(unescaped_tvb, pinfo, sigcomp_tree); + }else{ + proto_tree_add_text(sigcomp_tree, unescaped_tvb, 0, -1,"TCP Fragment, no end mark found"); + } + if ( offset < length){ + goto try_again; + } + + return offset; } /* Code to actually dissect the packets */ static int dissect_sigcomp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - proto_item *ti; - proto_tree *sigcomp_tree; - gint offset = 0; - gint8 octet; + proto_item *ti; + proto_tree *sigcomp_tree; + gint offset = 0; + gint8 octet; - /* If we got called from SIP this might be over TCP */ - if ( pinfo->ptype == PT_TCP ) - return dissect_sigcomp_tcp(tvb, pinfo, tree); + /* If we got called from SIP this might be over TCP */ + if ( pinfo->ptype == PT_TCP ) + return dissect_sigcomp_tcp(tvb, pinfo, tree); - /* Is this a SigComp message or not ? */ - octet = tvb_get_guint8(tvb, offset); - if ((octet & 0xf8) != 0xf8) - return 0; + /* Is this a SigComp message or not ? */ + octet = tvb_get_guint8(tvb, offset); + if ((octet & 0xf8) != 0xf8) + return 0; - /* Make entries in Protocol column and Info column on summary display */ - col_set_str(pinfo->cinfo, COL_PROTOCOL, "SIGCOMP"); + /* Make entries in Protocol column and Info column on summary display */ + col_set_str(pinfo->cinfo, COL_PROTOCOL, "SIGCOMP"); - col_clear(pinfo->cinfo, COL_INFO); + col_clear(pinfo->cinfo, COL_INFO); - top_tree = tree; + top_tree = tree; - /* create display subtree for the protocol */ - ti = proto_tree_add_item(tree, proto_sigcomp, tvb, 0, -1, FALSE); - sigcomp_tree = proto_item_add_subtree(ti, ett_sigcomp); + /* create display subtree for the protocol */ + ti = proto_tree_add_item(tree, proto_sigcomp, tvb, 0, -1, FALSE); + sigcomp_tree = proto_item_add_subtree(ti, ett_sigcomp); - return dissect_sigcomp_common(tvb, pinfo, sigcomp_tree); + return dissect_sigcomp_common(tvb, pinfo, sigcomp_tree); } /* Code to actually dissect the packets */ static int @@ -543,38 +542,38 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr { /* Set up structures needed to add the protocol subtree and manage it */ - tvbuff_t *udvm_tvb, *msg_tvb, *udvm2_tvb; - tvbuff_t *decomp_tvb = NULL; - proto_item *udvm_bytecode_item, *udvm_exe_item; - proto_tree *sigcomp_udvm_tree, *sigcomp_udvm_exe_tree; - gint offset = 0; - gint bytecode_offset; - guint16 partial_state_len; - guint octet; - guint8 returned_feedback_field[128]; - guint8 partial_state[12]; - guint tbit; - guint16 len = 0; - guint16 bytecode_len = 0; - guint destination; - gint msg_len = 0; - guint8 *buff; - guint16 p_id_start; - guint8 i; - guint16 state_begin; - guint16 state_length; - guint16 state_address; - guint16 state_instruction; - guint16 result_code; - gchar *partial_state_str; - guint8 nack_version; + tvbuff_t *udvm_tvb, *msg_tvb, *udvm2_tvb; + tvbuff_t *decomp_tvb = NULL; + proto_item *udvm_bytecode_item, *udvm_exe_item; + proto_tree *sigcomp_udvm_tree, *sigcomp_udvm_exe_tree; + gint offset = 0; + gint bytecode_offset; + guint16 partial_state_len; + guint octet; + guint8 returned_feedback_field[128]; + guint8 partial_state[12]; + guint tbit; + guint16 len = 0; + guint16 bytecode_len = 0; + guint destination; + gint msg_len = 0; + guint8 *buff; + guint16 p_id_start; + guint8 i; + guint16 state_begin; + guint16 state_length; + guint16 state_address; + guint16 state_instruction; + guint16 result_code; + gchar *partial_state_str; + guint8 nack_version; /* add an item to the subtree, see section 1.6 for more information */ - octet = tvb_get_guint8(tvb, offset); + octet = tvb_get_guint8(tvb, offset); -/* A SigComp message takes one of two forms depending on whether it +/* A SigComp message takes one of two forms depending on whether it * accesses a state item at the receiving endpoint. The two variants of * a SigComp message are given in Figure 3. (The T-bit controls the * format of the returned feedback item and is defined in Section 7.1.) @@ -635,308 +634,308 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr * Figure 1: SigComp NACK Message Format */ - proto_tree_add_item(sigcomp_tree,hf_sigcomp_t_bit, tvb, offset, 1, FALSE); - proto_tree_add_item(sigcomp_tree,hf_sigcomp_len, tvb, offset, 1, FALSE); - tbit = ( octet & 0x04)>>2; - partial_state_len = octet & 0x03; - offset ++; - if ( partial_state_len != 0 ){ - /* - * The len field encodes the number of transmitted bytes as follows: - * - * Encoding: Length of partial state identifier - * - * 01 6 bytes - * 10 9 bytes - * 11 12 bytes - * - */ - partial_state_len = partial_state_len * 3 + 3; - - /* - * Message format 1 - */ - col_set_str(pinfo->cinfo, COL_INFO, "Msg format 1"); - - if ( tbit == 1 ) { - /* - * Returned feedback item exists - */ - len = 1; - octet = tvb_get_guint8(tvb, offset); - /* 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 - * +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+ - * | 0 | returned_feedback_field | | 1 | returned_feedback_length | - * +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+ - * | | - * : returned_feedback_field : - * | | - * +---+---+---+---+---+---+---+---+ - * Figure 4: Format of returned feedback item - */ - - if ( (octet & 0x80) != 0 ){ - len = octet & 0x7f; - proto_tree_add_item(sigcomp_tree,hf_sigcomp_returned_feedback_item_len, - tvb, offset, 1, FALSE); - offset ++; - tvb_memcpy(tvb,returned_feedback_field,offset, len); - } else { - returned_feedback_field[0] = tvb_get_guint8(tvb, offset) & 0x7f; - } - proto_tree_add_bytes(sigcomp_tree,hf_sigcomp_returned_feedback_item, - tvb, offset, len, returned_feedback_field); - offset = offset + len; - } - tvb_memcpy(tvb, partial_state, offset, partial_state_len); - partial_state_str = bytes_to_str(partial_state, partial_state_len); - proto_tree_add_string(sigcomp_tree,hf_sigcomp_partial_state, - tvb, offset, partial_state_len, partial_state_str); - offset = offset + partial_state_len; - msg_len = tvb_reported_length_remaining(tvb, offset); - - if(msg_len>0){ - proto_item *ti; - ti = proto_tree_add_uint(sigcomp_tree, hf_sigcomp_remaining_message_bytes, tvb, - offset, 0, msg_len); - PROTO_ITEM_SET_GENERATED(ti); - } - - if ( decompress ) { - msg_tvb = tvb_new_subset(tvb, offset, msg_len, msg_len); - /* - * buff = Where "state" will be stored - * p_id_start = Partial state identifier start pos in the buffer(buff) - * partial_state_len = Partial state identifier length - * state_begin = Where to start to read state from - * state_length = Length of state - * state_address = Address where to store the state in the buffer(buff) - * state_instruction = - * TRUE = Indicates that state_* is in the stored state - */ - /* - * Note: The allocate buffer must be zeroed or some strange effects might occur. - */ - buff = g_malloc0(UDVM_MEMORY_SIZE); - - - p_id_start = 0; - state_begin = 0; - /* These values will be loaded from the buffered state in sigcomp_state_hdlr - */ - state_length = 0; - state_address = 0; - state_instruction =0; - - i = 0; - while ( i < partial_state_len ){ - buff[i] = partial_state[i]; - i++; - } - -/* begin partial state-id change cco@iptel.org */ + proto_tree_add_item(sigcomp_tree,hf_sigcomp_t_bit, tvb, offset, 1, FALSE); + proto_tree_add_item(sigcomp_tree,hf_sigcomp_len, tvb, offset, 1, FALSE); + tbit = ( octet & 0x04)>>2; + partial_state_len = octet & 0x03; + offset ++; + if ( partial_state_len != 0 ){ + /* + * The len field encodes the number of transmitted bytes as follows: + * + * Encoding: Length of partial state identifier + * + * 01 6 bytes + * 10 9 bytes + * 11 12 bytes + * + */ + partial_state_len = partial_state_len * 3 + 3; + + /* + * Message format 1 + */ + col_set_str(pinfo->cinfo, COL_INFO, "Msg format 1"); + + if ( tbit == 1 ) { + /* + * Returned feedback item exists + */ + len = 1; + octet = tvb_get_guint8(tvb, offset); + /* 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 + * +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+ + * | 0 | returned_feedback_field | | 1 | returned_feedback_length | + * +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+ + * | | + * : returned_feedback_field : + * | | + * +---+---+---+---+---+---+---+---+ + * Figure 4: Format of returned feedback item + */ + + if ( (octet & 0x80) != 0 ){ + len = octet & 0x7f; + proto_tree_add_item(sigcomp_tree,hf_sigcomp_returned_feedback_item_len, + tvb, offset, 1, FALSE); + offset ++; + tvb_memcpy(tvb,returned_feedback_field,offset, len); + } else { + returned_feedback_field[0] = tvb_get_guint8(tvb, offset) & 0x7f; + } + proto_tree_add_bytes(sigcomp_tree,hf_sigcomp_returned_feedback_item, + tvb, offset, len, returned_feedback_field); + offset = offset + len; + } + tvb_memcpy(tvb, partial_state, offset, partial_state_len); + partial_state_str = bytes_to_str(partial_state, partial_state_len); + proto_tree_add_string(sigcomp_tree,hf_sigcomp_partial_state, + tvb, offset, partial_state_len, partial_state_str); + offset = offset + partial_state_len; + msg_len = tvb_reported_length_remaining(tvb, offset); + + if(msg_len>0){ + proto_item *ti; + ti = proto_tree_add_uint(sigcomp_tree, hf_sigcomp_remaining_message_bytes, tvb, + offset, 0, msg_len); + PROTO_ITEM_SET_GENERATED(ti); + } + + if ( decompress ) { + msg_tvb = tvb_new_subset(tvb, offset, msg_len, msg_len); + /* + * buff = Where "state" will be stored + * p_id_start = Partial state identifier start pos in the buffer(buff) + * partial_state_len = Partial state identifier length + * state_begin = Where to start to read state from + * state_length = Length of state + * state_address = Address where to store the state in the buffer(buff) + * state_instruction = + * TRUE = Indicates that state_* is in the stored state + */ + /* + * Note: The allocate buffer must be zeroed or some strange effects might occur. + */ + buff = g_malloc0(UDVM_MEMORY_SIZE); + + + p_id_start = 0; + state_begin = 0; + /* These values will be loaded from the buffered state in sigcomp_state_hdlr + */ + state_length = 0; + state_address = 0; + state_instruction =0; + + i = 0; + while ( i < partial_state_len ){ + buff[i] = partial_state[i]; + i++; + } + +/* begin partial state-id change cco@iptel.org */ #if 0 - result_code = udvm_state_access(tvb, sigcomp_tree, buff, p_id_start, partial_state_len, state_begin, &state_length, - &state_address, &state_instruction, hf_sigcomp_partial_state); + result_code = udvm_state_access(tvb, sigcomp_tree, buff, p_id_start, partial_state_len, state_begin, &state_length, + &state_address, &state_instruction, hf_sigcomp_partial_state); #endif - result_code = udvm_state_access(tvb, sigcomp_tree, buff, p_id_start, STATE_MIN_ACCESS_LEN, state_begin, &state_length, - &state_address, &state_instruction, hf_sigcomp_partial_state); - -/* end partial state-id change cco@iptel.org */ - if ( result_code != 0 ){ - proto_item *ti; - ti = proto_tree_add_text(sigcomp_tree, tvb, 0, -1,"Failed to Access state Wireshark UDVM diagnostic: %s.", - val_to_str(result_code, result_code_vals,"Unknown (%u)")); - PROTO_ITEM_SET_GENERATED(ti); - g_free(buff); - return tvb_length(tvb); - } - - udvm_tvb = tvb_new_child_real_data(tvb, buff,state_length+state_address,state_length+state_address); - /* Arrange that the allocated packet data copy be freed when the - * tvbuff is freed. - */ - tvb_set_free_cb( udvm_tvb, g_free ); - - - udvm2_tvb = tvb_new_subset(udvm_tvb, state_address, state_length, state_length); - /* TODO Check if buff needs to be free'd */ - udvm_exe_item = proto_tree_add_item(sigcomp_tree, hf_udvm_execution_trace, - udvm2_tvb, 0, state_length, - FALSE); - sigcomp_udvm_exe_tree = proto_item_add_subtree( udvm_exe_item, ett_sigcomp_udvm_exe); - - decomp_tvb = decompress_sigcomp_message(udvm2_tvb, msg_tvb, pinfo, - sigcomp_udvm_exe_tree, state_address, - udvm_print_detail_level, hf_sigcomp_partial_state, - offset, state_length, partial_state_len, state_instruction); - - - if ( decomp_tvb ){ - proto_item *ti; - guint32 compression_ratio = - (guint32)(((float)tvb_length(decomp_tvb) / (float)tvb_length(tvb)) * 100); - - /* Celebrate success and show compression ratio achieved */ - proto_tree_add_text(sigcomp_tree, decomp_tvb, 0, -1,"SigComp message Decompressed WOHO!!"); - ti = proto_tree_add_uint(sigcomp_tree, hf_sigcomp_compression_ratio, decomp_tvb, - 0, 0, compression_ratio); - PROTO_ITEM_SET_GENERATED(ti); - - if ( display_raw_txt ) - tvb_raw_text_add(decomp_tvb, top_tree); - if (check_col(pinfo->cinfo, COL_PROTOCOL)){ - col_append_str(pinfo->cinfo, COL_PROTOCOL, "/"); - col_set_fence(pinfo->cinfo,COL_PROTOCOL); - } - call_dissector(sip_handle, decomp_tvb, pinfo, top_tree); - } - }/* if decompress */ - - } - else{ - /* - * Message format 2 - */ - col_set_str(pinfo->cinfo, COL_INFO, "Msg format 2"); - if ( tbit == 1 ) { - /* - * Returned feedback item exists - */ - len = 1; - octet = tvb_get_guint8(tvb, offset); - if ( (octet & 0x80) != 0 ){ - len = octet & 0x7f; - proto_tree_add_item(sigcomp_tree,hf_sigcomp_returned_feedback_item_len, - tvb, offset, 1, FALSE); - offset ++; - } - tvb_memcpy(tvb,returned_feedback_field,offset, len); - proto_tree_add_bytes(sigcomp_tree,hf_sigcomp_returned_feedback_item, - tvb, offset, len, returned_feedback_field); - offset = offset + len; - } - len = tvb_get_ntohs(tvb, offset) >> 4; - nack_version = tvb_get_guint8(tvb, offset+1) & 0x0f; - if ((len == 0) && (nack_version == 1)){ - /* NACK MESSAGE */ - proto_item *reason_ti; - guint8 opcode; - offset++; - proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_ver, tvb, offset, 1, FALSE); - offset++; - octet = tvb_get_guint8(tvb, offset); - reason_ti = proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_reason_code, tvb, offset, 1, FALSE); - offset++; - opcode = tvb_get_guint8(tvb, offset); - proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_failed_op_code, tvb, offset, 1, FALSE); - offset++; - - /* Add expert item for NACK */ - expert_add_info_format(pinfo, reason_ti, PI_SEQUENCE, PI_WARN, - "SigComp NACK (reason=%s, opcode=%s)", - val_to_str(octet, sigcomp_nack_reason_code_vals, "Unknown"), - val_to_str(opcode, udvm_instruction_code_vals, "Unknown")); - - proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_pc, tvb, offset, 2, FALSE); - offset = offset +2; - proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_sha1, tvb, offset, 20, FALSE); - offset = offset +20; - - /* Add NACK info to info column */ - if (check_col(pinfo->cinfo, COL_INFO)){ - col_append_fstr(pinfo->cinfo, COL_INFO, " NACK reason=%s, opcode=%s", - val_to_str(octet, sigcomp_nack_reason_code_vals, "Unknown"), - val_to_str(opcode, udvm_instruction_code_vals, "Unknown")); - } - - switch ( octet){ - case SIGCOMP_NACK_STATE_NOT_FOUND: - case SIGCOMP_NACK_ID_NOT_UNIQUE: - case SIGCOMP_NACK_STATE_TOO_SHORT: - /* State ID (6 - 20 bytes) */ - proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_state_id, tvb, offset, -1, FALSE); - break; - case SIGCOMP_NACK_CYCLES_EXHAUSTED: - /* Cycles Per Bit (1 byte) */ - proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_cycles_per_bit, tvb, offset, 1, FALSE); - break; - case SIGCOMP_NACK_BYTECODES_TOO_LARGE: - /* Memory size (2 bytes) */ - proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_memory_size, tvb, offset, 2, FALSE); - break; - default: - break; - } - }else{ - octet = tvb_get_guint8(tvb, (offset + 1)); - destination = (octet & 0x0f); - if ( destination != 0 ) - destination = 64 + ( destination * 64 ); - proto_tree_add_item(sigcomp_tree,hf_sigcomp_code_len, tvb, offset, 2, FALSE); - proto_tree_add_item(sigcomp_tree,hf_sigcomp_destination, tvb, (offset+ 1), 1, FALSE); - offset = offset +2; - - bytecode_len = len; - bytecode_offset = offset; - udvm_bytecode_item = proto_tree_add_item(sigcomp_tree, hf_sigcomp_udvm_bytecode, tvb, - bytecode_offset, bytecode_len, FALSE); - proto_item_append_text(udvm_bytecode_item, - " %u (0x%x) bytes", bytecode_len, bytecode_len); - sigcomp_udvm_tree = proto_item_add_subtree( udvm_bytecode_item, ett_sigcomp_udvm); - - udvm_tvb = tvb_new_subset(tvb, offset, len, len); - if ( dissect_udvm_code ) - dissect_udvm_bytecode(udvm_tvb, sigcomp_udvm_tree, destination); - - offset = offset + len; - msg_len = tvb_reported_length_remaining(tvb, offset); - if (msg_len>0) { - proto_item *ti = proto_tree_add_text(sigcomp_tree, tvb, offset, -1, - "Remaining SigComp message %u bytes", - tvb_reported_length_remaining(tvb, offset)); - PROTO_ITEM_SET_GENERATED(ti); - } - if ( decompress ){ - - msg_tvb = tvb_new_subset(tvb, offset, msg_len, msg_len); - - udvm_exe_item = proto_tree_add_item(sigcomp_tree, hf_udvm_execution_trace, - tvb, bytecode_offset, bytecode_len, - FALSE); - sigcomp_udvm_exe_tree = proto_item_add_subtree( udvm_exe_item, ett_sigcomp_udvm_exe); - decomp_tvb = decompress_sigcomp_message(udvm_tvb, msg_tvb, pinfo, - sigcomp_udvm_exe_tree, destination, - udvm_print_detail_level, hf_sigcomp_partial_state, - offset, 0, 0, destination); - if ( decomp_tvb ){ - proto_item *ti; - guint32 compression_ratio = - (guint32)(((float)tvb_length(decomp_tvb) / (float)tvb_length(tvb)) * 100); - - /* Celebrate success and show compression ratio achieved */ - proto_tree_add_text(sigcomp_tree, decomp_tvb, 0, -1,"SigComp message Decompressed WOHO!!"); - ti = proto_tree_add_uint(sigcomp_tree, hf_sigcomp_compression_ratio, decomp_tvb, - 0, 0, compression_ratio); - PROTO_ITEM_SET_GENERATED(ti); - - if ( display_raw_txt ) - tvb_raw_text_add(decomp_tvb, top_tree); - if (check_col(pinfo->cinfo, COL_PROTOCOL)){ - col_append_str(pinfo->cinfo, COL_PROTOCOL, "/"); - col_set_fence(pinfo->cinfo,COL_PROTOCOL); - } - call_dissector(sip_handle, decomp_tvb, pinfo, top_tree); - } - } /* if decompress */ - }/*if len==0 */ - - } - return tvb_length(tvb); + result_code = udvm_state_access(tvb, sigcomp_tree, buff, p_id_start, STATE_MIN_ACCESS_LEN, state_begin, &state_length, + &state_address, &state_instruction, hf_sigcomp_partial_state); + +/* end partial state-id change cco@iptel.org */ + if ( result_code != 0 ){ + proto_item *ti; + ti = proto_tree_add_text(sigcomp_tree, tvb, 0, -1,"Failed to Access state Wireshark UDVM diagnostic: %s.", + val_to_str(result_code, result_code_vals,"Unknown (%u)")); + PROTO_ITEM_SET_GENERATED(ti); + g_free(buff); + return tvb_length(tvb); + } + + udvm_tvb = tvb_new_child_real_data(tvb, buff,state_length+state_address,state_length+state_address); + /* Arrange that the allocated packet data copy be freed when the + * tvbuff is freed. + */ + tvb_set_free_cb( udvm_tvb, g_free ); + + + udvm2_tvb = tvb_new_subset(udvm_tvb, state_address, state_length, state_length); + /* TODO Check if buff needs to be free'd */ + udvm_exe_item = proto_tree_add_item(sigcomp_tree, hf_udvm_execution_trace, + udvm2_tvb, 0, state_length, + FALSE); + sigcomp_udvm_exe_tree = proto_item_add_subtree( udvm_exe_item, ett_sigcomp_udvm_exe); + + decomp_tvb = decompress_sigcomp_message(udvm2_tvb, msg_tvb, pinfo, + sigcomp_udvm_exe_tree, state_address, + udvm_print_detail_level, hf_sigcomp_partial_state, + offset, state_length, partial_state_len, state_instruction); + + + if ( decomp_tvb ){ + proto_item *ti; + guint32 compression_ratio = + (guint32)(((float)tvb_length(decomp_tvb) / (float)tvb_length(tvb)) * 100); + + /* Celebrate success and show compression ratio achieved */ + proto_tree_add_text(sigcomp_tree, decomp_tvb, 0, -1,"SigComp message Decompressed WOHO!!"); + ti = proto_tree_add_uint(sigcomp_tree, hf_sigcomp_compression_ratio, decomp_tvb, + 0, 0, compression_ratio); + PROTO_ITEM_SET_GENERATED(ti); + + if ( display_raw_txt ) + tvb_raw_text_add(decomp_tvb, top_tree); + if (check_col(pinfo->cinfo, COL_PROTOCOL)){ + col_append_str(pinfo->cinfo, COL_PROTOCOL, "/"); + col_set_fence(pinfo->cinfo,COL_PROTOCOL); + } + call_dissector(sip_handle, decomp_tvb, pinfo, top_tree); + } + }/* if decompress */ + + } + else{ + /* + * Message format 2 + */ + col_set_str(pinfo->cinfo, COL_INFO, "Msg format 2"); + if ( tbit == 1 ) { + /* + * Returned feedback item exists + */ + len = 1; + octet = tvb_get_guint8(tvb, offset); + if ( (octet & 0x80) != 0 ){ + len = octet & 0x7f; + proto_tree_add_item(sigcomp_tree,hf_sigcomp_returned_feedback_item_len, + tvb, offset, 1, FALSE); + offset ++; + } + tvb_memcpy(tvb,returned_feedback_field,offset, len); + proto_tree_add_bytes(sigcomp_tree,hf_sigcomp_returned_feedback_item, + tvb, offset, len, returned_feedback_field); + offset = offset + len; + } + len = tvb_get_ntohs(tvb, offset) >> 4; + nack_version = tvb_get_guint8(tvb, offset+1) & 0x0f; + if ((len == 0) && (nack_version == 1)){ + /* NACK MESSAGE */ + proto_item *reason_ti; + guint8 opcode; + offset++; + proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_ver, tvb, offset, 1, FALSE); + offset++; + octet = tvb_get_guint8(tvb, offset); + reason_ti = proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_reason_code, tvb, offset, 1, FALSE); + offset++; + opcode = tvb_get_guint8(tvb, offset); + proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_failed_op_code, tvb, offset, 1, FALSE); + offset++; + + /* Add expert item for NACK */ + expert_add_info_format(pinfo, reason_ti, PI_SEQUENCE, PI_WARN, + "SigComp NACK (reason=%s, opcode=%s)", + val_to_str(octet, sigcomp_nack_reason_code_vals, "Unknown"), + val_to_str(opcode, udvm_instruction_code_vals, "Unknown")); + + proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_pc, tvb, offset, 2, FALSE); + offset = offset +2; + proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_sha1, tvb, offset, 20, FALSE); + offset = offset +20; + + /* Add NACK info to info column */ + if (check_col(pinfo->cinfo, COL_INFO)){ + col_append_fstr(pinfo->cinfo, COL_INFO, " NACK reason=%s, opcode=%s", + val_to_str(octet, sigcomp_nack_reason_code_vals, "Unknown"), + val_to_str(opcode, udvm_instruction_code_vals, "Unknown")); + } + + switch ( octet){ + case SIGCOMP_NACK_STATE_NOT_FOUND: + case SIGCOMP_NACK_ID_NOT_UNIQUE: + case SIGCOMP_NACK_STATE_TOO_SHORT: + /* State ID (6 - 20 bytes) */ + proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_state_id, tvb, offset, -1, FALSE); + break; + case SIGCOMP_NACK_CYCLES_EXHAUSTED: + /* Cycles Per Bit (1 byte) */ + proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_cycles_per_bit, tvb, offset, 1, FALSE); + break; + case SIGCOMP_NACK_BYTECODES_TOO_LARGE: + /* Memory size (2 bytes) */ + proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_memory_size, tvb, offset, 2, FALSE); + break; + default: + break; + } + }else{ + octet = tvb_get_guint8(tvb, (offset + 1)); + destination = (octet & 0x0f); + if ( destination != 0 ) + destination = 64 + ( destination * 64 ); + proto_tree_add_item(sigcomp_tree,hf_sigcomp_code_len, tvb, offset, 2, FALSE); + proto_tree_add_item(sigcomp_tree,hf_sigcomp_destination, tvb, (offset+ 1), 1, FALSE); + offset = offset +2; + + bytecode_len = len; + bytecode_offset = offset; + udvm_bytecode_item = proto_tree_add_item(sigcomp_tree, hf_sigcomp_udvm_bytecode, tvb, + bytecode_offset, bytecode_len, FALSE); + proto_item_append_text(udvm_bytecode_item, + " %u (0x%x) bytes", bytecode_len, bytecode_len); + sigcomp_udvm_tree = proto_item_add_subtree( udvm_bytecode_item, ett_sigcomp_udvm); + + udvm_tvb = tvb_new_subset(tvb, offset, len, len); + if ( dissect_udvm_code ) + dissect_udvm_bytecode(udvm_tvb, sigcomp_udvm_tree, destination); + + offset = offset + len; + msg_len = tvb_reported_length_remaining(tvb, offset); + if (msg_len>0) { + proto_item *ti = proto_tree_add_text(sigcomp_tree, tvb, offset, -1, + "Remaining SigComp message %u bytes", + tvb_reported_length_remaining(tvb, offset)); + PROTO_ITEM_SET_GENERATED(ti); + } + if ( decompress ){ + + msg_tvb = tvb_new_subset(tvb, offset, msg_len, msg_len); + + udvm_exe_item = proto_tree_add_item(sigcomp_tree, hf_udvm_execution_trace, + tvb, bytecode_offset, bytecode_len, + FALSE); + sigcomp_udvm_exe_tree = proto_item_add_subtree( udvm_exe_item, ett_sigcomp_udvm_exe); + decomp_tvb = decompress_sigcomp_message(udvm_tvb, msg_tvb, pinfo, + sigcomp_udvm_exe_tree, destination, + udvm_print_detail_level, hf_sigcomp_partial_state, + offset, 0, 0, destination); + if ( decomp_tvb ){ + proto_item *ti; + guint32 compression_ratio = + (guint32)(((float)tvb_length(decomp_tvb) / (float)tvb_length(tvb)) * 100); + + /* Celebrate success and show compression ratio achieved */ + proto_tree_add_text(sigcomp_tree, decomp_tvb, 0, -1,"SigComp message Decompressed WOHO!!"); + ti = proto_tree_add_uint(sigcomp_tree, hf_sigcomp_compression_ratio, decomp_tvb, + 0, 0, compression_ratio); + PROTO_ITEM_SET_GENERATED(ti); + + if ( display_raw_txt ) + tvb_raw_text_add(decomp_tvb, top_tree); + if (check_col(pinfo->cinfo, COL_PROTOCOL)){ + col_append_str(pinfo->cinfo, COL_PROTOCOL, "/"); + col_set_fence(pinfo->cinfo,COL_PROTOCOL); + } + call_dissector(sip_handle, decomp_tvb, pinfo, top_tree); + } + } /* if decompress */ + }/*if len==0 */ + + } + return tvb_length(tvb); } - -#define SIGCOMP_INSTR_DECOMPRESSION_FAILURE 0 + +#define SIGCOMP_INSTR_DECOMPRESSION_FAILURE 0 #define SIGCOMP_INSTR_AND 1 #define SIGCOMP_INSTR_OR 2 #define SIGCOMP_INSTR_NOT 3 @@ -971,935 +970,935 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr #define SIGCOMP_INSTR_STATE_CREATE 32 #define SIGCOMP_INSTR_STATE_FREE 33 #define SIGCOMP_INSTR_OUTPUT 34 -#define SIGCOMP_INSTR_END_MESSAGE 35 +#define SIGCOMP_INSTR_END_MESSAGE 35 static void dissect_udvm_bytecode(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree,guint start_address) { - guint instruction; - gint offset = 0; - gint start_offset; - gint len; - gint n; - guint instruction_no = 0; - guint16 value = 0; - proto_item *item, *item2; - guint UDVM_address = start_address; - gboolean is_memory_address; - guint16 msg_length = tvb_reported_length_remaining(udvm_tvb, offset); - - - while (msg_length > offset) { - instruction = tvb_get_guint8(udvm_tvb, offset); - instruction_no ++; - UDVM_address = start_address + offset; + guint instruction; + gint offset = 0; + gint start_offset; + gint len; + gint n; + guint instruction_no = 0; + guint16 value = 0; + proto_item *item, *item2; + guint UDVM_address = start_address; + gboolean is_memory_address; + guint16 msg_length = tvb_reported_length_remaining(udvm_tvb, offset); + + + while (msg_length > offset) { + instruction = tvb_get_guint8(udvm_tvb, offset); + instruction_no ++; + UDVM_address = start_address + offset; ; - item = proto_tree_add_text(sigcomp_udvm_tree, udvm_tvb, offset, 1, - "######### UDVM instruction %u at UDVM-address %u (0x%x) #########", - instruction_no,UDVM_address,UDVM_address); - PROTO_ITEM_SET_GENERATED(item); - proto_tree_add_item(sigcomp_udvm_tree, hf_sigcomp_udvm_instr, udvm_tvb, offset, 1, FALSE); - offset ++; - switch ( instruction ) { - - case SIGCOMP_INSTR_AND: /* 1 AND ($operand_1, %operand_2) */ - /* $operand_1*/ - offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, - udvm_tvb, start_offset, len, value); - /* %operand_2*/ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, - udvm_tvb, start_offset, len, value); - } - break; - - case SIGCOMP_INSTR_OR: /* 2 OR ($operand_1, %operand_2) */ - /* $operand_1*/ - offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, - udvm_tvb, start_offset, len, value); - /* %operand_2*/ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, - udvm_tvb, start_offset, len, value); - } - break; - - case SIGCOMP_INSTR_NOT: /* 3 NOT ($operand_1) */ - /* $operand_1*/ - offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, - udvm_tvb, start_offset, len, value); - break; - - case SIGCOMP_INSTR_LSHIFT: /* 4 LSHIFT ($operand_1, %operand_2) */ - /* $operand_1*/ - offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, - udvm_tvb, start_offset, len, value); - /* %operand_2*/ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, - udvm_tvb, start_offset, len, value); - } - break; - - case SIGCOMP_INSTR_RSHIFT: /* 5 RSHIFT ($operand_1, %operand_2) */ - /* $operand_1*/ - offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, - udvm_tvb, start_offset, len, value); - /* %operand_2*/ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, - udvm_tvb, start_offset, len, value); - } - break; - - case SIGCOMP_INSTR_ADD: /* 6 ADD ($operand_1, %operand_2) */ - /* $operand_1*/ - offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, - udvm_tvb, start_offset, len, value); - /* %operand_2*/ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, - udvm_tvb, start_offset, len, value); - } - break; - - case SIGCOMP_INSTR_SUBTRACT: /* 7 SUBTRACT ($operand_1, %operand_2) */ - /* $operand_1*/ - offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, - udvm_tvb, start_offset, len, value); - /* %operand_2*/ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, - udvm_tvb, start_offset, len, value); - } - break; - - case SIGCOMP_INSTR_MULTIPLY: /* 8 MULTIPLY ($operand_1, %operand_2) */ - /* $operand_1*/ - offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, - udvm_tvb, start_offset, len, value); - /* %operand_2*/ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, - udvm_tvb, start_offset, len, value); - } - break; - - case SIGCOMP_INSTR_DIVIDE: /* 9 DIVIDE ($operand_1, %operand_2) */ - /* $operand_1*/ - offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, - udvm_tvb, start_offset, len, value); - /* %operand_2*/ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, - udvm_tvb, start_offset, len, value); - } - break; - - case SIGCOMP_INSTR_REMAINDER: /* 10 REMAINDER ($operand_1, %operand_2) */ - /* $operand_1*/ - offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, - udvm_tvb, start_offset, len, value); - /* %operand_2*/ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, - udvm_tvb, start_offset, len, value); - } - break; - case SIGCOMP_INSTR_SORT_ASCENDING: /* 11 SORT-ASCENDING (%start, %n, %k) */ - /* while programming stop while loop */ - offset = offset + tvb_reported_length_remaining(udvm_tvb, offset); - break; - - case SIGCOMP_INSTR_SORT_DESCENDING: /* 12 SORT-DESCENDING (%start, %n, %k) */ - offset = offset + tvb_reported_length_remaining(udvm_tvb, offset); - break; - case SIGCOMP_INSTR_SHA_1: /* 13 SHA-1 (%position, %length, %destination) */ - /* %position */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_position, - udvm_tvb, start_offset, len, value); - - /* %length, */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, - udvm_tvb, start_offset, len, value); - } - - /* $destination */ - offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_ref_dest, - udvm_tvb, start_offset, len, value); - break; - - case SIGCOMP_INSTR_LOAD: /* 14 LOAD (%address, %value) */ - /* %address */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_address, - udvm_tvb, start_offset, len, value); - /* %value */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_value, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_value, - udvm_tvb, start_offset, len, value); - } - break; - - case SIGCOMP_INSTR_MULTILOAD: /* 15 MULTILOAD (%address, #n, %value_0, ..., %value_n-1) */ - /* %address */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_address, - udvm_tvb, start_offset, len, value); - /* #n */ - offset = dissect_udvm_literal_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_literal_num, - udvm_tvb, start_offset, len, value); - n = value; - while ( n > 0) { - n = n -1; - /* %value */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_value, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_value, - udvm_tvb, start_offset, len, value); - } - } - break; - - case SIGCOMP_INSTR_PUSH: /* 16 PUSH (%value) */ - /* %value */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_value, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_value, - udvm_tvb, start_offset, len, value); - } - break; - - case SIGCOMP_INSTR_POP: /* 17 POP (%address) */ - /* %address */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_address, - udvm_tvb, start_offset, len, value); - break; - - case SIGCOMP_INSTR_COPY: /* 18 COPY (%position, %length, %destination) */ - /* %position */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_position, - udvm_tvb, start_offset, len, value); - - /* %length, */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, - udvm_tvb, start_offset, len, value); - } - - /* $destination */ - offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_ref_dest, - udvm_tvb, start_offset, len, value); - break; - - case SIGCOMP_INSTR_COPY_LITERAL: /* 19 COPY-LITERAL (%position, %length, $destination) */ - /* %position */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_position, - udvm_tvb, start_offset, len, value); - - /* %length, */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, - udvm_tvb, start_offset, len, value); - } - - /* $destination */ - offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_ref_dest, - udvm_tvb, start_offset, len, value); - break; - - case SIGCOMP_INSTR_COPY_OFFSET: /* 20 COPY-OFFSET (%offset, %length, $destination) */ - /* %offset */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_offset, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_offset, - udvm_tvb, start_offset, len, value); - } - - /* %length, */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, - udvm_tvb, start_offset, len, value); - } - - /* $destination */ - offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_ref_dest, - udvm_tvb, start_offset, len, value); - break; - case SIGCOMP_INSTR_MEMSET: /* 21 MEMSET (%address, %length, %start_value, %offset) */ - - /* %address */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_address, - udvm_tvb, start_offset, len, value); - - /* %length, */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, - udvm_tvb, start_offset, len, value); - } - - /* %start_value */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_start_value, - udvm_tvb, start_offset, len, value); - - /* %offset */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_offset, - udvm_tvb, start_offset, len, value); - break; - - - case SIGCOMP_INSTR_JUMP: /* 22 JUMP (@address) */ - /* @address */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ - value = ( value + UDVM_address ) & 0xffff; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, - udvm_tvb, start_offset, len, value); - break; - - case SIGCOMP_INSTR_COMPARE: /* 23 */ - /* COMPARE (%value_1, %value_2, @address_1, @address_2, @address_3) - */ - /* %value_1 */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_value, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_value, - udvm_tvb, start_offset, len, value); - } - - /* %value_2 */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_value, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_value, - udvm_tvb, start_offset, len, value); - } - - /* @address_1 */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ - value = ( value + UDVM_address ) & 0xffff; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, - udvm_tvb, start_offset, len, value); - - /* @address_2 */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ - value = ( value + UDVM_address ) & 0xffff; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, - udvm_tvb, start_offset, len, value); - - /* @address_3 */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ - value = ( value + UDVM_address ) & 0xffff; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, - udvm_tvb, start_offset, len, value); - break; - - case SIGCOMP_INSTR_CALL: /* 24 CALL (@address) (PUSH addr )*/ - /* @address */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ - value = ( value + UDVM_address ) & 0xffff; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, - udvm_tvb, start_offset, len, value); - break; - case SIGCOMP_INSTR_RETURN: /* 25 POP and return */ - - break; - - case SIGCOMP_INSTR_SWITCH: /* 26 SWITCH (#n, %j, @address_0, @address_1, ... , @address_n-1) */ - /* #n */ - offset = dissect_udvm_literal_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_literal_num, - udvm_tvb, start_offset, len, value); - - /* Number of addresses in the instruction */ - n = value; - /* %j */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_j, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_j, - udvm_tvb, start_offset, len, value); - } - - while ( n > 0) { - n = n -1; - /* @address_n-1 */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ - value = ( value + UDVM_address ) & 0xffff; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, - udvm_tvb, start_offset, len, value); - } - break; - case SIGCOMP_INSTR_CRC: /* 27 CRC (%value, %position, %length, @address) */ - /* %value */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_value, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_value, - udvm_tvb, start_offset, len, value); - } - - /* %position */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_position, - udvm_tvb, start_offset, len, value); - - /* %length */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, - udvm_tvb, start_offset, len, value); - } - - /* @address */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ - value = ( value + UDVM_address ) & 0xffff; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, - udvm_tvb, start_offset, len, value); - break; - - - case SIGCOMP_INSTR_INPUT_BYTES: /* 28 INPUT-BYTES (%length, %destination, @address) */ - /* %length */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, - udvm_tvb, start_offset, len, value); - } - - /* %destination */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_destination, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_destination, - udvm_tvb, start_offset, len, value); - } - - /* @address */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ - value = ( value + UDVM_address ) & 0xffff; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, - udvm_tvb, start_offset, len, value); - break; - case SIGCOMP_INSTR_INPUT_BITS:/* 29 INPUT-BITS (%length, %destination, @address) */ - /* %length */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, - udvm_tvb, start_offset, len, value); - } - - /* %destination */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_destination, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_destination, - udvm_tvb, start_offset, len, value); - } - - /* @address */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ - value = ( value + UDVM_address ) & 0xffff; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, - udvm_tvb, start_offset, len, value); - break; - case SIGCOMP_INSTR_INPUT_HUFFMAN: /* 30 */ - /* - * INPUT-HUFFMAN (%destination, @address, #n, %bits_1, %lower_bound_1, - * %upper_bound_1, %uncompressed_1, ... , %bits_n, %lower_bound_n, - * %upper_bound_n, %uncompressed_n) - */ - /* %destination */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ){ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_destination, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_destination, - udvm_tvb, start_offset, len, value); - } - /* @address */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ - value = ( value + UDVM_address ) & 0xffff; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, - udvm_tvb, start_offset, len, value); - /* #n */ - offset = dissect_udvm_literal_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_literal_num, - udvm_tvb, start_offset, len, value); - n = value; - while ( n > 0) { - n = n -1; - /* %bits_n */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_bits, - udvm_tvb, start_offset, len, value); - /* %lower_bound_n*/ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_lower_bound, - udvm_tvb, start_offset, len, value); - /* %upper_bound_n */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_upper_bound, - udvm_tvb, start_offset, len, value); - /* %uncompressed_n */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_uncompressed, - udvm_tvb, start_offset, len, value); - } - break; - - case SIGCOMP_INSTR_STATE_ACCESS: /* 31 */ - /* STATE-ACCESS (%partial_identifier_start, %partial_identifier_length, - * %state_begin, %state_length, %state_address, %state_instruction) - */ - - /* - * %partial_identifier_start - */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value ,&is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_partial_identifier_start, - udvm_tvb, start_offset, len, value); - - /* - * %partial_identifier_length - */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value ,&is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_partial_identifier_length, - udvm_tvb, start_offset, len, value); - /* - * %state_begin - */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_state_begin, - udvm_tvb, start_offset, len, value); - - /* - * %state_length - */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ) { - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_length_addr, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_length, - udvm_tvb, start_offset, len, value); - } - /* - * %state_address - */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value ,&is_memory_address); - len = offset - start_offset; - if ( is_memory_address ) { - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_address_addr, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_address, - udvm_tvb, start_offset, len, value); - } - /* - * %state_instruction - */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_instr, - udvm_tvb, start_offset, len, value); - break; - case SIGCOMP_INSTR_STATE_CREATE: /* 32 */ - /* - * STATE-CREATE (%state_length, %state_address, %state_instruction, - * %minimum_access_length, %state_retention_priority) - */ - - /* - * %state_length - */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ) { - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_length_addr, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_length, - udvm_tvb, start_offset, len, value); - } - /* - * %state_address - */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ) { - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_address_addr, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_address, - udvm_tvb, start_offset, len, value); - } - /* - * %state_instruction - */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_instr, - udvm_tvb, start_offset, len, value); - /* - * %minimum_access_length - */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_min_acc_len, - udvm_tvb, start_offset, len, value); - /* - * %state_retention_priority - */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_ret_pri, - udvm_tvb, start_offset, len, value); - - break; - case SIGCOMP_INSTR_STATE_FREE: /* 33 */ - /* - * STATE-FREE (%partial_identifier_start, %partial_identifier_length) - */ - /* - * %partial_identifier_start - */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_partial_identifier_start, - udvm_tvb, start_offset, len, value); - - /* - * %partial_identifier_length - */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_partial_identifier_length, - udvm_tvb, start_offset, len, value); - break; - case SIGCOMP_INSTR_OUTPUT: /* 34 OUTPUT (%output_start, %output_length) */ - /* - * %output_start - */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ) { - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_output_start, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_output_start, - udvm_tvb, start_offset, len, value); - } - /* - * %output_length - */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ) { - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_output_length_addr, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_output_length, - udvm_tvb, start_offset, len, value); - } - break; - case SIGCOMP_INSTR_END_MESSAGE: /* 35 */ - /* - * END-MESSAGE (%requested_feedback_location, - * %returned_parameters_location, %state_length, %state_address, - * %state_instruction, %minimum_access_length, - * %state_retention_priority) - */ - /* %requested_feedback_location */ - if ((msg_length-1) < offset){ - item2 = proto_tree_add_text(sigcomp_udvm_tree, udvm_tvb, 0, -1, - "All remaining parameters = 0(Not in the uploaded code as UDVM buffer initialized to Zero"); - PROTO_ITEM_SET_GENERATED(item2); - return; - } - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_req_feedback_loc, - udvm_tvb, start_offset, len, value); - /* returned_parameters_location */ - if ((msg_length-1) < offset){ - item2 = proto_tree_add_text(sigcomp_udvm_tree, udvm_tvb, offset-1, -1, - "All remaining parameters = 0(Not in the uploaded code as UDVM buffer initialized to Zero"); - PROTO_ITEM_SET_GENERATED(item2); - return; - } - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_ret_param_loc, - udvm_tvb, start_offset, len, value); - /* - * %state_length - */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ) { - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_length_addr, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_length, - udvm_tvb, start_offset, len, value); - } - /* - * %state_address - */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - if ( is_memory_address ) { - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_address_addr, - udvm_tvb, start_offset, len, value); - }else{ - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_address, - udvm_tvb, start_offset, len, value); - } - /* - * %state_instruction - */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_instr, - udvm_tvb, start_offset, len, value); - /* - * %minimum_access_length - */ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_min_acc_len, - udvm_tvb, start_offset, len, value); - /* - * %state_retention_priority - */ - if ( tvb_reported_length_remaining(udvm_tvb, offset) != 0 ){ - offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); - len = offset - start_offset; - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_ret_pri, - udvm_tvb, start_offset, len, value); - }else{ - item2 = proto_tree_add_text(sigcomp_udvm_tree, udvm_tvb, offset, 1, - "state_retention_priority = 0(Not in the uploaded code as UDVM buffer initialized to Zero"); - PROTO_ITEM_SET_GENERATED(item2); - } - if ( tvb_reported_length_remaining(udvm_tvb, offset) != 0 ){ - len = tvb_reported_length_remaining(udvm_tvb, offset); - UDVM_address = start_address + offset; - proto_tree_add_text(sigcomp_udvm_tree, udvm_tvb, offset, len, - "Remaining %u bytes starting at UDVM addr %u (0x%x)- State information ?",len, UDVM_address, UDVM_address); - } - offset = offset + tvb_reported_length_remaining(udvm_tvb, offset); - break; - - default: - offset = offset + tvb_reported_length_remaining(udvm_tvb, offset); - break; - } - - - } - return; + item = proto_tree_add_text(sigcomp_udvm_tree, udvm_tvb, offset, 1, + "######### UDVM instruction %u at UDVM-address %u (0x%x) #########", + instruction_no,UDVM_address,UDVM_address); + PROTO_ITEM_SET_GENERATED(item); + proto_tree_add_item(sigcomp_udvm_tree, hf_sigcomp_udvm_instr, udvm_tvb, offset, 1, FALSE); + offset ++; + switch ( instruction ) { + + case SIGCOMP_INSTR_AND: /* 1 AND ($operand_1, %operand_2) */ + /* $operand_1*/ + offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, + udvm_tvb, start_offset, len, value); + /* %operand_2*/ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, + udvm_tvb, start_offset, len, value); + } + break; + + case SIGCOMP_INSTR_OR: /* 2 OR ($operand_1, %operand_2) */ + /* $operand_1*/ + offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, + udvm_tvb, start_offset, len, value); + /* %operand_2*/ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, + udvm_tvb, start_offset, len, value); + } + break; + + case SIGCOMP_INSTR_NOT: /* 3 NOT ($operand_1) */ + /* $operand_1*/ + offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, + udvm_tvb, start_offset, len, value); + break; + + case SIGCOMP_INSTR_LSHIFT: /* 4 LSHIFT ($operand_1, %operand_2) */ + /* $operand_1*/ + offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, + udvm_tvb, start_offset, len, value); + /* %operand_2*/ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, + udvm_tvb, start_offset, len, value); + } + break; + + case SIGCOMP_INSTR_RSHIFT: /* 5 RSHIFT ($operand_1, %operand_2) */ + /* $operand_1*/ + offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, + udvm_tvb, start_offset, len, value); + /* %operand_2*/ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, + udvm_tvb, start_offset, len, value); + } + break; + + case SIGCOMP_INSTR_ADD: /* 6 ADD ($operand_1, %operand_2) */ + /* $operand_1*/ + offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, + udvm_tvb, start_offset, len, value); + /* %operand_2*/ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, + udvm_tvb, start_offset, len, value); + } + break; + + case SIGCOMP_INSTR_SUBTRACT: /* 7 SUBTRACT ($operand_1, %operand_2) */ + /* $operand_1*/ + offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, + udvm_tvb, start_offset, len, value); + /* %operand_2*/ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, + udvm_tvb, start_offset, len, value); + } + break; + + case SIGCOMP_INSTR_MULTIPLY: /* 8 MULTIPLY ($operand_1, %operand_2) */ + /* $operand_1*/ + offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, + udvm_tvb, start_offset, len, value); + /* %operand_2*/ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, + udvm_tvb, start_offset, len, value); + } + break; + + case SIGCOMP_INSTR_DIVIDE: /* 9 DIVIDE ($operand_1, %operand_2) */ + /* $operand_1*/ + offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, + udvm_tvb, start_offset, len, value); + /* %operand_2*/ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, + udvm_tvb, start_offset, len, value); + } + break; + + case SIGCOMP_INSTR_REMAINDER: /* 10 REMAINDER ($operand_1, %operand_2) */ + /* $operand_1*/ + offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, + udvm_tvb, start_offset, len, value); + /* %operand_2*/ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, + udvm_tvb, start_offset, len, value); + } + break; + case SIGCOMP_INSTR_SORT_ASCENDING: /* 11 SORT-ASCENDING (%start, %n, %k) */ + /* while programming stop while loop */ + offset = offset + tvb_reported_length_remaining(udvm_tvb, offset); + break; + + case SIGCOMP_INSTR_SORT_DESCENDING: /* 12 SORT-DESCENDING (%start, %n, %k) */ + offset = offset + tvb_reported_length_remaining(udvm_tvb, offset); + break; + case SIGCOMP_INSTR_SHA_1: /* 13 SHA-1 (%position, %length, %destination) */ + /* %position */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_position, + udvm_tvb, start_offset, len, value); + + /* %length, */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, + udvm_tvb, start_offset, len, value); + } + + /* $destination */ + offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_ref_dest, + udvm_tvb, start_offset, len, value); + break; + + case SIGCOMP_INSTR_LOAD: /* 14 LOAD (%address, %value) */ + /* %address */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_address, + udvm_tvb, start_offset, len, value); + /* %value */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_value, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_value, + udvm_tvb, start_offset, len, value); + } + break; + + case SIGCOMP_INSTR_MULTILOAD: /* 15 MULTILOAD (%address, #n, %value_0, ..., %value_n-1) */ + /* %address */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_address, + udvm_tvb, start_offset, len, value); + /* #n */ + offset = dissect_udvm_literal_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_literal_num, + udvm_tvb, start_offset, len, value); + n = value; + while ( n > 0) { + n = n -1; + /* %value */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_value, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_value, + udvm_tvb, start_offset, len, value); + } + } + break; + + case SIGCOMP_INSTR_PUSH: /* 16 PUSH (%value) */ + /* %value */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_value, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_value, + udvm_tvb, start_offset, len, value); + } + break; + + case SIGCOMP_INSTR_POP: /* 17 POP (%address) */ + /* %address */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_address, + udvm_tvb, start_offset, len, value); + break; + + case SIGCOMP_INSTR_COPY: /* 18 COPY (%position, %length, %destination) */ + /* %position */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_position, + udvm_tvb, start_offset, len, value); + + /* %length, */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, + udvm_tvb, start_offset, len, value); + } + + /* $destination */ + offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_ref_dest, + udvm_tvb, start_offset, len, value); + break; + + case SIGCOMP_INSTR_COPY_LITERAL: /* 19 COPY-LITERAL (%position, %length, $destination) */ + /* %position */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_position, + udvm_tvb, start_offset, len, value); + + /* %length, */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, + udvm_tvb, start_offset, len, value); + } + + /* $destination */ + offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_ref_dest, + udvm_tvb, start_offset, len, value); + break; + + case SIGCOMP_INSTR_COPY_OFFSET: /* 20 COPY-OFFSET (%offset, %length, $destination) */ + /* %offset */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_offset, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_offset, + udvm_tvb, start_offset, len, value); + } + + /* %length, */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, + udvm_tvb, start_offset, len, value); + } + + /* $destination */ + offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_ref_dest, + udvm_tvb, start_offset, len, value); + break; + case SIGCOMP_INSTR_MEMSET: /* 21 MEMSET (%address, %length, %start_value, %offset) */ + + /* %address */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_address, + udvm_tvb, start_offset, len, value); + + /* %length, */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, + udvm_tvb, start_offset, len, value); + } + + /* %start_value */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_start_value, + udvm_tvb, start_offset, len, value); + + /* %offset */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_offset, + udvm_tvb, start_offset, len, value); + break; + + + case SIGCOMP_INSTR_JUMP: /* 22 JUMP (@address) */ + /* @address */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ + value = ( value + UDVM_address ) & 0xffff; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, + udvm_tvb, start_offset, len, value); + break; + + case SIGCOMP_INSTR_COMPARE: /* 23 */ + /* COMPARE (%value_1, %value_2, @address_1, @address_2, @address_3) + */ + /* %value_1 */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_value, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_value, + udvm_tvb, start_offset, len, value); + } + + /* %value_2 */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_value, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_value, + udvm_tvb, start_offset, len, value); + } + + /* @address_1 */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ + value = ( value + UDVM_address ) & 0xffff; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, + udvm_tvb, start_offset, len, value); + + /* @address_2 */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ + value = ( value + UDVM_address ) & 0xffff; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, + udvm_tvb, start_offset, len, value); + + /* @address_3 */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ + value = ( value + UDVM_address ) & 0xffff; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, + udvm_tvb, start_offset, len, value); + break; + + case SIGCOMP_INSTR_CALL: /* 24 CALL (@address) (PUSH addr )*/ + /* @address */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ + value = ( value + UDVM_address ) & 0xffff; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, + udvm_tvb, start_offset, len, value); + break; + case SIGCOMP_INSTR_RETURN: /* 25 POP and return */ + + break; + + case SIGCOMP_INSTR_SWITCH: /* 26 SWITCH (#n, %j, @address_0, @address_1, ... , @address_n-1) */ + /* #n */ + offset = dissect_udvm_literal_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_literal_num, + udvm_tvb, start_offset, len, value); + + /* Number of addresses in the instruction */ + n = value; + /* %j */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_j, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_j, + udvm_tvb, start_offset, len, value); + } + + while ( n > 0) { + n = n -1; + /* @address_n-1 */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ + value = ( value + UDVM_address ) & 0xffff; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, + udvm_tvb, start_offset, len, value); + } + break; + case SIGCOMP_INSTR_CRC: /* 27 CRC (%value, %position, %length, @address) */ + /* %value */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_value, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_value, + udvm_tvb, start_offset, len, value); + } + + /* %position */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_position, + udvm_tvb, start_offset, len, value); + + /* %length */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, + udvm_tvb, start_offset, len, value); + } + + /* @address */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ + value = ( value + UDVM_address ) & 0xffff; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, + udvm_tvb, start_offset, len, value); + break; + + + case SIGCOMP_INSTR_INPUT_BYTES: /* 28 INPUT-BYTES (%length, %destination, @address) */ + /* %length */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, + udvm_tvb, start_offset, len, value); + } + + /* %destination */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_destination, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_destination, + udvm_tvb, start_offset, len, value); + } + + /* @address */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ + value = ( value + UDVM_address ) & 0xffff; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, + udvm_tvb, start_offset, len, value); + break; + case SIGCOMP_INSTR_INPUT_BITS:/* 29 INPUT-BITS (%length, %destination, @address) */ + /* %length */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, + udvm_tvb, start_offset, len, value); + } + + /* %destination */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_destination, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_destination, + udvm_tvb, start_offset, len, value); + } + + /* @address */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ + value = ( value + UDVM_address ) & 0xffff; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, + udvm_tvb, start_offset, len, value); + break; + case SIGCOMP_INSTR_INPUT_HUFFMAN: /* 30 */ + /* + * INPUT-HUFFMAN (%destination, @address, #n, %bits_1, %lower_bound_1, + * %upper_bound_1, %uncompressed_1, ... , %bits_n, %lower_bound_n, + * %upper_bound_n, %uncompressed_n) + */ + /* %destination */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ){ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_destination, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_destination, + udvm_tvb, start_offset, len, value); + } + /* @address */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ + value = ( value + UDVM_address ) & 0xffff; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, + udvm_tvb, start_offset, len, value); + /* #n */ + offset = dissect_udvm_literal_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_literal_num, + udvm_tvb, start_offset, len, value); + n = value; + while ( n > 0) { + n = n -1; + /* %bits_n */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_bits, + udvm_tvb, start_offset, len, value); + /* %lower_bound_n*/ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_lower_bound, + udvm_tvb, start_offset, len, value); + /* %upper_bound_n */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_upper_bound, + udvm_tvb, start_offset, len, value); + /* %uncompressed_n */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_uncompressed, + udvm_tvb, start_offset, len, value); + } + break; + + case SIGCOMP_INSTR_STATE_ACCESS: /* 31 */ + /* STATE-ACCESS (%partial_identifier_start, %partial_identifier_length, + * %state_begin, %state_length, %state_address, %state_instruction) + */ + + /* + * %partial_identifier_start + */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value ,&is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_partial_identifier_start, + udvm_tvb, start_offset, len, value); + + /* + * %partial_identifier_length + */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value ,&is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_partial_identifier_length, + udvm_tvb, start_offset, len, value); + /* + * %state_begin + */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_state_begin, + udvm_tvb, start_offset, len, value); + + /* + * %state_length + */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ) { + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_length_addr, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_length, + udvm_tvb, start_offset, len, value); + } + /* + * %state_address + */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value ,&is_memory_address); + len = offset - start_offset; + if ( is_memory_address ) { + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_address_addr, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_address, + udvm_tvb, start_offset, len, value); + } + /* + * %state_instruction + */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_instr, + udvm_tvb, start_offset, len, value); + break; + case SIGCOMP_INSTR_STATE_CREATE: /* 32 */ + /* + * STATE-CREATE (%state_length, %state_address, %state_instruction, + * %minimum_access_length, %state_retention_priority) + */ + + /* + * %state_length + */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ) { + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_length_addr, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_length, + udvm_tvb, start_offset, len, value); + } + /* + * %state_address + */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ) { + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_address_addr, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_address, + udvm_tvb, start_offset, len, value); + } + /* + * %state_instruction + */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_instr, + udvm_tvb, start_offset, len, value); + /* + * %minimum_access_length + */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_min_acc_len, + udvm_tvb, start_offset, len, value); + /* + * %state_retention_priority + */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_ret_pri, + udvm_tvb, start_offset, len, value); + + break; + case SIGCOMP_INSTR_STATE_FREE: /* 33 */ + /* + * STATE-FREE (%partial_identifier_start, %partial_identifier_length) + */ + /* + * %partial_identifier_start + */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_partial_identifier_start, + udvm_tvb, start_offset, len, value); + + /* + * %partial_identifier_length + */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_partial_identifier_length, + udvm_tvb, start_offset, len, value); + break; + case SIGCOMP_INSTR_OUTPUT: /* 34 OUTPUT (%output_start, %output_length) */ + /* + * %output_start + */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ) { + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_output_start, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_output_start, + udvm_tvb, start_offset, len, value); + } + /* + * %output_length + */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ) { + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_output_length_addr, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_output_length, + udvm_tvb, start_offset, len, value); + } + break; + case SIGCOMP_INSTR_END_MESSAGE: /* 35 */ + /* + * END-MESSAGE (%requested_feedback_location, + * %returned_parameters_location, %state_length, %state_address, + * %state_instruction, %minimum_access_length, + * %state_retention_priority) + */ + /* %requested_feedback_location */ + if ((msg_length-1) < offset){ + item2 = proto_tree_add_text(sigcomp_udvm_tree, udvm_tvb, 0, -1, + "All remaining parameters = 0(Not in the uploaded code as UDVM buffer initialized to Zero"); + PROTO_ITEM_SET_GENERATED(item2); + return; + } + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_req_feedback_loc, + udvm_tvb, start_offset, len, value); + /* returned_parameters_location */ + if ((msg_length-1) < offset){ + item2 = proto_tree_add_text(sigcomp_udvm_tree, udvm_tvb, offset-1, -1, + "All remaining parameters = 0(Not in the uploaded code as UDVM buffer initialized to Zero"); + PROTO_ITEM_SET_GENERATED(item2); + return; + } + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_ret_param_loc, + udvm_tvb, start_offset, len, value); + /* + * %state_length + */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ) { + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_length_addr, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_length, + udvm_tvb, start_offset, len, value); + } + /* + * %state_address + */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + if ( is_memory_address ) { + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_address_addr, + udvm_tvb, start_offset, len, value); + }else{ + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_address, + udvm_tvb, start_offset, len, value); + } + /* + * %state_instruction + */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_instr, + udvm_tvb, start_offset, len, value); + /* + * %minimum_access_length + */ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_min_acc_len, + udvm_tvb, start_offset, len, value); + /* + * %state_retention_priority + */ + if ( tvb_reported_length_remaining(udvm_tvb, offset) != 0 ){ + offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); + len = offset - start_offset; + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_ret_pri, + udvm_tvb, start_offset, len, value); + }else{ + item2 = proto_tree_add_text(sigcomp_udvm_tree, udvm_tvb, offset, 1, + "state_retention_priority = 0(Not in the uploaded code as UDVM buffer initialized to Zero"); + PROTO_ITEM_SET_GENERATED(item2); + } + if ( tvb_reported_length_remaining(udvm_tvb, offset) != 0 ){ + len = tvb_reported_length_remaining(udvm_tvb, offset); + UDVM_address = start_address + offset; + proto_tree_add_text(sigcomp_udvm_tree, udvm_tvb, offset, len, + "Remaining %u bytes starting at UDVM addr %u (0x%x)- State information ?",len, UDVM_address, UDVM_address); + } + offset = offset + tvb_reported_length_remaining(udvm_tvb, offset); + break; + + default: + offset = offset + tvb_reported_length_remaining(udvm_tvb, offset); + break; + } + + + } + return; } /* The simplest operand type is the literal (#), which encodes a * constant integer from 0 to 65535 inclusive. A literal operand may @@ -1913,61 +1912,61 @@ dissect_udvm_bytecode(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree,guint st * */ static int -dissect_udvm_literal_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree, - gint offset, gint *start_offset, guint16 *value) +dissect_udvm_literal_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree, + gint offset, gint *start_offset, guint16 *value) { - guint bytecode; - guint16 operand; - guint test_bits; - guint display_bytecode; - - bytecode = tvb_get_guint8(udvm_tvb, offset); - test_bits = bytecode >> 7; - if (test_bits == 1){ - test_bits = bytecode >> 6; - if (test_bits == 2){ - /* - * 10nnnnnn nnnnnnnn N 0 - 16383 - */ - display_bytecode = bytecode & 0xc0; - if ( display_udvm_bytecode ) - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_literal_bytecode, - udvm_tvb, offset, 1, display_bytecode); - operand = tvb_get_ntohs(udvm_tvb, offset) & 0x3fff; - *value = operand; - *start_offset = offset; - offset = offset + 2; - - }else{ - /* - * 111000000 nnnnnnnn nnnnnnnn N 0 - 65535 - */ - display_bytecode = bytecode & 0xc0; - if ( display_udvm_bytecode ) - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_literal_bytecode, - udvm_tvb, offset, 1, display_bytecode); - offset ++; - operand = tvb_get_ntohs(udvm_tvb, offset); - *value = operand; - *start_offset = offset; - offset = offset + 2; - - } - }else{ - /* - * 0nnnnnnn N 0 - 127 - */ - display_bytecode = bytecode & 0xc0; - if ( display_udvm_bytecode ) - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_literal_bytecode, - udvm_tvb, offset, 1, display_bytecode); - operand = ( bytecode & 0x7f); - *value = operand; - *start_offset = offset; - offset ++; - } - - return offset; + guint bytecode; + guint16 operand; + guint test_bits; + guint display_bytecode; + + bytecode = tvb_get_guint8(udvm_tvb, offset); + test_bits = bytecode >> 7; + if (test_bits == 1){ + test_bits = bytecode >> 6; + if (test_bits == 2){ + /* + * 10nnnnnn nnnnnnnn N 0 - 16383 + */ + display_bytecode = bytecode & 0xc0; + if ( display_udvm_bytecode ) + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_literal_bytecode, + udvm_tvb, offset, 1, display_bytecode); + operand = tvb_get_ntohs(udvm_tvb, offset) & 0x3fff; + *value = operand; + *start_offset = offset; + offset = offset + 2; + + }else{ + /* + * 111000000 nnnnnnnn nnnnnnnn N 0 - 65535 + */ + display_bytecode = bytecode & 0xc0; + if ( display_udvm_bytecode ) + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_literal_bytecode, + udvm_tvb, offset, 1, display_bytecode); + offset ++; + operand = tvb_get_ntohs(udvm_tvb, offset); + *value = operand; + *start_offset = offset; + offset = offset + 2; + + } + }else{ + /* + * 0nnnnnnn N 0 - 127 + */ + display_bytecode = bytecode & 0xc0; + if ( display_udvm_bytecode ) + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_literal_bytecode, + udvm_tvb, offset, 1, display_bytecode); + operand = ( bytecode & 0x7f); + *value = operand; + *start_offset = offset; + offset ++; + } + + return offset; } /* @@ -1985,61 +1984,61 @@ dissect_udvm_literal_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree, * Figure 9: Bytecode for a reference ($) operand */ static int -dissect_udvm_reference_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree, - gint offset, gint *start_offset, guint16 *value) +dissect_udvm_reference_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree, + gint offset, gint *start_offset, guint16 *value) { - guint bytecode; - guint16 operand; - guint test_bits; - guint display_bytecode; - - bytecode = tvb_get_guint8(udvm_tvb, offset); - test_bits = bytecode >> 7; - if (test_bits == 1){ - test_bits = bytecode >> 6; - if (test_bits == 2){ - /* - * 10nnnnnn nnnnnnnn memory[2 * N] 0 - 65535 - */ - display_bytecode = bytecode & 0xc0; - if ( display_udvm_bytecode ) - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_reference_bytecode, - udvm_tvb, offset, 1, display_bytecode); - operand = tvb_get_ntohs(udvm_tvb, offset) & 0x3fff; - *value = (operand * 2); - *start_offset = offset; - offset = offset + 2; - - }else{ - /* - * 11000000 nnnnnnnn nnnnnnnn memory[N] 0 - 65535 - */ - display_bytecode = bytecode & 0xc0; - if ( display_udvm_bytecode ) - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_reference_bytecode, - udvm_tvb, offset, 1, display_bytecode); - offset ++; - operand = tvb_get_ntohs(udvm_tvb, offset); - *value = operand; - *start_offset = offset; - offset = offset + 2; - - } - }else{ - /* - * 0nnnnnnn memory[2 * N] 0 - 65535 - */ - display_bytecode = bytecode & 0xc0; - if ( display_udvm_bytecode ) - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_reference_bytecode, - udvm_tvb, offset, 1, display_bytecode); - operand = ( bytecode & 0x7f); - *value = (operand * 2); - *start_offset = offset; - offset ++; - } - - return offset; + guint bytecode; + guint16 operand; + guint test_bits; + guint display_bytecode; + + bytecode = tvb_get_guint8(udvm_tvb, offset); + test_bits = bytecode >> 7; + if (test_bits == 1){ + test_bits = bytecode >> 6; + if (test_bits == 2){ + /* + * 10nnnnnn nnnnnnnn memory[2 * N] 0 - 65535 + */ + display_bytecode = bytecode & 0xc0; + if ( display_udvm_bytecode ) + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_reference_bytecode, + udvm_tvb, offset, 1, display_bytecode); + operand = tvb_get_ntohs(udvm_tvb, offset) & 0x3fff; + *value = (operand * 2); + *start_offset = offset; + offset = offset + 2; + + }else{ + /* + * 11000000 nnnnnnnn nnnnnnnn memory[N] 0 - 65535 + */ + display_bytecode = bytecode & 0xc0; + if ( display_udvm_bytecode ) + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_reference_bytecode, + udvm_tvb, offset, 1, display_bytecode); + offset ++; + operand = tvb_get_ntohs(udvm_tvb, offset); + *value = operand; + *start_offset = offset; + offset = offset + 2; + + } + }else{ + /* + * 0nnnnnnn memory[2 * N] 0 - 65535 + */ + display_bytecode = bytecode & 0xc0; + if ( display_udvm_bytecode ) + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_reference_bytecode, + udvm_tvb, offset, 1, display_bytecode); + operand = ( bytecode & 0x7f); + *value = (operand * 2); + *start_offset = offset; + offset ++; + } + + return offset; } /* @@ -2054,200 +2053,200 @@ dissect_udvm_reference_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree * TODO calculate correct value for operand in case of ADDR */ static int -dissect_udvm_multitype_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree, - gint offset, gboolean is_addr _U_, gint *start_offset, guint16 *value, gboolean *is_memory_address ) +dissect_udvm_multitype_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree, + gint offset, gboolean is_addr _U_, gint *start_offset, guint16 *value, gboolean *is_memory_address ) { - guint bytecode; - guint display_bytecode; - guint16 operand; - guint32 result; - guint test_bits; - /* RFC3320 - * Figure 10: Bytecode for a multitype (%) operand - * Bytecode: Operand value: Range: HEX val - * 00nnnnnn N 0 - 63 0x00 - * 01nnnnnn memory[2 * N] 0 - 65535 0x40 - * 1000011n 2 ^ (N + 6) 64 , 128 0x86 - * 10001nnn 2 ^ (N + 8) 256 , ... , 32768 0x88 - * 111nnnnn N + 65504 65504 - 65535 0xe0 - * 1001nnnn nnnnnnnn N + 61440 61440 - 65535 0x90 - * 101nnnnn nnnnnnnn N 0 - 8191 0xa0 - * 110nnnnn nnnnnnnn memory[N] 0 - 65535 0xc0 - * 10000000 nnnnnnnn nnnnnnnn N 0 - 65535 0x80 - * 10000001 nnnnnnnn nnnnnnnn memory[N] 0 - 65535 0x81 - */ - *is_memory_address = FALSE; - bytecode = tvb_get_guint8(udvm_tvb, offset); - test_bits = ( bytecode & 0xc0 ) >> 6; - switch (test_bits ){ - case 0: - /* - * 00nnnnnn N 0 - 63 - */ - display_bytecode = bytecode & 0xc0; - if ( display_udvm_bytecode ) - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, - udvm_tvb, offset, 1, display_bytecode); - operand = ( bytecode & 0x3f); - *value = operand; - *start_offset = offset; - offset ++; - break; - case 1: - /* - * 01nnnnnn memory[2 * N] 0 - 65535 - */ - display_bytecode = bytecode & 0xc0; - if ( display_udvm_bytecode ) - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, - udvm_tvb, offset, 1, display_bytecode); - operand = ( bytecode & 0x3f) * 2; - *is_memory_address = TRUE; - *value = operand; - *start_offset = offset; - offset ++; - break; - case 2: - /* Check tree most significant bits */ - test_bits = ( bytecode & 0xe0 ) >> 5; - if ( test_bits == 5 ){ - /* - * 101nnnnn nnnnnnnn N 0 - 8191 - */ - display_bytecode = bytecode & 0xe0; - if ( display_udvm_bytecode ) - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, - udvm_tvb, offset, 1, display_bytecode); - operand = tvb_get_ntohs(udvm_tvb, offset) & 0x1fff; - *value = operand; - *start_offset = offset; - offset = offset + 2; - }else{ - test_bits = ( bytecode & 0xf0 ) >> 4; - if ( test_bits == 9 ){ - /* - * 1001nnnn nnnnnnnn N + 61440 61440 - 65535 - */ - display_bytecode = bytecode & 0xf0; - if ( display_udvm_bytecode ) - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, - udvm_tvb, offset, 1, display_bytecode); - operand = (tvb_get_ntohs(udvm_tvb, offset) & 0x0fff) + 61440; - *start_offset = offset; - *value = operand; - offset = offset + 2; - }else{ - test_bits = ( bytecode & 0x08 ) >> 3; - if ( test_bits == 1){ - /* - * 10001nnn 2 ^ (N + 8) 256 , ... , 32768 - */ - display_bytecode = bytecode & 0xf8; - if ( display_udvm_bytecode ) - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, - udvm_tvb, offset, 1, display_bytecode); - result = (guint32)pow(2,( bytecode & 0x07) + 8); - operand = result & 0xffff; - *start_offset = offset; - *value = operand; - offset ++; - }else{ - test_bits = ( bytecode & 0x0e ) >> 1; - if ( test_bits == 3 ){ - /* - * 1000 011n 2 ^ (N + 6) 64 , 128 - */ - display_bytecode = bytecode & 0xfe; - if ( display_udvm_bytecode ) - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, - udvm_tvb, offset, 1, display_bytecode); - result = (guint32)pow(2,( bytecode & 0x01) + 6); - operand = result & 0xffff; - *start_offset = offset; - *value = operand; - offset ++; - }else{ - /* - * 1000 0000 nnnnnnnn nnnnnnnn N 0 - 65535 - * 1000 0001 nnnnnnnn nnnnnnnn memory[N] 0 - 65535 - */ - display_bytecode = bytecode; - if ( display_udvm_bytecode ) - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, - udvm_tvb, offset, 1, display_bytecode); - if ( (bytecode & 0x01) == 1 ) - *is_memory_address = TRUE; - offset ++; - operand = tvb_get_ntohs(udvm_tvb, offset); - *value = operand; - *start_offset = offset; - offset = offset +2; - } - - - } - } - } - break; - - case 3: - test_bits = ( bytecode & 0x20 ) >> 5; - if ( test_bits == 1 ){ - /* - * 111nnnnn N + 65504 65504 - 65535 - */ - display_bytecode = bytecode & 0xe0; - if ( display_udvm_bytecode ) - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, - udvm_tvb, offset, 1, display_bytecode); - operand = ( bytecode & 0x1f) + 65504; - *start_offset = offset; - *value = operand; - offset ++; - }else{ - /* - * 110nnnnn nnnnnnnn memory[N] 0 - 65535 - */ - display_bytecode = bytecode & 0xe0; - if ( display_udvm_bytecode ) - proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, - udvm_tvb, offset, 1, display_bytecode); - operand = (tvb_get_ntohs(udvm_tvb, offset) & 0x1fff); - *is_memory_address = TRUE; - *start_offset = offset; - *value = operand; - offset = offset +2; - } - - default : - break; - } - return offset; + guint bytecode; + guint display_bytecode; + guint16 operand; + guint32 result; + guint test_bits; + /* RFC3320 + * Figure 10: Bytecode for a multitype (%) operand + * Bytecode: Operand value: Range: HEX val + * 00nnnnnn N 0 - 63 0x00 + * 01nnnnnn memory[2 * N] 0 - 65535 0x40 + * 1000011n 2 ^ (N + 6) 64 , 128 0x86 + * 10001nnn 2 ^ (N + 8) 256 , ... , 32768 0x88 + * 111nnnnn N + 65504 65504 - 65535 0xe0 + * 1001nnnn nnnnnnnn N + 61440 61440 - 65535 0x90 + * 101nnnnn nnnnnnnn N 0 - 8191 0xa0 + * 110nnnnn nnnnnnnn memory[N] 0 - 65535 0xc0 + * 10000000 nnnnnnnn nnnnnnnn N 0 - 65535 0x80 + * 10000001 nnnnnnnn nnnnnnnn memory[N] 0 - 65535 0x81 + */ + *is_memory_address = FALSE; + bytecode = tvb_get_guint8(udvm_tvb, offset); + test_bits = ( bytecode & 0xc0 ) >> 6; + switch (test_bits ){ + case 0: + /* + * 00nnnnnn N 0 - 63 + */ + display_bytecode = bytecode & 0xc0; + if ( display_udvm_bytecode ) + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, + udvm_tvb, offset, 1, display_bytecode); + operand = ( bytecode & 0x3f); + *value = operand; + *start_offset = offset; + offset ++; + break; + case 1: + /* + * 01nnnnnn memory[2 * N] 0 - 65535 + */ + display_bytecode = bytecode & 0xc0; + if ( display_udvm_bytecode ) + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, + udvm_tvb, offset, 1, display_bytecode); + operand = ( bytecode & 0x3f) * 2; + *is_memory_address = TRUE; + *value = operand; + *start_offset = offset; + offset ++; + break; + case 2: + /* Check tree most significant bits */ + test_bits = ( bytecode & 0xe0 ) >> 5; + if ( test_bits == 5 ){ + /* + * 101nnnnn nnnnnnnn N 0 - 8191 + */ + display_bytecode = bytecode & 0xe0; + if ( display_udvm_bytecode ) + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, + udvm_tvb, offset, 1, display_bytecode); + operand = tvb_get_ntohs(udvm_tvb, offset) & 0x1fff; + *value = operand; + *start_offset = offset; + offset = offset + 2; + }else{ + test_bits = ( bytecode & 0xf0 ) >> 4; + if ( test_bits == 9 ){ + /* + * 1001nnnn nnnnnnnn N + 61440 61440 - 65535 + */ + display_bytecode = bytecode & 0xf0; + if ( display_udvm_bytecode ) + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, + udvm_tvb, offset, 1, display_bytecode); + operand = (tvb_get_ntohs(udvm_tvb, offset) & 0x0fff) + 61440; + *start_offset = offset; + *value = operand; + offset = offset + 2; + }else{ + test_bits = ( bytecode & 0x08 ) >> 3; + if ( test_bits == 1){ + /* + * 10001nnn 2 ^ (N + 8) 256 , ... , 32768 + */ + display_bytecode = bytecode & 0xf8; + if ( display_udvm_bytecode ) + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, + udvm_tvb, offset, 1, display_bytecode); + result = (guint32)pow(2,( bytecode & 0x07) + 8); + operand = result & 0xffff; + *start_offset = offset; + *value = operand; + offset ++; + }else{ + test_bits = ( bytecode & 0x0e ) >> 1; + if ( test_bits == 3 ){ + /* + * 1000 011n 2 ^ (N + 6) 64 , 128 + */ + display_bytecode = bytecode & 0xfe; + if ( display_udvm_bytecode ) + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, + udvm_tvb, offset, 1, display_bytecode); + result = (guint32)pow(2,( bytecode & 0x01) + 6); + operand = result & 0xffff; + *start_offset = offset; + *value = operand; + offset ++; + }else{ + /* + * 1000 0000 nnnnnnnn nnnnnnnn N 0 - 65535 + * 1000 0001 nnnnnnnn nnnnnnnn memory[N] 0 - 65535 + */ + display_bytecode = bytecode; + if ( display_udvm_bytecode ) + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, + udvm_tvb, offset, 1, display_bytecode); + if ( (bytecode & 0x01) == 1 ) + *is_memory_address = TRUE; + offset ++; + operand = tvb_get_ntohs(udvm_tvb, offset); + *value = operand; + *start_offset = offset; + offset = offset +2; + } + + + } + } + } + break; + + case 3: + test_bits = ( bytecode & 0x20 ) >> 5; + if ( test_bits == 1 ){ + /* + * 111nnnnn N + 65504 65504 - 65535 + */ + display_bytecode = bytecode & 0xe0; + if ( display_udvm_bytecode ) + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, + udvm_tvb, offset, 1, display_bytecode); + operand = ( bytecode & 0x1f) + 65504; + *start_offset = offset; + *value = operand; + offset ++; + }else{ + /* + * 110nnnnn nnnnnnnn memory[N] 0 - 65535 + */ + display_bytecode = bytecode & 0xe0; + if ( display_udvm_bytecode ) + proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, + udvm_tvb, offset, 1, display_bytecode); + operand = (tvb_get_ntohs(udvm_tvb, offset) & 0x1fff); + *is_memory_address = TRUE; + *start_offset = offset; + *value = operand; + offset = offset +2; + } + + default : + break; + } + return offset; } static void tvb_raw_text_add(tvbuff_t *tvb, proto_tree *tree) { - proto_tree *raw_tree = NULL; - proto_item *ti = NULL; - int offset, next_offset, linelen; - - if(tree) { - ti = proto_tree_add_item(tree, proto_raw_sigcomp, tvb, 0, -1, FALSE); - raw_tree = proto_item_add_subtree(ti, ett_raw_text); - } - - offset = 0; - - while (tvb_offset_exists(tvb, offset)) { - tvb_find_line_end(tvb, offset, -1, &next_offset, FALSE); - linelen = next_offset - offset; - if(raw_tree) { - proto_tree_add_text(raw_tree, tvb, offset, linelen, - "%s", tvb_format_text(tvb, offset, linelen)); - } - offset = next_offset; - } + proto_tree *raw_tree = NULL; + proto_item *ti = NULL; + int offset, next_offset, linelen; + + if(tree) { + ti = proto_tree_add_item(tree, proto_raw_sigcomp, tvb, 0, -1, FALSE); + raw_tree = proto_item_add_subtree(ti, ett_raw_text); + } + + offset = 0; + + while (tvb_offset_exists(tvb, offset)) { + tvb_find_line_end(tvb, offset, -1, &next_offset, FALSE); + linelen = next_offset - offset; + if(raw_tree) { + proto_tree_add_text(raw_tree, tvb, offset, linelen, + "%s", tvb_format_text(tvb, offset, linelen)); + } + offset = next_offset; + } } /* Register the protocol with Wireshark */ @@ -2260,36 +2259,36 @@ tvb_raw_text_add(tvbuff_t *tvb, proto_tree *tree) void proto_reg_handoff_sigcomp(void) { - static dissector_handle_t sigcomp_handle; - static dissector_handle_t sigcomp_tcp_handle; - static gboolean Initialized=FALSE; - static guint udp_port1; - static guint udp_port2; - static guint tcp_port1; - static guint tcp_port2; - - if (!Initialized) { - sigcomp_handle = find_dissector("sigcomp"); - sigcomp_tcp_handle = new_create_dissector_handle(dissect_sigcomp_tcp,proto_sigcomp); - sip_handle = find_dissector("sip"); - Initialized=TRUE; - }else{ - dissector_delete_uint("udp.port", udp_port1, sigcomp_handle); - dissector_delete_uint("udp.port", udp_port2, sigcomp_handle); - dissector_delete_uint("tcp.port", tcp_port1, sigcomp_tcp_handle); - dissector_delete_uint("tcp.port", tcp_port2, sigcomp_tcp_handle); - } - - udp_port1 = SigCompUDPPort1; - udp_port2 = SigCompUDPPort2; - tcp_port1 = SigCompTCPPort1; - tcp_port2 = SigCompTCPPort2; - - - dissector_add_uint("udp.port", SigCompUDPPort1, sigcomp_handle); - dissector_add_uint("udp.port", SigCompUDPPort2, sigcomp_handle); - dissector_add_uint("tcp.port", SigCompTCPPort1, sigcomp_tcp_handle); - dissector_add_uint("tcp.port", SigCompTCPPort2, sigcomp_tcp_handle); + static dissector_handle_t sigcomp_handle; + static dissector_handle_t sigcomp_tcp_handle; + static gboolean Initialized=FALSE; + static guint udp_port1; + static guint udp_port2; + static guint tcp_port1; + static guint tcp_port2; + + if (!Initialized) { + sigcomp_handle = find_dissector("sigcomp"); + sigcomp_tcp_handle = new_create_dissector_handle(dissect_sigcomp_tcp,proto_sigcomp); + sip_handle = find_dissector("sip"); + Initialized=TRUE; + }else{ + dissector_delete_uint("udp.port", udp_port1, sigcomp_handle); + dissector_delete_uint("udp.port", udp_port2, sigcomp_handle); + dissector_delete_uint("tcp.port", tcp_port1, sigcomp_tcp_handle); + dissector_delete_uint("tcp.port", tcp_port2, sigcomp_tcp_handle); + } + + udp_port1 = SigCompUDPPort1; + udp_port2 = SigCompUDPPort2; + tcp_port1 = SigCompTCPPort1; + tcp_port2 = SigCompTCPPort2; + + + dissector_add_uint("udp.port", SigCompUDPPort1, sigcomp_handle); + dissector_add_uint("udp.port", SigCompUDPPort2, sigcomp_handle); + dissector_add_uint("tcp.port", SigCompTCPPort1, sigcomp_tcp_handle); + dissector_add_uint("tcp.port", SigCompTCPPort2, sigcomp_tcp_handle); } @@ -2299,414 +2298,414 @@ proto_reg_handoff_sigcomp(void) void proto_register_sigcomp(void) -{ +{ /* Setup list of header fields See Section 1.6.1 for details*/ - static hf_register_info hf[] = { - { &hf_sigcomp_t_bit, - { "T bit", "sigcomp.t.bit", - FT_UINT8, BASE_DEC, NULL, 0x04, - "Sigcomp T bit", HFILL } - }, - { &hf_sigcomp_len, - { "Partial state id length","sigcomp.length", - FT_UINT8, BASE_HEX, VALS(length_encoding_vals), 0x03, - "Sigcomp length", HFILL } - }, - { &hf_sigcomp_returned_feedback_item, - { "Returned_feedback item", "sigcomp.returned.feedback.item", - FT_BYTES, BASE_NONE, NULL, 0x0, - "Returned feedback item", HFILL } - }, - { &hf_sigcomp_partial_state, - { "Partial state identifier", "sigcomp.partial.state.identifier", - FT_STRING, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, - { &hf_sigcomp_remaining_message_bytes, - { "Remaining SigComp message bytes", "sigcomp.remaining-bytes", - FT_UINT32, BASE_DEC, NULL, 0x0, - "Number of bytes remaining in message", HFILL } - }, - { &hf_sigcomp_compression_ratio, - { "Compression ratio (%)", "sigcomp.compression-ratio", - FT_UINT32, BASE_DEC, NULL, 0x0, - "Compression ratio (decompressed / compressed) %", HFILL } - }, - { &hf_sigcomp_returned_feedback_item_len, - { "Returned feedback item length", "sigcomp.returned.feedback.item.len", - FT_UINT8, BASE_DEC, NULL, 0x7f, - NULL, HFILL } - }, - { &hf_sigcomp_code_len, - { "Code length","sigcomp.code.len", - FT_UINT16, BASE_HEX, NULL, 0xfff0, - NULL, HFILL } - }, - { &hf_sigcomp_destination, - { "Destination","sigcomp.destination", - FT_UINT8, BASE_HEX, VALS(destination_address_encoding_vals), 0xf, - NULL, HFILL } - }, - { &hf_sigcomp_udvm_bytecode, - { "Uploaded UDVM bytecode","sigcomp.udvm.byte-code", - FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, - { &hf_sigcomp_udvm_instr, - { "UDVM instruction code","sigcomp.udvm.instr", - FT_UINT8, BASE_DEC, VALS(udvm_instruction_code_vals), 0x0, - NULL, HFILL } - }, - { &hf_udvm_execution_trace, - { "UDVM execution trace","sigcomp.udvm.execution-trace", - FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL } - }, - { &hf_udvm_multitype_bytecode, - { "UDVM bytecode", "sigcomp.udvm.multyt.bytecode", - FT_UINT8, BASE_HEX, VALS(display_bytecode_vals), 0x0, - NULL, HFILL } - }, - { &hf_udvm_reference_bytecode, - { "UDVM bytecode", "sigcomp.udvm.ref.bytecode", - FT_UINT8, BASE_HEX, VALS(display_ref_bytecode_vals), 0x0, - NULL, HFILL } - }, - { &hf_udvm_literal_bytecode, - { "UDVM bytecode", "sigcomp.udvm.lit.bytecode", - FT_UINT8, BASE_HEX, VALS(display_lit_bytecode_vals), 0x0, - NULL, HFILL } - }, - { &hf_udvm_operand, - { "UDVM operand", "sigcomp.udvm.operand", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - { &hf_udvm_length, - { "%Length", "sigcomp.udvm.length", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Length", HFILL } - }, - { &hf_udvm_addr_length, - { "%Length[memory address]", "sigcomp.udvm.addr.length", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Length", HFILL } - }, - { &hf_udvm_destination, - { "%Destination", "sigcomp.udvm.destination", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Destination", HFILL } - }, - { &hf_udvm_addr_destination, - { "%Destination[memory address]", "sigcomp.udvm.addr.destination", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Destination", HFILL } - }, - { &hf_udvm_at_address, - { "@Address(mem_add_of_inst + D) mod 2^16)", "sigcomp.udvm.at.address", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Address", HFILL } - }, - { &hf_udvm_address, - { "%Address", "sigcomp.udvm.length", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Address", HFILL } - }, - { &hf_udvm_literal_num, - { "#n", "sigcomp.udvm.literal-num", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Literal number", HFILL } - }, - { &hf_udvm_value, - { "%Value", "sigcomp.udvm.value", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Value", HFILL } - }, - { &hf_udvm_addr_value, - { "%Value[memory address]", "sigcomp.udvm.value", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Value", HFILL } - }, - { &hf_partial_identifier_start, - { "%Partial identifier start", "sigcomp.udvm.partial.identifier.start", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Partial identifier start", HFILL } - }, - { &hf_partial_identifier_length, - { "%Partial identifier length", "sigcomp.udvm.partial.identifier.length", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Partial identifier length", HFILL } - }, - { &hf_state_begin, - { "%State begin", "sigcomp.udvm.state.begin", - FT_UINT16, BASE_DEC, NULL, 0x0, - "State begin", HFILL } - }, - { &hf_udvm_state_length, - { "%State length", "sigcomp.udvm.state.length", - FT_UINT16, BASE_DEC, NULL, 0x0, - "State length", HFILL } - }, - - { &hf_udvm_state_length_addr, - { "%State length[memory address]", "sigcomp.udvm.state.length.addr", - FT_UINT16, BASE_DEC, NULL, 0x0, - "State length", HFILL } - }, - { &hf_udvm_state_address, - { "%State address", "sigcomp.udvm.start.address", - FT_UINT16, BASE_DEC, NULL, 0x0, - "State address", HFILL } - }, - { &hf_udvm_state_address_addr, - { "%State address[memory address]", "sigcomp.udvm.start.address.addr", - FT_UINT16, BASE_DEC, NULL, 0x0, - "State address", HFILL } - }, - { &hf_udvm_state_instr, - { "%State instruction", "sigcomp.udvm.start.instr", - FT_UINT16, BASE_DEC, NULL, 0x0, - "State instruction", HFILL } - }, - { &hf_udvm_operand_1, - { "$Operand 1[memory address]", "sigcomp.udvm.operand.1", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Reference $ Operand 1", HFILL } - }, - { &hf_udvm_operand_2, - { "%Operand 2", "sigcomp.udvm.operand.2", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Operand 2", HFILL } - }, - { &hf_udvm_operand_2_addr, - { "%Operand 2[memory address]", "sigcomp.udvm.operand.2.addr", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Operand 2", HFILL } - }, - { &hf_udvm_j, - { "%j", "sigcomp.udvm.j", - FT_UINT16, BASE_DEC, NULL, 0x0, - "j", HFILL } - }, - { &hf_udvm_addr_j, - { "%j[memory address]", "sigcomp.udvm.addr.j", - FT_UINT16, BASE_DEC, NULL, 0x0, - "j", HFILL } - }, - { &hf_udvm_output_start, - { "%Output_start", "sigcomp.output.start", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Output start", HFILL } - }, - { &hf_udvm_addr_output_start, - { "%Output_start[memory address]", "sigcomp.addr.output.start", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Output start", HFILL } - }, - { &hf_udvm_output_length, - { "%Output_length", "sigcomp.output.length", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Output length", HFILL } - }, - { &hf_udvm_output_length_addr, - { "%Output_length[memory address]", "sigcomp.output.length.addr", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Output length", HFILL } - }, - { &hf_udvm_req_feedback_loc, - { "%Requested feedback location", "sigcomp.req.feedback.loc", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Requested feedback location", HFILL } - }, - { &hf_udvm_min_acc_len, - { "%Minimum access length", "sigcomp.min.acc.len", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Minimum access length", HFILL } - }, - { &hf_udvm_state_ret_pri, - { "%State retention priority", "sigcomp.udvm.state.ret.pri", - FT_UINT16, BASE_DEC, NULL, 0x0, - "State retention priority", HFILL } - }, - { &hf_udvm_ret_param_loc, - { "%Returned parameters location", "sigcomp.ret.param.loc", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Returned parameters location", HFILL } - }, - { &hf_udvm_position, - { "%Position", "sigcomp.udvm.position", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Position", HFILL } - }, - { &hf_udvm_ref_dest, - { "$Destination[memory address]", "sigcomp.udvm.ref.destination", - FT_UINT16, BASE_DEC, NULL, 0x0, - "(reference)Destination", HFILL } - }, - { &hf_udvm_bits, - { "%Bits", "sigcomp.udvm.bits", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Bits", HFILL } - }, - { &hf_udvm_lower_bound, - { "%Lower bound", "sigcomp.udvm.lower.bound", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Lower_bound", HFILL } - }, - { &hf_udvm_upper_bound, - { "%Upper bound", "sigcomp.udvm.upper.bound", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Upper bound", HFILL } - }, - { &hf_udvm_uncompressed, - { "%Uncompressed", "sigcomp.udvm.uncompressed", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Uncompressed", HFILL } - }, - { &hf_udvm_start_value, - { "%Start value", "sigcomp.udvm.start.value", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Start value", HFILL } - }, - { &hf_udvm_offset, - { "%Offset", "sigcomp.udvm.offset", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Offset", HFILL } - }, - { &hf_udvm_addr_offset, - { "%Offset[memory address]", "sigcomp.udvm.addr.offset", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Offset", HFILL } - }, - { &hf_sigcomp_nack_ver, - { "NACK Version", "sigcomp.nack.ver", - FT_UINT8, BASE_DEC, NULL, 0x0f, - NULL, HFILL } - }, - { &hf_sigcomp_nack_reason_code, - { "Reason Code", "sigcomp.nack.reason", - FT_UINT8, BASE_DEC, VALS(sigcomp_nack_reason_code_vals), 0x0, - "NACK Reason Code", HFILL } - }, - { &hf_sigcomp_nack_failed_op_code, - { "OPCODE of failed instruction", "sigcomp.nack.failed_op_code", - FT_UINT8, BASE_DEC, VALS(udvm_instruction_code_vals), 0x0, - "NACK OPCODE of failed instruction", HFILL } - }, - { &hf_sigcomp_nack_pc, - { "PC of failed instruction", "sigcomp.nack.pc", - FT_UINT16, BASE_DEC, NULL, 0x0, - "NACK PC of failed instruction", HFILL } - }, - { &hf_sigcomp_nack_sha1, - { "SHA-1 Hash of failed message", "sigcomp.nack.sha1", - FT_BYTES, BASE_NONE, NULL, 0x0, - "NACK SHA-1 Hash of failed message", HFILL } - }, - { &hf_sigcomp_nack_state_id, - { "State ID (6 - 20 bytes)", "sigcomp.nack.state_id", - FT_BYTES, BASE_NONE, NULL, 0x0, - "NACK State ID (6 - 20 bytes)", HFILL } - }, - { &hf_sigcomp_nack_cycles_per_bit, - { "Cycles Per Bit", "sigcomp.nack.cycles_per_bit", - FT_UINT8, BASE_DEC, NULL, 0x0, - "NACK Cycles Per Bit", HFILL } - }, - { &hf_sigcomp_nack_memory_size, - { "Memory size", "sigcomp.memory_size", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL } - }, - }; + static hf_register_info hf[] = { + { &hf_sigcomp_t_bit, + { "T bit", "sigcomp.t.bit", + FT_UINT8, BASE_DEC, NULL, 0x04, + "Sigcomp T bit", HFILL } + }, + { &hf_sigcomp_len, + { "Partial state id length","sigcomp.length", + FT_UINT8, BASE_HEX, VALS(length_encoding_vals), 0x03, + "Sigcomp length", HFILL } + }, + { &hf_sigcomp_returned_feedback_item, + { "Returned_feedback item", "sigcomp.returned.feedback.item", + FT_BYTES, BASE_NONE, NULL, 0x0, + "Returned feedback item", HFILL } + }, + { &hf_sigcomp_partial_state, + { "Partial state identifier", "sigcomp.partial.state.identifier", + FT_STRING, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_sigcomp_remaining_message_bytes, + { "Remaining SigComp message bytes", "sigcomp.remaining-bytes", + FT_UINT32, BASE_DEC, NULL, 0x0, + "Number of bytes remaining in message", HFILL } + }, + { &hf_sigcomp_compression_ratio, + { "Compression ratio (%)", "sigcomp.compression-ratio", + FT_UINT32, BASE_DEC, NULL, 0x0, + "Compression ratio (decompressed / compressed) %", HFILL } + }, + { &hf_sigcomp_returned_feedback_item_len, + { "Returned feedback item length", "sigcomp.returned.feedback.item.len", + FT_UINT8, BASE_DEC, NULL, 0x7f, + NULL, HFILL } + }, + { &hf_sigcomp_code_len, + { "Code length","sigcomp.code.len", + FT_UINT16, BASE_HEX, NULL, 0xfff0, + NULL, HFILL } + }, + { &hf_sigcomp_destination, + { "Destination","sigcomp.destination", + FT_UINT8, BASE_HEX, VALS(destination_address_encoding_vals), 0xf, + NULL, HFILL } + }, + { &hf_sigcomp_udvm_bytecode, + { "Uploaded UDVM bytecode","sigcomp.udvm.byte-code", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_sigcomp_udvm_instr, + { "UDVM instruction code","sigcomp.udvm.instr", + FT_UINT8, BASE_DEC, VALS(udvm_instruction_code_vals), 0x0, + NULL, HFILL } + }, + { &hf_udvm_execution_trace, + { "UDVM execution trace","sigcomp.udvm.execution-trace", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_udvm_multitype_bytecode, + { "UDVM bytecode", "sigcomp.udvm.multyt.bytecode", + FT_UINT8, BASE_HEX, VALS(display_bytecode_vals), 0x0, + NULL, HFILL } + }, + { &hf_udvm_reference_bytecode, + { "UDVM bytecode", "sigcomp.udvm.ref.bytecode", + FT_UINT8, BASE_HEX, VALS(display_ref_bytecode_vals), 0x0, + NULL, HFILL } + }, + { &hf_udvm_literal_bytecode, + { "UDVM bytecode", "sigcomp.udvm.lit.bytecode", + FT_UINT8, BASE_HEX, VALS(display_lit_bytecode_vals), 0x0, + NULL, HFILL } + }, + { &hf_udvm_operand, + { "UDVM operand", "sigcomp.udvm.operand", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_udvm_length, + { "%Length", "sigcomp.udvm.length", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Length", HFILL } + }, + { &hf_udvm_addr_length, + { "%Length[memory address]", "sigcomp.udvm.addr.length", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Length", HFILL } + }, + { &hf_udvm_destination, + { "%Destination", "sigcomp.udvm.destination", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Destination", HFILL } + }, + { &hf_udvm_addr_destination, + { "%Destination[memory address]", "sigcomp.udvm.addr.destination", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Destination", HFILL } + }, + { &hf_udvm_at_address, + { "@Address(mem_add_of_inst + D) mod 2^16)", "sigcomp.udvm.at.address", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Address", HFILL } + }, + { &hf_udvm_address, + { "%Address", "sigcomp.udvm.length", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Address", HFILL } + }, + { &hf_udvm_literal_num, + { "#n", "sigcomp.udvm.literal-num", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Literal number", HFILL } + }, + { &hf_udvm_value, + { "%Value", "sigcomp.udvm.value", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Value", HFILL } + }, + { &hf_udvm_addr_value, + { "%Value[memory address]", "sigcomp.udvm.value", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Value", HFILL } + }, + { &hf_partial_identifier_start, + { "%Partial identifier start", "sigcomp.udvm.partial.identifier.start", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Partial identifier start", HFILL } + }, + { &hf_partial_identifier_length, + { "%Partial identifier length", "sigcomp.udvm.partial.identifier.length", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Partial identifier length", HFILL } + }, + { &hf_state_begin, + { "%State begin", "sigcomp.udvm.state.begin", + FT_UINT16, BASE_DEC, NULL, 0x0, + "State begin", HFILL } + }, + { &hf_udvm_state_length, + { "%State length", "sigcomp.udvm.state.length", + FT_UINT16, BASE_DEC, NULL, 0x0, + "State length", HFILL } + }, + + { &hf_udvm_state_length_addr, + { "%State length[memory address]", "sigcomp.udvm.state.length.addr", + FT_UINT16, BASE_DEC, NULL, 0x0, + "State length", HFILL } + }, + { &hf_udvm_state_address, + { "%State address", "sigcomp.udvm.start.address", + FT_UINT16, BASE_DEC, NULL, 0x0, + "State address", HFILL } + }, + { &hf_udvm_state_address_addr, + { "%State address[memory address]", "sigcomp.udvm.start.address.addr", + FT_UINT16, BASE_DEC, NULL, 0x0, + "State address", HFILL } + }, + { &hf_udvm_state_instr, + { "%State instruction", "sigcomp.udvm.start.instr", + FT_UINT16, BASE_DEC, NULL, 0x0, + "State instruction", HFILL } + }, + { &hf_udvm_operand_1, + { "$Operand 1[memory address]", "sigcomp.udvm.operand.1", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Reference $ Operand 1", HFILL } + }, + { &hf_udvm_operand_2, + { "%Operand 2", "sigcomp.udvm.operand.2", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Operand 2", HFILL } + }, + { &hf_udvm_operand_2_addr, + { "%Operand 2[memory address]", "sigcomp.udvm.operand.2.addr", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Operand 2", HFILL } + }, + { &hf_udvm_j, + { "%j", "sigcomp.udvm.j", + FT_UINT16, BASE_DEC, NULL, 0x0, + "j", HFILL } + }, + { &hf_udvm_addr_j, + { "%j[memory address]", "sigcomp.udvm.addr.j", + FT_UINT16, BASE_DEC, NULL, 0x0, + "j", HFILL } + }, + { &hf_udvm_output_start, + { "%Output_start", "sigcomp.output.start", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Output start", HFILL } + }, + { &hf_udvm_addr_output_start, + { "%Output_start[memory address]", "sigcomp.addr.output.start", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Output start", HFILL } + }, + { &hf_udvm_output_length, + { "%Output_length", "sigcomp.output.length", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Output length", HFILL } + }, + { &hf_udvm_output_length_addr, + { "%Output_length[memory address]", "sigcomp.output.length.addr", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Output length", HFILL } + }, + { &hf_udvm_req_feedback_loc, + { "%Requested feedback location", "sigcomp.req.feedback.loc", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Requested feedback location", HFILL } + }, + { &hf_udvm_min_acc_len, + { "%Minimum access length", "sigcomp.min.acc.len", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Minimum access length", HFILL } + }, + { &hf_udvm_state_ret_pri, + { "%State retention priority", "sigcomp.udvm.state.ret.pri", + FT_UINT16, BASE_DEC, NULL, 0x0, + "State retention priority", HFILL } + }, + { &hf_udvm_ret_param_loc, + { "%Returned parameters location", "sigcomp.ret.param.loc", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Returned parameters location", HFILL } + }, + { &hf_udvm_position, + { "%Position", "sigcomp.udvm.position", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Position", HFILL } + }, + { &hf_udvm_ref_dest, + { "$Destination[memory address]", "sigcomp.udvm.ref.destination", + FT_UINT16, BASE_DEC, NULL, 0x0, + "(reference)Destination", HFILL } + }, + { &hf_udvm_bits, + { "%Bits", "sigcomp.udvm.bits", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Bits", HFILL } + }, + { &hf_udvm_lower_bound, + { "%Lower bound", "sigcomp.udvm.lower.bound", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Lower_bound", HFILL } + }, + { &hf_udvm_upper_bound, + { "%Upper bound", "sigcomp.udvm.upper.bound", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Upper bound", HFILL } + }, + { &hf_udvm_uncompressed, + { "%Uncompressed", "sigcomp.udvm.uncompressed", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Uncompressed", HFILL } + }, + { &hf_udvm_start_value, + { "%Start value", "sigcomp.udvm.start.value", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Start value", HFILL } + }, + { &hf_udvm_offset, + { "%Offset", "sigcomp.udvm.offset", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Offset", HFILL } + }, + { &hf_udvm_addr_offset, + { "%Offset[memory address]", "sigcomp.udvm.addr.offset", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Offset", HFILL } + }, + { &hf_sigcomp_nack_ver, + { "NACK Version", "sigcomp.nack.ver", + FT_UINT8, BASE_DEC, NULL, 0x0f, + NULL, HFILL } + }, + { &hf_sigcomp_nack_reason_code, + { "Reason Code", "sigcomp.nack.reason", + FT_UINT8, BASE_DEC, VALS(sigcomp_nack_reason_code_vals), 0x0, + "NACK Reason Code", HFILL } + }, + { &hf_sigcomp_nack_failed_op_code, + { "OPCODE of failed instruction", "sigcomp.nack.failed_op_code", + FT_UINT8, BASE_DEC, VALS(udvm_instruction_code_vals), 0x0, + "NACK OPCODE of failed instruction", HFILL } + }, + { &hf_sigcomp_nack_pc, + { "PC of failed instruction", "sigcomp.nack.pc", + FT_UINT16, BASE_DEC, NULL, 0x0, + "NACK PC of failed instruction", HFILL } + }, + { &hf_sigcomp_nack_sha1, + { "SHA-1 Hash of failed message", "sigcomp.nack.sha1", + FT_BYTES, BASE_NONE, NULL, 0x0, + "NACK SHA-1 Hash of failed message", HFILL } + }, + { &hf_sigcomp_nack_state_id, + { "State ID (6 - 20 bytes)", "sigcomp.nack.state_id", + FT_BYTES, BASE_NONE, NULL, 0x0, + "NACK State ID (6 - 20 bytes)", HFILL } + }, + { &hf_sigcomp_nack_cycles_per_bit, + { "Cycles Per Bit", "sigcomp.nack.cycles_per_bit", + FT_UINT8, BASE_DEC, NULL, 0x0, + "NACK Cycles Per Bit", HFILL } + }, + { &hf_sigcomp_nack_memory_size, + { "Memory size", "sigcomp.memory_size", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + }; /* Setup protocol subtree array */ - static gint *ett[] = { - &ett_sigcomp, - &ett_sigcomp_udvm, - &ett_sigcomp_udvm_exe, - }; - static gint *ett_raw[] = { - &ett_raw_text, - }; - - module_t *sigcomp_module; + static gint *ett[] = { + &ett_sigcomp, + &ett_sigcomp_udvm, + &ett_sigcomp_udvm_exe, + }; + static gint *ett_raw[] = { + &ett_raw_text, + }; + + module_t *sigcomp_module; static enum_val_t udvm_detail_vals[] = { - {"no-printout", "No-Printout", 0}, - {"low-detail", "Low-detail", 1}, - {"medium-detail", "Medium-detail", 2}, - {"high-detail", "High-detail", 3}, - {NULL, NULL, -1} + {"no-printout", "No-Printout", 0}, + {"low-detail", "Low-detail", 1}, + {"medium-detail", "Medium-detail", 2}, + {"high-detail", "High-detail", 3}, + {NULL, NULL, -1} }; /* Register the protocol name and description */ - proto_sigcomp = proto_register_protocol("Signaling Compression", - "SIGCOMP", "sigcomp"); - proto_raw_sigcomp = proto_register_protocol("Decompressed SigComp message as raw text", - "Raw_SigComp", "raw_sigcomp"); + proto_sigcomp = proto_register_protocol("Signaling Compression", + "SIGCOMP", "sigcomp"); + proto_raw_sigcomp = proto_register_protocol("Decompressed SigComp message as raw text", + "Raw_SigComp", "raw_sigcomp"); - new_register_dissector("sigcomp", dissect_sigcomp, proto_sigcomp); + new_register_dissector("sigcomp", dissect_sigcomp, proto_sigcomp); /* Required function calls to register the header fields and subtrees used */ - proto_register_field_array(proto_sigcomp, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - proto_register_subtree_array(ett_raw, array_length(ett_raw)); + proto_register_field_array(proto_sigcomp, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + proto_register_subtree_array(ett_raw, array_length(ett_raw)); /* Register a configuration option for port */ - sigcomp_module = prefs_register_protocol(proto_sigcomp, - proto_reg_handoff_sigcomp); - - prefs_register_uint_preference(sigcomp_module, "udp.port", - "Sigcomp UDP Port 1", - "Set UDP port 1 for SigComp messages", - 10, - &SigCompUDPPort1); - - prefs_register_uint_preference(sigcomp_module, "udp.port2", - "Sigcomp UDP Port 2", - "Set UDP port 2 for SigComp messages", - 10, - &SigCompUDPPort2); - prefs_register_uint_preference(sigcomp_module, "tcp.port", - "Sigcomp TCP Port 1", - "Set TCP port 1 for SigComp messages", - 10, - &SigCompTCPPort1); - - prefs_register_uint_preference(sigcomp_module, "tcp.port2", - "Sigcomp TCP Port 2", - "Set TCP port 2 for SigComp messages", - 10, - &SigCompTCPPort2); - prefs_register_bool_preference(sigcomp_module, "display.udvm.code", - "Dissect the UDVM code", - "Preference whether to Dissect the UDVM code or not", - &dissect_udvm_code); - - prefs_register_bool_preference(sigcomp_module, "display.bytecode", - "Display the bytecode of operands", - "preference whether to display the bytecode in " + sigcomp_module = prefs_register_protocol(proto_sigcomp, + proto_reg_handoff_sigcomp); + + prefs_register_uint_preference(sigcomp_module, "udp.port", + "Sigcomp UDP Port 1", + "Set UDP port 1 for SigComp messages", + 10, + &SigCompUDPPort1); + + prefs_register_uint_preference(sigcomp_module, "udp.port2", + "Sigcomp UDP Port 2", + "Set UDP port 2 for SigComp messages", + 10, + &SigCompUDPPort2); + prefs_register_uint_preference(sigcomp_module, "tcp.port", + "Sigcomp TCP Port 1", + "Set TCP port 1 for SigComp messages", + 10, + &SigCompTCPPort1); + + prefs_register_uint_preference(sigcomp_module, "tcp.port2", + "Sigcomp TCP Port 2", + "Set TCP port 2 for SigComp messages", + 10, + &SigCompTCPPort2); + prefs_register_bool_preference(sigcomp_module, "display.udvm.code", + "Dissect the UDVM code", + "Preference whether to Dissect the UDVM code or not", + &dissect_udvm_code); + + prefs_register_bool_preference(sigcomp_module, "display.bytecode", + "Display the bytecode of operands", + "preference whether to display the bytecode in " "UDVM operands or not", - &display_udvm_bytecode); - prefs_register_bool_preference(sigcomp_module, "decomp.msg", - "Decompress message", - "preference whether to decompress message or not", - &decompress); - prefs_register_bool_preference(sigcomp_module, "display.decomp.msg.as.txt", - "Displays the decompressed message as text", - "preference whether to display the decompressed message " + &display_udvm_bytecode); + prefs_register_bool_preference(sigcomp_module, "decomp.msg", + "Decompress message", + "preference whether to decompress message or not", + &decompress); + prefs_register_bool_preference(sigcomp_module, "display.decomp.msg.as.txt", + "Displays the decompressed message as text", + "preference whether to display the decompressed message " "as raw text or not", - &display_raw_txt); - prefs_register_enum_preference(sigcomp_module, "show.udvm.execution", + &display_raw_txt); + prefs_register_enum_preference(sigcomp_module, "show.udvm.execution", "Level of detail of UDVM execution:", "'No-Printout' = UDVM executes silently, then increasing detail " "about execution of UDVM instructions; " "Warning! CPU intense at high detail", &udvm_print_detail_level, udvm_detail_vals, FALSE); - register_init_routine(&sigcomp_init_protocol); + register_init_routine(&sigcomp_init_protocol); diff --git a/epan/dissectors/packet-sndcp.c b/epan/dissectors/packet-sndcp.c index 32d595d65a..b9ce3d25bc 100644 --- a/epan/dissectors/packet-sndcp.c +++ b/epan/dissectors/packet-sndcp.c @@ -12,12 +12,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -27,8 +27,6 @@ # include "config.h" #endif -#include <stdlib.h> - #include <glib.h> #include <epan/packet.h> @@ -41,7 +39,7 @@ #define MASK_T 0x20 #define MASK_M 0x10 -/* Initialize the protocol and registered fields +/* Initialize the protocol and registered fields */ static int proto_sndcp = -1; static int hf_sndcp_x = -1; @@ -56,20 +54,20 @@ static int hf_sndcp_segment = -1; static int hf_sndcp_npdu1 = -1; static int hf_sndcp_npdu2 = -1; -/* These fields are used when reassembling N-PDU fragments +/* These fields are used when reassembling N-PDU fragments */ -static int hf_npdu_fragments = -1; -static int hf_npdu_fragment = -1; -static int hf_npdu_fragment_overlap = -1; -static int hf_npdu_fragment_overlap_conflict = -1; -static int hf_npdu_fragment_multiple_tails = -1; -static int hf_npdu_fragment_too_long_fragment = -1; -static int hf_npdu_fragment_error = -1; -static int hf_npdu_fragment_count = -1; -static int hf_npdu_reassembled_in = -1; -static int hf_npdu_reassembled_length = -1; - -/* Initialize the subtree pointers +static int hf_npdu_fragments = -1; +static int hf_npdu_fragment = -1; +static int hf_npdu_fragment_overlap = -1; +static int hf_npdu_fragment_overlap_conflict = -1; +static int hf_npdu_fragment_multiple_tails = -1; +static int hf_npdu_fragment_too_long_fragment = -1; +static int hf_npdu_fragment_error = -1; +static int hf_npdu_fragment_count = -1; +static int hf_npdu_reassembled_in = -1; +static int hf_npdu_reassembled_length = -1; + +/* Initialize the subtree pointers */ static gint ett_sndcp = -1; static gint ett_sndcp_address_field = -1; @@ -103,8 +101,8 @@ static dissector_handle_t ip_handle; /* reassembly of N-PDU */ -static GHashTable *npdu_fragment_table = NULL; -static GHashTable *sndcp_reassembled_table = NULL; +static GHashTable *npdu_fragment_table = NULL; +static GHashTable *sndcp_reassembled_table = NULL; static void sndcp_defragment_init(void) @@ -116,63 +114,63 @@ sndcp_defragment_init(void) /* value strings */ static const value_string nsapi_t[] = { - { 0, "Escape mechanism for future extensions"}, - { 1, "Point-to-Multipoint (PTM-M) Information" }, - { 2, "Reserved for future use" }, - { 3, "Reserved for future use" }, - { 4, "Reserved for future use" }, - { 5, "Dynamically allocated"}, - { 6, "Dynamically allocated"}, - { 7, "Dynamically allocated"}, - { 8, "Dynamically allocated"}, - { 9, "Dynamically allocated"}, - { 10, "Dynamically allocated"}, - { 11, "Dynamically allocated"}, - { 12, "Dynamically allocated"}, - { 13, "Dynamically allocated"}, - { 14, "Dynamically allocated"}, - { 15, "Dynamically allocated"}, - { 0, NULL }, + { 0, "Escape mechanism for future extensions"}, + { 1, "Point-to-Multipoint (PTM-M) Information" }, + { 2, "Reserved for future use" }, + { 3, "Reserved for future use" }, + { 4, "Reserved for future use" }, + { 5, "Dynamically allocated"}, + { 6, "Dynamically allocated"}, + { 7, "Dynamically allocated"}, + { 8, "Dynamically allocated"}, + { 9, "Dynamically allocated"}, + { 10, "Dynamically allocated"}, + { 11, "Dynamically allocated"}, + { 12, "Dynamically allocated"}, + { 13, "Dynamically allocated"}, + { 14, "Dynamically allocated"}, + { 15, "Dynamically allocated"}, + { 0, NULL }, }; static const value_string nsapi_abrv[] = { - { 0, "0"}, - { 1, "PTM-M" }, - { 2, "2" }, - { 3, "3"}, - { 4, "4" }, - { 5, "DYN5" }, - { 6, "DYN6" }, - { 7, "DYN7" }, - { 8, "DYN8" }, - { 9, "DYN9" }, - { 10, "DYN10" }, - { 11, "DYN11" }, - { 12, "DYN12" }, - { 13, "DYN13" }, - { 14, "DYN14" }, - { 15, "DYN15" }, - { 0, NULL }, + { 0, "0"}, + { 1, "PTM-M" }, + { 2, "2" }, + { 3, "3"}, + { 4, "4" }, + { 5, "DYN5" }, + { 6, "DYN6" }, + { 7, "DYN7" }, + { 8, "DYN8" }, + { 9, "DYN9" }, + { 10, "DYN10" }, + { 11, "DYN11" }, + { 12, "DYN12" }, + { 13, "DYN13" }, + { 14, "DYN14" }, + { 15, "DYN15" }, + { 0, NULL }, }; static const value_string compression_vals[] = { - { 0, "No compression"}, - { 1, "Pointer to selected protocol/data compression mechanism" }, - { 2, "Pointer to selected protocol/data compression mechanism" }, - { 3, "Pointer to selected protocol/data compression mechanism" }, - { 4, "Pointer to selected protocol/data compression mechanism" }, - { 5, "Pointer to selected protocol/data compression mechanism" }, - { 6, "Pointer to selected protocol/data compression mechanism" }, - { 7, "Pointer to selected protocol/data compression mechanism" }, - { 8, "Pointer to selected protocol/data compression mechanism" }, - { 9, "Pointer to selected protocol/data compression mechanism" }, - { 10, "Pointer to selected protocol/data compression mechanism" }, - { 11, "Pointer to selected protocol/data compression mechanism" }, - { 12, "Pointer to selected protocol/data compression mechanism" }, - { 13, "Pointer to selected protocol/data compression mechanism" }, - { 14, "Pointer to selected protocol/data compression mechanism" }, - { 15, "Pointer to selected protocol/data compression mechanism" }, - { 0, NULL }, + { 0, "No compression"}, + { 1, "Pointer to selected protocol/data compression mechanism" }, + { 2, "Pointer to selected protocol/data compression mechanism" }, + { 3, "Pointer to selected protocol/data compression mechanism" }, + { 4, "Pointer to selected protocol/data compression mechanism" }, + { 5, "Pointer to selected protocol/data compression mechanism" }, + { 6, "Pointer to selected protocol/data compression mechanism" }, + { 7, "Pointer to selected protocol/data compression mechanism" }, + { 8, "Pointer to selected protocol/data compression mechanism" }, + { 9, "Pointer to selected protocol/data compression mechanism" }, + { 10, "Pointer to selected protocol/data compression mechanism" }, + { 11, "Pointer to selected protocol/data compression mechanism" }, + { 12, "Pointer to selected protocol/data compression mechanism" }, + { 13, "Pointer to selected protocol/data compression mechanism" }, + { 14, "Pointer to selected protocol/data compression mechanism" }, + { 15, "Pointer to selected protocol/data compression mechanism" }, + { 0, NULL }, }; static const true_false_string x_bit = { @@ -192,34 +190,34 @@ static const true_false_string m_bit = { "Last segment of N-PDU" }; -/* Code to actually dissect the packets +/* Code to actually dissect the packets */ static void dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { guint8 addr_field, comp_field, npdu_field1, nsapi, dcomp=0, pcomp=0; guint16 offset=0, npdu=0, segment=0, npdu_field2; - tvbuff_t *next_tvb, *npdu_tvb; + tvbuff_t *next_tvb, *npdu_tvb; gint len; gboolean first, more_frags, unack; - /* Set up structures needed to add the protocol subtree and manage it + /* Set up structures needed to add the protocol subtree and manage it */ proto_item *ti, *address_field_item, *compression_field_item, *npdu_field_item; proto_tree *sndcp_tree = NULL, *address_field_tree, *compression_field_tree, *npdu_field_tree; - /* Make entries in Protocol column and clear Info column on summary display + /* Make entries in Protocol column and clear Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SNDCP"); col_clear(pinfo->cinfo, COL_INFO); - - /* create display subtree for the protocol + + /* create display subtree for the protocol */ if (tree) { ti = proto_tree_add_item(tree, proto_sndcp, tvb, 0, -1, FALSE); sndcp_tree = proto_item_add_subtree(ti, ett_sndcp); } - + /* get address field from next byte */ addr_field = tvb_get_guint8(tvb,offset); @@ -228,18 +226,18 @@ dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) more_frags = addr_field & MASK_M; unack = addr_field & MASK_T; - /* add subtree for the address field + /* add subtree for the address field */ if (tree) { address_field_item = proto_tree_add_uint_format(sndcp_tree,hf_sndcp_nsapi, - tvb, offset,1, nsapi, - "Address field NSAPI: %d", nsapi ); + tvb, offset,1, nsapi, + "Address field NSAPI: %d", nsapi ); address_field_tree = proto_item_add_subtree(address_field_item, ett_sndcp_address_field); proto_tree_add_boolean(address_field_tree, hf_sndcp_x, tvb,offset,1, addr_field ); proto_tree_add_boolean(address_field_tree, hf_sndcp_f, tvb,offset,1, addr_field ); proto_tree_add_boolean(address_field_tree, hf_sndcp_t, tvb,offset,1, addr_field ); proto_tree_add_boolean(address_field_tree, hf_sndcp_m, tvb,offset,1, addr_field ); - proto_tree_add_uint(address_field_tree, hf_sndcp_nsapib, tvb, offset, 1, addr_field ); + proto_tree_add_uint(address_field_tree, hf_sndcp_nsapib, tvb, offset, 1, addr_field ); } offset++; @@ -249,25 +247,25 @@ dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) comp_field = tvb_get_guint8(tvb,offset); dcomp = comp_field & 0xF0; pcomp = comp_field & 0x0F; - - /* add subtree for the compression field + + /* add subtree for the compression field */ if (tree) { - if (!pcomp) { - if (!dcomp) { - compression_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,1, "No compression"); - } - else { - compression_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,1, "Data compression"); - } + if (!pcomp) { + if (!dcomp) { + compression_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,1, "No compression"); + } + else { + compression_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,1, "Data compression"); + } } - else { - if (!dcomp) { - compression_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,1, "Protocol compression"); - } - else { - compression_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,1, "Data and Protocol compression"); - } + else { + if (!dcomp) { + compression_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,1, "Protocol compression"); + } + else { + compression_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,1, "Data and Protocol compression"); + } } compression_field_tree = proto_item_add_subtree(compression_field_item, ett_sndcp_compression_field); proto_tree_add_uint(compression_field_tree, hf_sndcp_dcomp, tvb, offset, 1, comp_field ); @@ -280,23 +278,23 @@ dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (!unack) { npdu = npdu_field1 = tvb_get_guint8(tvb,offset); if (check_col(pinfo->cinfo, COL_INFO)) - col_add_fstr(pinfo->cinfo, COL_INFO, "SN-DATA N-PDU %d", npdu_field1); + col_add_fstr(pinfo->cinfo, COL_INFO, "SN-DATA N-PDU %d", npdu_field1); if (tree) { - npdu_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,1, "Acknowledged mode, N-PDU %d", npdu_field1 ); - npdu_field_tree = proto_item_add_subtree(npdu_field_item, ett_sndcp_npdu_field); - proto_tree_add_uint(npdu_field_tree, hf_sndcp_npdu1, tvb, offset, 1, npdu_field1 ); + npdu_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,1, "Acknowledged mode, N-PDU %d", npdu_field1 ); + npdu_field_tree = proto_item_add_subtree(npdu_field_item, ett_sndcp_npdu_field); + proto_tree_add_uint(npdu_field_tree, hf_sndcp_npdu1, tvb, offset, 1, npdu_field1 ); } offset++; } } - /* get segment and N-PDU number from next two bytes for unacknowledged mode + /* get segment and N-PDU number from next two bytes for unacknowledged mode */ if (unack) { npdu_field2 = tvb_get_ntohs(tvb, offset); segment = (npdu_field2 & 0xF000) >> 12; npdu = (npdu_field2 & 0x0FFF); - if (check_col(pinfo->cinfo, COL_INFO)) + if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "SN-UNITDATA N-PDU %d (segment %d)", npdu, segment); if (tree) { npdu_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,2, "Unacknowledged mode, N-PDU %d (segment %d)", npdu, segment ); @@ -307,11 +305,11 @@ dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += 2; } - /* handle N-PDU data, reassemble if necessary + /* handle N-PDU data, reassemble if necessary */ if (first && !more_frags) { next_tvb = tvb_new_subset_remaining (tvb, offset); - + if (!dcomp && !pcomp) { call_dissector(ip_handle, next_tvb, pinfo, tree); } @@ -320,12 +318,12 @@ dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } } else { - /* Try reassembling fragments + /* Try reassembling fragments */ fragment_data *fd_npdu = NULL; guint32 reassembled_in = 0; gboolean save_fragmented = pinfo->fragmented; - + len = tvb_length_remaining(tvb, offset); if(len<=0){ return; @@ -333,221 +331,221 @@ dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) pinfo->fragmented = TRUE; - if (unack) + if (unack) fd_npdu = fragment_add_seq_check(tvb, offset, pinfo, npdu, - npdu_fragment_table, sndcp_reassembled_table, segment, len, more_frags); + npdu_fragment_table, sndcp_reassembled_table, segment, len, more_frags); else fd_npdu = fragment_add(tvb, offset, pinfo, npdu, - npdu_fragment_table, offset, len, more_frags); + npdu_fragment_table, offset, len, more_frags); npdu_tvb = process_reassembled_data(tvb, offset, pinfo, - "Reassembled N-PDU", fd_npdu, &npdu_frag_items, - NULL, sndcp_tree); + "Reassembled N-PDU", fd_npdu, &npdu_frag_items, + NULL, sndcp_tree); if (fd_npdu) { - /* Reassembled + /* Reassembled */ reassembled_in = fd_npdu->reassembled_in; if (pinfo->fd->num == reassembled_in) { - /* Reassembled in this very packet: - * We can safely hand the tvb to the IP dissector - */ - call_dissector(ip_handle, npdu_tvb, pinfo, tree); - } + /* Reassembled in this very packet: + * We can safely hand the tvb to the IP dissector + */ + call_dissector(ip_handle, npdu_tvb, pinfo, tree); + } else { - /* Not reassembled in this packet - */ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, - " (N-PDU payload reassembled in packet %u)", - fd_npdu->reassembled_in); - } - if (tree) { - proto_tree_add_text(sndcp_tree, tvb, offset, -1, "Payload"); - } + /* Not reassembled in this packet + */ + if (check_col(pinfo->cinfo, COL_INFO)) { + col_append_fstr(pinfo->cinfo, COL_INFO, + " (N-PDU payload reassembled in packet %u)", + fd_npdu->reassembled_in); + } + if (tree) { + proto_tree_add_text(sndcp_tree, tvb, offset, -1, "Payload"); + } } } else { - /* Not reassembled yet, or not reassembled at all + /* Not reassembled yet, or not reassembled at all */ if (check_col(pinfo->cinfo, COL_INFO)) { - if (unack) - col_append_fstr(pinfo->cinfo, COL_INFO, " (Unreassembled fragment %u)", segment); - else - col_append_str(pinfo->cinfo, COL_INFO, " (Unreassembled fragment)"); + if (unack) + col_append_fstr(pinfo->cinfo, COL_INFO, " (Unreassembled fragment %u)", segment); + else + col_append_str(pinfo->cinfo, COL_INFO, " (Unreassembled fragment)"); } if (tree) { - proto_tree_add_text(sndcp_tree, tvb, offset, -1, "Payload"); + proto_tree_add_text(sndcp_tree, tvb, offset, -1, "Payload"); } } - /* Now reset fragmentation information in pinfo + /* Now reset fragmentation information in pinfo */ pinfo->fragmented = save_fragmented; } } -/* Register the protocol with Wireshark +/* Register the protocol with Wireshark this format is required because a script is used to build the C function that calls all the protocol registration. */ void proto_register_sndcp(void) -{ +{ /* Setup list of header fields */ static hf_register_info hf[] = { { &hf_sndcp_nsapi, - { "NSAPI", - "sndcp.nsapi", - FT_UINT8, BASE_DEC, VALS(nsapi_abrv), 0x0, - "Network Layer Service Access Point Identifier", HFILL + { "NSAPI", + "sndcp.nsapi", + FT_UINT8, BASE_DEC, VALS(nsapi_abrv), 0x0, + "Network Layer Service Access Point Identifier", HFILL } }, - { &hf_sndcp_x, + { &hf_sndcp_x, { "Spare bit", - "sndcp.x", - FT_BOOLEAN,8, TFS(&x_bit), MASK_X, - "Spare bit (should be 0)", HFILL + "sndcp.x", + FT_BOOLEAN,8, TFS(&x_bit), MASK_X, + "Spare bit (should be 0)", HFILL } }, - { &hf_sndcp_f, - { "First segment indicator bit", - "sndcp.f", - FT_BOOLEAN,8, TFS(&f_bit), MASK_F, - NULL, HFILL + { &hf_sndcp_f, + { "First segment indicator bit", + "sndcp.f", + FT_BOOLEAN,8, TFS(&f_bit), MASK_F, + NULL, HFILL } }, - { &hf_sndcp_t, - { "Type", - "sndcp.t", - FT_BOOLEAN,8, TFS(&t_bit), MASK_T, - "SN-PDU Type", HFILL + { &hf_sndcp_t, + { "Type", + "sndcp.t", + FT_BOOLEAN,8, TFS(&t_bit), MASK_T, + "SN-PDU Type", HFILL } }, - { &hf_sndcp_m, - { "More bit", - "sndcp.m", - FT_BOOLEAN,8, TFS(&m_bit), MASK_M, - NULL, HFILL + { &hf_sndcp_m, + { "More bit", + "sndcp.m", + FT_BOOLEAN,8, TFS(&m_bit), MASK_M, + NULL, HFILL } }, - { &hf_sndcp_dcomp, - { "DCOMP", - "sndcp.dcomp", - FT_UINT8, BASE_DEC, VALS(compression_vals), 0xF0, - "Data compression coding", HFILL + { &hf_sndcp_dcomp, + { "DCOMP", + "sndcp.dcomp", + FT_UINT8, BASE_DEC, VALS(compression_vals), 0xF0, + "Data compression coding", HFILL } }, - { &hf_sndcp_pcomp, - { "PCOMP", - "sndcp.pcomp", - FT_UINT8, BASE_DEC, VALS(compression_vals), 0x0F, - "Protocol compression coding", HFILL + { &hf_sndcp_pcomp, + { "PCOMP", + "sndcp.pcomp", + FT_UINT8, BASE_DEC, VALS(compression_vals), 0x0F, + "Protocol compression coding", HFILL } }, { &hf_sndcp_nsapib, - { "NSAPI", - "sndcp.nsapib", - FT_UINT8, BASE_DEC , VALS(nsapi_t), 0xf, - "Network Layer Service Access Point Identifier",HFILL + { "NSAPI", + "sndcp.nsapib", + FT_UINT8, BASE_DEC , VALS(nsapi_t), 0xf, + "Network Layer Service Access Point Identifier",HFILL } - }, - { &hf_sndcp_segment, - { "Segment", - "sndcp.segment", - FT_UINT16, BASE_DEC, NULL, 0xF000, - "Segment number", HFILL + }, + { &hf_sndcp_segment, + { "Segment", + "sndcp.segment", + FT_UINT16, BASE_DEC, NULL, 0xF000, + "Segment number", HFILL } }, - { &hf_sndcp_npdu1, - { "N-PDU", - "sndcp.npdu", - FT_UINT8, BASE_DEC, NULL, 0, - NULL, HFILL + { &hf_sndcp_npdu1, + { "N-PDU", + "sndcp.npdu", + FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL } }, - { &hf_sndcp_npdu2, - { "N-PDU", - "sndcp.npdu", - FT_UINT16, BASE_DEC, NULL, 0x0FFF, - NULL, HFILL + { &hf_sndcp_npdu2, + { "N-PDU", + "sndcp.npdu", + FT_UINT16, BASE_DEC, NULL, 0x0FFF, + NULL, HFILL } }, - /* Fragment fields + /* Fragment fields */ { &hf_npdu_fragment_overlap, - { "Fragment overlap", - "npdu.fragment.overlap", - FT_BOOLEAN, BASE_NONE, NULL, 0x0, - "Fragment overlaps with other fragments", HFILL + { "Fragment overlap", + "npdu.fragment.overlap", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + "Fragment overlaps with other fragments", HFILL } }, { &hf_npdu_fragment_overlap_conflict, - { "Conflicting data in fragment overlap", - "npdu.fragment.overlap.conflict", - FT_BOOLEAN, BASE_NONE, NULL, 0x0, - "Overlapping fragments contained conflicting data", HFILL + { "Conflicting data in fragment overlap", + "npdu.fragment.overlap.conflict", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + "Overlapping fragments contained conflicting data", HFILL } }, { &hf_npdu_fragment_multiple_tails, - { "Multiple tail fragments found", - "npdu.fragment.multipletails", - FT_BOOLEAN, BASE_NONE, NULL, 0x0, - "Several tails were found when defragmenting the packet", HFILL + { "Multiple tail fragments found", + "npdu.fragment.multipletails", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + "Several tails were found when defragmenting the packet", HFILL } }, { &hf_npdu_fragment_too_long_fragment, - { "Fragment too long", - "npdu.fragment.toolongfragment", - FT_BOOLEAN, BASE_NONE, NULL, 0x0, - "Fragment contained data past end of packet", HFILL + { "Fragment too long", + "npdu.fragment.toolongfragment", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + "Fragment contained data past end of packet", HFILL } }, { &hf_npdu_fragment_error, - { "Defragmentation error", - "npdu.fragment.error", - FT_FRAMENUM, BASE_NONE, NULL, 0x0, - "Defragmentation error due to illegal fragments", HFILL + { "Defragmentation error", + "npdu.fragment.error", + FT_FRAMENUM, BASE_NONE, NULL, 0x0, + "Defragmentation error due to illegal fragments", HFILL } }, { &hf_npdu_fragment_count, - { "Fragment count", - "npdu.fragment.count", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL + { "Fragment count", + "npdu.fragment.count", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } }, { &hf_npdu_reassembled_in, - { "Reassembled in", - "npdu.reassembled.in", - FT_FRAMENUM, BASE_NONE, NULL, 0x0, - "N-PDU fragments are reassembled in the given packet", HFILL + { "Reassembled in", + "npdu.reassembled.in", + FT_FRAMENUM, BASE_NONE, NULL, 0x0, + "N-PDU fragments are reassembled in the given packet", HFILL } }, { &hf_npdu_reassembled_length, - { "Reassembled N-PDU length", - "npdu.reassembled.length", - FT_UINT32, BASE_DEC, NULL, 0x0, - "The total length of the reassembled payload", HFILL + { "Reassembled N-PDU length", + "npdu.reassembled.length", + FT_UINT32, BASE_DEC, NULL, 0x0, + "The total length of the reassembled payload", HFILL } }, { &hf_npdu_fragment, - { "N-PDU Fragment", - "npdu.fragment", - FT_FRAMENUM, BASE_NONE, NULL, 0x0, - NULL, HFILL + { "N-PDU Fragment", + "npdu.fragment", + FT_FRAMENUM, BASE_NONE, NULL, 0x0, + NULL, HFILL } }, { &hf_npdu_fragments, - { "N-PDU Fragments", - "npdu.fragments", - FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL + { "N-PDU Fragments", + "npdu.fragments", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } } }; - + /* Setup protocol subtree array */ static gint *ett[] = { &ett_sndcp , @@ -560,7 +558,7 @@ proto_register_sndcp(void) /* Register the protocol name and description */ proto_sndcp = proto_register_protocol("Subnetwork Dependent Convergence Protocol", - "SNDCP", "sndcp"); + "SNDCP", "sndcp"); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_sndcp, hf, array_length(hf)); @@ -578,17 +576,17 @@ proto_reg_handoff_sndcp(void) { dissector_handle_t sndcp_handle; - sndcp_handle = find_dissector("sndcp"); + sndcp_handle = find_dissector("sndcp"); - /* Register SNDCP dissector with LLC layer for SAPI 3,5,9 and 11 + /* Register SNDCP dissector with LLC layer for SAPI 3,5,9 and 11 */ dissector_add_uint("llcgprs.sapi", 3, sndcp_handle); dissector_add_uint("llcgprs.sapi", 5, sndcp_handle); dissector_add_uint("llcgprs.sapi", 9, sndcp_handle); dissector_add_uint("llcgprs.sapi", 11, sndcp_handle); - /* Find IP and data handle for upper layer dissectors + /* Find IP and data handle for upper layer dissectors */ - ip_handle = find_dissector("ip"); + ip_handle = find_dissector("ip"); data_handle = find_dissector("data"); } diff --git a/epan/dissectors/packet-sqloracle.h b/epan/dissectors/packet-sqloracle.h index 4b10603bdf..49a643ee5e 100644 --- a/epan/dissectors/packet-sqloracle.h +++ b/epan/dissectors/packet-sqloracle.h @@ -29,225 +29,225 @@ -typedef unsigned char UI8_T, BYTE,*UI8_P; +typedef unsigned char UI8_T, BYTE,*UI8_P; typedef unsigned short UI16_T, *UI16_P; -typedef unsigned int UI32_T, *UI32_P; -typedef int I32_T, *I32_P; -typedef short I16_T, *I16_P; -typedef char I8_T, *I8_P; +typedef unsigned int UI32_T, *UI32_P; +typedef int I32_T, *I32_P; +typedef short I16_T, *I16_P; +typedef char I8_T, *I8_P; /*+------------------------------- - * NET8 protocol definition + * NET8 protocol definition *-------------------------------- -*/ /*+------------------------------- - * NET8 Command Header + * NET8 Command Header *-------------------------------- -*/ -#define NET8_TYPE_SETPROP 1 /* Set PROtocol */ -#define NET8_TYPE_SETDATAREP 2 /* Set Data Representation */ -#define NET8_TYPE_USERTOSERVER 3 /* User to Server request */ -#define NET8_TYPE_ERRORSTATUS 4 /* Error return status */ -#define NET8_TYPE_AUAS 5 /* Access User Address space */ -#define NET8_TYPE_ROWTRANSFER 6 /* Row Transfer Header */ -#define NET8_TYPE_ROWDATA 7 /* I made this to handle spanning data rows */ -#define NET8_TYPE_OPIPARAM 8 /* return OPI parameter */ -#define NET8_TYPE_FUNCCOMPLETE 9 /* return Function Complete */ -#define NET8_TYPE_TTINOER 10 /* for msdos/os2 N oerdefs follow */ -#define NET8_TYPE_TTIIOV 11 /* Sending IO vec only for fast UPI */ -#define NET8_TYPE_TTISLG 12 /* Send LonG for fast UPI*/ -#define NET8_TYPE_TTIICA 13 /* Invoke user CAllback*/ -#define NET8_TYPE_TTILOBD 14 /* LOB/FILE data follows */ -#define NET8_TYPE_TTIWRN 15 /* warning messages - may be a set of them */ +#define NET8_TYPE_SETPROP 1 /* Set PROtocol */ +#define NET8_TYPE_SETDATAREP 2 /* Set Data Representation */ +#define NET8_TYPE_USERTOSERVER 3 /* User to Server request */ +#define NET8_TYPE_ERRORSTATUS 4 /* Error return status */ +#define NET8_TYPE_AUAS 5 /* Access User Address space */ +#define NET8_TYPE_ROWTRANSFER 6 /* Row Transfer Header */ +#define NET8_TYPE_ROWDATA 7 /* I made this to handle spanning data rows */ +#define NET8_TYPE_OPIPARAM 8 /* return OPI parameter */ +#define NET8_TYPE_FUNCCOMPLETE 9 /* return Function Complete */ +#define NET8_TYPE_TTINOER 10 /* for msdos/os2 N oerdefs follow */ +#define NET8_TYPE_TTIIOV 11 /* Sending IO vec only for fast UPI */ +#define NET8_TYPE_TTISLG 12 /* Send LonG for fast UPI*/ +#define NET8_TYPE_TTIICA 13 /* Invoke user CAllback*/ +#define NET8_TYPE_TTILOBD 14 /* LOB/FILE data follows */ +#define NET8_TYPE_TTIWRN 15 /* warning messages - may be a set of them */ -#define NET8_TYPE_DESCINFO 16 /* Describe Information */ -#define NET8_TYPE_PIGGYBACKFUNC 17 /* piggy back funtion follow */ -#define NET8_TYPE_TTI3GL 18 /* signals special action for untrusted callout support */ -#define NET8_TYPE_TTIFOB 19 /* Flush Out Bind data in DML/w RETURN when error */ -#define NET8_TYPE_SECURENEG 0xde /* Secure Network Services Negotiation */ -#define MAX_QUERY_STRING_LEN 256 +#define NET8_TYPE_DESCINFO 16 /* Describe Information */ +#define NET8_TYPE_PIGGYBACKFUNC 17 /* piggy back funtion follow */ +#define NET8_TYPE_TTI3GL 18 /* signals special action for untrusted callout support */ +#define NET8_TYPE_TTIFOB 19 /* Flush Out Bind data in DML/w RETURN when error */ +#define NET8_TYPE_SECURENEG 0xde /* Secure Network Services Negotiation */ +#define MAX_QUERY_STRING_LEN 256 /*+-------------------------------------- - * User to Server request function types - * NET8_TYPE_USERTOSERVER 0x03 + * User to Server request function types + * NET8_TYPE_USERTOSERVER 0x03 * look in ttc7\FunCodes.java *--------------------------------------- -*/ -#define NET8_USER_FUNC_OLOGON 1 /* logon to Oracle */ -#define NET8_USER_FUNC_OPENCURSOR 2 /* Open Cursor */ -#define NET8_USER_FUNC_PARSE 3 /* Parse */ -#define NET8_USER_FUNC_EXECUTE 4 /* Execute */ -#define NET8_USER_FUNC_OFETCH 5 /* fetch a row */ +#define NET8_USER_FUNC_OLOGON 1 /* logon to Oracle */ +#define NET8_USER_FUNC_OPENCURSOR 2 /* Open Cursor */ +#define NET8_USER_FUNC_PARSE 3 /* Parse */ +#define NET8_USER_FUNC_EXECUTE 4 /* Execute */ +#define NET8_USER_FUNC_OFETCH 5 /* fetch a row */ -#define NET8_USER_FUNC_CLOSECURSOR 8 /* Close Cursor */ +#define NET8_USER_FUNC_CLOSECURSOR 8 /* Close Cursor */ - -#define NET8_USER_FUNC_OLOGOFF 9 /* logoff of ORACLE */ -#define NET8_USER_FUNC_ODSCRIBE 10 /* describe a select list column */ -#define NET8_USER_FUNC_ODEFIN 11 /* define[] where the column goes */ -#define NET8_USER_FUNC_OCOMON 12 /* auto[] commit on */ -#define NET8_USER_FUNC_OCOMOFF 13 /* auto commit off */ -#define NET8_USER_FUNC_OCOMMIT 14 /* commit */ -#define NET8_USER_FUNC_OROLLBACK 15 /* rollback */ -#define NET8_USER_FUNC_OSFE 16 /* set fatal error options */ -#define NET8_USER_FUNC_ORESUME 17 /* resume current operation */ -#define NET8_USER_FUNC_OVERSN 18 /* get ORACLE version-date string */ -#define NET8_USER_FUNC_OTEMP 19 /* until we get rid of OASQL */ -#define NET8_USER_FUNC_CANCEL 20 /* cancel the current operation */ -#define NET8_USER_FUNC_OGEM 21 /* get error message */ -#define NET8_USER_FUNC_OEXIT 22 /* Exit oracle command */ -#define NET8_USER_FUNC_OSPECIAL 23 /* special function */ -#define NET8_USER_FUNC_OABORT 24 /* abort */ -#define NET8_USER_FUNC_ODQRID 25 /* deq by rowid */ -#define NET8_USER_FUNC_OLNGF6 26 /* fetch a long column value */ -#define NET8_USER_FUNC_OCAM 27 /* Create Access Module */ -#define NET8_USER_FUNC_OSAMS 28 /* Save Access Module Statement */ -#define NET8_USER_FUNC_OSAM 29 /* Save Access Module */ -#define NET8_USER_FUNC_OPAMS 30 /* Parse Access Module Statement */ -#define NET8_USER_FUNC_OHOWMANY 31 /* How Many Items? */ -#define NET8_USER_FUNC_OINIT 32 /* Initialize Oracle */ -#define NET8_USER_FUNC_OCHANGEU 33 /* change user id */ -#define NET8_USER_FUNC_OBINDRP 34 /* Bind by reference positional */ -#define NET8_USER_FUNC_OGETBV 35 /* Get n'th Bind Variable */ -#define NET8_USER_FUNC_OGETIV 36 /* Get n'th Into Variable */ -#define NET8_USER_FUNC_OBINDRV 37 /* Bind by reference */ -#define NET8_USER_FUNC_OBINDRN 38 /* Bind by reference numeric */ -#define NET8_USER_FUNC_OPARSEX 39 /* Parse And Execute */ -#define NET8_USER_FUNC_OPARSYN 40 /* Parse for Syntax only */ -#define NET8_USER_FUNC_OPARSDI 41 /* Parse for Syntax & SQL Dictionary lookup */ -#define NET8_USER_FUNC_OCONTINUE 42 /* continue serving after eof */ -#define NET8_USER_FUNC_ODSCRARR 43 /* array describe */ -#define NET8_USER_FUNC_OLCCINI 44 /* init sys pars command table */ -#define NET8_USER_FUNC_OLCCFIN 45 /* finalize sys pars command table */ -#define NET8_USER_FUNC_OLCCPUT 46 /* put sys par in command table */ -#define NET8_USER_FUNC_OLCCGPI 47 /* get sys pars info from command table */ -#define NET8_USER_FUNC_OV6STRT 48 /* start Oracle (V6) */ -#define NET8_USER_FUNC_OV6STOP 49 /* [poll for] shut down Oracle (V6) */ -#define NET8_USER_FUNC_ORIP 50 /* run independent process (V6) */ -#define NET8_USER_FUNC_OTRAM 51 /* test RAM (V6) */ -#define NET8_USER_FUNC_OARCHIVE 52 /* archive op (V6) */ -#define NET8_USER_FUNC_OMRSTART 53 /* media recovery - start (V6) */ -#define NET8_USER_FUNC_OMRRECTS 54 /* media recovery - record tablespace to recover (V6) */ - -#define NET8_USER_FUNC_OMRGSLSQ 55 /* media recovery - get starting log seq # (V6) */ -#define NET8_USER_FUNC_OMRREC 56 /* media recovery - recover using offline log (V6) */ -#define NET8_USER_FUNC_OMRCAN 57 /* media recovery - cancel media recovery (V6) */ -#define NET8_USER_FUNC_O2LOGON 58 /* logon to ORACLE (V6) (supercedes OLOGON) */ -#define NET8_USER_FUNC_OVERSION 59 /* get ORACLE version-date string in new format */ -#define NET8_USER_FUNC_OINIT2 60 /* new init call (supersedes OINIT) */ -#define NET8_USER_FUNC_OCLOALL 61 /* reserved for MAC; close all cursors */ -#define NET8_USER_FUNC_OALL 62 /* bundled execution call */ -#define NET8_USER_FUNC_OTEX 63 /* reserved for os2/msdos; transaction execute call */ -#define NET8_USER_FUNC_OSDAUTH 64 /* reserved for os2/msdos; set DBA authorization call */ - -#define NET8_USER_FUNC_OUDLFUN 65 /* for direct loader: functions */ -#define NET8_USER_FUNC_OUDLBUF 66 /* for direct loader: buffer transfer */ -#define NET8_USER_FUNC_OK2RPC 67 /* distrib. trans. mgr. RPC */ -#define NET8_USER_FUNC_ODSCIDX 68 /* describe indexes for distributed query */ -#define NET8_USER_FUNC_OSESOPN 69 /* session operations */ -#define NET8_USER_FUNC_OEXECSCN 70 /* execute using synchronized system commit numbers */ -#define NET8_USER_FUNC_OALL7 71 /* fast upi calls to opial7 */ -#define NET8_USER_FUNC_OLONGF 72 /* Long fetch version 7 */ -#define NET8_USER_FUNC_OEXECA 73 /* call opiexe from opiall; no two-task access */ -#define NET8_USER_FUNC_OSQL7 74 /* New ver 7 parse call to deal with various flavours*/ -#define NET8_USER_FUNC_OOBS 75 /* Please DO Not REUSE THIS CODE */ -#define NET8_USER_FUNC_ORPC 76 /* RPC Call from pl/sql */ -#define NET8_USER_FUNC_OKGL_OLD 77 /* do a KGL operation */ -#define NET8_USER_FUNC_OEXFEN 78 -#define NET8_USER_FUNC_OXAOPN 79 /* X/Open XA operation */ -#define NET8_USER_FUNC_OKGL 80 /* New OKGL call */ -#define NET8_USER_FUNC_03LOGON 81 /* 2nd Half of Logon */ -#define NET8_USER_FUNC_03LOGA 82 /* 1st Half of Logon */ -#define NET8_USER_FUNC_OFNSTM 83 /* Do Streaming Operation */ -#define NET8_USER_FUNC_OPENSESS 84 /* Open Session */ -#define NET8_USER_FUNC_O71XAOPN 85 /* X/Open XA operations (71 interface */ -#define NET8_USER_FUNC_ODEBUG 86 /* debugging operation */ -#define NET8_USER_FUNC_ODEBUGS 87 /* special debugging operation */ -#define NET8_USER_FUNC_OXAST 88 /* XA start */ -#define NET8_USER_FUNC_OXACM 89 /* XA Switch and Commit */ -#define NET8_USER_FUNC_OXAPR 90 /* XA Switch and Prepare */ -#define NET8_USER_FUNC_OXDP 91 /* direct copy from db buffers to client addr */ + +#define NET8_USER_FUNC_OLOGOFF 9 /* logoff of ORACLE */ +#define NET8_USER_FUNC_ODSCRIBE 10 /* describe a select list column */ +#define NET8_USER_FUNC_ODEFIN 11 /* define[] where the column goes */ +#define NET8_USER_FUNC_OCOMON 12 /* auto[] commit on */ +#define NET8_USER_FUNC_OCOMOFF 13 /* auto commit off */ +#define NET8_USER_FUNC_OCOMMIT 14 /* commit */ +#define NET8_USER_FUNC_OROLLBACK 15 /* rollback */ +#define NET8_USER_FUNC_OSFE 16 /* set fatal error options */ +#define NET8_USER_FUNC_ORESUME 17 /* resume current operation */ +#define NET8_USER_FUNC_OVERSN 18 /* get ORACLE version-date string */ +#define NET8_USER_FUNC_OTEMP 19 /* until we get rid of OASQL */ +#define NET8_USER_FUNC_CANCEL 20 /* cancel the current operation */ +#define NET8_USER_FUNC_OGEM 21 /* get error message */ +#define NET8_USER_FUNC_OEXIT 22 /* Exit oracle command */ +#define NET8_USER_FUNC_OSPECIAL 23 /* special function */ +#define NET8_USER_FUNC_OABORT 24 /* abort */ +#define NET8_USER_FUNC_ODQRID 25 /* deq by rowid */ +#define NET8_USER_FUNC_OLNGF6 26 /* fetch a long column value */ +#define NET8_USER_FUNC_OCAM 27 /* Create Access Module */ +#define NET8_USER_FUNC_OSAMS 28 /* Save Access Module Statement */ +#define NET8_USER_FUNC_OSAM 29 /* Save Access Module */ +#define NET8_USER_FUNC_OPAMS 30 /* Parse Access Module Statement */ +#define NET8_USER_FUNC_OHOWMANY 31 /* How Many Items? */ +#define NET8_USER_FUNC_OINIT 32 /* Initialize Oracle */ +#define NET8_USER_FUNC_OCHANGEU 33 /* change user id */ +#define NET8_USER_FUNC_OBINDRP 34 /* Bind by reference positional */ +#define NET8_USER_FUNC_OGETBV 35 /* Get n'th Bind Variable */ +#define NET8_USER_FUNC_OGETIV 36 /* Get n'th Into Variable */ +#define NET8_USER_FUNC_OBINDRV 37 /* Bind by reference */ +#define NET8_USER_FUNC_OBINDRN 38 /* Bind by reference numeric */ +#define NET8_USER_FUNC_OPARSEX 39 /* Parse And Execute */ +#define NET8_USER_FUNC_OPARSYN 40 /* Parse for Syntax only */ +#define NET8_USER_FUNC_OPARSDI 41 /* Parse for Syntax & SQL Dictionary lookup */ +#define NET8_USER_FUNC_OCONTINUE 42 /* continue serving after eof */ +#define NET8_USER_FUNC_ODSCRARR 43 /* array describe */ +#define NET8_USER_FUNC_OLCCINI 44 /* init sys pars command table */ +#define NET8_USER_FUNC_OLCCFIN 45 /* finalize sys pars command table */ +#define NET8_USER_FUNC_OLCCPUT 46 /* put sys par in command table */ +#define NET8_USER_FUNC_OLCCGPI 47 /* get sys pars info from command table */ +#define NET8_USER_FUNC_OV6STRT 48 /* start Oracle (V6) */ +#define NET8_USER_FUNC_OV6STOP 49 /* [poll for] shut down Oracle (V6) */ +#define NET8_USER_FUNC_ORIP 50 /* run independent process (V6) */ +#define NET8_USER_FUNC_OTRAM 51 /* test RAM (V6) */ +#define NET8_USER_FUNC_OARCHIVE 52 /* archive op (V6) */ +#define NET8_USER_FUNC_OMRSTART 53 /* media recovery - start (V6) */ +#define NET8_USER_FUNC_OMRRECTS 54 /* media recovery - record tablespace to recover (V6) */ + +#define NET8_USER_FUNC_OMRGSLSQ 55 /* media recovery - get starting log seq # (V6) */ +#define NET8_USER_FUNC_OMRREC 56 /* media recovery - recover using offline log (V6) */ +#define NET8_USER_FUNC_OMRCAN 57 /* media recovery - cancel media recovery (V6) */ +#define NET8_USER_FUNC_O2LOGON 58 /* logon to ORACLE (V6) (supercedes OLOGON) */ +#define NET8_USER_FUNC_OVERSION 59 /* get ORACLE version-date string in new format */ +#define NET8_USER_FUNC_OINIT2 60 /* new init call (supersedes OINIT) */ +#define NET8_USER_FUNC_OCLOALL 61 /* reserved for MAC; close all cursors */ +#define NET8_USER_FUNC_OALL 62 /* bundled execution call */ +#define NET8_USER_FUNC_OTEX 63 /* reserved for os2/msdos; transaction execute call */ +#define NET8_USER_FUNC_OSDAUTH 64 /* reserved for os2/msdos; set DBA authorization call */ + +#define NET8_USER_FUNC_OUDLFUN 65 /* for direct loader: functions */ +#define NET8_USER_FUNC_OUDLBUF 66 /* for direct loader: buffer transfer */ +#define NET8_USER_FUNC_OK2RPC 67 /* distrib. trans. mgr. RPC */ +#define NET8_USER_FUNC_ODSCIDX 68 /* describe indexes for distributed query */ +#define NET8_USER_FUNC_OSESOPN 69 /* session operations */ +#define NET8_USER_FUNC_OEXECSCN 70 /* execute using synchronized system commit numbers */ +#define NET8_USER_FUNC_OALL7 71 /* fast upi calls to opial7 */ +#define NET8_USER_FUNC_OLONGF 72 /* Long fetch version 7 */ +#define NET8_USER_FUNC_OEXECA 73 /* call opiexe from opiall; no two-task access */ +#define NET8_USER_FUNC_OSQL7 74 /* New ver 7 parse call to deal with various flavours*/ +#define NET8_USER_FUNC_OOBS 75 /* Please DO Not REUSE THIS CODE */ +#define NET8_USER_FUNC_ORPC 76 /* RPC Call from pl/sql */ +#define NET8_USER_FUNC_OKGL_OLD 77 /* do a KGL operation */ +#define NET8_USER_FUNC_OEXFEN 78 +#define NET8_USER_FUNC_OXAOPN 79 /* X/Open XA operation */ +#define NET8_USER_FUNC_OKGL 80 /* New OKGL call */ +#define NET8_USER_FUNC_03LOGON 81 /* 2nd Half of Logon */ +#define NET8_USER_FUNC_03LOGA 82 /* 1st Half of Logon */ +#define NET8_USER_FUNC_OFNSTM 83 /* Do Streaming Operation */ +#define NET8_USER_FUNC_OPENSESS 84 /* Open Session */ +#define NET8_USER_FUNC_O71XAOPN 85 /* X/Open XA operations (71 interface */ +#define NET8_USER_FUNC_ODEBUG 86 /* debugging operation */ +#define NET8_USER_FUNC_ODEBUGS 87 /* special debugging operation */ +#define NET8_USER_FUNC_OXAST 88 /* XA start */ +#define NET8_USER_FUNC_OXACM 89 /* XA Switch and Commit */ +#define NET8_USER_FUNC_OXAPR 90 /* XA Switch and Prepare */ +#define NET8_USER_FUNC_OXDP 91 /* direct copy from db buffers to client addr */ /* in Oracle 7 and lower, this used to be OCONNECT */ -#define NET8_USER_FUNC_OKOD 92 /* New OKOD call */ +#define NET8_USER_FUNC_OKOD 92 /* New OKOD call */ /* Oracle 8 changes follow */ -#define NET8_USER_FUNC_OCBK 93 /* OCBK call (kernel side only) */ -#define NET8_USER_FUNC_OALL8 94 /* new v8 bundled call */ -#define NET8_USER_FUNC_OFNSTM2 95 /* OFNSTM without the begintxn */ -#define NET8_USER_FUNC_OLOBOPS 96 /* LOB and FILE related calls */ -#define NET8_USER_FUNC_OFILECRT 97 /* FILE create call */ -#define NET8_USER_FUNC_ODNY 98 /* new describe query call */ -#define NET8_USER_FUNC_OCONNECT 99 /* code for non blocking attach host */ -#define NET8_USER_FUNC_OOPENRCS 100 /* Open a recursive cursor */ -#define NET8_USER_FUNC_OKPRALL 101 /* Bundled KPR execution */ -#define NET8_USER_FUNC_OPLS 102 /* Bundled PL/SQL execution */ -#define NET8_USER_FUNC_OTXSE 103 /* transaction start, attach, detach */ -#define NET8_USER_FUNC_OTXEN 104 /* transaction commit, rollback, recover */ -#define NET8_USER_FUNC_OCCA 105 /* Cursor Close All */ -#define NET8_USER_FUNC_OFOI 106 /* Failover info piggyback */ -#define NET8_USER_FUNC_O80SES 107 /* V8 session switching piggyback */ -#define NET8_USER_FUNC_ODDF 108 /* Do Dummy Defines */ -#define NET8_USER_FUNC_OLRMINI 109 /* init sys pars */ -#define NET8_USER_FUNC_OLRMFIN 110 /* finalize sys pars */ -#define NET8_USER_FUNC_OLRMPUT 111 /* put sys par in par space */ -#define NET8_USER_FUNC_OLRMTRM 112 /* terminate sys pars */ -#define NET8_USER_FUNC_OEXFENA 113 /* execute but don't unmap (used from opiall0) */ -#define NET8_USER_FUNC_OINIUCB 114 /* OINIT for Untrusted CallBacks */ -#define NET8_USER_FUNC_AUTH 115 /* Generic authentication call */ -#define NET8_USER_FUNC_OFGI 116 /* FailOver Get Instance Info */ -#define NET8_USER_FUNC_OOTCO 117 /* Oracle Transaction service COmmit remote sites */ -#define NET8_USER_FUNC_GETSESSKEY 118 /* Get the session key */ -#define NET8_USER_FUNC_ODSY 119 /* V8 Describe Any */ -#define NET8_USER_FUNC_OCANA 120 /* Cancel All */ -#define NET8_USER_FUNC_OAQEQ 121 /* AQ EnQueue */ -#define NET8_USER_FUNC_OAQDQ 122 /* AQ Dequeue */ -#define NET8_USER_FUNC_ORFS 123 /* RFS call */ -#define NET8_USER_FUNC_OKPN 124 /* Kernel Programmatic Notification */ -#define NET8_USER_FUNC_MAX_OFCN 124 /* last item allocated */ +#define NET8_USER_FUNC_OCBK 93 /* OCBK call (kernel side only) */ +#define NET8_USER_FUNC_OALL8 94 /* new v8 bundled call */ +#define NET8_USER_FUNC_OFNSTM2 95 /* OFNSTM without the begintxn */ +#define NET8_USER_FUNC_OLOBOPS 96 /* LOB and FILE related calls */ +#define NET8_USER_FUNC_OFILECRT 97 /* FILE create call */ +#define NET8_USER_FUNC_ODNY 98 /* new describe query call */ +#define NET8_USER_FUNC_OCONNECT 99 /* code for non blocking attach host */ +#define NET8_USER_FUNC_OOPENRCS 100 /* Open a recursive cursor */ +#define NET8_USER_FUNC_OKPRALL 101 /* Bundled KPR execution */ +#define NET8_USER_FUNC_OPLS 102 /* Bundled PL/SQL execution */ +#define NET8_USER_FUNC_OTXSE 103 /* transaction start, attach, detach */ +#define NET8_USER_FUNC_OTXEN 104 /* transaction commit, rollback, recover */ +#define NET8_USER_FUNC_OCCA 105 /* Cursor Close All */ +#define NET8_USER_FUNC_OFOI 106 /* Failover info piggyback */ +#define NET8_USER_FUNC_O80SES 107 /* V8 session switching piggyback */ +#define NET8_USER_FUNC_ODDF 108 /* Do Dummy Defines */ +#define NET8_USER_FUNC_OLRMINI 109 /* init sys pars */ +#define NET8_USER_FUNC_OLRMFIN 110 /* finalize sys pars */ +#define NET8_USER_FUNC_OLRMPUT 111 /* put sys par in par space */ +#define NET8_USER_FUNC_OLRMTRM 112 /* terminate sys pars */ +#define NET8_USER_FUNC_OEXFENA 113 /* execute but don't unmap (used from opiall0) */ +#define NET8_USER_FUNC_OINIUCB 114 /* OINIT for Untrusted CallBacks */ +#define NET8_USER_FUNC_AUTH 115 /* Generic authentication call */ +#define NET8_USER_FUNC_OFGI 116 /* FailOver Get Instance Info */ +#define NET8_USER_FUNC_OOTCO 117 /* Oracle Transaction service COmmit remote sites */ +#define NET8_USER_FUNC_GETSESSKEY 118 /* Get the session key */ +#define NET8_USER_FUNC_ODSY 119 /* V8 Describe Any */ +#define NET8_USER_FUNC_OCANA 120 /* Cancel All */ +#define NET8_USER_FUNC_OAQEQ 121 /* AQ EnQueue */ +#define NET8_USER_FUNC_OAQDQ 122 /* AQ Dequeue */ +#define NET8_USER_FUNC_ORFS 123 /* RFS call */ +#define NET8_USER_FUNC_OKPN 124 /* Kernel Programmatic Notification */ +#define NET8_USER_FUNC_MAX_OFCN 124 /* last item allocated */ /*+-------------------------------------------------- * query results db types in the describe pkt - * for NET8_TYPE_OPIPARAM 0x08 - * & for NET8_TYPE_DESCINFO 0x10 + * for NET8_TYPE_OPIPARAM 0x08 + * & for NET8_TYPE_DESCINFO 0x10 *--------------------------------------------------- -*/ -#define NET8_DATATYPE_VARCHAR 0x01 -#define NET8_DATATYPE_NUMBER 0x02 -#define NET8_DATATYPE_VARNUM 0x06 -#define NET8_DATATYPE_LONG 0x08 -#define NET8_DATATYPE_DATE 0x0C -#define NET8_DATATYPE_RAW 0x17 -#define NET8_DATATYPE_LONG_RAW 0x18 -#define NET8_DATATYPE_CHAR 0x60 -#define NET8_DATATYPE_RESULT_SET 0x66 -#define NET8_DATATYPE_ROWID 0x68 -#define NET8_DATATYPE_NAMED_TYPE 0x6D -#define NET8_DATATYPE_REF_TYPE 0x6F -#define NET8_DATATYPE_CLOB 0x70 -#define NET8_DATATYPE_BLOB 0x71 -#define NET8_DATATYPE_BFILE 0x72 -#define NET8_DATATYPE_TIMESTAMP 0xB4 -#define NET8_DATATYPE_TIMESTAMPTZ 0xB5 -#define NET8_DATATYPE_INTERVALYM 0xB6 -#define NET8_DATATYPE_INTERVALDS 0xB7 -#define NET8_DATATYPE_TIMESTAMPLTZ 0xE7 -#define NET8_DATATYPE_PLSQL_INDEX_TABLE 0x3E6 -#define NET8_DATATYPE_FIXED_CHAR 0x3E7 +#define NET8_DATATYPE_VARCHAR 0x01 +#define NET8_DATATYPE_NUMBER 0x02 +#define NET8_DATATYPE_VARNUM 0x06 +#define NET8_DATATYPE_LONG 0x08 +#define NET8_DATATYPE_DATE 0x0C +#define NET8_DATATYPE_RAW 0x17 +#define NET8_DATATYPE_LONG_RAW 0x18 +#define NET8_DATATYPE_CHAR 0x60 +#define NET8_DATATYPE_RESULT_SET 0x66 +#define NET8_DATATYPE_ROWID 0x68 +#define NET8_DATATYPE_NAMED_TYPE 0x6D +#define NET8_DATATYPE_REF_TYPE 0x6F +#define NET8_DATATYPE_CLOB 0x70 +#define NET8_DATATYPE_BLOB 0x71 +#define NET8_DATATYPE_BFILE 0x72 +#define NET8_DATATYPE_TIMESTAMP 0xB4 +#define NET8_DATATYPE_TIMESTAMPTZ 0xB5 +#define NET8_DATATYPE_INTERVALYM 0xB6 +#define NET8_DATATYPE_INTERVALDS 0xB7 +#define NET8_DATATYPE_TIMESTAMPLTZ 0xE7 +#define NET8_DATATYPE_PLSQL_INDEX_TABLE 0x3E6 +#define NET8_DATATYPE_FIXED_CHAR 0x3E7 /*+-------------------------------------------------- * datatype sizes *--------------------------------------------------- -*/ -#define NET8_DATATYPE_SIZE_TIMESTAMP 11 -#define NET8_DATATYPE_SIZE_TIMESTAMPNOFRAC 7 -#define NET8_DATATYPE_SIZE_DATE 7 -#define NET8_DATATYPE_SIZE_TIMESTAMPZ 13 -#define NET8_TIMESTAMPZ_REGIONIDBIT 0x80 /*-128*/ -#define NET8_DATATYPE_SIZE_TIMESTAMPLTZ 11 -#define NET8_DATATYPE_SIZE_TIMESTAMPLTZNOFRAC 7 +#define NET8_DATATYPE_SIZE_TIMESTAMP 11 +#define NET8_DATATYPE_SIZE_TIMESTAMPNOFRAC 7 +#define NET8_DATATYPE_SIZE_DATE 7 +#define NET8_DATATYPE_SIZE_TIMESTAMPZ 13 +#define NET8_TIMESTAMPZ_REGIONIDBIT 0x80 /*-128*/ +#define NET8_DATATYPE_SIZE_TIMESTAMPLTZ 11 +#define NET8_DATATYPE_SIZE_TIMESTAMPLTZNOFRAC 7 diff --git a/epan/dissectors/packet-xtp.c b/epan/dissectors/packet-xtp.c index 7f49be0e58..92720a5a11 100644 --- a/epan/dissectors/packet-xtp.c +++ b/epan/dissectors/packet-xtp.c @@ -29,8 +29,6 @@ # include "config.h" #endif -#include <stdlib.h> - #include <glib.h> #include <epan/packet.h> @@ -226,7 +224,7 @@ dissect_xtp_aseg(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { /** display common fields **/ offset = start; /* alen(2) */ - ti = proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_alen, + ti = proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_alen, tvb, offset, 2, aseg->alen); offset += 2; if (aseg->alen > len) { @@ -235,11 +233,11 @@ dissect_xtp_aseg(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { error = 1; } /* adomain(1) */ - proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_adomain, + proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_adomain, tvb, offset, 1, aseg->adomain); offset++; /* aformat(1) */ - ti2 = proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_aformat, + ti2 = proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_aformat, tvb, offset, 1, aseg->aformat); offset++; switch (aseg->aformat) { @@ -259,14 +257,14 @@ dissect_xtp_aseg(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { break; default: if (aseg->aformat < 128) { - proto_item_append_text(ti2, + proto_item_append_text(ti2, ", Unsupported aformat(%u)", aseg->aformat); error = 1; } break; } - if (error) + if (error) return (offset - start); /** parse and display each address fileds */ @@ -275,29 +273,29 @@ dissect_xtp_aseg(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { case 0: /* address(4) */ aseg->dsthost = tvb_get_ntohl(tvb, offset); - proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_address, + proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_address, tvb, offset, 4, aseg->dsthost); offset += 4; break; case 1: /* dsthost(4) */ aseg->dsthost = tvb_get_ipv4(tvb, offset); - proto_tree_add_ipv4(xtp_subtree, hf_xtp_aseg_dsthost, + proto_tree_add_ipv4(xtp_subtree, hf_xtp_aseg_dsthost, tvb, offset, 4, aseg->dsthost); offset += 4; /* srchost(4) */ aseg->srchost = tvb_get_ipv4(tvb, offset); - proto_tree_add_ipv4(xtp_subtree, hf_xtp_aseg_srchost, + proto_tree_add_ipv4(xtp_subtree, hf_xtp_aseg_srchost, tvb, offset, 4, aseg->srchost); offset += 4; /* dstport(2) */ aseg->dstport = tvb_get_ntohs(tvb, offset); - proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_dstport, + proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_dstport, tvb, offset, 2, aseg->dstport); offset += 2; /* srcport(2) */ aseg->srcport = tvb_get_ntohs(tvb, offset); - proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_srcport, + proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_srcport, tvb, offset, 2, aseg->srcport); offset += 2; @@ -321,12 +319,12 @@ dissect_xtp_traffic_cntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *xtp_subtree; struct xtp_traffic_cntl tcntl[1]; - top_ti = proto_tree_add_text(tree, tvb, offset, len, + top_ti = proto_tree_add_text(tree, tvb, offset, len, "Traffic Control Segment"); xtp_subtree = proto_item_add_subtree(top_ti, ett_xtp_tcntl); if (len < XTP_TRAFFIC_CNTL_LEN) { - proto_item_append_text(top_ti, + proto_item_append_text(top_ti, ", bogus length(%u, must be at least %u)", len, XTP_TRAFFIC_CNTL_LEN); return 0; @@ -356,34 +354,34 @@ dissect_xtp_traffic_cntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /** add summary **/ if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, + col_append_fstr(pinfo->cinfo, COL_INFO, " Recv-Seq=%" G_GINT64_MODIFIER "u", tcntl->rseq); - col_append_fstr(pinfo->cinfo, COL_INFO, + col_append_fstr(pinfo->cinfo, COL_INFO, " Alloc=%" G_GINT64_MODIFIER "u", tcntl->alloc); } - proto_item_append_text(top_ti, + proto_item_append_text(top_ti, ", Recv-Seq: %" G_GINT64_MODIFIER "u", tcntl->rseq); /** display **/ offset = start; /* rseq(8) */ - proto_tree_add_uint64(xtp_subtree, hf_xtp_tcntl_rseq, + proto_tree_add_uint64(xtp_subtree, hf_xtp_tcntl_rseq, tvb, offset, 8, tcntl->rseq); offset += 8; /* alloc(8) */ - proto_tree_add_uint64(xtp_subtree, hf_xtp_tcntl_alloc, + proto_tree_add_uint64(xtp_subtree, hf_xtp_tcntl_alloc, tvb, offset, 8, tcntl->alloc); offset += 4; /* echo(4) */ - proto_tree_add_uint(xtp_subtree, hf_xtp_tcntl_echo, + proto_tree_add_uint(xtp_subtree, hf_xtp_tcntl_echo, tvb, offset, 4, tcntl->echo); offset += 4; /* rsvd(4) */ - proto_tree_add_uint(xtp_subtree, hf_xtp_tcntl_rsvd, + proto_tree_add_uint(xtp_subtree, hf_xtp_tcntl_rsvd, tvb, offset, 4, tcntl->rsvd); offset += 4; /* xkey(8) */ - proto_tree_add_uint64(xtp_subtree, hf_xtp_tcntl_xkey, + proto_tree_add_uint64(xtp_subtree, hf_xtp_tcntl_xkey, tvb, offset, 8, tcntl->xkey); offset += 8; @@ -403,7 +401,7 @@ dissect_xtp_tspec(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { xtp_subtree = proto_item_add_subtree(ti, ett_xtp_tspec); if (len < XTP_TRAFFIC_SPEC0_LEN) { - proto_item_append_text(ti, + proto_item_append_text(ti, ", bogus length(%u, must be at least %u)", len, XTP_TRAFFIC_SPEC0_LEN); return 0; @@ -423,7 +421,7 @@ dissect_xtp_tspec(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { /** display common fields */ offset = start; /* tlen(2) */ - ti = proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_tlen, + ti = proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_tlen, tvb, offset, 2, tspec->tlen); offset += 2; if (tspec->tlen > len) { @@ -432,30 +430,30 @@ dissect_xtp_tspec(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { error = 1; } /* service(1) */ - proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_service, + proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_service, tvb, offset, 1, tspec->service); offset++; /* tformat(1) */ - ti2 = proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_tformat, + ti2 = proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_tformat, tvb, offset, 1, tspec->tformat); offset++; switch (tspec->tformat) { case 0: - if (tspec->tlen != XTP_TRAFFIC_SPEC0_LEN) { + if (tspec->tlen != XTP_TRAFFIC_SPEC0_LEN) { proto_item_append_text(ti, ", bogus length(%u, must be %u)", tspec->tlen, XTP_TRAFFIC_SPEC0_LEN); error = 1; } break; case 1: - if (tspec->tlen != XTP_TRAFFIC_SPEC1_LEN) { + if (tspec->tlen != XTP_TRAFFIC_SPEC1_LEN) { proto_item_append_text(ti, ", bogus length(%u, must be %u)", tspec->tlen, XTP_TRAFFIC_SPEC1_LEN); error = 1; } break; default: - proto_item_append_text(ti2, ", Unsupported tformat(%u)", + proto_item_append_text(ti2, ", Unsupported tformat(%u)", tspec->tformat); error = 1; break; @@ -470,34 +468,34 @@ dissect_xtp_tspec(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { case 0: /* traffic(4) */ tspec->maxdata = tvb_get_ntohl(tvb, offset); - proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_traffic, + proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_traffic, tvb, offset, 4, tspec->maxdata); offset += 4; break; case 1: /* maxdata(4) */ tspec->maxdata = tvb_get_ntohl(tvb, offset); - proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_maxdata, + proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_maxdata, tvb, offset, 4, tspec->maxdata); offset += 4; /* inrate(4) */ tspec->inrate = tvb_get_ntohl(tvb, offset); - proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_inrate, + proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_inrate, tvb, offset, 4, tspec->inrate); offset += 4; /* inburst(4) */ tspec->inburst = tvb_get_ntohl(tvb, offset); - proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_inburst, + proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_inburst, tvb, offset, 4, tspec->inburst); offset += 4; /* outrate(4) */ tspec->outrate = tvb_get_ntohl(tvb, offset); - proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_outrate, + proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_outrate, tvb, offset, 4, tspec->outrate); offset += 4; /* outburst(4) */ tspec->outburst = tvb_get_ntohl(tvb, offset); - proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_outburst, + proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_outburst, tvb, offset, 4, tspec->outburst); offset += 4; break; @@ -543,7 +541,7 @@ dissect_xtp_cntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *xtp_subtree; struct xtp_cntl cntl[1]; - top_ti = proto_tree_add_text(tree, tvb, offset, len, + top_ti = proto_tree_add_text(tree, tvb, offset, len, "Common Control Segment"); xtp_subtree = proto_item_add_subtree(top_ti, ett_xtp_cntl); @@ -569,26 +567,26 @@ dissect_xtp_cntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /** add summary **/ if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, + col_append_fstr(pinfo->cinfo, COL_INFO, " Recv-Seq=%" G_GINT64_MODIFIER "u", cntl->rseq); - col_append_fstr(pinfo->cinfo, COL_INFO, + col_append_fstr(pinfo->cinfo, COL_INFO, " Alloc=%" G_GINT64_MODIFIER "u", cntl->alloc); } - proto_item_append_text(top_ti, + proto_item_append_text(top_ti, ", Recv-Seq: %" G_GINT64_MODIFIER "u", cntl->rseq); /** display **/ offset = start; /* rseq(8) */ - proto_tree_add_uint64(xtp_subtree, hf_xtp_cntl_rseq, + proto_tree_add_uint64(xtp_subtree, hf_xtp_cntl_rseq, tvb, offset, 8, cntl->rseq); offset += 8; /* alloc(8) */ - proto_tree_add_uint64(xtp_subtree, hf_xtp_cntl_alloc, + proto_tree_add_uint64(xtp_subtree, hf_xtp_cntl_alloc, tvb, offset, 8, cntl->alloc); offset += 4; /* echo(4) */ - proto_tree_add_uint(xtp_subtree, hf_xtp_cntl_echo, + proto_tree_add_uint(xtp_subtree, hf_xtp_cntl_echo, tvb, offset, 4, cntl->echo); return; @@ -618,12 +616,12 @@ dissect_xtp_ecntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 spans_len; guint i; - top_ti = proto_tree_add_text(tree, tvb, offset, len, + top_ti = proto_tree_add_text(tree, tvb, offset, len, "Error Control Segment"); xtp_subtree = proto_item_add_subtree(top_ti, ett_xtp_ecntl); if (len < MIN_XTP_ECNTL_PKT_LEN) { - proto_item_append_text(top_ti, + proto_item_append_text(top_ti, ", bogus length (%u, must be at least %u)", len, MIN_XTP_ECNTL_PKT_LEN); return; @@ -649,7 +647,7 @@ dissect_xtp_ecntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, len = len + XTP_HEADER_LEN - offset; spans_len = 16 * ecntl->nspan; if (len != spans_len) { - proto_item_append_text(top_ti, + proto_item_append_text(top_ti, ", bogus spans field length (%u, must be %u)", len, spans_len); return; @@ -667,40 +665,40 @@ dissect_xtp_ecntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /** add summary **/ if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, + col_append_fstr(pinfo->cinfo, COL_INFO, " Recv-Seq=%" G_GINT64_MODIFIER "u", ecntl->rseq); - col_append_fstr(pinfo->cinfo, COL_INFO, + col_append_fstr(pinfo->cinfo, COL_INFO, " Alloc=%" G_GINT64_MODIFIER "u", ecntl->alloc); } - proto_item_append_text(top_ti, + proto_item_append_text(top_ti, ", Recv-Seq: %" G_GINT64_MODIFIER "u", ecntl->rseq); - + /** display **/ offset = start; /* rseq(8) */ - proto_tree_add_uint64(xtp_subtree, hf_xtp_ecntl_rseq, + proto_tree_add_uint64(xtp_subtree, hf_xtp_ecntl_rseq, tvb, offset, 8, ecntl->rseq); offset += 8; /* alloc(8) */ - proto_tree_add_uint64(xtp_subtree, hf_xtp_ecntl_alloc, + proto_tree_add_uint64(xtp_subtree, hf_xtp_ecntl_alloc, tvb, offset, 8, ecntl->alloc); offset += 8; /* echo(4) */ - proto_tree_add_uint(xtp_subtree, hf_xtp_ecntl_echo, + proto_tree_add_uint(xtp_subtree, hf_xtp_ecntl_echo, tvb, offset, 4, ecntl->echo); offset += 4; /* nspan(4) */ - ti = proto_tree_add_uint(xtp_subtree, hf_xtp_ecntl_nspan, + ti = proto_tree_add_uint(xtp_subtree, hf_xtp_ecntl_nspan, tvb, offset, 4, ecntl->nspan); offset += 4; /* spans(16n) */ p = spans; for (i = 0; i < ecntl->nspan; i++) { - proto_tree_add_uint64(xtp_subtree, hf_xtp_ecntl_span_left, + proto_tree_add_uint64(xtp_subtree, hf_xtp_ecntl_span_left, tvb, offset, 8, *p); p++; offset += 8; - proto_tree_add_uint64(xtp_subtree, hf_xtp_ecntl_span_right, + proto_tree_add_uint64(xtp_subtree, hf_xtp_ecntl_span_right, tvb, offset, 8, *p); p++; offset += 8; @@ -752,7 +750,7 @@ dissect_xtp_diag(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { xtp_subtree = proto_item_add_subtree(ti, ett_xtp_diag); if (len < XTP_DIAG_PKT_HEADER_LEN) { - proto_item_append_text(ti, + proto_item_append_text(ti, ", bogus length (%u, must be at least %u)", len, XTP_DIAG_PKT_HEADER_LEN); return; @@ -768,19 +766,19 @@ dissect_xtp_diag(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { /* message(n) */ msg_len = tvb_length_remaining(tvb, offset); diag->msg = tvb_get_string(tvb, offset, msg_len); - + /** display **/ offset = start; /* code(4) */ - proto_tree_add_uint(xtp_subtree, hf_xtp_diag_code, + proto_tree_add_uint(xtp_subtree, hf_xtp_diag_code, tvb, offset, 4, diag->code); offset += 4; /* val(4) */ - proto_tree_add_uint(xtp_subtree, hf_xtp_diag_val, + proto_tree_add_uint(xtp_subtree, hf_xtp_diag_val, tvb, offset, 4, diag->val); offset += 4; /* message(4) */ - proto_tree_add_string(xtp_subtree, hf_xtp_diag_msg, + proto_tree_add_string(xtp_subtree, hf_xtp_diag_msg, tvb, offset, msg_len, diag->msg); return; @@ -849,20 +847,20 @@ dissect_xtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { for (i = 0; i < 16; i++) { bpos = 1 << (15 - i); if (cmd_options & bpos) { - returned_length = g_snprintf(&options[fpos], + returned_length = g_snprintf(&options[fpos], MAX_OPTIONS_LEN-fpos, "%s%s", fpos?", ":"", fstr[i]); fpos += MIN(returned_length, MAX_OPTIONS_LEN-fpos); } } - + if (check_col(pinfo->cinfo, COL_INFO)) { col_add_str(pinfo->cinfo, COL_INFO, - val_to_str(xtph->cmd_ptype_pformat, + val_to_str(xtph->cmd_ptype_pformat, pformat_vals, "Unknown pformat (%u)")); col_append_fstr(pinfo->cinfo, COL_INFO, " [%s]", options); - col_append_fstr(pinfo->cinfo, COL_INFO, + col_append_fstr(pinfo->cinfo, COL_INFO, " Seq=%" G_GINT64_MODIFIER "u", xtph->seq); col_append_fstr(pinfo->cinfo, COL_INFO, " Len=%u", xtph->dlen); } @@ -870,75 +868,75 @@ dissect_xtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if (tree) { ti = proto_tree_add_item(tree, proto_xtp, tvb, 0, -1, FALSE); /** add summary **/ - proto_item_append_text(ti, + proto_item_append_text(ti, ", Key: 0x%016" G_GINT64_MODIFIER "X", xtph->key); - proto_item_append_text(ti, + proto_item_append_text(ti, ", Seq: %" G_GINT64_MODIFIER "u", xtph->seq); proto_item_append_text(ti, ", Len: %u", xtph->dlen); xtp_tree = proto_item_add_subtree(ti, ett_xtp); /* key(8) */ offset = 0; - ti = proto_tree_add_uint64(xtp_tree, hf_xtp_key, + ti = proto_tree_add_uint64(xtp_tree, hf_xtp_key, tvb, offset, 8, xtph->key); xtp_subtree = proto_item_add_subtree(ti, ett_xtp_key); offset += 8; /* cmd(4) */ - ti = proto_tree_add_uint(xtp_tree, hf_xtp_cmd, + ti = proto_tree_add_uint(xtp_tree, hf_xtp_cmd, tvb, offset, 4, xtph->cmd); xtp_cmd_tree = proto_item_add_subtree(ti, ett_xtp_cmd); - ti = proto_tree_add_uint(xtp_cmd_tree, hf_xtp_cmd_options, + ti = proto_tree_add_uint(xtp_cmd_tree, hf_xtp_cmd_options, tvb, offset, 3, xtph->cmd_options); /** add summary **/ proto_item_append_text(ti, " [%s]", options); xtp_subtree = proto_item_add_subtree(ti, ett_xtp_cmd_options); - proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_nocheck, + proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_nocheck, tvb, offset, 3, xtph->cmd_options); - proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_edge, + proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_edge, tvb, offset, 3, xtph->cmd_options); - proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_noerr, + proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_noerr, tvb, offset, 3, xtph->cmd_options); - proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_multi, + proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_multi, tvb, offset, 3, xtph->cmd_options); - proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_res, + proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_res, tvb, offset, 3, xtph->cmd_options); - proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_sort, + proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_sort, tvb, offset, 3, xtph->cmd_options); - proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_noflow, + proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_noflow, tvb, offset, 3, xtph->cmd_options); - proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_fastnak, + proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_fastnak, tvb, offset, 3, xtph->cmd_options); - proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_sreq, + proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_sreq, tvb, offset, 3, xtph->cmd_options); - proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_dreq, + proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_dreq, tvb, offset, 3, xtph->cmd_options); - proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_rclose, + proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_rclose, tvb, offset, 3, xtph->cmd_options); - proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_wclose, + proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_wclose, tvb, offset, 3, xtph->cmd_options); - proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_eom, + proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_eom, tvb, offset, 3, xtph->cmd_options); - proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_end, + proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_end, tvb, offset, 3, xtph->cmd_options); - proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_btag, + proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_btag, tvb, offset, 3, xtph->cmd_options); - offset += 3; - ti = proto_tree_add_uint(xtp_cmd_tree, hf_xtp_cmd_ptype, + offset += 3; + ti = proto_tree_add_uint(xtp_cmd_tree, hf_xtp_cmd_ptype, tvb, offset, 1, xtph->cmd_ptype); xtp_subtree = proto_item_add_subtree(ti, ett_xtp_cmd_ptype); - proto_tree_add_uint(xtp_subtree, hf_xtp_cmd_ptype_ver, + proto_tree_add_uint(xtp_subtree, hf_xtp_cmd_ptype_ver, tvb, offset, 1, xtph->cmd_ptype_ver); if (xtph->cmd_ptype_ver != XTP_VERSION_4) { - proto_item_append_text(ti, + proto_item_append_text(ti, ", Unknown XTP version (%03X)", xtph->cmd_ptype_ver); error = 1; } - proto_tree_add_uint(xtp_subtree, hf_xtp_cmd_ptype_pformat, + proto_tree_add_uint(xtp_subtree, hf_xtp_cmd_ptype_pformat, tvb, offset, 1, xtph->cmd_ptype_pformat); offset++; /* dlen(4) */ - ti = proto_tree_add_uint(xtp_tree, hf_xtp_dlen, + ti = proto_tree_add_uint(xtp_tree, hf_xtp_dlen, tvb, offset, 4, xtph->dlen); if (xtph->dlen != len - XTP_HEADER_LEN) { proto_item_append_text(ti, ", bogus length (%u, must be %u)", @@ -960,12 +958,12 @@ dissect_xtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { } else { proto_tree_add_text(xtp_tree, tvb, offset, 2, "Checksum: 0x%04x [incorrect, should be 0x%04x]", - xtph->check, + xtph->check, in_cksum_shouldbe(xtph->check, computed_cksum)); } } else { - proto_tree_add_text(xtp_tree, tvb, offset, 2, + proto_tree_add_text(xtp_tree, tvb, offset, 2, "Checksum: 0x%04x", xtph->check); } offset += 2; @@ -978,7 +976,7 @@ dissect_xtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /* seq(8) */ proto_tree_add_uint64(xtp_tree, hf_xtp_seq, tvb, offset, 8, xtph->seq); offset += 8; - + if (!error) { switch (xtph->cmd_ptype_pformat) { case XTP_DATA_PKT: @@ -1036,77 +1034,77 @@ proto_register_xtp(void) }, { &hf_xtp_cmd_options_nocheck, { "NOCHECK", "xtp.cmd.options.nocheck", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), + FT_BOOLEAN, 24, TFS(&tfs_set_notset), XTP_CMD_OPTIONS_NOCHECK, NULL, HFILL } }, { &hf_xtp_cmd_options_edge, { "EDGE", "xtp.cmd.options.edge", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), + FT_BOOLEAN, 24, TFS(&tfs_set_notset), XTP_CMD_OPTIONS_EDGE, NULL, HFILL } }, { &hf_xtp_cmd_options_noerr, { "NOERR", "xtp.cmd.options.noerr", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), + FT_BOOLEAN, 24, TFS(&tfs_set_notset), XTP_CMD_OPTIONS_NOERR, NULL, HFILL } }, { &hf_xtp_cmd_options_multi, { "MULTI", "xtp.cmd.options.multi", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), + FT_BOOLEAN, 24, TFS(&tfs_set_notset), XTP_CMD_OPTIONS_MULTI, NULL, HFILL } }, { &hf_xtp_cmd_options_res, { "RES", "xtp.cmd.options.res", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), + FT_BOOLEAN, 24, TFS(&tfs_set_notset), XTP_CMD_OPTIONS_RES, NULL, HFILL } }, { &hf_xtp_cmd_options_sort, { "SORT", "xtp.cmd.options.sort", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), + FT_BOOLEAN, 24, TFS(&tfs_set_notset), XTP_CMD_OPTIONS_SORT, NULL, HFILL } }, { &hf_xtp_cmd_options_noflow, { "NOFLOW", "xtp.cmd.options.noflow", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), + FT_BOOLEAN, 24, TFS(&tfs_set_notset), XTP_CMD_OPTIONS_NOFLOW, NULL, HFILL } }, { &hf_xtp_cmd_options_fastnak, { "FASTNAK", "xtp.cmd.options.fastnak", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), + FT_BOOLEAN, 24, TFS(&tfs_set_notset), XTP_CMD_OPTIONS_FASTNAK, NULL, HFILL } }, { &hf_xtp_cmd_options_sreq, { "SREQ", "xtp.cmd.options.sreq", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), + FT_BOOLEAN, 24, TFS(&tfs_set_notset), XTP_CMD_OPTIONS_SREQ, NULL, HFILL } }, { &hf_xtp_cmd_options_dreq, { "DREQ", "xtp.cmd.options.dreq", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), + FT_BOOLEAN, 24, TFS(&tfs_set_notset), XTP_CMD_OPTIONS_DREQ, NULL, HFILL } }, { &hf_xtp_cmd_options_rclose, { "RCLOSE", "xtp.cmd.options.rclose", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), + FT_BOOLEAN, 24, TFS(&tfs_set_notset), XTP_CMD_OPTIONS_RCLOSE, NULL, HFILL } }, { &hf_xtp_cmd_options_wclose, { "WCLOSE", "xtp.cmd.options.wclose", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), + FT_BOOLEAN, 24, TFS(&tfs_set_notset), XTP_CMD_OPTIONS_WCLOSE, NULL, HFILL } }, { &hf_xtp_cmd_options_eom, { "EOM", "xtp.cmd.options.eom", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), + FT_BOOLEAN, 24, TFS(&tfs_set_notset), XTP_CMD_OPTIONS_EOM, NULL, HFILL } }, { &hf_xtp_cmd_options_end, { "END", "xtp.cmd.options.end", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), + FT_BOOLEAN, 24, TFS(&tfs_set_notset), XTP_CMD_OPTIONS_END, NULL, HFILL } }, { &hf_xtp_cmd_options_btag, { "BTAG", "xtp.cmd.options.btag", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), + FT_BOOLEAN, 24, TFS(&tfs_set_notset), XTP_CMD_OPTIONS_BTAG, NULL, HFILL } }, { &hf_xtp_cmd_ptype, |