From 121c65c613316380596cda4d3ae16c01f4e49c65 Mon Sep 17 00:00:00 2001 From: Bill Meier Date: Mon, 7 Feb 2011 18:49:29 +0000 Subject: Remove unneeded #includes (stdio.h,stdlib.h); Whitespace cleanup: trailing, indentation, "4-space tabs" svn path=/trunk/; revision=35850 --- epan/dissectors/packet-bssap.c | 248 +- epan/dissectors/packet-dpnss.c | 2825 +++++++++++----------- epan/dissectors/packet-eigrp.c | 1458 +++++------ epan/dissectors/packet-erf.c | 326 ++- epan/dissectors/packet-icep.c | 857 ++++--- epan/dissectors/packet-icmpv6.c | 3318 ++++++++++++------------- epan/dissectors/packet-kink.c | 182 +- epan/dissectors/packet-nsip.c | 472 ++-- epan/dissectors/packet-pw-atm.c | 160 +- epan/dissectors/packet-rtps.c | 1365 ++++++----- epan/dissectors/packet-sbus.c | 2162 ++++++++--------- epan/dissectors/packet-sigcomp.c | 4649 ++++++++++++++++++------------------ epan/dissectors/packet-sndcp.c | 474 ++-- epan/dissectors/packet-sqloracle.h | 374 +-- epan/dissectors/packet-xtp.c | 214 +- 15 files changed, 9551 insertions(+), 9533 deletions(-) (limited to 'epan/dissectors') 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 #include #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 - * + * * Supplementary string parameter table and testing by Tomas Muehlhoff. * * $Id$ @@ -9,17 +9,17 @@ * Wireshark - Network traffic analyzer * By Gerald Combs * 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 - #include #include #include /* 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((offsetcinfo, 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 -#include #include #include @@ -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 * * $Id$ @@ -8,17 +8,17 @@ * Wireshark - Network traffic analyzer * By Gerald Combs * 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 -#include - #include #include @@ -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 * * - * 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 + * "context" is a dictionary * - * dictionary == Size + SizeKeyValuePairs + * dictionary == Size + SizeKeyValuePairs * dictionary = 1byte (0..254) + SizeKeyValuePairs - * or - * dictionary= 1byte (255) + 1int (255..2^32-1)+SizeKeyValuePairs - * + * or + * dictionary= 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 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 * */ - + 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); - } - 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); + proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_ext_data, tvb, opt_offset, ext_data_len, FALSE); + opt_offset += ext_data_len; + } - 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; + /* 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; - /* 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; + /* 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); - /* 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; - } /* switch (opt_type) */ + /* 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; + + 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 * * $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 - #include #include @@ -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 -#include #include #include #include @@ -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 * PETR SMOLIK * ZDENEK SEBEK - * Czech Technical University in Prague + * Czech Technical University in Prague * Faculty of Electrical Engineering - * Department of Control Engineering - * + * Department of Control Engineering + * * $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 -#include #include #include #include - #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, * ::= char+ * ::= unsigned long * ::= (char)0 - * + * * ::= - * + * *