Dissect RIM related IEs

svn path=/trunk/; revision=39740
This commit is contained in:
Anders Broman 2011-11-06 08:18:26 +00:00
parent d0fa4d6df7
commit 28f7d63c58
4 changed files with 196 additions and 10 deletions

View File

@ -783,7 +783,7 @@ de_bssgp_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32
* 3GPP TS 24.008 IEI (10.5.1.1)
*/
static guint16
guint16
de_bssgp_cell_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string, int string_len)
{
guint32 curr_offset;

View File

@ -31,6 +31,7 @@
WS_VAR_IMPORT value_string_ext bssgp_cause_vals_ext;
void bssgp_suspend_ack(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len);
guint16 de_bssgp_cell_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string, int string_len);
#endif /* __PACKET_BSSGP_H__ */

View File

@ -253,6 +253,7 @@ static int hf_gtp_ext_gcsi = -1;
static int hf_gtp_ext_dti = -1;
static int hf_gtp_ra_prio_lcs = -1;
static int hf_gtp_bcm = -1;
static int hf_gtp_rim_routing_addr = -1;
/* Initialize the subtree pointers */
static gint ett_gtp = -1;
@ -415,7 +416,7 @@ static const value_string next_extension_header_fieldvals[] = {
#define GTPv1_EXT_RP_SPARE_MASK 0x08
#define GTPv1_EXT_RP_MASK 0x07
static const value_string message_type[] = {
static const value_string gtp_message_type[] = {
{GTP_MSG_UNKNOWN, "For future use"},
{GTP_MSG_ECHO_REQ, "Echo request"},
{GTP_MSG_ECHO_RESP, "Echo response"},
@ -546,6 +547,14 @@ static const value_string message_type[] = {
/* 106 - 111 For future use. Shall not be sent. If received,
* shall be treated as an Unknown message.
*/
#if 0
{ 106, "Unknown message(For future use)"},
{ 107, "Unknown message(For future use)"},
{ 108, "Unknown message(For future use)"},
{ 109, "Unknown message(For future use)"},
{ 110, "Unknown message(For future use)"},
{ 111, "Unknown message(For future use)"},
#endif
{GTP_MBMS_REG_REQ, "MBMS Registration Request"},
{GTP_MBMS_REG_RES, "MBMS Registration Response"},
{GTP_MBMS_DE_REG_REQ, "MBMS De-Registration Request"},
@ -559,11 +568,51 @@ static const value_string message_type[] = {
/* 122-127 For future use. Shall not be sent.
* If received, shall be treated as an Unknown message.
*/
{GTP_MS_INFO_CNG_NOT_REQ, "MS Info Change Notification Request"},
#if 0
{ 122, "Unknown message(For future use)"},
{ 123, "Unknown message(For future use)"},
{ 124, "Unknown message(For future use)"},
{ 125, "Unknown message(For future use)"},
{ 126, "Unknown message(For future use)"},
{ 127, "Unknown message(For future use)"},
#endif
{GTP_MS_INFO_CNG_NOT_REQ, "MS Info Change Notification Request"},
{GTP_MS_INFO_CNG_NOT_RES, "MS Info Change Notification Response"},
/* 130-239 For future use. Shall not be sent. If received,
* shall be treated as an Unknown message.
*/
#if 0
{ 130, "Unknown message(For future use)"},
{ 131, "Unknown message(For future use)"},
{ 132, "Unknown message(For future use)"},
{ 133, "Unknown message(For future use)"},
{ 134, "Unknown message(For future use)"},
{ 135, "Unknown message(For future use)"},
{ 136, "Unknown message(For future use)"},
{ 137, "Unknown message(For future use)"},
{ 138, "Unknown message(For future use)"},
{ 139, "Unknown message(For future use)"},
{ 140, "Unknown message(For future use)"},
{ 141, "Unknown message(For future use)"},
{ 142, "Unknown message(For future use)"},
{ 143, "Unknown message(For future use)"},
{ 144, "Unknown message(For future use)"},
{ 145, "Unknown message(For future use)"},
{ 146, "Unknown message(For future use)"},
{ 147, "Unknown message(For future use)"},
{ 148, "Unknown message(For future use)"},
{ 149, "Unknown message(For future use)"},
{ 150, "Unknown message(For future use)"},
{ 151, "Unknown message(For future use)"},
{ 152, "Unknown message(For future use)"},
{ 153, "Unknown message(For future use)"},
{ 154, "Unknown message(For future use)"},
{ 155, "Unknown message(For future use)"},
{ 156, "Unknown message(For future use)"},
{ 157, "Unknown message(For future use)"},
{ 158, "Unknown message(For future use)"},
{ 159, "Unknown message(For future use)"},
#endif
{GTP_MSG_DATA_TRANSF_REQ, "Data record transfer request"},
{GTP_MSG_DATA_TRANSF_RESP, "Data record transfer response"},
/* 242-253 For future use. Shall not be sent. If received,
@ -573,7 +622,7 @@ static const value_string message_type[] = {
{GTP_MSG_TPDU, "T-PDU"},
{0, NULL}
};
static value_string_ext message_type_ext = VALUE_STRING_EXT_INIT(message_type);
static value_string_ext gtp_message_type_ext = VALUE_STRING_EXT_INIT(gtp_message_type);
/* definitions of fields in extension header */
#define GTP_EXT_CAUSE 0x01
@ -5516,11 +5565,11 @@ static int decode_gtp_rim_ra(tvbuff_t * tvb, int offset, packet_info * pinfo _U_
offset++;
proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
offset = offset + 2;
/* TODO add decoding of data */
proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
/* To dissect the Address the Routing Address discriminator must be known */
/*
* Octets 4-n are coded according to 3GPP TS 48.018 [20] 11.3.77 RIM Routing Information IE octets 4-n.
*/
proto_tree_add_item(ext_tree, hf_gtp_rim_routing_addr, tvb, offset, length, ENC_BIG_ENDIAN);
return 3 + length;
@ -6691,7 +6740,7 @@ static void dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree *
break;
}
col_add_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(gtp_hdr.message, &message_type_ext, "Unknown"));
col_add_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(gtp_hdr.message, &gtp_message_type_ext, "Unknown"));
if (tree) {
ti = proto_tree_add_item(tree, proto_gtp, tvb, 0, -1, ENC_NA);
@ -7097,7 +7146,7 @@ void proto_register_gtp(void)
{&hf_gtp_imsi, {"IMSI", "gtp.imsi", FT_STRING, BASE_NONE, NULL, 0, "International Mobile Subscriber Identity number", HFILL}},
{&hf_gtp_length, {"Length", "gtp.length", FT_UINT16, BASE_DEC, NULL, 0, "Length (i.e. number of octets after TID or TEID)", HFILL}},
{&hf_gtp_map_cause, {"MAP cause", "gtp.map_cause", FT_UINT8, BASE_DEC, VALS(gsm_old_GSMMAPLocalErrorcode_vals), 0, NULL, HFILL}},
{&hf_gtp_message_type, {"Message Type", "gtp.message", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &message_type_ext, 0x0, "GTP Message Type", HFILL}},
{&hf_gtp_message_type, {"Message Type", "gtp.message", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &gtp_message_type_ext, 0x0, "GTP Message Type", HFILL}},
{&hf_gtp_ms_reason,
{"MS not reachable reason", "gtp.ms_reason", FT_UINT8, BASE_DEC, VALS(ms_not_reachable_type), 0, NULL, HFILL}},
{&hf_gtp_ms_valid, {"MS validated", "gtp.ms_valid", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},
@ -7412,6 +7461,11 @@ void proto_register_gtp(void)
{"Bearer Control Mode", "gtp.bcm",
FT_UINT8, BASE_DEC, VALS(gtp_pdp_bcm_type_vals), 0,
NULL, HFILL}
},
{ &hf_gtp_rim_routing_addr,
{"RIM Routing Address value", "gtp.rim_routing_addr_val",
FT_BYTES, BASE_NONE, NULL, 0,
NULL, HFILL}
},
};

View File

@ -42,6 +42,7 @@
#include "packet-e212.h"
#include "packet-s1ap.h"
#include "packet-ranap.h"
#include "packet-bssgp.h"
static dissector_handle_t nas_eps_handle;
@ -314,6 +315,17 @@ static int hf_gtpv2_uli_ecgi_eci_spare= -1;
static int hf_gtpv2_nsapi = -1;
static int hf_gtpv2_bearer_control_mode= -1;
static int hf_gtpv2_bss_container_phx = -1;
static int hf_gtpv2_bss_con_sapi_flg = -1;
static int hf_gtpv2_bss_con_rp_flg = -1;
static int hf_gtpv2_bss_con_pfi_flg = -1;
static int hf_gtpv2_bss_con_pfi = -1;
static int hf_gtpv2_bss_con_rp = -1;
static int hf_gtpv2_bss_con_sapi = -1;
static int hf_gtpv2_bss_con_xid_len = -1;
static int hf_gtpv2_bss_con_xid = -1;
static int hf_gtpv2_home_enodeb_id = -1;
static int hf_gtpv2_tac = -1;
static gint ett_gtpv2 = -1;
static gint ett_gtpv2_flags = -1;
@ -347,6 +359,7 @@ static gint ett_gtpv2_rai = -1;
static gint ett_gtpv2_ms_mark = -1;
static gint ett_gtpv2_stn_sr = -1;
static gint ett_gtpv2_supp_codec_list = -1;
static gint ett_bss_con = -1;
/* Definition of User Location Info (AVP 22) masks */
#define GTPv2_ULI_CGI_MASK 0x01
@ -358,8 +371,11 @@ static gint ett_gtpv2_supp_codec_list = -1;
#define GTPV2_CREATE_SESSION_REQUEST 32
#define GTPV2_CREATE_SESSION_RESPONSE 33
#define GTPV2_CONTEXT_RESPONSE 131
#define GTPV2_FORWARD_RELOCATION_REQ 133
#define GTPV2_FORWARD_CTX_NOTIFICATION 137
#define GTPV2_RAN_INFORMATION_RELAY 152
static void dissect_gtpv2_ie_common(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, gint offset, guint8 message_type);
/*Message Types for GTPv2 (Refer Pg19 29.274) (SB)*/
@ -2951,8 +2967,11 @@ static void
dissect_gtpv2_F_container(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type, guint8 instance _U_)
{
tvbuff_t *tvb_new;
proto_item *bss_item;
proto_tree *sub_tree;
int offset = 0;
guint8 container_type;
guint8 container_flags, xid_len;
/* Octets 8 7 6 5 4 3 2 1
* 5 Spare | Container Type
@ -2960,6 +2979,52 @@ dissect_gtpv2_F_container(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, p
proto_tree_add_item(tree, hf_gtpv2_container_type, tvb, offset, 1, ENC_BIG_ENDIAN);
container_type = tvb_get_guint8(tvb,offset);
offset++;
if((message_type == GTPV2_FORWARD_RELOCATION_REQ)
||(message_type == GTPV2_CONTEXT_RESPONSE)
||(message_type == GTPV2_RAN_INFORMATION_RELAY)){
switch(container_type){
case 2:
/* BSS container */
bss_item = proto_tree_add_text(tree, tvb, offset, length, "BSS container");
sub_tree = proto_item_add_subtree(bss_item, ett_bss_con);
/* The flags PFI, RP, SAPI and PHX in octet 6 indicate the corresponding type of paratemer */
proto_tree_add_item(tree, hf_gtpv2_bss_container_phx, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_gtpv2_bss_con_sapi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_gtpv2_bss_con_rp_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_gtpv2_bss_con_pfi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
container_flags = tvb_get_guint8(tvb,offset);
offset++;
if((container_flags&0x01)==1){
/* Packet Flow ID present */
proto_tree_add_item(tree, hf_gtpv2_bss_con_pfi, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
}
if(((container_flags&0x04)==4)||((container_flags&0x02)==2)){
if((container_flags&0x04)==4){
/* SAPI present */
proto_tree_add_item(tree, hf_gtpv2_bss_con_sapi, tvb, offset, 1, ENC_BIG_ENDIAN);
}
if((container_flags&0x02)==2){
/* Radio Priority present */
proto_tree_add_item(tree, hf_gtpv2_bss_con_rp, tvb, offset, 1, ENC_BIG_ENDIAN);
}
offset++;
}
if((container_flags&0x08)==8){
/* XiD parameters length is present in Octet c.
* XiD parameters are present in Octet d to n.
*/
xid_len = tvb_get_guint8(tvb,offset);
proto_tree_add_item(tree, hf_gtpv2_bss_con_xid_len, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_gtpv2_bss_con_xid, tvb, offset, xid_len, ENC_BIG_ENDIAN);
offset += xid_len;
}
return;
default:
break;
}
}
if(message_type == GTPV2_FORWARD_CTX_NOTIFICATION) {
switch(container_type){
case 3:
@ -3142,10 +3207,26 @@ dissect_gtpv2_target_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pro
/* Target ID field shall be same as the Octets 3 to 10 of the Cell Identifier IEI
* in 3GPP TS 48.018 [34].
*/
tvb_new = tvb_new_subset_remaining(tvb, offset);
de_bssgp_cell_id(tvb_new, tree, pinfo, 0, 0/* not used */, NULL, 0);
return;
case 3:
/* Home eNodeB ID */
/* Octet 10 to 12 Home eNodeB ID */
tvb_new = tvb_new_subset_remaining(tvb, offset);
dissect_e212_mcc_mnc(tvb_new, pinfo, tree, 0, TRUE);
offset+=3;
/* Octet 10 to 12 Home eNodeB ID
* The Home eNodeB ID consists of 28 bits. See 3GPP TS 36.413 [10].
* Bit 4 of Octet 9 is the most significant bit and bit 1 of Octet 12 is the least significant bit.
* The coding of the Home eNodeB ID is the responsibility of each administration.
* Coding using full hexadecimal representation shall be used.
*/
proto_tree_add_item(tree, hf_gtpv2_home_enodeb_id, tvb, offset, 4 , ENC_BIG_ENDIAN);
offset+=4;
/* Octet 13 to 14 Tracking Area Code (TAC) */
proto_tree_add_item(tree, hf_gtpv2_tac, tvb, offset, 2 , ENC_BIG_ENDIAN);
offset+=2;
return;
default:
break;
@ -5005,7 +5086,56 @@ void proto_register_gtpv2(void)
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL}
},
{ &hf_gtpv2_bss_container_phx,
{"PHX", "gtpv2.bss_cont.phx",
FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
NULL, HFILL}
},
{ &hf_gtpv2_bss_con_sapi_flg,
{"SAPI", "gtpv2.bss_cont.sapi_flg",
FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
NULL, HFILL}
},
{ &hf_gtpv2_bss_con_rp_flg,
{"RP", "gtpv2.bss_cont.rp_flg",
FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
NULL, HFILL}
},
{ &hf_gtpv2_bss_con_pfi_flg,
{"PFI", "gtpv2.bss_cont.pfi_flg",
FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
NULL, HFILL}
},
{ &hf_gtpv2_bss_con_pfi,
{"Packet Flow ID(PFI)", "gtpv2.bss_cont.pfi",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{ &hf_gtpv2_bss_con_rp,
{"Radio Priority(RP)", "gtpv2.bss_cont.rp",
FT_UINT8, BASE_DEC, NULL, 0x07,
NULL, HFILL}
},
{ &hf_gtpv2_bss_con_sapi,
{"SAPI", "gtpv2.bss_cont.sapi",
FT_UINT8, BASE_DEC, NULL, 0xf0,
NULL, HFILL}
},
{ &hf_gtpv2_bss_con_xid_len,
{"XiD parameters length", "gtpv2.bss_cont.xid_len",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL}
},
{ &hf_gtpv2_home_enodeb_id,
{"Home eNodeB ID", "gtpv2.home_enodeb_id",
FT_UINT32, BASE_HEX, NULL, 0x0fffffff,
NULL, HFILL}
},
{ &hf_gtpv2_tac,
{"Tracking Area Code (TAC)", "gtpv2.tac",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
};
static gint *ett_gtpv2_array[] = {
@ -5041,6 +5171,7 @@ void proto_register_gtpv2(void)
&ett_gtpv2_stn_sr,
&ett_gtpv2_ms_mark,
&ett_gtpv2_supp_codec_list,
&ett_bss_con,
};
proto_gtpv2 = proto_register_protocol("GPRS Tunneling Protocol V2", "GTPv2", "gtpv2");