Remove unneeded #includes (stdio.h,stdlib.h);

Whitespace cleanup: trailing, indentation, "4-space tabs"

svn path=/trunk/; revision=35850
This commit is contained in:
Bill Meier 2011-02-07 18:49:29 +00:00
parent 9d3586b4f5
commit 121c65c613
15 changed files with 9513 additions and 9495 deletions

View File

@ -35,7 +35,6 @@
# include "config.h"
#endif
#include <stdlib.h>
#include <glib.h>
#ifdef HAVE_SYS_TYPES_H
@ -215,39 +214,39 @@ static const value_string bssap_plus_message_type_values[] = {
static const value_string bssap_plus_ie_id_values[] = {
static const value_string bssap_plus_ie_id_values[] = {
{ BSSAP_IMSI, "IMSI" }, /* 18.4.10 */
{ BSSAP_VLR_NUMBER, "VLR number" }, /* 18.4.26 */
{ BSSAP_VLR_NUMBER, "VLR number" }, /* 18.4.26 */
{ BSSAP_TMSI, "TMSI" }, /* 18.4.23 */
{ BSSAP_LOC_AREA_ID, "Location area identifier" }, /* 18.4.14 */
{ BSSAP_CHANNEL_NEEDED, "Channel Needed" }, /* 18.4.2 */
{ BSSAP_EMLPP_PRIORITY, "eMLPP Priority" }, /* 18.4.4 */
{ BSSAP_TMSI_STATUS, "TMSI status" }, /* 18.4.24 */
{ BSSAP_GS_CAUSE, "Gs cause" }, /* 18.4.7 */
{ BSSAP_SGSN_NUMBER, "SGSN number" }, /* 18.4.22 */
{ BSSAP_GPRS_LOC_UPD_TYPE, "GPRS location update type" }, /* 18.4.6 */
{ BSSAP_GLOBAL_CN_ID, "Global CN-Id" }, /* 18.4.27 */
{ 0x0c, "Unassigned: treated as an unknown IEI." }, /* 18 and 16 */
{ BSSAP_MOBILE_STN_CLS_MRK1, "Mobile station classmark 1" }, /* 18.4.18 */
{ BSSAP_MOBILE_ID, "Mobile identity" }, /* 18.4.17 */
{ BSSAP_REJECT_CAUSE, "Reject cause" }, /* 18.4.21 */
{ BSSAP_IMSI_DET_FROM_GPRS_SERV_TYPE, "IMSI detach from GPRS service type" }, /* 18.4.11 */
{ BSSAP_IMSI_DET_FROM_NON_GPRS_SERV_TYPE, "IMSI detach from non-GPRS service type" }, /* 18.4.12 */
{ BSSAP_LOC_AREA_ID, "Location area identifier" }, /* 18.4.14 */
{ BSSAP_CHANNEL_NEEDED, "Channel Needed" }, /* 18.4.2 */
{ BSSAP_EMLPP_PRIORITY, "eMLPP Priority" }, /* 18.4.4 */
{ BSSAP_TMSI_STATUS, "TMSI status" }, /* 18.4.24 */
{ BSSAP_GS_CAUSE, "Gs cause" }, /* 18.4.7 */
{ BSSAP_SGSN_NUMBER, "SGSN number" }, /* 18.4.22 */
{ BSSAP_GPRS_LOC_UPD_TYPE, "GPRS location update type" }, /* 18.4.6 */
{ BSSAP_GLOBAL_CN_ID, "Global CN-Id" }, /* 18.4.27 */
{ 0x0c, "Unassigned: treated as an unknown IEI." }, /* 18 and 16 */
{ BSSAP_MOBILE_STN_CLS_MRK1, "Mobile station classmark 1" }, /* 18.4.18 */
{ BSSAP_MOBILE_ID, "Mobile identity" }, /* 18.4.17 */
{ BSSAP_REJECT_CAUSE, "Reject cause" }, /* 18.4.21 */
{ BSSAP_IMSI_DET_FROM_GPRS_SERV_TYPE, "IMSI detach from GPRS service type" }, /* 18.4.11 */
{ BSSAP_IMSI_DET_FROM_NON_GPRS_SERV_TYPE, "IMSI detach from non-GPRS service type" }, /* 18.4.12 */
{ BSSAP_INFO_REQ, "Information requested" }, /* 18.4.13 */
{ BSSAP_PTMSI, "PTMSI" }, /* 18.4.20 */
{ BSSAP_IMEI, "IMEI" }, /* 18.4.8 */
{ BSSAP_IMEISV, "IMEISV" }, /* 18.4.9 */
{ 0x16, "Unassigned: treated as an unknown IEI." }, /* 18 and 16 */
{ BSSAP_MM_INFORMATION, "MM information" }, /* 18.4.16 */
{ BSSAP_CELL_GBL_ID, "Cell Global Identity" }, /* 18.4.1 */
{ BSSAP_LOC_INF_AGE, "Location information age" }, /* 18.4.15 */
{ BSSAP_MOBILE_STN_STATE, "Mobile station state" }, /* 18.4.19 */
{ BSSAP_ERRONEOUS_MSG, "Erroneous message" }, /* 18.4.5 */
{ BSSAP_DLINK_TNL_PLD_CTR_AND_INF, "Downlink Tunnel Payload Control and Info" }, /* 18.4.3 */
{ BSSAP_ULINK_TNL_PLD_CTR_AND_INF, "Uplink Tunnel Payload Control and Info" }, /* 18.4.25 */
{ BSSAP_SERVICE_AREA_ID, "Service Area Identification" }, /* 18.4.21b */
{ 0, NULL }
};
{ 0x16, "Unassigned: treated as an unknown IEI." }, /* 18 and 16 */
{ BSSAP_MM_INFORMATION, "MM information" }, /* 18.4.16 */
{ BSSAP_CELL_GBL_ID, "Cell Global Identity" }, /* 18.4.1 */
{ BSSAP_LOC_INF_AGE, "Location information age" }, /* 18.4.15 */
{ BSSAP_MOBILE_STN_STATE, "Mobile station state" }, /* 18.4.19 */
{ BSSAP_ERRONEOUS_MSG, "Erroneous message" }, /* 18.4.5 */
{ BSSAP_DLINK_TNL_PLD_CTR_AND_INF, "Downlink Tunnel Payload Control and Info" }, /* 18.4.3 */
{ BSSAP_ULINK_TNL_PLD_CTR_AND_INF, "Uplink Tunnel Payload Control and Info" }, /* 18.4.25 */
{ BSSAP_SERVICE_AREA_ID, "Service Area Identification" }, /* 18.4.21b */
{ 0, NULL }
};
/* Initialize the protocol and registered fields */
static int proto_bssap = -1;
@ -286,7 +285,7 @@ static int hf_bssap_global_cn_id_ie = -1;
static int hf_bssap_plus_ie_data = -1;
static int hf_bssap_extension = -1;
static int hf_bssap_type_of_number = -1;
static int hf_bssap_type_of_number = -1;
static int hf_bssap_numbering_plan_id = -1;
static int hf_bssap_sgsn_number = -1;
static int hf_bssap_vlr_number = -1;
@ -608,7 +607,7 @@ dissect_bssap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, ((bssap_or_bsap_global == BSSAP) ? "BSSAP" : "BSAP"));
}
if ( pinfo->sccp_info && pinfo->sccp_info->data.co.assoc )
if ( pinfo->sccp_info && pinfo->sccp_info->data.co.assoc )
pinfo->sccp_info->data.co.assoc->payload = SCCP_PLOAD_BSSAP;
/*
@ -625,7 +624,7 @@ dissect_bssap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/*
/*
* BSSAP+ Routines
*/
@ -644,7 +643,7 @@ static dgt_set_t Dgt1_9_bcd = {
'0','1','2','3','4','5','6','7','8','9','?','?','?','?','?'
}
};
/* Assumes the rest of the tvb contains the digits to be turned into a string
/* Assumes the rest of the tvb contains the digits to be turned into a string
*/
static const char*
unpack_digits(tvbuff_t *tvb, int offset,dgt_set_t *dgt,gboolean skip_first){
@ -663,7 +662,7 @@ unpack_digits(tvbuff_t *tvb, int offset,dgt_set_t *dgt,gboolean skip_first){
octet = tvb_get_guint8(tvb,offset);
if (!skip_first){
digit_str[i] = dgt->out[octet & 0x0f];
digit_str[i] = dgt->out[octet & 0x0f];
i++;
}
skip_first = FALSE;
@ -676,7 +675,7 @@ unpack_digits(tvbuff_t *tvb, int offset,dgt_set_t *dgt,gboolean skip_first){
if (octet == 0x0f) /* odd number bytes - hit filler */
break;
digit_str[i] = dgt->out[octet & 0x0f];
digit_str[i] = dgt->out[octet & 0x0f];
i++;
offset++;
@ -693,7 +692,8 @@ check_ie(tvbuff_t *tvb, proto_tree *tree, int *offset, guint8 expected_ie){
ie_type = tvb_get_guint8(tvb,*offset);
if (ie_type != expected_ie){
proto_tree_add_text(tree, tvb, *offset, 1, "Mandatory IE %s expected but IE %s Found",
val_to_str(expected_ie,bssap_plus_ie_id_values,"Unknown %u"), val_to_str(ie_type,bssap_plus_ie_id_values,"Unknown %u"));
val_to_str(expected_ie,bssap_plus_ie_id_values,"Unknown %u"),
val_to_str(ie_type,bssap_plus_ie_id_values,"Unknown %u"));
(*offset)++;
ie_len = tvb_get_guint8(tvb,*offset);
*offset = *offset + ie_len;
@ -725,7 +725,7 @@ dissect_bssap_cell_global_id(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_item *cgi_item = NULL;
proto_tree *cgi_tree = NULL;
guint8 ie_len;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_cell_global_id_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_cell_global_id);
@ -764,7 +764,7 @@ dissect_bssap_channel_needed(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_item *item = NULL;
proto_tree *ie_tree = NULL;
guint8 ie_len;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_channel_needed_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_channel_needed);
@ -793,7 +793,7 @@ dissect_bssap_dlink_tunnel_payload_control_and_info(tvbuff_t *tvb, packet_info *
guint8 ie_len;
guint8 octet;
guint8 prot_disc;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_dlink_tnl_pld_cntrl_amd_inf_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_dlink_tnl_pld_cntrl_amd_inf);
@ -817,7 +817,7 @@ dissect_bssap_dlink_tunnel_payload_control_and_info(tvbuff_t *tvb, packet_info *
*/
proto_tree_add_item(ie_tree, hf_bssap_e_bit, tvb, offset, 1, FALSE);
/* octet 3 bit 2 - 1
/* octet 3 bit 2 - 1
* Tunnel Priority: Indicates the priority of the Tunnel Payload. For coding, see Table 20.1: Association
* between Tunnel Priority and LLC SAPs.
*/
@ -837,16 +837,16 @@ dissect_bssap_dlink_tunnel_payload_control_and_info(tvbuff_t *tvb, packet_info *
/* 18.4.4 eMLPP Priority */
/* Call priority */
static const value_string bssap_call_priority_values[] = {
static const value_string bssap_call_priority_values[] = {
{ 0x00, "No priority applied" },
{ 0x01, "Call priority level 4" },
{ 0x02, "Call priority level 3" },
{ 0x03, "Call priority level 2" },
{ 0x04, "Call priority level 1" },
{ 0x05, "Call priority level 0" },
{ 0x06, "Call priority level B" },
{ 0x07, "Call priority level A" },
{ 0, NULL }
{ 0x01, "Call priority level 4" },
{ 0x02, "Call priority level 3" },
{ 0x03, "Call priority level 2" },
{ 0x04, "Call priority level 1" },
{ 0x05, "Call priority level 0" },
{ 0x06, "Call priority level B" },
{ 0x07, "Call priority level A" },
{ 0, NULL }
};
static int
dissect_bssap_emlpp_priority(tvbuff_t *tvb, proto_tree *tree, int offset)
@ -854,7 +854,7 @@ dissect_bssap_emlpp_priority(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_item *item = NULL;
proto_tree *ie_tree = NULL;
guint8 ie_len;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_emlpp_prio_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_emlpp_prio);
@ -867,7 +867,7 @@ dissect_bssap_emlpp_priority(tvbuff_t *tvb, proto_tree *tree, int offset)
the eMLPP-Priority IE defined in 3GPP TS 48.008 (not including
3GPP TS 48.008 IEI and 3GPP TS 48.008 length indicator).
3.2.2.56 eMLPP Priority
The call priority field (bit 3 to 1 of octet 2) is coded in the same way
The call priority field (bit 3 to 1 of octet 2) is coded in the same way
as the call priority field (bit 3 to 1 of octet 5) in the Descriptive group
or broadcast call reference information element as defined in 3GPP TS 24.008.
*/
@ -885,7 +885,7 @@ dissect_bssap_gprs_erroneous_msg(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_item *item = NULL;
proto_tree *ie_tree = NULL;
guint8 ie_len;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_gprs_erroneous_msg_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_erroneous_msg);
@ -903,12 +903,12 @@ dissect_bssap_gprs_erroneous_msg(tvbuff_t *tvb, proto_tree *tree, int offset)
}
static const value_string bssap_plus_GPRS_loc_upd_type_values[] = {
static const value_string bssap_plus_GPRS_loc_upd_type_values[] = {
{ 0x00, "Shall not be sent in this version of the protocol. If received, shall be treated as '00000010'." },
{ 0x01, "IMSI attach" },
{ 0x02, "Normal location update" },
{ 0, NULL }
};
{ 0x01, "IMSI attach" },
{ 0x02, "Normal location update" },
{ 0, NULL }
};
/* 18.4.6 GPRS location update type */
static int
dissect_bssap_gprs_location_update_type(tvbuff_t *tvb, proto_tree *tree, int offset)
@ -916,7 +916,7 @@ dissect_bssap_gprs_location_update_type(tvbuff_t *tvb, proto_tree *tree, int off
proto_item *item = NULL;
proto_tree *ie_tree = NULL;
guint8 ie_len;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_gprs_loc_upd_type_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_gprs_loc_upd);
@ -925,15 +925,15 @@ dissect_bssap_gprs_location_update_type(tvbuff_t *tvb, proto_tree *tree, int off
offset++;
proto_tree_add_item(ie_tree, hf_bssap_plus_ie_len, tvb, offset, 1, FALSE);
offset++;
/* GPRS location update type value (octet 3) */
proto_tree_add_item(ie_tree, hf_bssap_gprs_loc_upd_type, tvb, offset, ie_len, FALSE);
return offset + ie_len;
}
/* Gs Cause value (octet 3) */
static const value_string bssap_Gs_cause_values[] = {
static const value_string bssap_Gs_cause_values[] = {
{ 0x00, "Normal, unspecified in this version of the protocol." },
{ 0x01, "IMSI detached for GPRS services" },
@ -951,8 +951,8 @@ static const value_string bssap_Gs_cause_values[] = {
{ 0x0d, "Address error" },
{ 0x0e, "TOM functionality not supported" },
{ 0x0f, "Ciphering request cannot be accommodated" },
{ 0, NULL }
};
{ 0, NULL }
};
/* 18.4.7 Gs cause */
static int
@ -961,7 +961,7 @@ dissect_bssap_Gs_cause(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_item *item = NULL;
proto_tree *ie_tree = NULL;
guint8 ie_len;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_Gs_cause_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bassp_Gs_cause);
@ -1014,7 +1014,7 @@ dissect_bssap_imesiv(tvbuff_t *tvb, proto_tree *tree, int offset)
guint8 ie_len;
tvbuff_t *ie_tvb;
const char *digit_str;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_imesiv_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bassp_imesiv);
@ -1033,8 +1033,8 @@ dissect_bssap_imesiv(tvbuff_t *tvb, proto_tree *tree, int offset)
return offset + ie_len;
}
/* 18.4.10 IMSI
* The IMSI is coded as a sequence of BCD digits, compressed two into each octet.
/* 18.4.10 IMSI
* The IMSI is coded as a sequence of BCD digits, compressed two into each octet.
* This is a variable length element, and includes a length indicator.
* The IMSI is defined in 3GPP TS 23.003. It shall not exceed 15 digits (see 3GPP TS 23.003).
*/
@ -1048,7 +1048,7 @@ dissect_bssap_imsi(tvbuff_t *tvb, proto_tree *tree, int offset)
guint8 ie_len;
tvbuff_t *ie_tvb;
const char *digit_str;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_imsi_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_imsi);
@ -1060,17 +1060,17 @@ dissect_bssap_imsi(tvbuff_t *tvb, proto_tree *tree, int offset)
ie_tvb = tvb_new_subset(tvb, offset, ie_len,ie_len);
digit_str = unpack_digits(ie_tvb, 0, &Dgt1_9_bcd, TRUE);
proto_tree_add_string(ie_tree, hf_bssap_imsi, ie_tvb, 0, -1, digit_str);
return offset + ie_len;
}
static const value_string bssap_imsi_det_from_gprs_serv_type_values[] _U_ = {
static const value_string bssap_imsi_det_from_gprs_serv_type_values[] _U_ = {
{ 0x00, "Interpreted as reserved in this version of the protocol" },
{ 0x01, "Network initiated IMSI detach from GPRS service" },
{ 0x01, "Network initiated IMSI detach from GPRS service" },
{ 0x02, "MS initiated IMSI detach from GPRS service" },
{ 0x03, "GPRS services not allowed" },
{ 0, NULL }
};
{ 0, NULL }
};
/* 18.4.11 IMSI detach from GPRS service type */
static int
@ -1079,7 +1079,7 @@ dissect_bssap_imsi_det_from_gprs_serv_type(tvbuff_t *tvb, proto_tree *tree, int
proto_item *item = NULL;
proto_tree *ie_tree = NULL;
guint8 ie_len;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_imsi_det_from_gprs_serv_type_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_imsi_det_from_gprs_serv_type);
@ -1102,7 +1102,7 @@ dissect_bssap_imsi_det_from_non_gprs_serv_type(tvbuff_t *tvb, proto_tree *tree,
proto_item *item = NULL;
proto_tree *ie_tree = NULL;
guint8 ie_len;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_imsi_det_from_non_gprs_serv_type_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_imsi_det_from_non_gprs_serv_type);
@ -1117,9 +1117,9 @@ dissect_bssap_imsi_det_from_non_gprs_serv_type(tvbuff_t *tvb, proto_tree *tree,
return offset + ie_len;
}
static const value_string bssap_info_req_values[] = {
static const value_string bssap_info_req_values[] = {
{ 0x00, "Interpreted as Not supported in this version of the protocol." },
{ 0x01, "PTMSI" },
{ 0x01, "PTMSI" },
{ 0x02, "IMEI" },
{ 0x03, "IMEISV" },
{ 0x04, "PTMSI and IMEI" },
@ -1128,8 +1128,8 @@ static const value_string bssap_info_req_values[] = {
{ 0x07, "PTMSI, IMEI, and IMEISV" },
{ 0x08, "Mobile location information" },
{ 0x09, "TMSI" },
{ 0, NULL }
};
{ 0, NULL }
};
/* 18.4.13 Information requested */
static int
dissect_bssap_info_req(tvbuff_t *tvb, proto_tree *tree, int offset)
@ -1137,7 +1137,7 @@ dissect_bssap_info_req(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_item *item = NULL;
proto_tree *ie_tree = NULL;
guint8 ie_len;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_info_req_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_info_req);
@ -1160,7 +1160,7 @@ dissect_bssap_loc_area_id(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_item *item = NULL;
proto_tree *ie_tree = NULL;
guint8 ie_len;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_loc_area_id_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_loc_area_id);
@ -1186,7 +1186,7 @@ dissect_bssap_location_information_age(tvbuff_t *tvb, proto_tree *tree, int offs
proto_item *item = NULL;
proto_tree *ie_tree = NULL;
guint8 ie_len;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_loc_inf_age_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_loc_inf_age);
@ -1219,7 +1219,7 @@ dissect_bssap_MM_information(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_item *item = NULL;
proto_tree *ie_tree = NULL;
guint8 ie_len;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_mm_information_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_mm_information);
@ -1235,7 +1235,7 @@ dissect_bssap_MM_information(tvbuff_t *tvb, proto_tree *tree, int offset)
* indicatior of the other information elements.
*/
dtap_mm_mm_info(tvb, ie_tree, offset, ie_len);
return offset + ie_len;
@ -1247,7 +1247,7 @@ dissect_bssap_mobile_id(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_item *item = NULL;
proto_tree *ie_tree = NULL;
guint ie_len;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_mobile_id_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_mobile_id);
@ -1273,7 +1273,7 @@ dissect_bssap_mobile_stn_cls_mrk1(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_item *item = NULL;
proto_tree *ie_tree = NULL;
guint8 ie_len;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_mobile_stn_cls_mrk1_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_mobile_stn_cls_mrk1);
@ -1292,9 +1292,9 @@ dissect_bssap_mobile_stn_cls_mrk1(tvbuff_t *tvb, proto_tree *tree, int offset)
}
/* 18.4.19 Mobile station state */
static const value_string bssap_mobile_station_state_values[] = {
static const value_string bssap_mobile_station_state_values[] = {
{ 0x00, "IDLE or PMM-DETACHED" },
{ 0x01, "STANDBY or PMM-IDLE, 0 PDP contexts active" },
{ 0x01, "STANDBY or PMM-IDLE, 0 PDP contexts active" },
{ 0x02, "STANDBY or PMM-IDLE, 1 or more PDP contexts active" },
{ 0x03, "SUSPENDED, 0 PDP contexts active" },
{ 0x04, "SUSPENDED, 1 or more PDP contexts active" },
@ -1302,7 +1302,7 @@ static const value_string bssap_mobile_station_state_values[] = {
{ 0x06, "READY or PMM-CONNECTED, 1 or more PDP contexts active" },
{ 0x07, "IMSI unknown" },
{ 0x08, "Information requested not supported" },
{ 0, NULL }
{ 0, NULL }
};
static int
dissect_bssap_mobile_station_state(tvbuff_t *tvb, proto_tree *tree, int offset)
@ -1310,7 +1310,7 @@ dissect_bssap_mobile_station_state(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_item *item = NULL;
proto_tree *ie_tree = NULL;
guint8 ie_len;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_mobile_station_state_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_mobile_station_state);
@ -1332,7 +1332,7 @@ dissect_bssap_ptmsi(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_item *item = NULL;
proto_tree *ie_tree = NULL;
guint8 ie_len;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_ptmsi_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_ptmsi);
@ -1356,7 +1356,7 @@ dissect_bssap_reject_cause(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_item *item = NULL;
proto_tree *ie_tree = NULL;
guint8 ie_len;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_reject_cause_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_reject_cause);
@ -1382,7 +1382,7 @@ dissect_bssap_service_area_id(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_item *item = NULL;
proto_tree *ie_tree = NULL;
guint8 ie_len;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_service_area_id_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_service_area_id);
@ -1416,7 +1416,7 @@ dissect_bssap_sgsn_number(tvbuff_t *tvb, proto_tree *tree, int offset)
guint8 ie_len;
tvbuff_t *number_tvb;
const char *digit_str;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_sgsn_nr_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_sgsn_nr);
@ -1425,10 +1425,10 @@ dissect_bssap_sgsn_number(tvbuff_t *tvb, proto_tree *tree, int offset)
offset++;
proto_tree_add_item(ie_tree, hf_bssap_plus_ie_len, tvb, offset, 1, FALSE);
offset++;
/* The SGSN number is coded as a sequence of TBCD digits (as specified in 3GPP TS 29.002),
/* The SGSN number is coded as a sequence of TBCD digits (as specified in 3GPP TS 29.002),
* compressed two into each octet. The Number is in international E.164 format as indicated by Octet 3
* which coding is specified in 3GPP TS 29.002. This is a variable length information element,
* and includes a length indicator. The value part of the SGSN number information element
* which coding is specified in 3GPP TS 29.002. This is a variable length information element,
* and includes a length indicator. The value part of the SGSN number information element
* (not including IEI, Length indicator and Octet 3) shall not exceed 15 digits.
*/
proto_tree_add_item(ie_tree, hf_bssap_extension, tvb, offset, 1, FALSE);
@ -1450,7 +1450,7 @@ dissect_bssap_tmsi(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_item *item = NULL;
proto_tree *ie_tree = NULL;
guint8 ie_len;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_tmsi_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_tmsi);
@ -1459,7 +1459,7 @@ dissect_bssap_tmsi(tvbuff_t *tvb, proto_tree *tree, int offset)
offset++;
proto_tree_add_item(ie_tree, hf_bssap_plus_ie_len, tvb, offset, 1, FALSE);
offset++;
/* The TMSI consists of 4 octets. It can be coded using a full hexadecimal representation
/* The TMSI consists of 4 octets. It can be coded using a full hexadecimal representation
* (see 3GPP TS 23.003).
*/
proto_tree_add_item(ie_tree, hf_bssap_tmsi, tvb, offset, ie_len, FALSE);
@ -1480,7 +1480,7 @@ dissect_bssap_tmsi_status(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_item *item = NULL;
proto_tree *ie_tree = NULL;
guint8 ie_len;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_tmsi_status_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_tmsi_status);
@ -1502,12 +1502,12 @@ static const true_false_string bssap_E_flag = {
"SGSN did not receive the payload in ciphered form"
};
/* 3GPP TS 44.064 B.1.1 TOM Protocol Discriminator */
static const value_string bssap_tom_prot_disc_values[] = {
static const value_string bssap_tom_prot_disc_values[] = {
{ 0x00, "Not specified" },
{ 0x01, "TIA/EIA-136" },
{ 0x01, "TIA/EIA-136" },
{ 0x02, "RRLP" },
{ 0x03, "Reserved for extension" },
{ 0, NULL }
{ 0, NULL }
};
static int
dissect_bssap_ulink_tunnel_payload_control_and_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
@ -1518,7 +1518,7 @@ dissect_bssap_ulink_tunnel_payload_control_and_info(tvbuff_t *tvb, packet_info *
guint8 ie_len;
guint8 octet;
guint8 prot_disc;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_ulink_tnl_pld_cntrl_amd_inf_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_ulink_tnl_pld_cntrl_amd_inf);
@ -1528,7 +1528,7 @@ dissect_bssap_ulink_tunnel_payload_control_and_info(tvbuff_t *tvb, packet_info *
proto_tree_add_item(ie_tree, hf_bssap_plus_ie_len, tvb, offset, 1, FALSE);
offset++;
/* octet 3 bit 8 Spare */
/* octet 3 bit 7 - 4
/* octet 3 bit 7 - 4
* TOM Protocol Discriminator: Identifies the protocol using tunnelling of non-GSM signalling.
* For coding, see 3GPP TS 44.064.
*/
@ -1541,7 +1541,7 @@ dissect_bssap_ulink_tunnel_payload_control_and_info(tvbuff_t *tvb, packet_info *
*/
proto_tree_add_item(ie_tree, hf_bssap_e_bit, tvb, offset, 1, FALSE);
/* octet 3 bit 2 - 1
/* octet 3 bit 2 - 1
* Tunnel Priority: Indicates the priority of the Tunnel Payload. For coding, see Table 20.1: Association
* between Tunnel Priority and LLC SAPs.
*/
@ -1567,7 +1567,7 @@ dissect_bssap_vlr_number(tvbuff_t *tvb, proto_tree *tree, int offset)
guint8 ie_len;
tvbuff_t *number_tvb;
const char *digit_str;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_vlr_number_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_vlr_number);
@ -1576,7 +1576,7 @@ dissect_bssap_vlr_number(tvbuff_t *tvb, proto_tree *tree, int offset)
offset++;
proto_tree_add_item(ie_tree, hf_bssap_plus_ie_len, tvb, offset, 1, FALSE);
offset++;
/* The VLR number is coded as a sequence of TBCD digits (as specified in 3GPP TS 29.002),
/* The VLR number is coded as a sequence of TBCD digits (as specified in 3GPP TS 29.002),
* compressed two into each octet. The Number is in international E.164 format as indicated by Octet 3
* which coding is specified in 3GPP TS 29.002. This is a variable length information element,
* and includes a length indicator. The value part of the VLR number information element
@ -1605,7 +1605,7 @@ dissect_bssap_global_cn_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_item *global_cn_id_item = NULL;
proto_tree *global_cn_id_tree = NULL;
guint8 ie_len;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_global_cn_id_ie, tvb, offset, ie_len+2, FALSE);
ie_tree = proto_item_add_subtree(item, ett_bssap_global_cn);
@ -1614,7 +1614,7 @@ dissect_bssap_global_cn_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset++;
proto_tree_add_item(ie_tree, hf_bssap_plus_ie_len, tvb, offset, 1, FALSE);
offset++;
/* The Global CN-Id consists of a PLMN-Id and a CN-Id, see 3GPP TS 23.003.
/* The Global CN-Id consists of a PLMN-Id and a CN-Id, see 3GPP TS 23.003.
* The PLMN-Id consists of MCC and MNC coded according to Location Area Identification
* in 3GPP TS 24.008. The CN-Id is an integer defined by O&M.
* The least significant bit of the CN-Id field is bit 1 of octet 7 and
@ -1650,14 +1650,14 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
* Make entry in the Protocol column on summary display
*/
col_set_str(pinfo->cinfo, COL_PROTOCOL, "BSSAP+");
if (pinfo->sccp_info && pinfo->sccp_info->data.co.assoc)
pinfo->sccp_info->data.co.assoc->payload = SCCP_PLOAD_BSSAP;
/* create the BSSAP+ protocol tree */
bssap_item = proto_tree_add_item(tree, proto_bssap, tvb, 0, -1, FALSE);
bssap_tree = proto_item_add_subtree(bssap_item, ett_bssap);
message_type = tvb_get_guint8(tvb,offset);
proto_tree_add_item(bssap_tree, hf_bssap_plus_message_type, tvb, offset, 1,FALSE);
offset++;
@ -1672,10 +1672,10 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if ( check_ie(tvb, tree, &offset, BSSAP_IMSI))
offset = dissect_bssap_imsi(tvb, bssap_tree, offset);
/* VLR number VLR number 18.4.26 M TLV 5-11 */
/* VLR number VLR number 18.4.26 M TLV 5-11 */
if ( check_ie(tvb, tree, &offset, BSSAP_VLR_NUMBER))
offset = dissect_bssap_vlr_number(tvb, bssap_tree, offset);
/* End of mandatory elements */
if (tvb_length_remaining(tvb,offset) == 0)
return;
@ -1733,7 +1733,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if ( check_ie(tvb, tree, &offset, BSSAP_VLR_NUMBER))
offset = dissect_bssap_vlr_number(tvb, bssap_tree, offset);
/* Downlink Tunnel Payload Control and Info 18.4.3 M TLV 3-223 */
/* Downlink Tunnel Payload Control and Info 18.4.3 M TLV 3-223 */
if ( check_ie(tvb, tree, &offset, BSSAP_DLINK_TNL_PLD_CTR_AND_INF))
offset = dissect_bssap_dlink_tunnel_payload_control_and_info(tvb, pinfo, bssap_tree, offset);
@ -1770,19 +1770,19 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* New Cell global identity Cell global identity 18.4.1 M TLV 10 */
if ( check_ie(tvb, tree, &offset, BSSAP_CELL_GBL_ID))
offset = dissect_bssap_cell_global_id(tvb, bssap_tree, offset);
/* Mobile station classmark Mobile station classmark 1 18.4.18 M TLV 3 */
if ( check_ie(tvb, tree, &offset, BSSAP_MOBILE_STN_CLS_MRK1))
offset = dissect_bssap_mobile_stn_cls_mrk1(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb,offset) == 0)
return;
/* Old location area identifier Location area identifier 18.4.14 O TLV 7 */
if ( check_optional_ie(tvb, offset, BSSAP_LOC_AREA_ID))
offset = dissect_bssap_loc_area_id(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb,offset) == 0)
return;
/* TMSI status TMSI status 18.4.24 O TLV 3 */
if ( check_optional_ie(tvb, offset, BSSAP_TMSI_STATUS))
offset = dissect_bssap_tmsi_status(tvb, bssap_tree, offset);
@ -1814,7 +1814,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (tvb_length_remaining(tvb,offset) == 0)
return;
/* New TMSI, or IMSI Mobile identity 18.4.17 O TLV 6-10 */
/* New TMSI, or IMSI Mobile identity 18.4.17 O TLV 6-10 */
if ( check_optional_ie(tvb, offset, BSSAP_MOBILE_ID))
offset = dissect_bssap_mobile_id(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb,offset) == 0)
@ -1955,7 +1955,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if ( check_ie(tvb, tree, &offset, BSSAP_SGSN_NUMBER))
offset = dissect_bssap_sgsn_number(tvb, bssap_tree, offset);
/* Detach type IMSI detach from non-GPRS service type 18.4.11 M TLV 3 */
/* Detach type IMSI detach from non-GPRS service type 18.4.11 M TLV 3 */
if ( check_ie(tvb, tree, &offset, BSSAP_IMSI_DET_FROM_NON_GPRS_SERV_TYPE))
offset = dissect_bssap_imsi_det_from_non_gprs_serv_type(tvb, bssap_tree, offset);
@ -2164,7 +2164,7 @@ dissect_bssap_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
case 0x00:
if (tvb_get_guint8(tvb, 1) != (tvb_length(tvb) - 2)) { return(FALSE); }
if (tvb_get_guint8(tvb, 2) == 0x40 && tvb_get_guint8(tvb, 3) != 0x01) {
if (tvb_get_guint8(tvb, 2) == 0x40 && tvb_get_guint8(tvb, 3) != 0x01) {
return(FALSE); }
break;
@ -2353,11 +2353,11 @@ proto_register_bssap(void)
{ &hf_bssap_sgsn_nr_ie,
{ "SGSN number IE", "bssap.imsi_ie",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
NULL, HFILL }},
{ &hf_bssap_tmsi_ie,
{ "TMSI IE", "bssap.tmsi_ie",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
NULL, HFILL }},
{ &hf_bssap_tmsi_status_ie,
{ "TMSI status IE", "bssap.tmsi_status_ie",
FT_NONE, BASE_NONE, NULL, 0,
@ -2563,7 +2563,7 @@ proto_reg_handoff_bssap(void)
rrlp_handle = find_dissector("rrlp");
initialized = TRUE;
} else {
dissector_delete_uint("sccp.ssn", old_bssap_ssn, bssap_plus_handle);
dissector_delete_uint("sccp.ssn", old_bssap_ssn, bssap_plus_handle);
}
dissector_add_uint("sccp.ssn", global_bssap_ssn, bssap_plus_handle);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -25,8 +25,6 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <epan/packet.h>
@ -65,7 +63,7 @@ static int hf_erf_wlen = -1;
static int hf_erf_ehdr_int_res1 = -1;
static int hf_erf_ehdr_int_id = -1;
static int hf_erf_ehdr_int_res2 = -1;
/* Raw Link extension header */
static int hf_erf_ehdr_raw_link_res = -1;
static int hf_erf_ehdr_raw_link_seqnum = -1;
@ -195,7 +193,7 @@ static dissector_handle_t ipv6_handle;
static dissector_handle_t infiniband_handle;
static dissector_handle_t infiniband_link_handle;
typedef enum {
typedef enum {
ERF_HDLC_CHDLC = 0,
ERF_HDLC_PPP = 1,
ERF_HDLC_FRELAY = 2,
@ -316,7 +314,7 @@ static const value_string erf_type_vals[] = {
{ ERF_TYPE_HDLC_POS,"HDLC_POS"},
{ ERF_TYPE_ETH,"ETH"},
{ ERF_TYPE_ATM,"ATM"},
{ ERF_TYPE_AAL5,"AAL5"},
{ ERF_TYPE_AAL5,"AAL5"},
{ ERF_TYPE_MC_HDLC,"MC_HDLC"},
{ ERF_TYPE_MC_RAW,"MC_RAW"},
{ ERF_TYPE_MC_ATM,"MC_ATM"},
@ -372,103 +370,103 @@ static void
erf_atm_guess_lane_type(const guint8 *pd, guint len,
union wtap_pseudo_header *pseudo_header)
{
if (len >= 2) {
if (pd[0] == 0xff && pd[1] == 0x00) {
/*
* Looks like LE Control traffic.
*/
pseudo_header->atm.subtype = TRAF_ST_LANE_LE_CTRL;
} else {
/*
* XXX - Ethernet, or Token Ring?
* Assume Ethernet for now; if we see earlier
* LANE traffic, we may be able to figure out
* the traffic type from that, but there may
* still be situations where the user has to
* tell us.
*/
pseudo_header->atm.subtype = TRAF_ST_LANE_802_3;
}
}
if (len >= 2) {
if (pd[0] == 0xff && pd[1] == 0x00) {
/*
* Looks like LE Control traffic.
*/
pseudo_header->atm.subtype = TRAF_ST_LANE_LE_CTRL;
} else {
/*
* XXX - Ethernet, or Token Ring?
* Assume Ethernet for now; if we see earlier
* LANE traffic, we may be able to figure out
* the traffic type from that, but there may
* still be situations where the user has to
* tell us.
*/
pseudo_header->atm.subtype = TRAF_ST_LANE_802_3;
}
}
}
static void
erf_atm_guess_traffic_type(const guint8 *pd, guint len,
union wtap_pseudo_header *pseudo_header)
{
/*
* Start out assuming nothing other than that it's AAL5.
*/
pseudo_header->atm.aal = AAL_5;
pseudo_header->atm.type = TRAF_UNKNOWN;
pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
/*
* 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) {
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 5:
/*
* Signalling AAL.
*/
pseudo_header->atm.aal = AAL_SIGNALLING;
return;
case 16:
/*
* ILMI.
*/
pseudo_header->atm.type = TRAF_ILMI;
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;
}
/*
* 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");
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* packet-kink.c
* Routines for KINK packet disassembly
* Routines for KINK packet disassembly
* It is referrenced draft-ietf-kink-kink-jp-04.txt,v 1.14 2003/02/10
*
*
* Copyright 2004, Takeshi Nakashima <T.Nakashima@jp.yokogawa.com>
*
* $Id$
@ -36,7 +36,7 @@
#include "packet-kerberos.h"
#include "packet-isakmp.h"
#define KINK_PORT 57203
#define KINK_PORT 57203
#define KINK_ISAKMP_PAYLOAD_BASE 14
@ -55,7 +55,7 @@ static int hf_kink_next_payload = -1;
/* Argument for making the subtree */
static gint ett_kink = -1;
/*static gint ett_kink_version = -1;*/
static gint ett_kink_payload = -1;
static gint ett_kink_payload = -1;
static gint ett_payload_kink_ap_req = -1;
static gint ett_payload_kink_ap_rep = -1;
static gint ett_payload_kink_krb_error = -1;
@ -122,7 +122,7 @@ static const value_string kink_next_payload[]={
};
/* Define the magic number
* Using at the kink error
* Using at the kink error
*/
#define KINK_OK 0
#define KINK_PROTOERR 1
@ -134,7 +134,7 @@ static const value_string kink_next_payload[]={
#define BOTTOM_RESERVED 7
#define TOP_RESERVED 8191
#define BOTTOM_PRIVATE_USE 8192
#define TOP_PRIVATE_USE 16383
#define TOP_PRIVATE_USE 16383
/* Using at the kink header */
#define IPSEC 1
@ -176,9 +176,9 @@ static void dissect_payload_kink_not_defined(packet_info *pinfo, tvbuff_t *tvb,
#ifdef HAVE_KERBEROS
static void dissect_decrypt_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, int payload_length);
#endif
/* This function is dissecting the kink header. */
static void
static void
dissect_kink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){
proto_item *ti = NULL;
proto_tree *kink_tree = NULL;
@ -190,13 +190,13 @@ dissect_kink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){
guint8 value_a_and_front_reserved;
guint16 value_a_and_reserved;
guint8 value_a;
guint16 value_reserved;
guint16 value_reserved;
int offset=0;
type = tvb_get_guint8(tvb,offset);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "KINK");
/* It shows kink type by the type value. */
if(check_col(pinfo->cinfo, COL_INFO)){
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(type, kink_type_vals, "unknown"));
@ -206,11 +206,11 @@ dissect_kink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){
ti = proto_tree_add_item(tree, proto_kink, tvb, offset, -1, FALSE);
kink_tree = proto_item_add_subtree(ti, ett_kink);
}
proto_tree_add_uint(kink_tree, hf_kink_type, tvb, offset, 1, type);
offset++;
/* This part is the version. Consider less than 1 octet value.
/* This part is the version. Consider less than 1 octet value.
* Major version and minor version is 4bit. Front half of 1octet
* is major version, and second half of 1octet is minor version.
* The calculation of major version is shown below.
@ -224,12 +224,12 @@ dissect_kink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){
minor_version = version & SECOND_FOUR_BIT;
proto_tree_add_text(kink_tree, tvb, offset, 1, "version: %u.%u", major_version, minor_version);
offset++;
proto_tree_add_item(kink_tree, hf_kink_length, tvb, offset, 2, FALSE);
offset += 2;
doi = tvb_get_ntohl(tvb, offset);
if(doi == IPSEC){
proto_tree_add_text(kink_tree, tvb, offset, 4, "Domain Of Interpretation: %s (%u)", "IPsec", doi);
}
@ -237,18 +237,18 @@ dissect_kink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){
proto_tree_add_text(kink_tree, tvb, offset, 4, "Domain Of Interpretation: %s (%u)", "Not IPsec", doi);
}
offset += 4;
proto_tree_add_item(kink_tree, hf_kink_transactionId, tvb, offset, 4, FALSE);
offset += 4;
chsumlen = tvb_get_guint8(tvb, offset);
proto_tree_add_item(kink_tree, hf_kink_checkSumLength, tvb, offset, 1, FALSE);
offset ++;
next_payload = tvb_get_guint8(tvb, offset);
proto_tree_add_uint(kink_tree, hf_kink_next_payload, tvb, offset, 1, next_payload);
offset ++;
/* A is 1bit field. The caluculation of A is shown below.
* The logical product of 1octet value and 0x80 is performed.
* And It is performed 7bit right shift.
@ -256,18 +256,18 @@ dissect_kink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){
value_a_and_front_reserved = tvb_get_guint8(tvb, offset);
value_a = (value_a_and_front_reserved & FRONT_ONE_BIT) >> A_BIT_SHIFT;
proto_tree_add_uint(kink_tree, hf_kink_A, tvb, offset, 1, value_a);
/* The reserved field is 15bit.
/* The reserved field is 15bit.
* The logical product of 2octet value and 0x7fff is performed.
*/
value_a_and_reserved = tvb_get_ntohs(tvb, offset);
value_reserved = value_a_and_reserved & SECOND_FIFTEEN_BIT;
proto_tree_add_uint(kink_tree, hf_kink_reserved, tvb, offset, 2, value_reserved);
offset += 2;
proto_tree_add_item(kink_tree, hf_kink_checkSum, tvb, offset, chsumlen, FALSE);
/* This part consider the padding. Chsumlen don't contain the padding. */
/* This part consider the padding. Chsumlen don't contain the padding. */
if((chsumlen % PADDING) != 0){
chsumlen += (PADDING - (chsumlen % PADDING));
offset += chsumlen;
@ -275,12 +275,12 @@ dissect_kink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){
else{
offset += chsumlen;
}
control_payload(pinfo, tvb, offset, next_payload, kink_tree);
}
/* This part call the dissect payload function by next_payload value.
/* This part call the dissect payload function by next_payload value.
* This function called by the respective function again.
*/
static void
@ -288,7 +288,7 @@ control_payload(packet_info *pinfo, tvbuff_t *tvb, int offset, guint8 next_paylo
switch(next_payload){
case KINK_DONE:
break;
case KINK_AP_REQ:
case KINK_AP_REQ:
dissect_payload_kink_ap_req(pinfo, tvb, offset, kink_tree);
break;
case KINK_AP_REP:
@ -305,8 +305,8 @@ control_payload(packet_info *pinfo, tvbuff_t *tvb, int offset, guint8 next_paylo
break;
case KINK_ISAKMP:
dissect_payload_kink_isakmp(pinfo, tvb, offset, kink_tree);
break;
case KINK_ENCRYPT:
break;
case KINK_ENCRYPT:
dissect_payload_kink_encrypt(pinfo, tvb, offset, kink_tree);
break;
case KINK_ERROR:
@ -339,7 +339,7 @@ dissect_payload_kink_ap_req(packet_info *pinfo, tvbuff_t *tvb, int offset, proto
next_payload = tvb_get_guint8(tvb, offset);
proto_tree_add_uint(payload_kink_ap_req_tree, hf_kink_next_payload, tvb, offset, 1, next_payload);
offset ++;
reserved = tvb_get_guint8(tvb, offset);
proto_tree_add_text(payload_kink_ap_req_tree, tvb, offset, 1, "RESERVED: %u", reserved);
offset ++;
@ -354,10 +354,10 @@ dissect_payload_kink_ap_req(packet_info *pinfo, tvbuff_t *tvb, int offset, proto
/* Show time as UTC, not local time. */
timer = tvb_get_ntohl(tvb, offset);
proto_tree_add_text(payload_kink_ap_req_tree, tvb, offset, 4, "EPOCH: %s",
abs_time_secs_to_str(timer, ABSOLUTE_TIME_UTC, TRUE));
proto_tree_add_text(payload_kink_ap_req_tree, tvb, offset, 4, "EPOCH: %s",
abs_time_secs_to_str(timer, ABSOLUTE_TIME_UTC, TRUE));
offset += 4;
if(payload_length > PAYLOAD_HEADER){
tvbuff_t *krb_tvb;
@ -416,8 +416,8 @@ dissect_payload_kink_ap_rep(packet_info *pinfo, tvbuff_t *tvb, int offset, proto
/* Show time as UTC, not local time. */
timer = tvb_get_ntohl(tvb, offset);
proto_tree_add_text(payload_kink_ap_rep_tree, tvb, offset, 4, "EPOCH: %s",
abs_time_secs_to_str(timer, ABSOLUTE_TIME_UTC, TRUE));
proto_tree_add_text(payload_kink_ap_rep_tree, tvb, offset, 4, "EPOCH: %s",
abs_time_secs_to_str(timer, ABSOLUTE_TIME_UTC, TRUE));
offset += 4;
if(payload_length > PAYLOAD_HEADER){
@ -462,7 +462,7 @@ dissect_payload_kink_krb_error(packet_info *pinfo, tvbuff_t *tvb, int offset, pr
next_payload = tvb_get_guint8(tvb, offset);
proto_tree_add_uint(payload_kink_krb_error_tree, hf_kink_next_payload, tvb, offset, 1, next_payload);
offset ++;
reserved = tvb_get_guint8(tvb, offset);
proto_tree_add_text(payload_kink_krb_error_tree, tvb, offset, 1, "RESERVED: %u", reserved);
offset ++;
@ -527,11 +527,11 @@ dissect_payload_kink_tgt_req(packet_info *pinfo, tvbuff_t *tvb, int offset, prot
proto_tree_add_text(payload_kink_tgt_req_tree, tvb, offset, 2, "RealmNameLength: %u", realm_name_length);
offset += 2;
proto_tree_add_text(payload_kink_tgt_req_tree, tvb, offset, realm_name_length, "RealmName: %s",
tvb_format_text(tvb, offset, realm_name_length));
offset += realm_name_length;
proto_tree_add_text(payload_kink_tgt_req_tree, tvb, offset, realm_name_length, "RealmName: %s",
tvb_format_text(tvb, offset, realm_name_length));
offset += realm_name_length;
/* This part consider the padding. Payload_length don't contain the padding. */
if(payload_length % PADDING != 0){
payload_length += (PADDING - (payload_length % PADDING));
@ -564,11 +564,11 @@ dissect_payload_kink_tgt_rep(packet_info *pinfo, tvbuff_t *tvb, int offset, prot
next_payload = tvb_get_guint8(tvb, offset);
proto_tree_add_uint(payload_kink_tgt_rep_tree, hf_kink_next_payload, tvb, offset, 1, next_payload);
offset ++;
reserved = tvb_get_guint8(tvb, offset);
proto_tree_add_text(payload_kink_tgt_rep_tree, tvb, offset, 1, "RESERVED: %u", reserved);
offset ++;
proto_tree_add_text(payload_kink_tgt_rep_tree, tvb, offset, 2, "Payload Length: %u", payload_length);
offset += 2;
@ -578,7 +578,7 @@ dissect_payload_kink_tgt_rep(packet_info *pinfo, tvbuff_t *tvb, int offset, prot
proto_tree_add_text(payload_kink_tgt_rep_tree, tvb, offset, princ_name_length, "PrincName: %s", tvb_format_text(tvb, offset, princ_name_length));
/* This part consider the padding. Princ_name_length don't contain the padding. */
/* This part consider the padding. Princ_name_length don't contain the padding. */
if((princ_name_length + FRONT_TGT_REP_HEADER) % PADDING != 0){
offset += (princ_name_length + PADDING - ((princ_name_length + FRONT_TGT_REP_HEADER) % PADDING));
}
@ -618,7 +618,7 @@ dissect_payload_kink_isakmp(packet_info *pinfo, tvbuff_t *tvb, int offset, proto
guint16 reserved2;
int start_payload_offset = 0; /* Keep the begining of the payload offset */
tvbuff_t *isakmp_tvb;
payload_length = tvb_get_ntohs(tvb, offset + TO_PAYLOAD_LENGTH);
start_payload_offset = offset;
@ -633,7 +633,7 @@ dissect_payload_kink_isakmp(packet_info *pinfo, tvbuff_t *tvb, int offset, proto
reserved = tvb_get_guint8(tvb, offset);
proto_tree_add_text(payload_kink_isakmp_tree, tvb, offset, 1, "RESERVED: %u", reserved);
offset ++;
if(payload_length <= PAYLOAD_HEADER){
proto_tree_add_text(payload_kink_isakmp_tree, tvb, offset, 2, "This Payload Length is too small.: %u", payload_length);
}
@ -661,7 +661,7 @@ dissect_payload_kink_isakmp(packet_info *pinfo, tvbuff_t *tvb, int offset, proto
reserved2 = tvb_get_ntohs(tvb, offset);
proto_tree_add_text(payload_kink_isakmp_tree, tvb, offset, 2, "RESERVED: %u", reserved2);
offset += 2;
if(payload_length > PAYLOAD_HEADER){
isakmp_length = payload_length - PAYLOAD_HEADER;
length = tvb_length_remaining(tvb, offset);
@ -673,7 +673,7 @@ dissect_payload_kink_isakmp(packet_info *pinfo, tvbuff_t *tvb, int offset, proto
isakmp_tvb = tvb_new_subset(tvb, offset, length, reported_length);
isakmp_dissect_payloads(isakmp_tvb, payload_kink_isakmp_tree, 1, inner_next_pload, 0, isakmp_length, pinfo);
}
/* This part consider the padding. Payload_length don't contain the padding. */
if(payload_length % PADDING != 0){
payload_length += (PADDING - (payload_length % PADDING));
@ -731,7 +731,7 @@ dissect_payload_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, int offset, prot
guint8 *plaintext=NULL;
next_tvb=tvb_new_subset(tvb, offset, MIN(tvb_length_remaining(tvb, offset), encrypt_length), encrypt_length);
plaintext=decrypt_krb5_data(tree, pinfo, 0, next_tvb, keytype, NULL);
plaintext=decrypt_krb5_data(tree, pinfo, 0, next_tvb, keytype, NULL);
if(plaintext){
next_tvb=tvb_new_child_real_data(tvb, plaintext, encrypt_length, encrypt_length);
tvb_set_free_cb(next_tvb, g_free);
@ -744,11 +744,11 @@ dissect_payload_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, int offset, prot
inner_next_pload = tvb_get_guint8(tvb, offset);
proto_tree_add_text(payload_kink_encrypt_tree, tvb, offset, 1, "InnerNextPload: %u", inner_next_pload);
offset += 1;
reserved2 = 65536*tvb_get_guint8(tvb, offset) + 256*tvb_get_guint8(tvb, offset+1) + tvb_get_guint8(tvb, offset+2);
proto_tree_add_text(payload_kink_encrypt_tree, tvb, offset, 3, "RESERVED: %u", reserved2);
offset += 3;
if(payload_length > PAYLOAD_HEADER){
inner_payload_length = payload_length - PAYLOAD_HEADER;
proto_tree_add_text(payload_kink_encrypt_tree, tvb, offset, inner_payload_length, "Payload");
@ -769,7 +769,7 @@ dissect_payload_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, int offset, prot
#ifdef HAVE_KERBEROS
static void
dissect_decrypt_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, int payload_length){
proto_tree *decrypt_kink_encrypt_tree;
proto_item *ti;
int offset=0;
@ -810,7 +810,7 @@ dissect_payload_kink_error(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_
"KINK_INTERR",
"KINK_BADQMVERS"
};
payload_length = tvb_get_ntohs(tvb,offset + TO_PAYLOAD_LENGTH);
start_payload_offset = offset;
@ -835,7 +835,7 @@ dissect_payload_kink_error(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_
offset += 2;
error_code = tvb_get_ntohl(tvb, offset);
/* Choosed the error code by erro_code */
switch(error_code){
case KINK_OK:
@ -873,14 +873,14 @@ dissect_payload_kink_not_defined(packet_info *pinfo, tvbuff_t *tvb, int offset,
guint payload_length;
guint8 reserved;
int start_payload_offset = 0; /* Keep the begining of the payload offset */
start_payload_offset = offset;
payload_length = tvb_get_ntohs(tvb, offset + TO_PAYLOAD_LENGTH);
/* Make the subtree */
ti = proto_tree_add_text(tree, tvb, offset, payload_length, "UNKNOWN PAYLOAD");
payload_kink_not_defined_tree = proto_item_add_subtree(ti, ett_payload_not_defined);
next_payload = tvb_get_guint8(tvb, offset);
proto_tree_add_uint(payload_kink_not_defined_tree, hf_kink_next_payload, tvb, offset, 1, next_payload);
offset ++;
@ -888,10 +888,10 @@ dissect_payload_kink_not_defined(packet_info *pinfo, tvbuff_t *tvb, int offset,
reserved = tvb_get_guint8(tvb, offset);
proto_tree_add_text(payload_kink_not_defined_tree, tvb, offset, 1, "RESERVED: %u", reserved);
offset ++;
proto_tree_add_text(payload_kink_not_defined_tree, tvb, offset, 2, "Payload Length: %u", payload_length);
offset += 2;
/* This part consider the padding. Payload_length don't contain the padding. */
if(payload_length % PADDING != 0){
payload_length += (PADDING - (payload_length % PADDING));
@ -905,42 +905,42 @@ dissect_payload_kink_not_defined(packet_info *pinfo, tvbuff_t *tvb, int offset,
}
/* Output part */
void
void
proto_register_kink(void) {
static hf_register_info hf[] = {
{ &hf_kink_type,
{ "Type", "kink.type",
FT_UINT8, BASE_DEC, VALS(kink_type_vals), 0x0,
"the type of the kink", HFILL }},
{ "Type", "kink.type",
FT_UINT8, BASE_DEC, VALS(kink_type_vals), 0x0,
"the type of the kink", HFILL }},
{ &hf_kink_length,
{ "Length", "kink.length",
FT_UINT16, BASE_DEC, NULL, 0x0,
"the length of the kink length", HFILL }},
{ "Length", "kink.length",
FT_UINT16, BASE_DEC, NULL, 0x0,
"the length of the kink length", HFILL }},
{ &hf_kink_transactionId,
{ "Transaction ID", "kink.transactionId",
FT_UINT32, BASE_DEC, NULL, 0x0,
"the transactionID of kink", HFILL }},
{ "Transaction ID", "kink.transactionId",
FT_UINT32, BASE_DEC, NULL, 0x0,
"the transactionID of kink", HFILL }},
{ &hf_kink_checkSumLength,
{ "Checksum Length", "kink.checkSumLength",
FT_UINT8, BASE_DEC, NULL, 0x0,
"the check sum length of kink", HFILL }},
{ "Checksum Length", "kink.checkSumLength",
FT_UINT8, BASE_DEC, NULL, 0x0,
"the check sum length of kink", HFILL }},
{ &hf_kink_A,
{ "A", "kink.A",
FT_UINT8, BASE_DEC, VALS(kink_A_vals), 0x0,
"the A of kink", HFILL }},
{ "A", "kink.A",
FT_UINT8, BASE_DEC, VALS(kink_A_vals), 0x0,
"the A of kink", HFILL }},
{ &hf_kink_reserved,
{ "Reserved", "kink.reserved",
FT_UINT16, BASE_DEC, NULL, 0x0,
"the reserved of kink", HFILL }},
{ "Reserved", "kink.reserved",
FT_UINT16, BASE_DEC, NULL, 0x0,
"the reserved of kink", HFILL }},
{ &hf_kink_checkSum,
{ "Checksum", "kink.checkSum",
FT_BYTES, BASE_NONE, NULL, 0x0,
"the checkSum of kink", HFILL }},
{ "Checksum", "kink.checkSum",
FT_BYTES, BASE_NONE, NULL, 0x0,
"the checkSum of kink", HFILL }},
{ &hf_kink_next_payload,
{ "Next Payload", "kink.nextPayload",
FT_UINT8, BASE_DEC, VALS(kink_next_payload), 0x0,
"the next payload of kink", HFILL }}
{ "Next Payload", "kink.nextPayload",
FT_UINT8, BASE_DEC, VALS(kink_next_payload), 0x0,
"the next payload of kink", HFILL }}
};
@ -959,9 +959,9 @@ proto_register_kink(void) {
&ett_payload_kink_error,
&ett_payload_not_defined,
&ett_decrypt_kink_encrypt,
};
proto_kink = proto_register_protocol("Kerberized Internet Negotiation of Key", "KINK", "kink");
proto_register_field_array(proto_kink, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@ -969,9 +969,9 @@ proto_register_kink(void) {
}
void proto_reg_handoff_kink(void) {
dissector_handle_t kink_handle = NULL;
kink_handle = create_dissector_handle(dissect_kink, proto_kink);
dissector_add_uint("udp.port", KINK_PORT, kink_handle);

View File

@ -12,12 +12,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@ -29,8 +29,6 @@
# include "config.h"
#endif
#include <stdlib.h>
#include <glib.h>
#include <epan/packet.h>
@ -86,7 +84,7 @@ static gint ett_nsip_ip_element_list = -1;
/* PDU type coding, v5.3.0, table 10.3.7.1, p 51 */
#define NSIP_PDU_NS_UNITDATA 0x00
#define NSIP_PDU_NS_RESET 0x02
#define NSIP_PDU_NS_RESET 0x02
#define NSIP_PDU_NS_RESET_ACK 0x03
#define NSIP_PDU_NS_BLOCK 0x04
#define NSIP_PDU_NS_BLOCK_ACK 0x05
@ -106,7 +104,7 @@ static gint ett_nsip_ip_element_list = -1;
static const value_string tab_nsip_pdu_types[] = {
{ NSIP_PDU_NS_UNITDATA, "NS_UNITDATA" },
{ NSIP_PDU_NS_RESET, "NS_RESET" },
{ NSIP_PDU_NS_RESET, "NS_RESET" },
{ NSIP_PDU_NS_RESET_ACK, "NS_RESET_ACK" },
{ NSIP_PDU_NS_BLOCK, "NS_BLOCK" },
{ NSIP_PDU_NS_BLOCK_ACK, "NS_BLOCK_ACK" },
@ -152,7 +150,7 @@ static const value_string tab_nsip_ieis[] = {
{ NSIP_IE_NUM_IP4_ENDPOINTS, "Number of IP4 Endpoints" },
{ NSIP_IE_NUM_IP6_ENDPOINTS, "Number of IP6 Endpoints"},
{ NSIP_IE_RESET_FLAG, "Reset Flag" },
{ NSIP_IE_IP_ADDRESS, "IP Address" },
{ NSIP_IE_IP_ADDRESS, "IP Address" },
{ 0, NULL },
};
@ -260,17 +258,17 @@ typedef struct {
static nsip_ip_element_info_t ipv4_element = { NSIP_IP_VERSION_4, 4, 8 };
static nsip_ip_element_info_t ipv6_element = { NSIP_IP_VERSION_6, 16, 20 };
static void
static void
get_value_length(nsip_ie_t *ie, build_info_t *bi) {
/* length indicator in bit 8, 0 => two bytes, 1 => one byte */
const guint8 MASK_LENGTH_INDICATOR = 0x80;
const guint8 MASK_ONE_BYTE_LENGTH = 0x7f;
guint8 length_len;
guint16 length;
length = tvb_get_guint8(bi->tvb, bi->offset);
length_len = 1;
if (length & MASK_LENGTH_INDICATOR) {
length &= MASK_ONE_BYTE_LENGTH;
}
@ -284,18 +282,18 @@ get_value_length(nsip_ie_t *ie, build_info_t *bi) {
bi->offset += length_len;
}
static int
static int
check_correct_iei(nsip_ie_t *ie, build_info_t *bi) {
guint8 fetched_iei = tvb_get_guint8(bi->tvb, bi->offset);
#if NSIP_DEBUG
if (fetched_iei != ie->iei) {
proto_tree_add_text(bi->nsip_tree, bi->tvb, bi->offset, 1,
"Tried IEI %s (%#02x), found IEI %s (%#02x)",
val_to_str(ie->iei, tab_nsip_ieis, "Unknown"),
ie->iei,
val_to_str(fetched_iei, tab_nsip_ieis, "Unknown"),
fetched_iei);
proto_tree_add_text(bi->nsip_tree, bi->tvb, bi->offset, 1,
"Tried IEI %s (%#02x), found IEI %s (%#02x)",
val_to_str(ie->iei, tab_nsip_ieis, "Unknown"),
ie->iei,
val_to_str(fetched_iei, tab_nsip_ieis, "Unknown"),
fetched_iei);
}
#endif
return (fetched_iei == ie->iei);
@ -307,14 +305,14 @@ decode_iei_cause(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
if (bi->nsip_tree) {
cause = tvb_get_guint8(bi->tvb, bi->offset);
proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_cause,
bi->tvb, ie_start_offset, ie->total_length,
cause,
"Cause: %s (%#02x)",
val_to_str(cause, tab_nsip_cause_values,
"Unknown"), cause);
proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_cause,
bi->tvb, ie_start_offset, ie->total_length,
cause,
"Cause: %s (%#02x)",
val_to_str(cause, tab_nsip_cause_values,
"Unknown"), cause);
if (check_col(bi->pinfo->cinfo, COL_INFO)) {
col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
"Cause: %s",
val_to_str(cause, tab_nsip_cause_values, "Unknown (0x%02x)"));
}
@ -324,19 +322,19 @@ decode_iei_cause(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
bi->offset += ie->value_length;
}
static void
static void
decode_iei_ns_vci(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
guint16 ns_vci;
if (bi->nsip_tree) {
ns_vci = tvb_get_ntohs(bi->tvb, bi->offset);
proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_ns_vci,
bi->tvb, ie_start_offset, ie->total_length,
ns_vci,
"NS VCI: %#04x", ns_vci);
proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_ns_vci,
bi->tvb, ie_start_offset, ie->total_length,
ns_vci,
"NS VCI: %#04x", ns_vci);
if (check_col(bi->pinfo->cinfo, COL_INFO)) {
col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
"NS VCI: %#04x", ns_vci);
}
proto_item_append_text(bi->ti, ", NS VCI: %#04x", ns_vci);
@ -344,14 +342,14 @@ decode_iei_ns_vci(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
bi->offset += ie->value_length;
}
static void
static void
decode_iei_ns_pdu(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
tvbuff_t * next_tvb;
if (bi->nsip_tree) {
proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset,
ie->total_length,
"NS PDU (%u bytes)", ie->value_length);
proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset,
ie->total_length,
"NS PDU (%u bytes)", ie->value_length);
}
next_tvb = tvb_new_subset(bi->tvb, bi->offset, ie->value_length, -1);
if (nsip_handle) {
@ -367,31 +365,31 @@ decode_iei_nsei(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
guint16 nsei = tvb_get_ntohs(bi->tvb, bi->offset);
if (bi->nsip_tree) {
proto_tree_add_uint(bi->nsip_tree, hf_nsip_nsei, bi->tvb,
ie_start_offset, ie->total_length, nsei);
proto_tree_add_uint(bi->nsip_tree, hf_nsip_nsei, bi->tvb,
ie_start_offset, ie->total_length, nsei);
}
bi->offset += ie->value_length;
if (check_col(bi->pinfo->cinfo, COL_INFO)) {
col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
"NSEI %u", nsei);
col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
"NSEI %u", nsei);
}
proto_item_append_text(bi->ti, ", NSEI %u", nsei);
}
static void
static void
decode_iei_bvci(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
guint16 bvci = tvb_get_ntohs(bi->tvb, bi->offset);
if (bi->nsip_tree) {
proto_tree_add_uint(bi->nsip_tree, hf_nsip_bvci, bi->tvb,
ie_start_offset, ie->total_length, bvci);
proto_tree_add_uint(bi->nsip_tree, hf_nsip_bvci, bi->tvb,
ie_start_offset, ie->total_length, bvci);
}
bi->offset += ie->value_length;
if (check_col(bi->pinfo->cinfo, COL_INFO)) {
col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
"BVCI %u", bvci);
col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
"BVCI %u", bvci);
}
proto_item_append_text(bi->ti, ", BVCI %u", bvci);
}
@ -405,56 +403,56 @@ decode_ip_element(nsip_ip_element_info_t *element, build_info_t *bi, proto_tree
proto_tree *field_tree = NULL;
if (bi->nsip_tree) {
tf = proto_tree_add_text(element_tree, bi->tvb, bi->offset,
element->total_length, "IP Element");
tf = proto_tree_add_text(element_tree, bi->tvb, bi->offset,
element->total_length, "IP Element");
field_tree = proto_item_add_subtree(tf, ett_nsip_ip_element);
/* IP address */
switch (element->version) {
case NSIP_IP_VERSION_4:
ip4_addr = tvb_get_ipv4(bi->tvb, bi->offset);
proto_tree_add_item(field_tree, hf_nsip_ip_address_ipv4,
bi->tvb, bi->offset, element->address_length,
NSIP_LITTLE_ENDIAN);
proto_item_append_text(tf, ": IP address: %s",
ip_to_str((guint8 *)&ip4_addr));
proto_tree_add_item(field_tree, hf_nsip_ip_address_ipv4,
bi->tvb, bi->offset, element->address_length,
NSIP_LITTLE_ENDIAN);
proto_item_append_text(tf, ": IP address: %s",
ip_to_str((guint8 *)&ip4_addr));
break;
case NSIP_IP_VERSION_6:
tvb_get_ipv6(bi->tvb, bi->offset, &ip6_addr);
proto_tree_add_item(field_tree, hf_nsip_ip_address_ipv6, bi->tvb,
bi->offset, element->address_length,
NSIP_LITTLE_ENDIAN);
proto_item_append_text(tf, ": IP address: %s",
ip6_to_str((struct e_in6_addr *)&ip6_addr));
proto_tree_add_item(field_tree, hf_nsip_ip_address_ipv6, bi->tvb,
bi->offset, element->address_length,
NSIP_LITTLE_ENDIAN);
proto_item_append_text(tf, ": IP address: %s",
ip6_to_str((struct e_in6_addr *)&ip6_addr));
break;
default:
;
}
}
bi->offset += element->address_length;
if (bi->nsip_tree) {
/* UDP port value */
udp_port = tvb_get_ntohs(bi->tvb, bi->offset);
proto_tree_add_uint_format(field_tree, hf_nsip_ip_element_udp_port,
bi->tvb, bi->offset, 2, udp_port,
"UDP Port: %u", udp_port);
proto_tree_add_uint_format(field_tree, hf_nsip_ip_element_udp_port,
bi->tvb, bi->offset, 2, udp_port,
"UDP Port: %u", udp_port);
proto_item_append_text(tf, ", UDP Port: %u", udp_port);
}
bi->offset += 2;
if (bi->nsip_tree) {
/* Signalling weight */
proto_tree_add_item(field_tree, hf_nsip_ip_element_signalling_weight,
bi->tvb, bi->offset, 1, NSIP_LITTLE_ENDIAN);
proto_tree_add_item(field_tree, hf_nsip_ip_element_signalling_weight,
bi->tvb, bi->offset, 1, NSIP_LITTLE_ENDIAN);
}
bi->offset++;
if (bi->nsip_tree) {
/* Data weight */
proto_tree_add_item(field_tree, hf_nsip_ip_element_data_weight,
bi->tvb, bi->offset, 1, NSIP_LITTLE_ENDIAN);
proto_tree_add_item(field_tree, hf_nsip_ip_element_data_weight,
bi->tvb, bi->offset, 1, NSIP_LITTLE_ENDIAN);
}
bi->offset++;
return tf;
@ -466,11 +464,11 @@ decode_ip_elements(nsip_ip_element_info_t *element, nsip_ie_t *ie, build_info_t
int num_elements = ie->value_length / element->total_length;
proto_item *tf, *ti = NULL;
proto_tree *field_tree;
tf = proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset,
ie->total_length,
"List of IP%u Elements (%u Elements)",
element->version, num_elements);
tf = proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset,
ie->total_length,
"List of IP%u Elements (%u Elements)",
element->version, num_elements);
field_tree = proto_item_add_subtree(tf, ett_nsip_ip_element_list);
for (i = 0; i < num_elements; i++) {
@ -479,52 +477,52 @@ decode_ip_elements(nsip_ip_element_info_t *element, nsip_ie_t *ie, build_info_t
return tf;
}
static void
static void
decode_iei_max_num_ns_vc(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
guint16 num_ns_vc;
if (bi->nsip_tree) {
num_ns_vc = tvb_get_ntohs(bi->tvb, bi->offset);
proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_max_num_ns_vc,
bi->tvb, ie_start_offset, ie->total_length,
num_ns_vc,
"Maximum Number of NS-VCs: %u", num_ns_vc);
proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_max_num_ns_vc,
bi->tvb, ie_start_offset, ie->total_length,
num_ns_vc,
"Maximum Number of NS-VCs: %u", num_ns_vc);
}
bi->offset += 2;
}
static void
static void
decode_iei_num_ip4_endpoints(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
guint16 num_endpoints;
if (bi->nsip_tree) {
num_endpoints = tvb_get_ntohs(bi->tvb, bi->offset);
proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_num_ip4_endpoints,
bi->tvb, ie_start_offset, ie->total_length,
num_endpoints,
"Number of IP4 Endpoints: %u", num_endpoints);
proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_num_ip4_endpoints,
bi->tvb, ie_start_offset, ie->total_length,
num_endpoints,
"Number of IP4 Endpoints: %u", num_endpoints);
}
bi->offset += 2;
}
static void
static void
decode_iei_num_ip6_endpoints(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
guint16 num_endpoints;
if (bi->nsip_tree) {
num_endpoints = tvb_get_ntohs(bi->tvb, bi->offset);
proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_num_ip6_endpoints,
bi->tvb, ie_start_offset, ie->total_length,
num_endpoints,
"Number of IP6 Endpoints: %u", num_endpoints);
proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_num_ip6_endpoints,
bi->tvb, ie_start_offset, ie->total_length,
num_endpoints,
"Number of IP6 Endpoints: %u", num_endpoints);
}
bi->offset += 2;
}
static void
static void
decode_iei_reset_flag(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
guint8 flag;
proto_item *tf;
@ -533,29 +531,29 @@ decode_iei_reset_flag(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
flag = tvb_get_guint8(bi->tvb, bi->offset);
if (bi->nsip_tree) {
tf = proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset,
ie->total_length,
tf = proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset,
ie->total_length,
"Reset Flag: %#02x", flag);
field_tree = proto_item_add_subtree(tf, ett_nsip_reset_flag);
proto_tree_add_boolean(field_tree, hf_nsip_reset_flag, bi->tvb,
bi->offset, 1,
flag & NSIP_MASK_RESET_FLAG);
proto_tree_add_boolean(field_tree, hf_nsip_reset_flag, bi->tvb,
bi->offset, 1,
flag & NSIP_MASK_RESET_FLAG);
if (flag & NSIP_MASK_RESET_FLAG) {
if (check_col(bi->pinfo->cinfo, COL_INFO)) {
col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
"Reset");
}
proto_item_append_text(bi->ti, ", Reset");
}
proto_tree_add_uint(field_tree, hf_nsip_reset_flag_spare,
bi->tvb, bi->offset, 1,
flag & NSIP_MASK_RESET_FLAG_SPARE);
proto_tree_add_uint(field_tree, hf_nsip_reset_flag_spare,
bi->tvb, bi->offset, 1,
flag & NSIP_MASK_RESET_FLAG_SPARE);
}
bi->offset += 1;
}
static void
static void
decode_iei_ip_address(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
guint8 addr_type;
guint32 ip4_addr;
@ -563,24 +561,24 @@ decode_iei_ip_address(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
addr_type = tvb_get_guint8(bi->tvb, bi->offset);
proto_tree_add_item(bi->nsip_tree, hf_nsip_ip_address_type,
bi->tvb, bi->offset, 1, FALSE);
bi->tvb, bi->offset, 1, FALSE);
switch (addr_type) {
case NSIP_IP_ADDRESS_TYPE_IPV4:
ie->total_length = 2 + ipv4_element.address_length;
ip4_addr = tvb_get_ipv4(bi->tvb, bi->offset+1);
if (bi->nsip_tree) {
proto_tree_add_ipv4(bi->nsip_tree, hf_nsip_ip_address_ipv4,
bi->tvb, ie_start_offset, ie->total_length,
ip4_addr);
proto_tree_add_ipv4(bi->nsip_tree, hf_nsip_ip_address_ipv4,
bi->tvb, ie_start_offset, ie->total_length,
ip4_addr);
}
break;
case NSIP_IP_ADDRESS_TYPE_IPV6:
ie->total_length = 2 + ipv6_element.address_length;
tvb_get_ipv6(bi->tvb, bi->offset+1, &ip6_addr);
if (bi->nsip_tree) {
proto_tree_add_ipv6(bi->nsip_tree, hf_nsip_ip_address_ipv4,
bi->tvb, ie_start_offset, ie->total_length,
(guint8 *)&ip6_addr);
proto_tree_add_ipv6(bi->nsip_tree, hf_nsip_ip_address_ipv4,
bi->tvb, ie_start_offset, ie->total_length,
(guint8 *)&ip6_addr);
}
break;
default:
@ -589,22 +587,22 @@ decode_iei_ip_address(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
bi->offset += ie->value_length;
}
static void
static void
decode_iei_transaction_id(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
guint8 id;
if (bi->nsip_tree) {
id = tvb_get_guint8(bi->tvb, bi->offset);
proto_tree_add_uint(bi->nsip_tree, hf_nsip_transaction_id,
bi->tvb, ie_start_offset, ie->total_length, id);
proto_tree_add_uint(bi->nsip_tree, hf_nsip_transaction_id,
bi->tvb, ie_start_offset, ie->total_length, id);
if (check_col(bi->pinfo->cinfo, COL_INFO)) {
col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
"Transaction Id: %d", id);
}
}
bi->offset += 1;
}
static void
static void
decode_iei_end_flag(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
guint8 flag;
proto_item *tf;
@ -613,47 +611,47 @@ decode_iei_end_flag(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
if (bi->nsip_tree) {
flag = tvb_get_guint8(bi->tvb, bi->offset);
tf = proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset,
ie->total_length,
tf = proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset,
ie->total_length,
"End Flag: %#02x", flag);
field_tree = proto_item_add_subtree(tf, ett_nsip_end_flag);
proto_tree_add_boolean(field_tree, hf_nsip_end_flag, bi->tvb,
bi->offset, 1,
flag & NSIP_MASK_END_FLAG);
proto_tree_add_boolean(field_tree, hf_nsip_end_flag, bi->tvb,
bi->offset, 1,
flag & NSIP_MASK_END_FLAG);
if (flag & NSIP_MASK_END_FLAG) {
proto_item_append_text(bi->ti, ", End");
}
proto_tree_add_uint(field_tree, hf_nsip_end_flag_spare,
bi->tvb, bi->offset, 1,
flag & NSIP_MASK_END_FLAG_SPARE);
proto_tree_add_uint(field_tree, hf_nsip_end_flag_spare,
bi->tvb, bi->offset, 1,
flag & NSIP_MASK_END_FLAG_SPARE);
}
bi->offset += 1;
}
static void
static void
decode_iei_control_bits(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
guint8 control_bits;
proto_item *tf;
proto_tree *field_tree;
control_bits = tvb_get_guint8(bi->tvb, bi->offset);
if (bi->nsip_tree) {
tf = proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset,
ie->total_length,
"NS SDU Control bits: %#02x", control_bits);
tf = proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset,
ie->total_length,
"NS SDU Control bits: %#02x", control_bits);
field_tree = proto_item_add_subtree(tf, ett_nsip_control_bits);
proto_tree_add_boolean(field_tree, hf_nsip_control_bits_r, bi->tvb,
bi->offset, 1,
control_bits & NSIP_MASK_CONTROL_BITS_R);
proto_tree_add_boolean(field_tree, hf_nsip_control_bits_c, bi->tvb,
bi->offset, 1,
control_bits & NSIP_MASK_CONTROL_BITS_C);
proto_tree_add_uint(field_tree, hf_nsip_control_bits_spare,
bi->tvb, bi->offset, 1,
control_bits & NSIP_MASK_CONTROL_BITS_SPARE);
proto_tree_add_boolean(field_tree, hf_nsip_control_bits_r, bi->tvb,
bi->offset, 1,
control_bits & NSIP_MASK_CONTROL_BITS_R);
proto_tree_add_boolean(field_tree, hf_nsip_control_bits_c, bi->tvb,
bi->offset, 1,
control_bits & NSIP_MASK_CONTROL_BITS_C);
proto_tree_add_uint(field_tree, hf_nsip_control_bits_spare,
bi->tvb, bi->offset, 1,
control_bits & NSIP_MASK_CONTROL_BITS_SPARE);
}
bi->offset++;
@ -757,7 +755,7 @@ decode_pdu_ns_unitdata(build_info_t *bi) {
nsip_ie_t ies[] = {
{ 0, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_V, 0, 1 }, /* Control bits */
{ NSIP_IE_BVCI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_V, 0, 2 },
{ 0, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_V, 0, 0 },
{ 0, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_V, 0, 0 },
/* NS SDU, length unknown */
};
gint sdu_length;
@ -768,15 +766,15 @@ decode_pdu_ns_unitdata(build_info_t *bi) {
next_tvb = tvb_new_subset_remaining(bi->tvb, bi->offset);
if (bssgp_handle) {
call_dissector(bssgp_handle, next_tvb, bi->pinfo, bi->parent_tree);
}
}
else {
sdu_length = tvb_length_remaining(bi->tvb, bi->offset);
proto_tree_add_text(bi->nsip_tree, bi->tvb, bi->offset, sdu_length,
"NS SDU (%u bytes)", sdu_length);
proto_tree_add_text(bi->nsip_tree, bi->tvb, bi->offset, sdu_length,
"NS SDU (%u bytes)", sdu_length);
}
}
static void
static void
decode_pdu_ns_reset(build_info_t *bi) {
nsip_ie_t ies[] = {
{ NSIP_IE_CAUSE, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 3 },
@ -786,7 +784,7 @@ decode_pdu_ns_reset(build_info_t *bi) {
decode_pdu_general(ies, 3, bi);
}
static void
static void
decode_pdu_ns_reset_ack(build_info_t *bi) {
nsip_ie_t ies[] = {
{ NSIP_IE_NS_VCI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 4 },
@ -795,7 +793,7 @@ decode_pdu_ns_reset_ack(build_info_t *bi) {
decode_pdu_general(ies, 2, bi);
}
static void
static void
decode_pdu_ns_block(build_info_t *bi) {
nsip_ie_t ies[] = {
{ NSIP_IE_CAUSE, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 3 },
@ -804,36 +802,36 @@ decode_pdu_ns_block(build_info_t *bi) {
decode_pdu_general(ies, 2, bi);
}
static void
static void
decode_pdu_ns_block_ack(build_info_t *bi) {
nsip_ie_t ies[] = { { NSIP_IE_NS_VCI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV,
0, 1 }, };
0, 1 }, };
decode_pdu_general(ies, 1, bi);
}
static void
static void
decode_pdu_ns_status(build_info_t *bi) {
nsip_ie_t ies[] = {
nsip_ie_t ies[] = {
{ NSIP_IE_CAUSE, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 3 },
{ NSIP_IE_NS_VCI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 4 },
{ NSIP_IE_NS_PDU, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 },
{ NSIP_IE_NS_PDU, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 },
/* Unknown length */
{ NSIP_IE_BVCI, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 4 },
{ NSIP_IE_IP4_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 },
{ NSIP_IE_IP4_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 },
/* Unknown length */
{ NSIP_IE_IP6_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 },
{ NSIP_IE_IP6_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 },
/* Unknown length */
};
decode_pdu_general(ies, 6, bi);
}
static void
static void
decode_pdu_sns_ack(build_info_t *bi) {
nsip_ie_t ies[] = {
{ NSIP_IE_NSEI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 4 },
{ 0, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_V, 0, 1 }, /* Transaction id */
{ NSIP_IE_CAUSE, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 3 },
{ NSIP_IE_IP_ADDRESS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TV, 0, 0 },
{ NSIP_IE_IP_ADDRESS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TV, 0, 0 },
/* Unknown length */
{ NSIP_IE_IP4_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 },
{ NSIP_IE_IP6_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 },
@ -843,14 +841,14 @@ decode_pdu_sns_ack(build_info_t *bi) {
decode_pdu_general(&ies[2], 4, bi);
}
static void
static void
decode_pdu_sns_add(build_info_t *bi) {
nsip_ie_t ies[] = {
{ NSIP_IE_NSEI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 4 },
{ 0, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_V, 0, 1 }, /* Transaction id */
{ NSIP_IE_IP4_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 },
/* Unknown length */
{ NSIP_IE_IP6_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 },
{ NSIP_IE_IP6_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 },
/* Unknown length */
};
decode_pdu_general(ies, 1, bi);
@ -858,14 +856,14 @@ decode_pdu_sns_add(build_info_t *bi) {
decode_pdu_general(&ies[2], 2, bi);
}
static void
static void
decode_pdu_sns_changeweight(build_info_t *bi) {
nsip_ie_t ies[] = {
{ NSIP_IE_NSEI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 4 },
{ 0, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_V, 0, 1 }, /* Transaction id */
{ NSIP_IE_IP4_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 },
{ NSIP_IE_IP4_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 },
/* Unknown length */
{ NSIP_IE_IP6_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 },
{ NSIP_IE_IP6_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 },
/* Unknown length */
};
decode_pdu_general(ies, 1, bi);
@ -873,13 +871,13 @@ decode_pdu_sns_changeweight(build_info_t *bi) {
decode_pdu_general(&ies[2], 2, bi);
}
static void
static void
decode_pdu_sns_config(build_info_t *bi) {
nsip_ie_t ies[] = {
nsip_ie_t ies[] = {
{ 0, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_V, 0, 1 }, /* End flag */
{ NSIP_IE_NSEI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 4 },
{ NSIP_IE_IP4_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 },
{ NSIP_IE_IP4_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 },
/* Unknown length */
{ NSIP_IE_IP6_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 },
/* Unknown length */
@ -888,7 +886,7 @@ decode_pdu_sns_config(build_info_t *bi) {
decode_pdu_general(&ies[1], 3, bi);
}
static void
static void
decode_pdu_sns_config_ack(build_info_t *bi) {
nsip_ie_t ies[] = {
{ NSIP_IE_NSEI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 4 },
@ -897,12 +895,12 @@ decode_pdu_sns_config_ack(build_info_t *bi) {
decode_pdu_general(ies, 2, bi);
}
static void
static void
decode_pdu_sns_delete(build_info_t *bi) {
nsip_ie_t ies[] = {
{ NSIP_IE_NSEI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 4}, /* CR013 */
{ 0, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_V, 0, 1 }, /* Transaction id */
{ NSIP_IE_IP_ADDRESS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TV, 0, 0 },
{ NSIP_IE_IP_ADDRESS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TV, 0, 0 },
/* Unknown length */
{ NSIP_IE_IP4_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 },
{ NSIP_IE_IP6_ELEMENTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TLV, 0, 0 },
@ -912,21 +910,21 @@ decode_pdu_sns_delete(build_info_t *bi) {
decode_pdu_general(&ies[2], 3, bi);
}
static void
static void
decode_pdu_sns_size(build_info_t *bi) {
nsip_ie_t ies[] = {
{ NSIP_IE_NSEI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 4 },
{ NSIP_IE_RESET_FLAG, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TV, 0, 2 },
{ NSIP_IE_MAX_NUM_NS_VC, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TV, 0, 3 },
{ NSIP_IE_NUM_IP4_ENDPOINTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TV,
{ NSIP_IE_NUM_IP4_ENDPOINTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TV,
0, 3 },
{ NSIP_IE_NUM_IP6_ENDPOINTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TV,
{ NSIP_IE_NUM_IP6_ENDPOINTS, NSIP_IE_PRESENCE_C, NSIP_IE_FORMAT_TV,
0, 3 },
};
decode_pdu_general(ies, 5, bi);
}
static void
static void
decode_pdu_sns_size_ack(build_info_t *bi) {
nsip_ie_t ies[] = {
{ NSIP_IE_NSEI, NSIP_IE_PRESENCE_M, NSIP_IE_FORMAT_TLV, 0, 4 },
@ -1002,136 +1000,136 @@ dissect_nsip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
pinfo->current_proto = "GPRS-NS";
col_set_str(pinfo->cinfo, COL_PROTOCOL, "GPRS-NS");
col_clear(pinfo->cinfo, COL_INFO);
pdu_type = tvb_get_guint8(tvb, 0);
bi.offset++;
if (tree) {
bi.ti = proto_tree_add_item(tree, proto_nsip, tvb, 0, -1,
NSIP_LITTLE_ENDIAN);
bi.ti = proto_tree_add_item(tree, proto_nsip, tvb, 0, -1,
NSIP_LITTLE_ENDIAN);
nsip_tree = proto_item_add_subtree(bi.ti, ett_nsip);
proto_tree_add_uint_format(nsip_tree, hf_nsip_pdu_type, tvb, 0, 1,
pdu_type,
"PDU type: %s (%#02x)",
val_to_str(pdu_type, tab_nsip_pdu_types,
"Unknown"), pdu_type);
proto_tree_add_uint_format(nsip_tree, hf_nsip_pdu_type, tvb, 0, 1,
pdu_type,
"PDU type: %s (%#02x)",
val_to_str(pdu_type, tab_nsip_pdu_types,
"Unknown"), pdu_type);
proto_item_append_text(bi.ti, ", PDU type: %s",
val_to_str(pdu_type, tab_nsip_pdu_types, "Unknown"));
val_to_str(pdu_type, tab_nsip_pdu_types, "Unknown"));
bi.nsip_tree = nsip_tree;
}
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_str(pinfo->cinfo, COL_INFO,
val_to_str(pdu_type, tab_nsip_pdu_types, "Unknown PDU type"));
col_add_str(pinfo->cinfo, COL_INFO,
val_to_str(pdu_type, tab_nsip_pdu_types, "Unknown PDU type"));
}
decode_pdu(pdu_type, &bi);
}
void
proto_register_nsip(void)
{
{
static hf_register_info hf[] = {
{ &hf_nsip_cause,
{ "Cause", "nsip.cause",
FT_UINT8, BASE_OCT, VALS(tab_nsip_cause_values), 0x0,
NULL, HFILL }
FT_UINT8, BASE_OCT, VALS(tab_nsip_cause_values), 0x0,
NULL, HFILL }
},
{ &hf_nsip_ns_vci,
{ "NS-VCI", "nsip.ns_vci",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Network Service Virtual Link Identifier", HFILL }
FT_UINT16, BASE_DEC, NULL, 0x0,
"Network Service Virtual Link Identifier", HFILL }
},
{ &hf_nsip_pdu_type,
{ "PDU type", "nsip.pdu_type",
FT_UINT8, BASE_OCT, VALS(tab_nsip_pdu_types), 0x0,
"PDU type information element", HFILL }
FT_UINT8, BASE_OCT, VALS(tab_nsip_pdu_types), 0x0,
"PDU type information element", HFILL }
},
{ &hf_nsip_bvci,
{ "BVCI", "nsip.bvci",
FT_UINT16, BASE_DEC, NULL, 0x0,
"BSSGP Virtual Connection Identifier", HFILL }
FT_UINT16, BASE_DEC, NULL, 0x0,
"BSSGP Virtual Connection Identifier", HFILL }
},
{ &hf_nsip_nsei,
{ "NSEI", "nsip.nsei",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Network Service Entity Identifier", HFILL }
FT_UINT16, BASE_DEC, NULL, 0x0,
"Network Service Entity Identifier", HFILL }
},
{ &hf_nsip_ip4_elements,
{ "IP4 elements", "nsip.ip4_elements",
FT_NONE, BASE_NONE, NULL, 0x0,
"List of IP4 elements", HFILL }
FT_NONE, BASE_NONE, NULL, 0x0,
"List of IP4 elements", HFILL }
},
{ &hf_nsip_ip6_elements,
{ "IP6 elements", "nsip.ip6_elements",
FT_NONE, BASE_NONE, NULL, 0x0,
"List of IP6 elements", HFILL }
FT_NONE, BASE_NONE, NULL, 0x0,
"List of IP6 elements", HFILL }
},
{ &hf_nsip_max_num_ns_vc,
{ "Maximum number of NS-VCs", "nsip.max_num_ns_vc",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_nsip_num_ip4_endpoints,
{ "Number of IP4 endpoints", "nsip.num_ip4_endpoints",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_nsip_num_ip6_endpoints,
{ "Number of IP6 endpoints", "nsip.num_ip6_endpoints",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_nsip_reset_flag,
{ "Reset flag", "nsip.reset_flag.flag",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), NSIP_MASK_RESET_FLAG,
NULL, HFILL }
FT_BOOLEAN, 8, TFS(&tfs_set_notset), NSIP_MASK_RESET_FLAG,
NULL, HFILL }
},
{ &hf_nsip_reset_flag_spare,
{ "Reset flag spare bits", "nsip.reset_flag.spare",
FT_UINT8, BASE_HEX, NULL, NSIP_MASK_RESET_FLAG_SPARE,
NULL, HFILL }
FT_UINT8, BASE_HEX, NULL, NSIP_MASK_RESET_FLAG_SPARE,
NULL, HFILL }
},
{ &hf_nsip_ip_address_type,
{ "IP Address Type", "nsip.ip_address_type",
FT_UINT8, BASE_DEC, VALS(ip_address_type_vals), 0x0,
NULL, HFILL }
FT_UINT8, BASE_DEC, VALS(ip_address_type_vals), 0x0,
NULL, HFILL }
},
{ &hf_nsip_ip_address_ipv4,
{ "IP Address", "nsip.ipv4_address",
FT_IPv4, BASE_NONE, NULL, 0x0,
NULL, HFILL }
FT_IPv4, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_nsip_ip_address_ipv6,
{ "IP Address", "nsip.ipv6_address",
FT_IPv6, BASE_NONE, NULL, 0x0,
NULL, HFILL }
FT_IPv6, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_nsip_end_flag,
{ "End flag", "nsip.end_flag.flag",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), NSIP_MASK_END_FLAG,
NULL, HFILL }
FT_BOOLEAN, 8, TFS(&tfs_set_notset), NSIP_MASK_END_FLAG,
NULL, HFILL }
},
{ &hf_nsip_end_flag_spare,
{ "End flag spare bits", "nsip.end_flag.spare",
FT_UINT8, BASE_HEX, NULL, NSIP_MASK_END_FLAG_SPARE,
NULL, HFILL }
FT_UINT8, BASE_HEX, NULL, NSIP_MASK_END_FLAG_SPARE,
NULL, HFILL }
},
{ &hf_nsip_control_bits_r,
{ "Request change flow", "nsip.control_bits.r",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), NSIP_MASK_CONTROL_BITS_R,
NULL, HFILL }
FT_BOOLEAN, 8, TFS(&tfs_set_notset), NSIP_MASK_CONTROL_BITS_R,
NULL, HFILL }
},
{ &hf_nsip_control_bits_c,
{ "Confirm change flow", "nsip.control_bits.c",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), NSIP_MASK_CONTROL_BITS_C,
NULL, HFILL }
FT_BOOLEAN, 8, TFS(&tfs_set_notset), NSIP_MASK_CONTROL_BITS_C,
NULL, HFILL }
},
{ &hf_nsip_control_bits_spare,
{ "Spare bits", "nsip.control_bits.spare",
FT_UINT8, BASE_HEX, NULL, NSIP_MASK_CONTROL_BITS_SPARE,
NULL, HFILL }
FT_UINT8, BASE_HEX, NULL, NSIP_MASK_CONTROL_BITS_SPARE,
NULL, HFILL }
},
{ &hf_nsip_transaction_id,
{ "Transaction ID", "nsip.transaction_id",
@ -1140,28 +1138,28 @@ proto_register_nsip(void)
},
{ &hf_nsip_ip_element_ip_address_ipv4,
{ "IP Address", "nsip.ip_element.ipv4_address",
FT_IPv4, BASE_NONE, NULL, 0x0,
NULL, HFILL }
FT_IPv4, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_nsip_ip_element_ip_address_ipv6,
{ "IP Address", "nsip.ip_element.ipv6_address",
FT_IPv6, BASE_NONE, NULL, 0x0,
NULL, HFILL }
FT_IPv6, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_nsip_ip_element_udp_port,
{ "UDP Port", "nsip.ip_element.udp_port",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_nsip_ip_element_signalling_weight,
{ "Signalling Weight", "nsip.ip_element.signalling_weight",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_nsip_ip_element_data_weight,
{ "Data Weight", "nsip.ip_element.data_weight",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
};
@ -1178,10 +1176,10 @@ proto_register_nsip(void)
module_t *nsip_module;
/* Register the protocol name and description */
proto_nsip = proto_register_protocol("GPRS Network Service",
"GPRS-NS", "gprs-ns");
proto_nsip = proto_register_protocol("GPRS Network Service",
"GPRS-NS", "gprs-ns");
/* Required function calls to register the header fields and
/* Required function calls to register the header fields and
subtrees used */
proto_register_field_array(proto_nsip, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@ -1196,9 +1194,9 @@ proto_register_nsip(void)
prefs_register_obsolete_preference(nsip_module, "udp.port1");
prefs_register_obsolete_preference(nsip_module, "udp.port2");
prefs_register_range_preference(nsip_module, "udp.ports", "GPRS-NS UDP ports",
"UDP ports to be decoded as GPRS-NS (default: "
DEFAULT_NSIP_PORT_RANGE ")",
&global_nsip_udp_port_range, MAX_UDP_PORT);
"UDP ports to be decoded as GPRS-NS (default: "
DEFAULT_NSIP_PORT_RANGE ")",
&global_nsip_udp_port_range, MAX_UDP_PORT);
}
static void
@ -1230,5 +1228,5 @@ proto_reg_handoff_nsip(void) {
nsip_udp_port_range = range_copy(global_nsip_udp_port_range);
range_foreach(nsip_udp_port_range, range_add_callback);
}

View File

@ -40,8 +40,6 @@
# include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <epan/packet.h>
#include <epan/expert.h>
@ -248,10 +246,10 @@ int number_of_cells(const pwatm_mode_t mode
,const gint payload_size
,gint* const remainder_size)
{
int cells;
int cells;
DISSECTOR_ASSERT(payload_size >= 0);
switch(mode)
{
case PWATM_MODE_N1_NOCW:
@ -280,7 +278,7 @@ int number_of_cells(const pwatm_mode_t mode
*remainder_size = payload_size;
return 0;
}
}
@ -300,7 +298,7 @@ void col_append_pw_info(packet_info * pinfo
{
col_append_str(pinfo->cinfo, COL_INFO, "CW:Bad");
}
if (pd->props & PWC_PAY_SIZE_BAD)
{
if (pd->props & PWC_ANYOF_CW_BAD)
@ -312,7 +310,7 @@ void col_append_pw_info(packet_info * pinfo
,(int)payload_size
,plurality(payload_size,"","s"));
}
if (pd->props == 0) /*omit "atm cells" etc if something is wrong*/
{
/* number of cells may be not known */
@ -337,7 +335,7 @@ void col_append_pw_info(packet_info * pinfo
if (pd->cumulative.clp >= 0)
col_append_fstr(pinfo->cinfo, COL_INFO, ", CLP:%.1d", pd->cumulative.clp);
}
if (padding_size != 0)
{
col_append_fstr(pinfo->cinfo, COL_INFO, ", %d padding"
@ -345,7 +343,7 @@ void col_append_pw_info(packet_info * pinfo
}
}
static
void prepare_pseudo_header_atm(
union wtap_pseudo_header * const ph,
@ -366,7 +364,7 @@ void prepare_pseudo_header_atm(
ph->atm.channel = 0; /*unknown*//* link: 0 for DTE->DCE, 1 for DCE->DTE */
ph->atm.cells = 0; /*zero indicates that we do not have trailer info*/
/*user-to-user indicator & CPI*/
ph->atm.aal5t_u2u = 0; /* all bits unknown except lsb of UU */
ph->atm.aal5t_u2u = 0; /* all bits unknown except lsb of UU */
if (pdata->aal5_sdu_frame_relay_cr_bit)
{ /* Let's give Frame Relay C/R bit to ATM dissector.*/
ph->atm.aal5t_u2u |= (1<<8); /*UU octet is at << 8 in aal5t_u2u*/
@ -399,9 +397,9 @@ void dissect_payload_and_padding(
{
tvb_2 = tvb_new_subset_remaining(tvb,dissected);
dissected += call_dissector(dh_cell_header, tvb_2, pinfo, tree);
tvb_2 = tvb_new_subset_remaining(tvb,dissected);
/*dissect as oam for specific vci/pti, just like atm dissector does*/
if (pd->vci >= 0 && pd->pti >=0)
{
@ -410,7 +408,7 @@ void dissect_payload_and_padding(
pd->cell_mode_oam = TRUE;
}
}
if (pd->cell_mode_oam)
{
union wtap_pseudo_header* pseudo_header_save;
@ -444,7 +442,7 @@ void dissect_payload_and_padding(
dissected += call_dissector(dh_cell, tvb_2, pinfo, tree);
}
}
if (padding_size != 0)
{
tvb_2 = tvb_new_subset(tvb
@ -552,8 +550,8 @@ void dissect_11_or_aal5_pdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr
proto_name_tree = &longname_pw_atm_aal5_pdu[0];
}
}
/* check how "good" is this packet */
pd.props = PWC_PACKET_PROPERTIES_T_INITIALIZER;
if (0 != (tvb_get_guint8(tvb, 0) & 0xf0 /*bits03*/))
@ -564,12 +562,12 @@ void dissect_11_or_aal5_pdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr
{
pd.props |= PWC_CW_BAD_RSV;
}
/*
* Do not dissect and validate atm-specific byte (3rd byte of CW).
* It will be dissected/validated as pw cell header.
*/
/*
* Decide about payload length and padding.
*
@ -621,7 +619,7 @@ void dissect_11_or_aal5_pdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr
proto_item* item;
item = proto_tree_add_item(tree, proto_11_or_aal5_pdu, tvb, 0, -1, FALSE);
/*overwrite heading line*/
proto_item_set_text(item, proto_name_tree, 0/*-warn gcc 3.4.4*/);
proto_item_set_text(item, proto_name_tree, 0/*-warn gcc 3.4.4*/);
pwc_item_append_text_n_items(item,cells,"good ATM cell");
{
proto_tree* tree2;
@ -654,12 +652,12 @@ void dissect_11_or_aal5_pdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr
}
}
}
{
tvbuff_t* tvb_2;
tvb_2 = tvb_new_subset(tvb, 0, PWC_SIZEOF_CW, PWC_SIZEOF_CW);
call_dissector(dh_control_word, tvb_2, pinfo, tree);
tvb_2 = tvb_new_subset(tvb, (PWC_SIZEOF_CW-1), -1, -1);
if (MODE_11(pd.mode))
{
@ -672,7 +670,7 @@ void dissect_11_or_aal5_pdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr
tvbuff_t* tvb_3;
union wtap_pseudo_header* pseudo_header_save;
union wtap_pseudo_header ph;
tvb_3 = tvb_new_subset_remaining(tvb_2, 1);
/* prepare pseudo header for atm aal5 decoding */
pseudo_header_save = pinfo->pseudo_header;
@ -684,7 +682,7 @@ void dissect_11_or_aal5_pdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr
}
}
}
if (MODE_11(pd.mode))
{
/* overwrite everything written by sub-dissectors in 1:1 modes*/
@ -695,7 +693,7 @@ void dissect_11_or_aal5_pdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr
col_append_pw_info(pinfo, payload_size, cells, 0);
}
}
pinfo->private_data = pd_save;
return;
}
@ -733,7 +731,7 @@ void dissect_aal5_sdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
{
pd.submode = PWATM_SUBMODE_ADMIN_CELL;
}
if (! pref_aal5_sdu_extend_cw_length_with_rsvd)
{
if (0 != (tvb_get_guint8(tvb, 1) & 0xc0 /*preferred_cw.rsvd*/))
@ -748,7 +746,7 @@ void dissect_aal5_sdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
* length field MUST be set to the packet's length. Otherwise, the
* length field MUST be set to zero... Note that the length field
* is not used in the N-to-one mode and MUST be set to 0. ]
*
*
* Also we allow some "extensions"conducted by pref_xxx.
*/
gint payload_size_from_packet;
@ -763,14 +761,14 @@ void dissect_aal5_sdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
{
cw_len = tvb_get_guint8(tvb, 1) & 0x3f;
}
/*
* Initial assumptions: no padding,
* payload size derived from psn packet size.
*/
payload_size = payload_size_from_packet;
padding_size = 0;
if (0 == cw_len)
{
/*keep initial assumptions*/
@ -820,7 +818,7 @@ void dissect_aal5_sdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
}
}
}
if (PWATM_SUBMODE_ADMIN_CELL == pd.submode)
{
gint bad_padding_size;
@ -847,7 +845,7 @@ void dissect_aal5_sdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
col_append_str(pinfo->cinfo, COL_PROTOCOL, ", OAM cell");
}
}
if (check_col(pinfo->cinfo, COL_INFO))
{
col_clear(pinfo->cinfo, COL_INFO);
@ -875,25 +873,25 @@ void dissect_aal5_sdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
,(int)payload_size,(int)SIZEOF_N1_PW_CELL);
}
}
{
tvbuff_t* tvb_2;
tvb_2 = tvb_new_subset(tvb, 0, PWC_SIZEOF_CW, PWC_SIZEOF_CW);
call_dissector(dh_control_word, tvb_2, pinfo, tree);
tvb_2 = tvb_new_subset_remaining(tvb, PWC_SIZEOF_CW);
if (PWATM_SUBMODE_ADMIN_CELL == pd.submode)
{
dissect_payload_and_padding(tvb_2,pinfo,tree,payload_size,padding_size);
}
else /*AAL5 payload*/
{
{
if (payload_size != 0)
{
tvbuff_t* tvb_3;
union wtap_pseudo_header* pseudo_header_save;
union wtap_pseudo_header ph;
tvb_3 = tvb_new_subset(tvb_2, 0, payload_size, payload_size);
/* prepare pseudo header for atm aal5 decoding */
pseudo_header_save = pinfo->pseudo_header;
@ -962,7 +960,7 @@ void dissect_n1_cw(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
* length field MUST be set to the packet's length. Otherwise, the
* length field MUST be set to zero... Note that the length field
* is not used in the N-to-one mode and MUST be set to 0. ]
*
*
* Also we allow some "extensions"conducted by pref_xxx.
*/
gint payload_size_from_packet;
@ -977,14 +975,14 @@ void dissect_n1_cw(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
{
cw_len = tvb_get_guint8(tvb, 1) & 0x3f;
}
/*
* Initial assumptions: no padding,
* payload size derived from psn packet size.
*/
payload_size = payload_size_from_packet;
padding_size = 0;
if (0 == cw_len)
{
/*keep initial assumptions*/
@ -1058,12 +1056,12 @@ void dissect_n1_cw(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
,(int)payload_size,(int)SIZEOF_N1_PW_CELL);
}
}
{
tvbuff_t* tvb_2;
tvb_2 = tvb_new_subset(tvb, 0, PWC_SIZEOF_CW, PWC_SIZEOF_CW);
call_dissector(dh_control_word, tvb_2, pinfo, tree);
tvb_2 = tvb_new_subset_remaining(tvb, PWC_SIZEOF_CW);
dissect_payload_and_padding(tvb_2,pinfo,tree,payload_size,padding_size);
}
@ -1077,7 +1075,7 @@ void dissect_n1_cw(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
col_clear(pinfo->cinfo, COL_INFO);
col_append_pw_info(pinfo, payload_size, cells, padding_size);
}
pinfo->private_data = pd_save;
return;
}
@ -1138,9 +1136,9 @@ void dissect_n1_nocw(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
,(int)payload_size,(int)SIZEOF_N1_PW_CELL);
}
}
dissect_payload_and_padding(tvb,pinfo,tree,payload_size,0);
/* fill columns in Packet List */
/* overwrite everything written by sub-dissectors */
col_set_str(pinfo->cinfo, COL_PROTOCOL, proto_name_column);
@ -1175,7 +1173,7 @@ void proto_item_append_text_cwb3_fields(proto_item * item, const pwatm_private_d
proto_item_append_text(item, "CLP:%.1u ", (unsigned)(pd->cwb3.clp));
return;
}
static
void dissect_control_word(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
@ -1210,7 +1208,7 @@ void dissect_control_word(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree
proto_item* item_top;
item_top = proto_tree_add_item(tree, proto_control_word, tvb, 0, -1, FALSE);
pwc_item_append_cw(item_top,tvb_get_ntohl(tvb, 0),FALSE);
{
proto_tree* tree2;
tree2 = proto_item_add_subtree(item_top, ett_cw);
@ -1228,7 +1226,7 @@ void dissect_control_word(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree
{
PROTO_ITEM_SET_HIDDEN(item); /* show only in error cases */
}
/* flags */
if (MODE_N1(pd->mode))
{
@ -1259,7 +1257,7 @@ void dissect_control_word(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree
(0 == (tvb_get_guint8(tvb, 0) & 0x01 /*preferred_cw.U*/))
? FALSE : TRUE;
}
/* reserved bits */
if (MODE_11_OR_AAL5_PDU(pd->mode)
|| (MODE_N1(pd->mode) && !pref_n1_cw_extend_cw_length_with_rsvd)
@ -1288,7 +1286,7 @@ void dissect_control_word(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree
PROTO_ITEM_SET_HIDDEN(item); /*...and show only in error cases */
}
}
/* length */
if (MODE_N1(pd->mode)
|| (PWATM_MODE_AAL5_SDU == pd->mode))
@ -1331,11 +1329,11 @@ void dissect_control_word(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree
,(int)pd->packet_size);
}
}
/* sequence number */
proto_tree_add_item(tree2, hf_cw_seq, tvb
,MODE_11_OR_AAL5_PDU(pd->mode) ? 1 : 2, 2, FALSE);
/* atm-specific byte */
if (MODE_11(pd->mode))
{
@ -1355,7 +1353,7 @@ void dissect_control_word(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree
* marked as "bad".
*/
}
/*3rd byte of CW*/
if (PWATM_MODE_AAL5_PDU == pd->mode)
{
@ -1381,12 +1379,12 @@ int dissect_cell_header(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
pwatm_private_data_t * pd;
gboolean is_enough_data;
int dissect_size;
pd = pinfo->private_data;
DISSECTOR_ASSERT (NULL != pd);
pd->vpi = pd->vci = pd->pti = -1;
pd->cwb3.clp = pd->cwb3.m = pd->cwb3.v = pd->cwb3.rsv = pd->cwb3.u = pd->cwb3.e = -1;
if (PWATM_MODE_AAL5_PDU == pd->mode)
{
if (tvb_reported_length_remaining(tvb, 0) < 1)
@ -1420,7 +1418,7 @@ int dissect_cell_header(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
/*
* NB: do not touch columns -- keep info from previous dissector
*/
/* Collect info for upper-level dissectors regardless of
* the presence of the tree
*/
@ -1484,11 +1482,11 @@ int dissect_cell_header(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
break;
}
}
if (tree)
{
proto_item* item;
item = proto_tree_add_item(tree, proto_cell_header, tvb
,0
,dissect_size
@ -1510,8 +1508,8 @@ int dissect_cell_header(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
proto_item_append_text(item, "PTI:%.1u ", (unsigned)(pd->pti));
proto_item_append_text_cwb3_fields(item,pd);
}
{
{
proto_tree* tree2;
tree2 = proto_item_add_subtree(item, ett_cell_header);
if (is_enough_data)
@ -1537,7 +1535,7 @@ int dissect_cell_header(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
" PTI field (%d) should be 4, 5 or 6.",
pd->pti);
}
proto_tree_add_item(tree2, hf_cell_h_clp, tvb, 3, 1, FALSE);
}
else if (MODE_11_OR_AAL5_PDU(pd->mode))
@ -1569,7 +1567,7 @@ int dissect_cell_header(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
,"AAL5 PDU mode:"
" V bit must be 0 to indicate that VCI is absent");
}
item2 = proto_tree_add_item(tree2
,(PWATM_MODE_AAL5_PDU == pd->mode)
? hf_aal5_pdu_rsv
@ -1584,7 +1582,7 @@ int dissect_cell_header(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
{
PROTO_ITEM_SET_HIDDEN(item2); /*...and show only in error cases */
}
if (MODE_11(pd->mode))
{
item2 = proto_tree_add_item(tree2, hf_cell_h_pti, tvb, 0, 1, FALSE);
@ -1600,9 +1598,9 @@ int dissect_cell_header(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
proto_tree_add_item(tree2, hf_aal5_pdu_u, tvb, 0, 1, FALSE);
proto_tree_add_item(tree2, hf_aal5_pdu_e, tvb, 0, 1, FALSE);
}
proto_tree_add_item(tree2, hf_cell_h_clp, tvb, 0, 1, FALSE);
if (PWATM_MODE_11_VPC == pd->mode)
{
proto_tree_add_uint(tree2, hf_cell_h_vci, tvb, 1, 2
@ -1632,7 +1630,7 @@ int dissect_cell(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
{
gboolean is_enough_data;
int dissect_size;
{
gint size;
size = tvb_reported_length_remaining(tvb, 0);
@ -1651,7 +1649,7 @@ int dissect_cell(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
/*
* NB: do not touch columns -- keep info from previous dissector
*/
if (tree)
{
proto_item* item;
@ -1671,7 +1669,7 @@ int dissect_cell(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
,"Bad length of cell payload: must be == %d"
,(int)SIZEOF_ATM_CELL_PAYLOAD);
}
{
proto_tree* tree2;
tvbuff_t* tvb_d;
@ -1731,7 +1729,7 @@ void proto_register_pw_atm_ata(void)
,"Bit (M) of the control byte indicates whether the packet"
" contains an ATM cell or a frame payload. If set to 0,"
" the packet contains an ATM cell. If set to 1, the PDU"
" contains an AAL5 payload."
" contains an AAL5 payload."
,HFILL }}
,{ &hf_cell_h_v ,{"VCI Present" ,"atm.pw_control_byte.v"
,FT_BOOLEAN ,8 ,TFS(&tfs_yes_no),0x40
@ -1769,7 +1767,7 @@ static hf_register_info hfa_cell[] = {
,FT_INT32 ,BASE_DEC ,NULL ,0
,NULL ,HFILL }}
};
#define HF_INITIALIZER_NCELLS(hf_handle)\
{&(hf_handle) ,{"Number of good encapsulated cells","pw.atm.cells"\
,FT_INT32 ,BASE_DEC ,NULL ,0\
@ -1807,29 +1805,29 @@ static hf_register_info hfa_cell[] = {
{ 1, "ATM admin cell" },
{ 0, NULL }
};
static const value_string a5s_e_vals[] = {
{ 0, "No congestion" },
{ 1, "Congestion experienced" },
{ 0, NULL }
};
static hf_register_info hfa_cw[] = {
{ &hf_cw_bits03 ,{"Bits 0 to 3" ,"pw.cw.bits03"
,FT_UINT8 ,BASE_HEX ,NULL ,0xf0
,FT_UINT8 ,BASE_HEX ,NULL ,0xf0
,NULL ,HFILL }}
,{ &hf_pref_cw_flags ,{"Flags" ,"pw.cw.flags"
,{ &hf_pref_cw_flags ,{"Flags" ,"pw.cw.flags"
,FT_UINT8 ,BASE_HEX ,NULL ,0x0f
,NULL ,HFILL }}
,{ &hf_pref_cw_a5s_t ,{"Payload type" ,"atm.pt"
,{ &hf_pref_cw_a5s_t ,{"Payload type" ,"atm.pt"
,FT_UINT8 ,BASE_DEC ,VALS(a5s_t_vals),0x08
,"Bit (T) of the control word indicates whether the packet contains"
" an ATM admin cell or an AAL5 payload. If T = 1, the packet"
" contains an ATM admin cell, encapsulated according to the N:1"
" cell relay encapsulation. If not set, the PDU"
" contains an AAL5 payload."
" contains an AAL5 payload."
,HFILL }}
,{ &hf_pref_cw_a5s_e ,{"EFCI bit" ,"atm.efci"
,{ &hf_pref_cw_a5s_e ,{"EFCI bit" ,"atm.efci"
,FT_UINT8 ,BASE_DEC ,VALS(a5s_e_vals),0x04
,"The ingress router sets this bit to 1 if the EFCI bit"
" of the final cell of those that transported the AAL5 CPCS-SDU is"
@ -1837,14 +1835,14 @@ static hf_register_info hfa_cell[] = {
" transported in the packet is set to 1. Otherwise, this bit"
" is set to 0."
,HFILL }}
,{ &hf_pref_cw_a5s_c ,{"CLP bit" ,"atm.clp"
,{ &hf_pref_cw_a5s_c ,{"CLP bit" ,"atm.clp"
,FT_UINT8 ,BASE_DEC ,VALS(clp_vals) ,0x02
,"The ingress router sets this bit to 1 if the CLP bit"
" of any of the ATM cells that transported the AAL5 CPCS-SDU is set"
" to 1, or if the CLP bit of the single ATM cell to be transported"
" in the packet is set to 1. Otherwise this bit is set to 0."
,HFILL }}
,{ &hf_pref_cw_a5s_u ,{"U bit (Command/Response)" ,"pw.cw.aal5sdu.u"
,{ &hf_pref_cw_a5s_u ,{"U bit (Command/Response)" ,"pw.cw.aal5sdu.u"
,FT_UINT8 ,BASE_DEC ,NULL ,0x01
,"When FRF.8.1 Frame Relay/ATM PVC Service Interworking [RFC3916]"
" traffic is being transported, the Least-Significant Bit of CPCS-UU"
@ -1864,10 +1862,10 @@ static hf_register_info hfa_cell[] = {
,FT_UINT8 ,BASE_DEC ,NULL ,0xff
,NULL ,HFILL }}
,{ &hf_cw_seq ,{"Sequence number" ,"pw.cw.seqno"
,FT_UINT16 ,BASE_DEC ,NULL ,0
,FT_UINT16 ,BASE_DEC ,NULL ,0
,NULL ,HFILL }}
,{ &hf_gen_cw_atmbyte ,{"ATM-specific byte" ,"pw.cw.3rd_byte"
,FT_UINT8 ,BASE_HEX ,NULL ,0xFF
,FT_UINT8 ,BASE_HEX ,NULL ,0xFF
,NULL ,HFILL }}
};
static gint *ett_array[] = {
@ -1915,7 +1913,7 @@ static hf_register_info hfa_cell[] = {
proto_register_field_array( proto_aal5_sdu ,hfa_aal5_sdu ,array_length(hfa_aal5_sdu));
proto_register_subtree_array(ett_array, array_length(ett_array));
register_dissector("mpls_pw_atm_aal5_sdu" ,dissect_aal5_sdu ,proto_aal5_sdu);
register_dissector("mpls_pw_atm_11_or_aal5_pdu" ,dissect_11_or_aal5_pdu ,proto_11_or_aal5_pdu);
register_dissector("mpls_pw_atm_n1_cw" ,dissect_n1_cw ,proto_n1_cw);
@ -1941,7 +1939,7 @@ static hf_register_info hfa_cell[] = {
;
module_t * module_n1_cw;
module_t * module_aal5_sdu;
module_n1_cw = prefs_register_protocol(proto_n1_cw,NULL);
prefs_register_bool_preference(module_n1_cw
,"allow_cw_length_nonzero"
@ -1953,7 +1951,7 @@ static hf_register_info hfa_cell[] = {
,"Use CW.Reserved as extension of CW.Length"
,&description_extend_cw_length_with_rsvd[0]
,&pref_n1_cw_extend_cw_length_with_rsvd);
module_aal5_sdu = prefs_register_protocol(proto_aal5_sdu,NULL);
prefs_register_bool_preference(module_aal5_sdu
,"allow_cw_length_nonzero_aal5"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -12,12 +12,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@ -27,8 +27,6 @@
# include "config.h"
#endif
#include <stdlib.h>
#include <glib.h>
#include <epan/packet.h>
@ -41,7 +39,7 @@
#define MASK_T 0x20
#define MASK_M 0x10
/* Initialize the protocol and registered fields
/* Initialize the protocol and registered fields
*/
static int proto_sndcp = -1;
static int hf_sndcp_x = -1;
@ -56,20 +54,20 @@ static int hf_sndcp_segment = -1;
static int hf_sndcp_npdu1 = -1;
static int hf_sndcp_npdu2 = -1;
/* These fields are used when reassembling N-PDU fragments
/* These fields are used when reassembling N-PDU fragments
*/
static int hf_npdu_fragments = -1;
static int hf_npdu_fragment = -1;
static int hf_npdu_fragment_overlap = -1;
static int hf_npdu_fragment_overlap_conflict = -1;
static int hf_npdu_fragment_multiple_tails = -1;
static int hf_npdu_fragment_too_long_fragment = -1;
static int hf_npdu_fragment_error = -1;
static int hf_npdu_fragment_count = -1;
static int hf_npdu_reassembled_in = -1;
static int hf_npdu_reassembled_length = -1;
static int hf_npdu_fragments = -1;
static int hf_npdu_fragment = -1;
static int hf_npdu_fragment_overlap = -1;
static int hf_npdu_fragment_overlap_conflict = -1;
static int hf_npdu_fragment_multiple_tails = -1;
static int hf_npdu_fragment_too_long_fragment = -1;
static int hf_npdu_fragment_error = -1;
static int hf_npdu_fragment_count = -1;
static int hf_npdu_reassembled_in = -1;
static int hf_npdu_reassembled_length = -1;
/* Initialize the subtree pointers
/* Initialize the subtree pointers
*/
static gint ett_sndcp = -1;
static gint ett_sndcp_address_field = -1;
@ -103,8 +101,8 @@ static dissector_handle_t ip_handle;
/* reassembly of N-PDU
*/
static GHashTable *npdu_fragment_table = NULL;
static GHashTable *sndcp_reassembled_table = NULL;
static GHashTable *npdu_fragment_table = NULL;
static GHashTable *sndcp_reassembled_table = NULL;
static void
sndcp_defragment_init(void)
@ -116,63 +114,63 @@ sndcp_defragment_init(void)
/* value strings
*/
static const value_string nsapi_t[] = {
{ 0, "Escape mechanism for future extensions"},
{ 1, "Point-to-Multipoint (PTM-M) Information" },
{ 2, "Reserved for future use" },
{ 3, "Reserved for future use" },
{ 4, "Reserved for future use" },
{ 5, "Dynamically allocated"},
{ 6, "Dynamically allocated"},
{ 7, "Dynamically allocated"},
{ 8, "Dynamically allocated"},
{ 9, "Dynamically allocated"},
{ 10, "Dynamically allocated"},
{ 11, "Dynamically allocated"},
{ 12, "Dynamically allocated"},
{ 13, "Dynamically allocated"},
{ 14, "Dynamically allocated"},
{ 15, "Dynamically allocated"},
{ 0, NULL },
{ 0, "Escape mechanism for future extensions"},
{ 1, "Point-to-Multipoint (PTM-M) Information" },
{ 2, "Reserved for future use" },
{ 3, "Reserved for future use" },
{ 4, "Reserved for future use" },
{ 5, "Dynamically allocated"},
{ 6, "Dynamically allocated"},
{ 7, "Dynamically allocated"},
{ 8, "Dynamically allocated"},
{ 9, "Dynamically allocated"},
{ 10, "Dynamically allocated"},
{ 11, "Dynamically allocated"},
{ 12, "Dynamically allocated"},
{ 13, "Dynamically allocated"},
{ 14, "Dynamically allocated"},
{ 15, "Dynamically allocated"},
{ 0, NULL },
};
static const value_string nsapi_abrv[] = {
{ 0, "0"},
{ 1, "PTM-M" },
{ 2, "2" },
{ 3, "3"},
{ 4, "4" },
{ 5, "DYN5" },
{ 6, "DYN6" },
{ 7, "DYN7" },
{ 8, "DYN8" },
{ 9, "DYN9" },
{ 10, "DYN10" },
{ 11, "DYN11" },
{ 12, "DYN12" },
{ 13, "DYN13" },
{ 14, "DYN14" },
{ 15, "DYN15" },
{ 0, NULL },
{ 0, "0"},
{ 1, "PTM-M" },
{ 2, "2" },
{ 3, "3"},
{ 4, "4" },
{ 5, "DYN5" },
{ 6, "DYN6" },
{ 7, "DYN7" },
{ 8, "DYN8" },
{ 9, "DYN9" },
{ 10, "DYN10" },
{ 11, "DYN11" },
{ 12, "DYN12" },
{ 13, "DYN13" },
{ 14, "DYN14" },
{ 15, "DYN15" },
{ 0, NULL },
};
static const value_string compression_vals[] = {
{ 0, "No compression"},
{ 1, "Pointer to selected protocol/data compression mechanism" },
{ 2, "Pointer to selected protocol/data compression mechanism" },
{ 3, "Pointer to selected protocol/data compression mechanism" },
{ 4, "Pointer to selected protocol/data compression mechanism" },
{ 5, "Pointer to selected protocol/data compression mechanism" },
{ 6, "Pointer to selected protocol/data compression mechanism" },
{ 7, "Pointer to selected protocol/data compression mechanism" },
{ 8, "Pointer to selected protocol/data compression mechanism" },
{ 9, "Pointer to selected protocol/data compression mechanism" },
{ 10, "Pointer to selected protocol/data compression mechanism" },
{ 11, "Pointer to selected protocol/data compression mechanism" },
{ 12, "Pointer to selected protocol/data compression mechanism" },
{ 13, "Pointer to selected protocol/data compression mechanism" },
{ 14, "Pointer to selected protocol/data compression mechanism" },
{ 15, "Pointer to selected protocol/data compression mechanism" },
{ 0, NULL },
{ 0, "No compression"},
{ 1, "Pointer to selected protocol/data compression mechanism" },
{ 2, "Pointer to selected protocol/data compression mechanism" },
{ 3, "Pointer to selected protocol/data compression mechanism" },
{ 4, "Pointer to selected protocol/data compression mechanism" },
{ 5, "Pointer to selected protocol/data compression mechanism" },
{ 6, "Pointer to selected protocol/data compression mechanism" },
{ 7, "Pointer to selected protocol/data compression mechanism" },
{ 8, "Pointer to selected protocol/data compression mechanism" },
{ 9, "Pointer to selected protocol/data compression mechanism" },
{ 10, "Pointer to selected protocol/data compression mechanism" },
{ 11, "Pointer to selected protocol/data compression mechanism" },
{ 12, "Pointer to selected protocol/data compression mechanism" },
{ 13, "Pointer to selected protocol/data compression mechanism" },
{ 14, "Pointer to selected protocol/data compression mechanism" },
{ 15, "Pointer to selected protocol/data compression mechanism" },
{ 0, NULL },
};
static const true_false_string x_bit = {
@ -192,34 +190,34 @@ static const true_false_string m_bit = {
"Last segment of N-PDU"
};
/* Code to actually dissect the packets
/* Code to actually dissect the packets
*/
static void
dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint8 addr_field, comp_field, npdu_field1, nsapi, dcomp=0, pcomp=0;
guint16 offset=0, npdu=0, segment=0, npdu_field2;
tvbuff_t *next_tvb, *npdu_tvb;
tvbuff_t *next_tvb, *npdu_tvb;
gint len;
gboolean first, more_frags, unack;
/* Set up structures needed to add the protocol subtree and manage it
/* Set up structures needed to add the protocol subtree and manage it
*/
proto_item *ti, *address_field_item, *compression_field_item, *npdu_field_item;
proto_tree *sndcp_tree = NULL, *address_field_tree, *compression_field_tree, *npdu_field_tree;
/* Make entries in Protocol column and clear Info column on summary display
/* Make entries in Protocol column and clear Info column on summary display
*/
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SNDCP");
col_clear(pinfo->cinfo, COL_INFO);
/* create display subtree for the protocol
/* create display subtree for the protocol
*/
if (tree) {
ti = proto_tree_add_item(tree, proto_sndcp, tvb, 0, -1, FALSE);
sndcp_tree = proto_item_add_subtree(ti, ett_sndcp);
}
/* get address field from next byte
*/
addr_field = tvb_get_guint8(tvb,offset);
@ -228,18 +226,18 @@ dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
more_frags = addr_field & MASK_M;
unack = addr_field & MASK_T;
/* add subtree for the address field
/* add subtree for the address field
*/
if (tree) {
address_field_item = proto_tree_add_uint_format(sndcp_tree,hf_sndcp_nsapi,
tvb, offset,1, nsapi,
"Address field NSAPI: %d", nsapi );
tvb, offset,1, nsapi,
"Address field NSAPI: %d", nsapi );
address_field_tree = proto_item_add_subtree(address_field_item, ett_sndcp_address_field);
proto_tree_add_boolean(address_field_tree, hf_sndcp_x, tvb,offset,1, addr_field );
proto_tree_add_boolean(address_field_tree, hf_sndcp_f, tvb,offset,1, addr_field );
proto_tree_add_boolean(address_field_tree, hf_sndcp_t, tvb,offset,1, addr_field );
proto_tree_add_boolean(address_field_tree, hf_sndcp_m, tvb,offset,1, addr_field );
proto_tree_add_uint(address_field_tree, hf_sndcp_nsapib, tvb, offset, 1, addr_field );
proto_tree_add_uint(address_field_tree, hf_sndcp_nsapib, tvb, offset, 1, addr_field );
}
offset++;
@ -249,25 +247,25 @@ dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
comp_field = tvb_get_guint8(tvb,offset);
dcomp = comp_field & 0xF0;
pcomp = comp_field & 0x0F;
/* add subtree for the compression field
/* add subtree for the compression field
*/
if (tree) {
if (!pcomp) {
if (!dcomp) {
compression_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,1, "No compression");
}
else {
compression_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,1, "Data compression");
}
if (!pcomp) {
if (!dcomp) {
compression_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,1, "No compression");
}
else {
compression_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,1, "Data compression");
}
}
else {
if (!dcomp) {
compression_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,1, "Protocol compression");
}
else {
compression_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,1, "Data and Protocol compression");
}
else {
if (!dcomp) {
compression_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,1, "Protocol compression");
}
else {
compression_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,1, "Data and Protocol compression");
}
}
compression_field_tree = proto_item_add_subtree(compression_field_item, ett_sndcp_compression_field);
proto_tree_add_uint(compression_field_tree, hf_sndcp_dcomp, tvb, offset, 1, comp_field );
@ -280,23 +278,23 @@ dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (!unack) {
npdu = npdu_field1 = tvb_get_guint8(tvb,offset);
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "SN-DATA N-PDU %d", npdu_field1);
col_add_fstr(pinfo->cinfo, COL_INFO, "SN-DATA N-PDU %d", npdu_field1);
if (tree) {
npdu_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,1, "Acknowledged mode, N-PDU %d", npdu_field1 );
npdu_field_tree = proto_item_add_subtree(npdu_field_item, ett_sndcp_npdu_field);
proto_tree_add_uint(npdu_field_tree, hf_sndcp_npdu1, tvb, offset, 1, npdu_field1 );
npdu_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,1, "Acknowledged mode, N-PDU %d", npdu_field1 );
npdu_field_tree = proto_item_add_subtree(npdu_field_item, ett_sndcp_npdu_field);
proto_tree_add_uint(npdu_field_tree, hf_sndcp_npdu1, tvb, offset, 1, npdu_field1 );
}
offset++;
}
}
/* get segment and N-PDU number from next two bytes for unacknowledged mode
/* get segment and N-PDU number from next two bytes for unacknowledged mode
*/
if (unack) {
npdu_field2 = tvb_get_ntohs(tvb, offset);
segment = (npdu_field2 & 0xF000) >> 12;
npdu = (npdu_field2 & 0x0FFF);
if (check_col(pinfo->cinfo, COL_INFO))
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "SN-UNITDATA N-PDU %d (segment %d)", npdu, segment);
if (tree) {
npdu_field_item = proto_tree_add_text(sndcp_tree, tvb, offset,2, "Unacknowledged mode, N-PDU %d (segment %d)", npdu, segment );
@ -307,11 +305,11 @@ dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 2;
}
/* handle N-PDU data, reassemble if necessary
/* handle N-PDU data, reassemble if necessary
*/
if (first && !more_frags) {
next_tvb = tvb_new_subset_remaining (tvb, offset);
if (!dcomp && !pcomp) {
call_dissector(ip_handle, next_tvb, pinfo, tree);
}
@ -320,12 +318,12 @@ dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
else {
/* Try reassembling fragments
/* Try reassembling fragments
*/
fragment_data *fd_npdu = NULL;
guint32 reassembled_in = 0;
gboolean save_fragmented = pinfo->fragmented;
len = tvb_length_remaining(tvb, offset);
if(len<=0){
return;
@ -333,221 +331,221 @@ dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pinfo->fragmented = TRUE;
if (unack)
if (unack)
fd_npdu = fragment_add_seq_check(tvb, offset, pinfo, npdu,
npdu_fragment_table, sndcp_reassembled_table, segment, len, more_frags);
npdu_fragment_table, sndcp_reassembled_table, segment, len, more_frags);
else
fd_npdu = fragment_add(tvb, offset, pinfo, npdu,
npdu_fragment_table, offset, len, more_frags);
npdu_fragment_table, offset, len, more_frags);
npdu_tvb = process_reassembled_data(tvb, offset, pinfo,
"Reassembled N-PDU", fd_npdu, &npdu_frag_items,
NULL, sndcp_tree);
"Reassembled N-PDU", fd_npdu, &npdu_frag_items,
NULL, sndcp_tree);
if (fd_npdu) {
/* Reassembled
/* Reassembled
*/
reassembled_in = fd_npdu->reassembled_in;
if (pinfo->fd->num == reassembled_in) {
/* Reassembled in this very packet:
* We can safely hand the tvb to the IP dissector
*/
call_dissector(ip_handle, npdu_tvb, pinfo, tree);
}
/* Reassembled in this very packet:
* We can safely hand the tvb to the IP dissector
*/
call_dissector(ip_handle, npdu_tvb, pinfo, tree);
}
else {
/* Not reassembled in this packet
*/
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO,
" (N-PDU payload reassembled in packet %u)",
fd_npdu->reassembled_in);
}
if (tree) {
proto_tree_add_text(sndcp_tree, tvb, offset, -1, "Payload");
}
/* Not reassembled in this packet
*/
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO,
" (N-PDU payload reassembled in packet %u)",
fd_npdu->reassembled_in);
}
if (tree) {
proto_tree_add_text(sndcp_tree, tvb, offset, -1, "Payload");
}
}
} else {
/* Not reassembled yet, or not reassembled at all
/* Not reassembled yet, or not reassembled at all
*/
if (check_col(pinfo->cinfo, COL_INFO)) {
if (unack)
col_append_fstr(pinfo->cinfo, COL_INFO, " (Unreassembled fragment %u)", segment);
else
col_append_str(pinfo->cinfo, COL_INFO, " (Unreassembled fragment)");
if (unack)
col_append_fstr(pinfo->cinfo, COL_INFO, " (Unreassembled fragment %u)", segment);
else
col_append_str(pinfo->cinfo, COL_INFO, " (Unreassembled fragment)");
}
if (tree) {
proto_tree_add_text(sndcp_tree, tvb, offset, -1, "Payload");
proto_tree_add_text(sndcp_tree, tvb, offset, -1, "Payload");
}
}
/* Now reset fragmentation information in pinfo
/* Now reset fragmentation information in pinfo
*/
pinfo->fragmented = save_fragmented;
}
}
/* Register the protocol with Wireshark
/* Register the protocol with Wireshark
this format is required because a script is used to build the C function
that calls all the protocol registration.
*/
void
proto_register_sndcp(void)
{
{
/* Setup list of header fields
*/
static hf_register_info hf[] = {
{ &hf_sndcp_nsapi,
{ "NSAPI",
"sndcp.nsapi",
FT_UINT8, BASE_DEC, VALS(nsapi_abrv), 0x0,
"Network Layer Service Access Point Identifier", HFILL
{ "NSAPI",
"sndcp.nsapi",
FT_UINT8, BASE_DEC, VALS(nsapi_abrv), 0x0,
"Network Layer Service Access Point Identifier", HFILL
}
},
{ &hf_sndcp_x,
{ &hf_sndcp_x,
{ "Spare bit",
"sndcp.x",
FT_BOOLEAN,8, TFS(&x_bit), MASK_X,
"Spare bit (should be 0)", HFILL
"sndcp.x",
FT_BOOLEAN,8, TFS(&x_bit), MASK_X,
"Spare bit (should be 0)", HFILL
}
},
{ &hf_sndcp_f,
{ "First segment indicator bit",
"sndcp.f",
FT_BOOLEAN,8, TFS(&f_bit), MASK_F,
NULL, HFILL
{ &hf_sndcp_f,
{ "First segment indicator bit",
"sndcp.f",
FT_BOOLEAN,8, TFS(&f_bit), MASK_F,
NULL, HFILL
}
},
{ &hf_sndcp_t,
{ "Type",
"sndcp.t",
FT_BOOLEAN,8, TFS(&t_bit), MASK_T,
"SN-PDU Type", HFILL
{ &hf_sndcp_t,
{ "Type",
"sndcp.t",
FT_BOOLEAN,8, TFS(&t_bit), MASK_T,
"SN-PDU Type", HFILL
}
},
{ &hf_sndcp_m,
{ "More bit",
"sndcp.m",
FT_BOOLEAN,8, TFS(&m_bit), MASK_M,
NULL, HFILL
{ &hf_sndcp_m,
{ "More bit",
"sndcp.m",
FT_BOOLEAN,8, TFS(&m_bit), MASK_M,
NULL, HFILL
}
},
{ &hf_sndcp_dcomp,
{ "DCOMP",
"sndcp.dcomp",
FT_UINT8, BASE_DEC, VALS(compression_vals), 0xF0,
"Data compression coding", HFILL
{ &hf_sndcp_dcomp,
{ "DCOMP",
"sndcp.dcomp",
FT_UINT8, BASE_DEC, VALS(compression_vals), 0xF0,
"Data compression coding", HFILL
}
},
{ &hf_sndcp_pcomp,
{ "PCOMP",
"sndcp.pcomp",
FT_UINT8, BASE_DEC, VALS(compression_vals), 0x0F,
"Protocol compression coding", HFILL
{ &hf_sndcp_pcomp,
{ "PCOMP",
"sndcp.pcomp",
FT_UINT8, BASE_DEC, VALS(compression_vals), 0x0F,
"Protocol compression coding", HFILL
}
},
{ &hf_sndcp_nsapib,
{ "NSAPI",
"sndcp.nsapib",
FT_UINT8, BASE_DEC , VALS(nsapi_t), 0xf,
"Network Layer Service Access Point Identifier",HFILL
}
},
{ &hf_sndcp_segment,
{ "Segment",
"sndcp.segment",
FT_UINT16, BASE_DEC, NULL, 0xF000,
"Segment number", HFILL
{ "NSAPI",
"sndcp.nsapib",
FT_UINT8, BASE_DEC , VALS(nsapi_t), 0xf,
"Network Layer Service Access Point Identifier",HFILL
}
},
{ &hf_sndcp_npdu1,
{ "N-PDU",
"sndcp.npdu",
FT_UINT8, BASE_DEC, NULL, 0,
NULL, HFILL
{ &hf_sndcp_segment,
{ "Segment",
"sndcp.segment",
FT_UINT16, BASE_DEC, NULL, 0xF000,
"Segment number", HFILL
}
},
{ &hf_sndcp_npdu2,
{ "N-PDU",
"sndcp.npdu",
FT_UINT16, BASE_DEC, NULL, 0x0FFF,
NULL, HFILL
{ &hf_sndcp_npdu1,
{ "N-PDU",
"sndcp.npdu",
FT_UINT8, BASE_DEC, NULL, 0,
NULL, HFILL
}
},
{ &hf_sndcp_npdu2,
{ "N-PDU",
"sndcp.npdu",
FT_UINT16, BASE_DEC, NULL, 0x0FFF,
NULL, HFILL
}
},
/* Fragment fields
/* Fragment fields
*/
{ &hf_npdu_fragment_overlap,
{ "Fragment overlap",
"npdu.fragment.overlap",
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"Fragment overlaps with other fragments", HFILL
{ "Fragment overlap",
"npdu.fragment.overlap",
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"Fragment overlaps with other fragments", HFILL
}
},
{ &hf_npdu_fragment_overlap_conflict,
{ "Conflicting data in fragment overlap",
"npdu.fragment.overlap.conflict",
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"Overlapping fragments contained conflicting data", HFILL
{ "Conflicting data in fragment overlap",
"npdu.fragment.overlap.conflict",
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"Overlapping fragments contained conflicting data", HFILL
}
},
{ &hf_npdu_fragment_multiple_tails,
{ "Multiple tail fragments found",
"npdu.fragment.multipletails",
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"Several tails were found when defragmenting the packet", HFILL
{ "Multiple tail fragments found",
"npdu.fragment.multipletails",
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"Several tails were found when defragmenting the packet", HFILL
}
},
{ &hf_npdu_fragment_too_long_fragment,
{ "Fragment too long",
"npdu.fragment.toolongfragment",
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"Fragment contained data past end of packet", HFILL
{ "Fragment too long",
"npdu.fragment.toolongfragment",
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"Fragment contained data past end of packet", HFILL
}
},
{ &hf_npdu_fragment_error,
{ "Defragmentation error",
"npdu.fragment.error",
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
"Defragmentation error due to illegal fragments", HFILL
{ "Defragmentation error",
"npdu.fragment.error",
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
"Defragmentation error due to illegal fragments", HFILL
}
},
{ &hf_npdu_fragment_count,
{ "Fragment count",
"npdu.fragment.count",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL
{ "Fragment count",
"npdu.fragment.count",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL
}
},
{ &hf_npdu_reassembled_in,
{ "Reassembled in",
"npdu.reassembled.in",
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
"N-PDU fragments are reassembled in the given packet", HFILL
{ "Reassembled in",
"npdu.reassembled.in",
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
"N-PDU fragments are reassembled in the given packet", HFILL
}
},
{ &hf_npdu_reassembled_length,
{ "Reassembled N-PDU length",
"npdu.reassembled.length",
FT_UINT32, BASE_DEC, NULL, 0x0,
"The total length of the reassembled payload", HFILL
{ "Reassembled N-PDU length",
"npdu.reassembled.length",
FT_UINT32, BASE_DEC, NULL, 0x0,
"The total length of the reassembled payload", HFILL
}
},
{ &hf_npdu_fragment,
{ "N-PDU Fragment",
"npdu.fragment",
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
NULL, HFILL
{ "N-PDU Fragment",
"npdu.fragment",
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
NULL, HFILL
}
},
{ &hf_npdu_fragments,
{ "N-PDU Fragments",
"npdu.fragments",
FT_NONE, BASE_NONE, NULL, 0x0,
NULL, HFILL
{ "N-PDU Fragments",
"npdu.fragments",
FT_NONE, BASE_NONE, NULL, 0x0,
NULL, HFILL
}
}
};
/* Setup protocol subtree array */
static gint *ett[] = {
&ett_sndcp ,
@ -560,7 +558,7 @@ proto_register_sndcp(void)
/* Register the protocol name and description */
proto_sndcp = proto_register_protocol("Subnetwork Dependent Convergence Protocol",
"SNDCP", "sndcp");
"SNDCP", "sndcp");
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_sndcp, hf, array_length(hf));
@ -578,17 +576,17 @@ proto_reg_handoff_sndcp(void)
{
dissector_handle_t sndcp_handle;
sndcp_handle = find_dissector("sndcp");
sndcp_handle = find_dissector("sndcp");
/* Register SNDCP dissector with LLC layer for SAPI 3,5,9 and 11
/* Register SNDCP dissector with LLC layer for SAPI 3,5,9 and 11
*/
dissector_add_uint("llcgprs.sapi", 3, sndcp_handle);
dissector_add_uint("llcgprs.sapi", 5, sndcp_handle);
dissector_add_uint("llcgprs.sapi", 9, sndcp_handle);
dissector_add_uint("llcgprs.sapi", 11, sndcp_handle);
/* Find IP and data handle for upper layer dissectors
/* Find IP and data handle for upper layer dissectors
*/
ip_handle = find_dissector("ip");
ip_handle = find_dissector("ip");
data_handle = find_dissector("data");
}

View File

@ -29,225 +29,225 @@
typedef unsigned char UI8_T, BYTE,*UI8_P;
typedef unsigned char UI8_T, BYTE,*UI8_P;
typedef unsigned short UI16_T, *UI16_P;
typedef unsigned int UI32_T, *UI32_P;
typedef int I32_T, *I32_P;
typedef short I16_T, *I16_P;
typedef char I8_T, *I8_P;
typedef unsigned int UI32_T, *UI32_P;
typedef int I32_T, *I32_P;
typedef short I16_T, *I16_P;
typedef char I8_T, *I8_P;
/*+-------------------------------
* NET8 protocol definition
* NET8 protocol definition
*--------------------------------
-*/
/*+-------------------------------
* NET8 Command Header
* NET8 Command Header
*--------------------------------
-*/
#define NET8_TYPE_SETPROP 1 /* Set PROtocol */
#define NET8_TYPE_SETDATAREP 2 /* Set Data Representation */
#define NET8_TYPE_USERTOSERVER 3 /* User to Server request */
#define NET8_TYPE_ERRORSTATUS 4 /* Error return status */
#define NET8_TYPE_AUAS 5 /* Access User Address space */
#define NET8_TYPE_ROWTRANSFER 6 /* Row Transfer Header */
#define NET8_TYPE_ROWDATA 7 /* I made this to handle spanning data rows */
#define NET8_TYPE_OPIPARAM 8 /* return OPI parameter */
#define NET8_TYPE_FUNCCOMPLETE 9 /* return Function Complete */
#define NET8_TYPE_TTINOER 10 /* for msdos/os2 N oerdefs follow */
#define NET8_TYPE_TTIIOV 11 /* Sending IO vec only for fast UPI */
#define NET8_TYPE_TTISLG 12 /* Send LonG for fast UPI*/
#define NET8_TYPE_TTIICA 13 /* Invoke user CAllback*/
#define NET8_TYPE_TTILOBD 14 /* LOB/FILE data follows */
#define NET8_TYPE_TTIWRN 15 /* warning messages - may be a set of them */
#define NET8_TYPE_SETPROP 1 /* Set PROtocol */
#define NET8_TYPE_SETDATAREP 2 /* Set Data Representation */
#define NET8_TYPE_USERTOSERVER 3 /* User to Server request */
#define NET8_TYPE_ERRORSTATUS 4 /* Error return status */
#define NET8_TYPE_AUAS 5 /* Access User Address space */
#define NET8_TYPE_ROWTRANSFER 6 /* Row Transfer Header */
#define NET8_TYPE_ROWDATA 7 /* I made this to handle spanning data rows */
#define NET8_TYPE_OPIPARAM 8 /* return OPI parameter */
#define NET8_TYPE_FUNCCOMPLETE 9 /* return Function Complete */
#define NET8_TYPE_TTINOER 10 /* for msdos/os2 N oerdefs follow */
#define NET8_TYPE_TTIIOV 11 /* Sending IO vec only for fast UPI */
#define NET8_TYPE_TTISLG 12 /* Send LonG for fast UPI*/
#define NET8_TYPE_TTIICA 13 /* Invoke user CAllback*/
#define NET8_TYPE_TTILOBD 14 /* LOB/FILE data follows */
#define NET8_TYPE_TTIWRN 15 /* warning messages - may be a set of them */
#define NET8_TYPE_DESCINFO 16 /* Describe Information */
#define NET8_TYPE_PIGGYBACKFUNC 17 /* piggy back funtion follow */
#define NET8_TYPE_TTI3GL 18 /* signals special action for untrusted callout support */
#define NET8_TYPE_TTIFOB 19 /* Flush Out Bind data in DML/w RETURN when error */
#define NET8_TYPE_SECURENEG 0xde /* Secure Network Services Negotiation */
#define MAX_QUERY_STRING_LEN 256
#define NET8_TYPE_DESCINFO 16 /* Describe Information */
#define NET8_TYPE_PIGGYBACKFUNC 17 /* piggy back funtion follow */
#define NET8_TYPE_TTI3GL 18 /* signals special action for untrusted callout support */
#define NET8_TYPE_TTIFOB 19 /* Flush Out Bind data in DML/w RETURN when error */
#define NET8_TYPE_SECURENEG 0xde /* Secure Network Services Negotiation */
#define MAX_QUERY_STRING_LEN 256
/*+--------------------------------------
* User to Server request function types
* NET8_TYPE_USERTOSERVER 0x03
* User to Server request function types
* NET8_TYPE_USERTOSERVER 0x03
* look in ttc7\FunCodes.java
*---------------------------------------
-*/
#define NET8_USER_FUNC_OLOGON 1 /* logon to Oracle */
#define NET8_USER_FUNC_OPENCURSOR 2 /* Open Cursor */
#define NET8_USER_FUNC_PARSE 3 /* Parse */
#define NET8_USER_FUNC_EXECUTE 4 /* Execute */
#define NET8_USER_FUNC_OFETCH 5 /* fetch a row */
#define NET8_USER_FUNC_OLOGON 1 /* logon to Oracle */
#define NET8_USER_FUNC_OPENCURSOR 2 /* Open Cursor */
#define NET8_USER_FUNC_PARSE 3 /* Parse */
#define NET8_USER_FUNC_EXECUTE 4 /* Execute */
#define NET8_USER_FUNC_OFETCH 5 /* fetch a row */
#define NET8_USER_FUNC_CLOSECURSOR 8 /* Close Cursor */
#define NET8_USER_FUNC_CLOSECURSOR 8 /* Close Cursor */
#define NET8_USER_FUNC_OLOGOFF 9 /* logoff of ORACLE */
#define NET8_USER_FUNC_ODSCRIBE 10 /* describe a select list column */
#define NET8_USER_FUNC_ODEFIN 11 /* define[] where the column goes */
#define NET8_USER_FUNC_OCOMON 12 /* auto[] commit on */
#define NET8_USER_FUNC_OCOMOFF 13 /* auto commit off */
#define NET8_USER_FUNC_OCOMMIT 14 /* commit */
#define NET8_USER_FUNC_OROLLBACK 15 /* rollback */
#define NET8_USER_FUNC_OSFE 16 /* set fatal error options */
#define NET8_USER_FUNC_ORESUME 17 /* resume current operation */
#define NET8_USER_FUNC_OVERSN 18 /* get ORACLE version-date string */
#define NET8_USER_FUNC_OTEMP 19 /* until we get rid of OASQL */
#define NET8_USER_FUNC_CANCEL 20 /* cancel the current operation */
#define NET8_USER_FUNC_OGEM 21 /* get error message */
#define NET8_USER_FUNC_OEXIT 22 /* Exit oracle command */
#define NET8_USER_FUNC_OSPECIAL 23 /* special function */
#define NET8_USER_FUNC_OABORT 24 /* abort */
#define NET8_USER_FUNC_ODQRID 25 /* deq by rowid */
#define NET8_USER_FUNC_OLNGF6 26 /* fetch a long column value */
#define NET8_USER_FUNC_OCAM 27 /* Create Access Module */
#define NET8_USER_FUNC_OSAMS 28 /* Save Access Module Statement */
#define NET8_USER_FUNC_OSAM 29 /* Save Access Module */
#define NET8_USER_FUNC_OPAMS 30 /* Parse Access Module Statement */
#define NET8_USER_FUNC_OHOWMANY 31 /* How Many Items? */
#define NET8_USER_FUNC_OINIT 32 /* Initialize Oracle */
#define NET8_USER_FUNC_OCHANGEU 33 /* change user id */
#define NET8_USER_FUNC_OBINDRP 34 /* Bind by reference positional */
#define NET8_USER_FUNC_OGETBV 35 /* Get n'th Bind Variable */
#define NET8_USER_FUNC_OGETIV 36 /* Get n'th Into Variable */
#define NET8_USER_FUNC_OBINDRV 37 /* Bind by reference */
#define NET8_USER_FUNC_OBINDRN 38 /* Bind by reference numeric */
#define NET8_USER_FUNC_OPARSEX 39 /* Parse And Execute */
#define NET8_USER_FUNC_OPARSYN 40 /* Parse for Syntax only */
#define NET8_USER_FUNC_OPARSDI 41 /* Parse for Syntax & SQL Dictionary lookup */
#define NET8_USER_FUNC_OCONTINUE 42 /* continue serving after eof */
#define NET8_USER_FUNC_ODSCRARR 43 /* array describe */
#define NET8_USER_FUNC_OLCCINI 44 /* init sys pars command table */
#define NET8_USER_FUNC_OLCCFIN 45 /* finalize sys pars command table */
#define NET8_USER_FUNC_OLCCPUT 46 /* put sys par in command table */
#define NET8_USER_FUNC_OLCCGPI 47 /* get sys pars info from command table */
#define NET8_USER_FUNC_OV6STRT 48 /* start Oracle (V6) */
#define NET8_USER_FUNC_OV6STOP 49 /* [poll for] shut down Oracle (V6) */
#define NET8_USER_FUNC_ORIP 50 /* run independent process (V6) */
#define NET8_USER_FUNC_OTRAM 51 /* test RAM (V6) */
#define NET8_USER_FUNC_OARCHIVE 52 /* archive op (V6) */
#define NET8_USER_FUNC_OMRSTART 53 /* media recovery - start (V6) */
#define NET8_USER_FUNC_OMRRECTS 54 /* media recovery - record tablespace to recover (V6) */
#define NET8_USER_FUNC_OMRGSLSQ 55 /* media recovery - get starting log seq # (V6) */
#define NET8_USER_FUNC_OMRREC 56 /* media recovery - recover using offline log (V6) */
#define NET8_USER_FUNC_OMRCAN 57 /* media recovery - cancel media recovery (V6) */
#define NET8_USER_FUNC_O2LOGON 58 /* logon to ORACLE (V6) (supercedes OLOGON) */
#define NET8_USER_FUNC_OVERSION 59 /* get ORACLE version-date string in new format */
#define NET8_USER_FUNC_OINIT2 60 /* new init call (supersedes OINIT) */
#define NET8_USER_FUNC_OCLOALL 61 /* reserved for MAC; close all cursors */
#define NET8_USER_FUNC_OALL 62 /* bundled execution call */
#define NET8_USER_FUNC_OTEX 63 /* reserved for os2/msdos; transaction execute call */
#define NET8_USER_FUNC_OSDAUTH 64 /* reserved for os2/msdos; set DBA authorization call */
#define NET8_USER_FUNC_OUDLFUN 65 /* for direct loader: functions */
#define NET8_USER_FUNC_OUDLBUF 66 /* for direct loader: buffer transfer */
#define NET8_USER_FUNC_OK2RPC 67 /* distrib. trans. mgr. RPC */
#define NET8_USER_FUNC_ODSCIDX 68 /* describe indexes for distributed query */
#define NET8_USER_FUNC_OSESOPN 69 /* session operations */
#define NET8_USER_FUNC_OEXECSCN 70 /* execute using synchronized system commit numbers */
#define NET8_USER_FUNC_OALL7 71 /* fast upi calls to opial7 */
#define NET8_USER_FUNC_OLONGF 72 /* Long fetch version 7 */
#define NET8_USER_FUNC_OEXECA 73 /* call opiexe from opiall; no two-task access */
#define NET8_USER_FUNC_OSQL7 74 /* New ver 7 parse call to deal with various flavours*/
#define NET8_USER_FUNC_OOBS 75 /* Please DO Not REUSE THIS CODE */
#define NET8_USER_FUNC_ORPC 76 /* RPC Call from pl/sql */
#define NET8_USER_FUNC_OKGL_OLD 77 /* do a KGL operation */
#define NET8_USER_FUNC_OEXFEN 78
#define NET8_USER_FUNC_OXAOPN 79 /* X/Open XA operation */
#define NET8_USER_FUNC_OKGL 80 /* New OKGL call */
#define NET8_USER_FUNC_03LOGON 81 /* 2nd Half of Logon */
#define NET8_USER_FUNC_03LOGA 82 /* 1st Half of Logon */
#define NET8_USER_FUNC_OFNSTM 83 /* Do Streaming Operation */
#define NET8_USER_FUNC_OPENSESS 84 /* Open Session */
#define NET8_USER_FUNC_O71XAOPN 85 /* X/Open XA operations (71 interface */
#define NET8_USER_FUNC_ODEBUG 86 /* debugging operation */
#define NET8_USER_FUNC_ODEBUGS 87 /* special debugging operation */
#define NET8_USER_FUNC_OXAST 88 /* XA start */
#define NET8_USER_FUNC_OXACM 89 /* XA Switch and Commit */
#define NET8_USER_FUNC_OXAPR 90 /* XA Switch and Prepare */
#define NET8_USER_FUNC_OXDP 91 /* direct copy from db buffers to client addr */
#define NET8_USER_FUNC_OLOGOFF 9 /* logoff of ORACLE */
#define NET8_USER_FUNC_ODSCRIBE 10 /* describe a select list column */
#define NET8_USER_FUNC_ODEFIN 11 /* define[] where the column goes */
#define NET8_USER_FUNC_OCOMON 12 /* auto[] commit on */
#define NET8_USER_FUNC_OCOMOFF 13 /* auto commit off */
#define NET8_USER_FUNC_OCOMMIT 14 /* commit */
#define NET8_USER_FUNC_OROLLBACK 15 /* rollback */
#define NET8_USER_FUNC_OSFE 16 /* set fatal error options */
#define NET8_USER_FUNC_ORESUME 17 /* resume current operation */
#define NET8_USER_FUNC_OVERSN 18 /* get ORACLE version-date string */
#define NET8_USER_FUNC_OTEMP 19 /* until we get rid of OASQL */
#define NET8_USER_FUNC_CANCEL 20 /* cancel the current operation */
#define NET8_USER_FUNC_OGEM 21 /* get error message */
#define NET8_USER_FUNC_OEXIT 22 /* Exit oracle command */
#define NET8_USER_FUNC_OSPECIAL 23 /* special function */
#define NET8_USER_FUNC_OABORT 24 /* abort */
#define NET8_USER_FUNC_ODQRID 25 /* deq by rowid */
#define NET8_USER_FUNC_OLNGF6 26 /* fetch a long column value */
#define NET8_USER_FUNC_OCAM 27 /* Create Access Module */
#define NET8_USER_FUNC_OSAMS 28 /* Save Access Module Statement */
#define NET8_USER_FUNC_OSAM 29 /* Save Access Module */
#define NET8_USER_FUNC_OPAMS 30 /* Parse Access Module Statement */
#define NET8_USER_FUNC_OHOWMANY 31 /* How Many Items? */
#define NET8_USER_FUNC_OINIT 32 /* Initialize Oracle */
#define NET8_USER_FUNC_OCHANGEU 33 /* change user id */
#define NET8_USER_FUNC_OBINDRP 34 /* Bind by reference positional */
#define NET8_USER_FUNC_OGETBV 35 /* Get n'th Bind Variable */
#define NET8_USER_FUNC_OGETIV 36 /* Get n'th Into Variable */
#define NET8_USER_FUNC_OBINDRV 37 /* Bind by reference */
#define NET8_USER_FUNC_OBINDRN 38 /* Bind by reference numeric */
#define NET8_USER_FUNC_OPARSEX 39 /* Parse And Execute */
#define NET8_USER_FUNC_OPARSYN 40 /* Parse for Syntax only */
#define NET8_USER_FUNC_OPARSDI 41 /* Parse for Syntax & SQL Dictionary lookup */
#define NET8_USER_FUNC_OCONTINUE 42 /* continue serving after eof */
#define NET8_USER_FUNC_ODSCRARR 43 /* array describe */
#define NET8_USER_FUNC_OLCCINI 44 /* init sys pars command table */
#define NET8_USER_FUNC_OLCCFIN 45 /* finalize sys pars command table */
#define NET8_USER_FUNC_OLCCPUT 46 /* put sys par in command table */
#define NET8_USER_FUNC_OLCCGPI 47 /* get sys pars info from command table */
#define NET8_USER_FUNC_OV6STRT 48 /* start Oracle (V6) */
#define NET8_USER_FUNC_OV6STOP 49 /* [poll for] shut down Oracle (V6) */
#define NET8_USER_FUNC_ORIP 50 /* run independent process (V6) */
#define NET8_USER_FUNC_OTRAM 51 /* test RAM (V6) */
#define NET8_USER_FUNC_OARCHIVE 52 /* archive op (V6) */
#define NET8_USER_FUNC_OMRSTART 53 /* media recovery - start (V6) */
#define NET8_USER_FUNC_OMRRECTS 54 /* media recovery - record tablespace to recover (V6) */
#define NET8_USER_FUNC_OMRGSLSQ 55 /* media recovery - get starting log seq # (V6) */
#define NET8_USER_FUNC_OMRREC 56 /* media recovery - recover using offline log (V6) */
#define NET8_USER_FUNC_OMRCAN 57 /* media recovery - cancel media recovery (V6) */
#define NET8_USER_FUNC_O2LOGON 58 /* logon to ORACLE (V6) (supercedes OLOGON) */
#define NET8_USER_FUNC_OVERSION 59 /* get ORACLE version-date string in new format */
#define NET8_USER_FUNC_OINIT2 60 /* new init call (supersedes OINIT) */
#define NET8_USER_FUNC_OCLOALL 61 /* reserved for MAC; close all cursors */
#define NET8_USER_FUNC_OALL 62 /* bundled execution call */
#define NET8_USER_FUNC_OTEX 63 /* reserved for os2/msdos; transaction execute call */
#define NET8_USER_FUNC_OSDAUTH 64 /* reserved for os2/msdos; set DBA authorization call */
#define NET8_USER_FUNC_OUDLFUN 65 /* for direct loader: functions */
#define NET8_USER_FUNC_OUDLBUF 66 /* for direct loader: buffer transfer */
#define NET8_USER_FUNC_OK2RPC 67 /* distrib. trans. mgr. RPC */
#define NET8_USER_FUNC_ODSCIDX 68 /* describe indexes for distributed query */
#define NET8_USER_FUNC_OSESOPN 69 /* session operations */
#define NET8_USER_FUNC_OEXECSCN 70 /* execute using synchronized system commit numbers */
#define NET8_USER_FUNC_OALL7 71 /* fast upi calls to opial7 */
#define NET8_USER_FUNC_OLONGF 72 /* Long fetch version 7 */
#define NET8_USER_FUNC_OEXECA 73 /* call opiexe from opiall; no two-task access */
#define NET8_USER_FUNC_OSQL7 74 /* New ver 7 parse call to deal with various flavours*/
#define NET8_USER_FUNC_OOBS 75 /* Please DO Not REUSE THIS CODE */
#define NET8_USER_FUNC_ORPC 76 /* RPC Call from pl/sql */
#define NET8_USER_FUNC_OKGL_OLD 77 /* do a KGL operation */
#define NET8_USER_FUNC_OEXFEN 78
#define NET8_USER_FUNC_OXAOPN 79 /* X/Open XA operation */
#define NET8_USER_FUNC_OKGL 80 /* New OKGL call */
#define NET8_USER_FUNC_03LOGON 81 /* 2nd Half of Logon */
#define NET8_USER_FUNC_03LOGA 82 /* 1st Half of Logon */
#define NET8_USER_FUNC_OFNSTM 83 /* Do Streaming Operation */
#define NET8_USER_FUNC_OPENSESS 84 /* Open Session */
#define NET8_USER_FUNC_O71XAOPN 85 /* X/Open XA operations (71 interface */
#define NET8_USER_FUNC_ODEBUG 86 /* debugging operation */
#define NET8_USER_FUNC_ODEBUGS 87 /* special debugging operation */
#define NET8_USER_FUNC_OXAST 88 /* XA start */
#define NET8_USER_FUNC_OXACM 89 /* XA Switch and Commit */
#define NET8_USER_FUNC_OXAPR 90 /* XA Switch and Prepare */
#define NET8_USER_FUNC_OXDP 91 /* direct copy from db buffers to client addr */
/* in Oracle 7 and lower, this used to be OCONNECT */
#define NET8_USER_FUNC_OKOD 92 /* New OKOD call */
#define NET8_USER_FUNC_OKOD 92 /* New OKOD call */
/* Oracle 8 changes follow */
#define NET8_USER_FUNC_OCBK 93 /* OCBK call (kernel side only) */
#define NET8_USER_FUNC_OALL8 94 /* new v8 bundled call */
#define NET8_USER_FUNC_OFNSTM2 95 /* OFNSTM without the begintxn */
#define NET8_USER_FUNC_OLOBOPS 96 /* LOB and FILE related calls */
#define NET8_USER_FUNC_OFILECRT 97 /* FILE create call */
#define NET8_USER_FUNC_ODNY 98 /* new describe query call */
#define NET8_USER_FUNC_OCONNECT 99 /* code for non blocking attach host */
#define NET8_USER_FUNC_OOPENRCS 100 /* Open a recursive cursor */
#define NET8_USER_FUNC_OKPRALL 101 /* Bundled KPR execution */
#define NET8_USER_FUNC_OPLS 102 /* Bundled PL/SQL execution */
#define NET8_USER_FUNC_OTXSE 103 /* transaction start, attach, detach */
#define NET8_USER_FUNC_OTXEN 104 /* transaction commit, rollback, recover */
#define NET8_USER_FUNC_OCCA 105 /* Cursor Close All */
#define NET8_USER_FUNC_OFOI 106 /* Failover info piggyback */
#define NET8_USER_FUNC_O80SES 107 /* V8 session switching piggyback */
#define NET8_USER_FUNC_ODDF 108 /* Do Dummy Defines */
#define NET8_USER_FUNC_OLRMINI 109 /* init sys pars */
#define NET8_USER_FUNC_OLRMFIN 110 /* finalize sys pars */
#define NET8_USER_FUNC_OLRMPUT 111 /* put sys par in par space */
#define NET8_USER_FUNC_OLRMTRM 112 /* terminate sys pars */
#define NET8_USER_FUNC_OEXFENA 113 /* execute but don't unmap (used from opiall0) */
#define NET8_USER_FUNC_OINIUCB 114 /* OINIT for Untrusted CallBacks */
#define NET8_USER_FUNC_AUTH 115 /* Generic authentication call */
#define NET8_USER_FUNC_OFGI 116 /* FailOver Get Instance Info */
#define NET8_USER_FUNC_OOTCO 117 /* Oracle Transaction service COmmit remote sites */
#define NET8_USER_FUNC_GETSESSKEY 118 /* Get the session key */
#define NET8_USER_FUNC_ODSY 119 /* V8 Describe Any */
#define NET8_USER_FUNC_OCANA 120 /* Cancel All */
#define NET8_USER_FUNC_OAQEQ 121 /* AQ EnQueue */
#define NET8_USER_FUNC_OAQDQ 122 /* AQ Dequeue */
#define NET8_USER_FUNC_ORFS 123 /* RFS call */
#define NET8_USER_FUNC_OKPN 124 /* Kernel Programmatic Notification */
#define NET8_USER_FUNC_MAX_OFCN 124 /* last item allocated */
#define NET8_USER_FUNC_OCBK 93 /* OCBK call (kernel side only) */
#define NET8_USER_FUNC_OALL8 94 /* new v8 bundled call */
#define NET8_USER_FUNC_OFNSTM2 95 /* OFNSTM without the begintxn */
#define NET8_USER_FUNC_OLOBOPS 96 /* LOB and FILE related calls */
#define NET8_USER_FUNC_OFILECRT 97 /* FILE create call */
#define NET8_USER_FUNC_ODNY 98 /* new describe query call */
#define NET8_USER_FUNC_OCONNECT 99 /* code for non blocking attach host */
#define NET8_USER_FUNC_OOPENRCS 100 /* Open a recursive cursor */
#define NET8_USER_FUNC_OKPRALL 101 /* Bundled KPR execution */
#define NET8_USER_FUNC_OPLS 102 /* Bundled PL/SQL execution */
#define NET8_USER_FUNC_OTXSE 103 /* transaction start, attach, detach */
#define NET8_USER_FUNC_OTXEN 104 /* transaction commit, rollback, recover */
#define NET8_USER_FUNC_OCCA 105 /* Cursor Close All */
#define NET8_USER_FUNC_OFOI 106 /* Failover info piggyback */
#define NET8_USER_FUNC_O80SES 107 /* V8 session switching piggyback */
#define NET8_USER_FUNC_ODDF 108 /* Do Dummy Defines */
#define NET8_USER_FUNC_OLRMINI 109 /* init sys pars */
#define NET8_USER_FUNC_OLRMFIN 110 /* finalize sys pars */
#define NET8_USER_FUNC_OLRMPUT 111 /* put sys par in par space */
#define NET8_USER_FUNC_OLRMTRM 112 /* terminate sys pars */
#define NET8_USER_FUNC_OEXFENA 113 /* execute but don't unmap (used from opiall0) */
#define NET8_USER_FUNC_OINIUCB 114 /* OINIT for Untrusted CallBacks */
#define NET8_USER_FUNC_AUTH 115 /* Generic authentication call */
#define NET8_USER_FUNC_OFGI 116 /* FailOver Get Instance Info */
#define NET8_USER_FUNC_OOTCO 117 /* Oracle Transaction service COmmit remote sites */
#define NET8_USER_FUNC_GETSESSKEY 118 /* Get the session key */
#define NET8_USER_FUNC_ODSY 119 /* V8 Describe Any */
#define NET8_USER_FUNC_OCANA 120 /* Cancel All */
#define NET8_USER_FUNC_OAQEQ 121 /* AQ EnQueue */
#define NET8_USER_FUNC_OAQDQ 122 /* AQ Dequeue */
#define NET8_USER_FUNC_ORFS 123 /* RFS call */
#define NET8_USER_FUNC_OKPN 124 /* Kernel Programmatic Notification */
#define NET8_USER_FUNC_MAX_OFCN 124 /* last item allocated */
/*+--------------------------------------------------
* query results db types in the describe pkt
* for NET8_TYPE_OPIPARAM 0x08
* & for NET8_TYPE_DESCINFO 0x10
* for NET8_TYPE_OPIPARAM 0x08
* & for NET8_TYPE_DESCINFO 0x10
*---------------------------------------------------
-*/
#define NET8_DATATYPE_VARCHAR 0x01
#define NET8_DATATYPE_NUMBER 0x02
#define NET8_DATATYPE_VARNUM 0x06
#define NET8_DATATYPE_LONG 0x08
#define NET8_DATATYPE_DATE 0x0C
#define NET8_DATATYPE_RAW 0x17
#define NET8_DATATYPE_LONG_RAW 0x18
#define NET8_DATATYPE_CHAR 0x60
#define NET8_DATATYPE_RESULT_SET 0x66
#define NET8_DATATYPE_ROWID 0x68
#define NET8_DATATYPE_NAMED_TYPE 0x6D
#define NET8_DATATYPE_REF_TYPE 0x6F
#define NET8_DATATYPE_CLOB 0x70
#define NET8_DATATYPE_BLOB 0x71
#define NET8_DATATYPE_BFILE 0x72
#define NET8_DATATYPE_TIMESTAMP 0xB4
#define NET8_DATATYPE_TIMESTAMPTZ 0xB5
#define NET8_DATATYPE_INTERVALYM 0xB6
#define NET8_DATATYPE_INTERVALDS 0xB7
#define NET8_DATATYPE_TIMESTAMPLTZ 0xE7
#define NET8_DATATYPE_PLSQL_INDEX_TABLE 0x3E6
#define NET8_DATATYPE_FIXED_CHAR 0x3E7
#define NET8_DATATYPE_VARCHAR 0x01
#define NET8_DATATYPE_NUMBER 0x02
#define NET8_DATATYPE_VARNUM 0x06
#define NET8_DATATYPE_LONG 0x08
#define NET8_DATATYPE_DATE 0x0C
#define NET8_DATATYPE_RAW 0x17
#define NET8_DATATYPE_LONG_RAW 0x18
#define NET8_DATATYPE_CHAR 0x60
#define NET8_DATATYPE_RESULT_SET 0x66
#define NET8_DATATYPE_ROWID 0x68
#define NET8_DATATYPE_NAMED_TYPE 0x6D
#define NET8_DATATYPE_REF_TYPE 0x6F
#define NET8_DATATYPE_CLOB 0x70
#define NET8_DATATYPE_BLOB 0x71
#define NET8_DATATYPE_BFILE 0x72
#define NET8_DATATYPE_TIMESTAMP 0xB4
#define NET8_DATATYPE_TIMESTAMPTZ 0xB5
#define NET8_DATATYPE_INTERVALYM 0xB6
#define NET8_DATATYPE_INTERVALDS 0xB7
#define NET8_DATATYPE_TIMESTAMPLTZ 0xE7
#define NET8_DATATYPE_PLSQL_INDEX_TABLE 0x3E6
#define NET8_DATATYPE_FIXED_CHAR 0x3E7
/*+--------------------------------------------------
* datatype sizes
*---------------------------------------------------
-*/
#define NET8_DATATYPE_SIZE_TIMESTAMP 11
#define NET8_DATATYPE_SIZE_TIMESTAMPNOFRAC 7
#define NET8_DATATYPE_SIZE_DATE 7
#define NET8_DATATYPE_SIZE_TIMESTAMPZ 13
#define NET8_TIMESTAMPZ_REGIONIDBIT 0x80 /*-128*/
#define NET8_DATATYPE_SIZE_TIMESTAMPLTZ 11
#define NET8_DATATYPE_SIZE_TIMESTAMPLTZNOFRAC 7
#define NET8_DATATYPE_SIZE_TIMESTAMP 11
#define NET8_DATATYPE_SIZE_TIMESTAMPNOFRAC 7
#define NET8_DATATYPE_SIZE_DATE 7
#define NET8_DATATYPE_SIZE_TIMESTAMPZ 13
#define NET8_TIMESTAMPZ_REGIONIDBIT 0x80 /*-128*/
#define NET8_DATATYPE_SIZE_TIMESTAMPLTZ 11
#define NET8_DATATYPE_SIZE_TIMESTAMPLTZNOFRAC 7

View File

@ -29,8 +29,6 @@
# include "config.h"
#endif
#include <stdlib.h>
#include <glib.h>
#include <epan/packet.h>
@ -226,7 +224,7 @@ dissect_xtp_aseg(tvbuff_t *tvb, proto_tree *tree, guint32 offset) {
/** display common fields **/
offset = start;
/* alen(2) */
ti = proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_alen,
ti = proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_alen,
tvb, offset, 2, aseg->alen);
offset += 2;
if (aseg->alen > len) {
@ -235,11 +233,11 @@ dissect_xtp_aseg(tvbuff_t *tvb, proto_tree *tree, guint32 offset) {
error = 1;
}
/* adomain(1) */
proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_adomain,
proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_adomain,
tvb, offset, 1, aseg->adomain);
offset++;
/* aformat(1) */
ti2 = proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_aformat,
ti2 = proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_aformat,
tvb, offset, 1, aseg->aformat);
offset++;
switch (aseg->aformat) {
@ -259,14 +257,14 @@ dissect_xtp_aseg(tvbuff_t *tvb, proto_tree *tree, guint32 offset) {
break;
default:
if (aseg->aformat < 128) {
proto_item_append_text(ti2,
proto_item_append_text(ti2,
", Unsupported aformat(%u)", aseg->aformat);
error = 1;
}
break;
}
if (error)
if (error)
return (offset - start);
/** parse and display each address fileds */
@ -275,29 +273,29 @@ dissect_xtp_aseg(tvbuff_t *tvb, proto_tree *tree, guint32 offset) {
case 0:
/* address(4) */
aseg->dsthost = tvb_get_ntohl(tvb, offset);
proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_address,
proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_address,
tvb, offset, 4, aseg->dsthost);
offset += 4;
break;
case 1:
/* dsthost(4) */
aseg->dsthost = tvb_get_ipv4(tvb, offset);
proto_tree_add_ipv4(xtp_subtree, hf_xtp_aseg_dsthost,
proto_tree_add_ipv4(xtp_subtree, hf_xtp_aseg_dsthost,
tvb, offset, 4, aseg->dsthost);
offset += 4;
/* srchost(4) */
aseg->srchost = tvb_get_ipv4(tvb, offset);
proto_tree_add_ipv4(xtp_subtree, hf_xtp_aseg_srchost,
proto_tree_add_ipv4(xtp_subtree, hf_xtp_aseg_srchost,
tvb, offset, 4, aseg->srchost);
offset += 4;
/* dstport(2) */
aseg->dstport = tvb_get_ntohs(tvb, offset);
proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_dstport,
proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_dstport,
tvb, offset, 2, aseg->dstport);
offset += 2;
/* srcport(2) */
aseg->srcport = tvb_get_ntohs(tvb, offset);
proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_srcport,
proto_tree_add_uint(xtp_subtree, hf_xtp_aseg_srcport,
tvb, offset, 2, aseg->srcport);
offset += 2;
@ -321,12 +319,12 @@ dissect_xtp_traffic_cntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree *xtp_subtree;
struct xtp_traffic_cntl tcntl[1];
top_ti = proto_tree_add_text(tree, tvb, offset, len,
top_ti = proto_tree_add_text(tree, tvb, offset, len,
"Traffic Control Segment");
xtp_subtree = proto_item_add_subtree(top_ti, ett_xtp_tcntl);
if (len < XTP_TRAFFIC_CNTL_LEN) {
proto_item_append_text(top_ti,
proto_item_append_text(top_ti,
", bogus length(%u, must be at least %u)",
len, XTP_TRAFFIC_CNTL_LEN);
return 0;
@ -356,34 +354,34 @@ dissect_xtp_traffic_cntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/** add summary **/
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO,
col_append_fstr(pinfo->cinfo, COL_INFO,
" Recv-Seq=%" G_GINT64_MODIFIER "u", tcntl->rseq);
col_append_fstr(pinfo->cinfo, COL_INFO,
col_append_fstr(pinfo->cinfo, COL_INFO,
" Alloc=%" G_GINT64_MODIFIER "u", tcntl->alloc);
}
proto_item_append_text(top_ti,
proto_item_append_text(top_ti,
", Recv-Seq: %" G_GINT64_MODIFIER "u", tcntl->rseq);
/** display **/
offset = start;
/* rseq(8) */
proto_tree_add_uint64(xtp_subtree, hf_xtp_tcntl_rseq,
proto_tree_add_uint64(xtp_subtree, hf_xtp_tcntl_rseq,
tvb, offset, 8, tcntl->rseq);
offset += 8;
/* alloc(8) */
proto_tree_add_uint64(xtp_subtree, hf_xtp_tcntl_alloc,
proto_tree_add_uint64(xtp_subtree, hf_xtp_tcntl_alloc,
tvb, offset, 8, tcntl->alloc);
offset += 4;
/* echo(4) */
proto_tree_add_uint(xtp_subtree, hf_xtp_tcntl_echo,
proto_tree_add_uint(xtp_subtree, hf_xtp_tcntl_echo,
tvb, offset, 4, tcntl->echo);
offset += 4;
/* rsvd(4) */
proto_tree_add_uint(xtp_subtree, hf_xtp_tcntl_rsvd,
proto_tree_add_uint(xtp_subtree, hf_xtp_tcntl_rsvd,
tvb, offset, 4, tcntl->rsvd);
offset += 4;
/* xkey(8) */
proto_tree_add_uint64(xtp_subtree, hf_xtp_tcntl_xkey,
proto_tree_add_uint64(xtp_subtree, hf_xtp_tcntl_xkey,
tvb, offset, 8, tcntl->xkey);
offset += 8;
@ -403,7 +401,7 @@ dissect_xtp_tspec(tvbuff_t *tvb, proto_tree *tree, guint32 offset) {
xtp_subtree = proto_item_add_subtree(ti, ett_xtp_tspec);
if (len < XTP_TRAFFIC_SPEC0_LEN) {
proto_item_append_text(ti,
proto_item_append_text(ti,
", bogus length(%u, must be at least %u)",
len, XTP_TRAFFIC_SPEC0_LEN);
return 0;
@ -423,7 +421,7 @@ dissect_xtp_tspec(tvbuff_t *tvb, proto_tree *tree, guint32 offset) {
/** display common fields */
offset = start;
/* tlen(2) */
ti = proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_tlen,
ti = proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_tlen,
tvb, offset, 2, tspec->tlen);
offset += 2;
if (tspec->tlen > len) {
@ -432,30 +430,30 @@ dissect_xtp_tspec(tvbuff_t *tvb, proto_tree *tree, guint32 offset) {
error = 1;
}
/* service(1) */
proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_service,
proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_service,
tvb, offset, 1, tspec->service);
offset++;
/* tformat(1) */
ti2 = proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_tformat,
ti2 = proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_tformat,
tvb, offset, 1, tspec->tformat);
offset++;
switch (tspec->tformat) {
case 0:
if (tspec->tlen != XTP_TRAFFIC_SPEC0_LEN) {
if (tspec->tlen != XTP_TRAFFIC_SPEC0_LEN) {
proto_item_append_text(ti, ", bogus length(%u, must be %u)",
tspec->tlen, XTP_TRAFFIC_SPEC0_LEN);
error = 1;
}
break;
case 1:
if (tspec->tlen != XTP_TRAFFIC_SPEC1_LEN) {
if (tspec->tlen != XTP_TRAFFIC_SPEC1_LEN) {
proto_item_append_text(ti, ", bogus length(%u, must be %u)",
tspec->tlen, XTP_TRAFFIC_SPEC1_LEN);
error = 1;
}
break;
default:
proto_item_append_text(ti2, ", Unsupported tformat(%u)",
proto_item_append_text(ti2, ", Unsupported tformat(%u)",
tspec->tformat);
error = 1;
break;
@ -470,34 +468,34 @@ dissect_xtp_tspec(tvbuff_t *tvb, proto_tree *tree, guint32 offset) {
case 0:
/* traffic(4) */
tspec->maxdata = tvb_get_ntohl(tvb, offset);
proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_traffic,
proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_traffic,
tvb, offset, 4, tspec->maxdata);
offset += 4;
break;
case 1:
/* maxdata(4) */
tspec->maxdata = tvb_get_ntohl(tvb, offset);
proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_maxdata,
proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_maxdata,
tvb, offset, 4, tspec->maxdata);
offset += 4;
/* inrate(4) */
tspec->inrate = tvb_get_ntohl(tvb, offset);
proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_inrate,
proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_inrate,
tvb, offset, 4, tspec->inrate);
offset += 4;
/* inburst(4) */
tspec->inburst = tvb_get_ntohl(tvb, offset);
proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_inburst,
proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_inburst,
tvb, offset, 4, tspec->inburst);
offset += 4;
/* outrate(4) */
tspec->outrate = tvb_get_ntohl(tvb, offset);
proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_outrate,
proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_outrate,
tvb, offset, 4, tspec->outrate);
offset += 4;
/* outburst(4) */
tspec->outburst = tvb_get_ntohl(tvb, offset);
proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_outburst,
proto_tree_add_uint(xtp_subtree, hf_xtp_tspec_outburst,
tvb, offset, 4, tspec->outburst);
offset += 4;
break;
@ -543,7 +541,7 @@ dissect_xtp_cntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree *xtp_subtree;
struct xtp_cntl cntl[1];
top_ti = proto_tree_add_text(tree, tvb, offset, len,
top_ti = proto_tree_add_text(tree, tvb, offset, len,
"Common Control Segment");
xtp_subtree = proto_item_add_subtree(top_ti, ett_xtp_cntl);
@ -569,26 +567,26 @@ dissect_xtp_cntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/** add summary **/
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO,
col_append_fstr(pinfo->cinfo, COL_INFO,
" Recv-Seq=%" G_GINT64_MODIFIER "u", cntl->rseq);
col_append_fstr(pinfo->cinfo, COL_INFO,
col_append_fstr(pinfo->cinfo, COL_INFO,
" Alloc=%" G_GINT64_MODIFIER "u", cntl->alloc);
}
proto_item_append_text(top_ti,
proto_item_append_text(top_ti,
", Recv-Seq: %" G_GINT64_MODIFIER "u", cntl->rseq);
/** display **/
offset = start;
/* rseq(8) */
proto_tree_add_uint64(xtp_subtree, hf_xtp_cntl_rseq,
proto_tree_add_uint64(xtp_subtree, hf_xtp_cntl_rseq,
tvb, offset, 8, cntl->rseq);
offset += 8;
/* alloc(8) */
proto_tree_add_uint64(xtp_subtree, hf_xtp_cntl_alloc,
proto_tree_add_uint64(xtp_subtree, hf_xtp_cntl_alloc,
tvb, offset, 8, cntl->alloc);
offset += 4;
/* echo(4) */
proto_tree_add_uint(xtp_subtree, hf_xtp_cntl_echo,
proto_tree_add_uint(xtp_subtree, hf_xtp_cntl_echo,
tvb, offset, 4, cntl->echo);
return;
@ -618,12 +616,12 @@ dissect_xtp_ecntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint32 spans_len;
guint i;
top_ti = proto_tree_add_text(tree, tvb, offset, len,
top_ti = proto_tree_add_text(tree, tvb, offset, len,
"Error Control Segment");
xtp_subtree = proto_item_add_subtree(top_ti, ett_xtp_ecntl);
if (len < MIN_XTP_ECNTL_PKT_LEN) {
proto_item_append_text(top_ti,
proto_item_append_text(top_ti,
", bogus length (%u, must be at least %u)",
len, MIN_XTP_ECNTL_PKT_LEN);
return;
@ -649,7 +647,7 @@ dissect_xtp_ecntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
len = len + XTP_HEADER_LEN - offset;
spans_len = 16 * ecntl->nspan;
if (len != spans_len) {
proto_item_append_text(top_ti,
proto_item_append_text(top_ti,
", bogus spans field length (%u, must be %u)",
len, spans_len);
return;
@ -667,40 +665,40 @@ dissect_xtp_ecntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/** add summary **/
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO,
col_append_fstr(pinfo->cinfo, COL_INFO,
" Recv-Seq=%" G_GINT64_MODIFIER "u", ecntl->rseq);
col_append_fstr(pinfo->cinfo, COL_INFO,
col_append_fstr(pinfo->cinfo, COL_INFO,
" Alloc=%" G_GINT64_MODIFIER "u", ecntl->alloc);
}
proto_item_append_text(top_ti,
proto_item_append_text(top_ti,
", Recv-Seq: %" G_GINT64_MODIFIER "u", ecntl->rseq);
/** display **/
offset = start;
/* rseq(8) */
proto_tree_add_uint64(xtp_subtree, hf_xtp_ecntl_rseq,
proto_tree_add_uint64(xtp_subtree, hf_xtp_ecntl_rseq,
tvb, offset, 8, ecntl->rseq);
offset += 8;
/* alloc(8) */
proto_tree_add_uint64(xtp_subtree, hf_xtp_ecntl_alloc,
proto_tree_add_uint64(xtp_subtree, hf_xtp_ecntl_alloc,
tvb, offset, 8, ecntl->alloc);
offset += 8;
/* echo(4) */
proto_tree_add_uint(xtp_subtree, hf_xtp_ecntl_echo,
proto_tree_add_uint(xtp_subtree, hf_xtp_ecntl_echo,
tvb, offset, 4, ecntl->echo);
offset += 4;
/* nspan(4) */
ti = proto_tree_add_uint(xtp_subtree, hf_xtp_ecntl_nspan,
ti = proto_tree_add_uint(xtp_subtree, hf_xtp_ecntl_nspan,
tvb, offset, 4, ecntl->nspan);
offset += 4;
/* spans(16n) */
p = spans;
for (i = 0; i < ecntl->nspan; i++) {
proto_tree_add_uint64(xtp_subtree, hf_xtp_ecntl_span_left,
proto_tree_add_uint64(xtp_subtree, hf_xtp_ecntl_span_left,
tvb, offset, 8, *p);
p++;
offset += 8;
proto_tree_add_uint64(xtp_subtree, hf_xtp_ecntl_span_right,
proto_tree_add_uint64(xtp_subtree, hf_xtp_ecntl_span_right,
tvb, offset, 8, *p);
p++;
offset += 8;
@ -752,7 +750,7 @@ dissect_xtp_diag(tvbuff_t *tvb, proto_tree *tree, guint32 offset) {
xtp_subtree = proto_item_add_subtree(ti, ett_xtp_diag);
if (len < XTP_DIAG_PKT_HEADER_LEN) {
proto_item_append_text(ti,
proto_item_append_text(ti,
", bogus length (%u, must be at least %u)",
len, XTP_DIAG_PKT_HEADER_LEN);
return;
@ -768,19 +766,19 @@ dissect_xtp_diag(tvbuff_t *tvb, proto_tree *tree, guint32 offset) {
/* message(n) */
msg_len = tvb_length_remaining(tvb, offset);
diag->msg = tvb_get_string(tvb, offset, msg_len);
/** display **/
offset = start;
/* code(4) */
proto_tree_add_uint(xtp_subtree, hf_xtp_diag_code,
proto_tree_add_uint(xtp_subtree, hf_xtp_diag_code,
tvb, offset, 4, diag->code);
offset += 4;
/* val(4) */
proto_tree_add_uint(xtp_subtree, hf_xtp_diag_val,
proto_tree_add_uint(xtp_subtree, hf_xtp_diag_val,
tvb, offset, 4, diag->val);
offset += 4;
/* message(4) */
proto_tree_add_string(xtp_subtree, hf_xtp_diag_msg,
proto_tree_add_string(xtp_subtree, hf_xtp_diag_msg,
tvb, offset, msg_len, diag->msg);
return;
@ -849,20 +847,20 @@ dissect_xtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
for (i = 0; i < 16; i++) {
bpos = 1 << (15 - i);
if (cmd_options & bpos) {
returned_length = g_snprintf(&options[fpos],
returned_length = g_snprintf(&options[fpos],
MAX_OPTIONS_LEN-fpos, "%s%s",
fpos?", ":"",
fstr[i]);
fpos += MIN(returned_length, MAX_OPTIONS_LEN-fpos);
}
}
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_str(pinfo->cinfo, COL_INFO,
val_to_str(xtph->cmd_ptype_pformat,
val_to_str(xtph->cmd_ptype_pformat,
pformat_vals, "Unknown pformat (%u)"));
col_append_fstr(pinfo->cinfo, COL_INFO, " [%s]", options);
col_append_fstr(pinfo->cinfo, COL_INFO,
col_append_fstr(pinfo->cinfo, COL_INFO,
" Seq=%" G_GINT64_MODIFIER "u", xtph->seq);
col_append_fstr(pinfo->cinfo, COL_INFO, " Len=%u", xtph->dlen);
}
@ -870,75 +868,75 @@ dissect_xtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
if (tree) {
ti = proto_tree_add_item(tree, proto_xtp, tvb, 0, -1, FALSE);
/** add summary **/
proto_item_append_text(ti,
proto_item_append_text(ti,
", Key: 0x%016" G_GINT64_MODIFIER "X", xtph->key);
proto_item_append_text(ti,
proto_item_append_text(ti,
", Seq: %" G_GINT64_MODIFIER "u", xtph->seq);
proto_item_append_text(ti, ", Len: %u", xtph->dlen);
xtp_tree = proto_item_add_subtree(ti, ett_xtp);
/* key(8) */
offset = 0;
ti = proto_tree_add_uint64(xtp_tree, hf_xtp_key,
ti = proto_tree_add_uint64(xtp_tree, hf_xtp_key,
tvb, offset, 8, xtph->key);
xtp_subtree = proto_item_add_subtree(ti, ett_xtp_key);
offset += 8;
/* cmd(4) */
ti = proto_tree_add_uint(xtp_tree, hf_xtp_cmd,
ti = proto_tree_add_uint(xtp_tree, hf_xtp_cmd,
tvb, offset, 4, xtph->cmd);
xtp_cmd_tree = proto_item_add_subtree(ti, ett_xtp_cmd);
ti = proto_tree_add_uint(xtp_cmd_tree, hf_xtp_cmd_options,
ti = proto_tree_add_uint(xtp_cmd_tree, hf_xtp_cmd_options,
tvb, offset, 3, xtph->cmd_options);
/** add summary **/
proto_item_append_text(ti, " [%s]", options);
xtp_subtree = proto_item_add_subtree(ti, ett_xtp_cmd_options);
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_nocheck,
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_nocheck,
tvb, offset, 3, xtph->cmd_options);
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_edge,
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_edge,
tvb, offset, 3, xtph->cmd_options);
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_noerr,
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_noerr,
tvb, offset, 3, xtph->cmd_options);
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_multi,
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_multi,
tvb, offset, 3, xtph->cmd_options);
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_res,
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_res,
tvb, offset, 3, xtph->cmd_options);
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_sort,
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_sort,
tvb, offset, 3, xtph->cmd_options);
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_noflow,
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_noflow,
tvb, offset, 3, xtph->cmd_options);
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_fastnak,
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_fastnak,
tvb, offset, 3, xtph->cmd_options);
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_sreq,
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_sreq,
tvb, offset, 3, xtph->cmd_options);
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_dreq,
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_dreq,
tvb, offset, 3, xtph->cmd_options);
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_rclose,
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_rclose,
tvb, offset, 3, xtph->cmd_options);
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_wclose,
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_wclose,
tvb, offset, 3, xtph->cmd_options);
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_eom,
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_eom,
tvb, offset, 3, xtph->cmd_options);
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_end,
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_end,
tvb, offset, 3, xtph->cmd_options);
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_btag,
proto_tree_add_boolean(xtp_subtree, hf_xtp_cmd_options_btag,
tvb, offset, 3, xtph->cmd_options);
offset += 3;
ti = proto_tree_add_uint(xtp_cmd_tree, hf_xtp_cmd_ptype,
offset += 3;
ti = proto_tree_add_uint(xtp_cmd_tree, hf_xtp_cmd_ptype,
tvb, offset, 1, xtph->cmd_ptype);
xtp_subtree = proto_item_add_subtree(ti, ett_xtp_cmd_ptype);
proto_tree_add_uint(xtp_subtree, hf_xtp_cmd_ptype_ver,
proto_tree_add_uint(xtp_subtree, hf_xtp_cmd_ptype_ver,
tvb, offset, 1, xtph->cmd_ptype_ver);
if (xtph->cmd_ptype_ver != XTP_VERSION_4) {
proto_item_append_text(ti,
proto_item_append_text(ti,
", Unknown XTP version (%03X)", xtph->cmd_ptype_ver);
error = 1;
}
proto_tree_add_uint(xtp_subtree, hf_xtp_cmd_ptype_pformat,
proto_tree_add_uint(xtp_subtree, hf_xtp_cmd_ptype_pformat,
tvb, offset, 1, xtph->cmd_ptype_pformat);
offset++;
/* dlen(4) */
ti = proto_tree_add_uint(xtp_tree, hf_xtp_dlen,
ti = proto_tree_add_uint(xtp_tree, hf_xtp_dlen,
tvb, offset, 4, xtph->dlen);
if (xtph->dlen != len - XTP_HEADER_LEN) {
proto_item_append_text(ti, ", bogus length (%u, must be %u)",
@ -960,12 +958,12 @@ dissect_xtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
} else {
proto_tree_add_text(xtp_tree, tvb, offset, 2,
"Checksum: 0x%04x [incorrect, should be 0x%04x]",
xtph->check,
xtph->check,
in_cksum_shouldbe(xtph->check, computed_cksum));
}
}
else {
proto_tree_add_text(xtp_tree, tvb, offset, 2,
proto_tree_add_text(xtp_tree, tvb, offset, 2,
"Checksum: 0x%04x", xtph->check);
}
offset += 2;
@ -978,7 +976,7 @@ dissect_xtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
/* seq(8) */
proto_tree_add_uint64(xtp_tree, hf_xtp_seq, tvb, offset, 8, xtph->seq);
offset += 8;
if (!error) {
switch (xtph->cmd_ptype_pformat) {
case XTP_DATA_PKT:
@ -1036,77 +1034,77 @@ proto_register_xtp(void)
},
{ &hf_xtp_cmd_options_nocheck,
{ "NOCHECK", "xtp.cmd.options.nocheck",
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
XTP_CMD_OPTIONS_NOCHECK, NULL, HFILL }
},
{ &hf_xtp_cmd_options_edge,
{ "EDGE", "xtp.cmd.options.edge",
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
XTP_CMD_OPTIONS_EDGE, NULL, HFILL }
},
{ &hf_xtp_cmd_options_noerr,
{ "NOERR", "xtp.cmd.options.noerr",
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
XTP_CMD_OPTIONS_NOERR, NULL, HFILL }
},
{ &hf_xtp_cmd_options_multi,
{ "MULTI", "xtp.cmd.options.multi",
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
XTP_CMD_OPTIONS_MULTI, NULL, HFILL }
},
{ &hf_xtp_cmd_options_res,
{ "RES", "xtp.cmd.options.res",
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
XTP_CMD_OPTIONS_RES, NULL, HFILL }
},
{ &hf_xtp_cmd_options_sort,
{ "SORT", "xtp.cmd.options.sort",
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
XTP_CMD_OPTIONS_SORT, NULL, HFILL }
},
{ &hf_xtp_cmd_options_noflow,
{ "NOFLOW", "xtp.cmd.options.noflow",
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
XTP_CMD_OPTIONS_NOFLOW, NULL, HFILL }
},
{ &hf_xtp_cmd_options_fastnak,
{ "FASTNAK", "xtp.cmd.options.fastnak",
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
XTP_CMD_OPTIONS_FASTNAK, NULL, HFILL }
},
{ &hf_xtp_cmd_options_sreq,
{ "SREQ", "xtp.cmd.options.sreq",
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
XTP_CMD_OPTIONS_SREQ, NULL, HFILL }
},
{ &hf_xtp_cmd_options_dreq,
{ "DREQ", "xtp.cmd.options.dreq",
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
XTP_CMD_OPTIONS_DREQ, NULL, HFILL }
},
{ &hf_xtp_cmd_options_rclose,
{ "RCLOSE", "xtp.cmd.options.rclose",
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
XTP_CMD_OPTIONS_RCLOSE, NULL, HFILL }
},
{ &hf_xtp_cmd_options_wclose,
{ "WCLOSE", "xtp.cmd.options.wclose",
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
XTP_CMD_OPTIONS_WCLOSE, NULL, HFILL }
},
{ &hf_xtp_cmd_options_eom,
{ "EOM", "xtp.cmd.options.eom",
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
XTP_CMD_OPTIONS_EOM, NULL, HFILL }
},
{ &hf_xtp_cmd_options_end,
{ "END", "xtp.cmd.options.end",
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
XTP_CMD_OPTIONS_END, NULL, HFILL }
},
{ &hf_xtp_cmd_options_btag,
{ "BTAG", "xtp.cmd.options.btag",
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
FT_BOOLEAN, 24, TFS(&tfs_set_notset),
XTP_CMD_OPTIONS_BTAG, NULL, HFILL }
},
{ &hf_xtp_cmd_ptype,