diff options
author | Anders Broman <anders.broman@ericsson.com> | 2012-10-29 16:02:51 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2012-10-29 16:02:51 +0000 |
commit | 3d194979d670c81d14c2ba0c294c4a841909ba7c (patch) | |
tree | 0d537936df148612e79c994a2a001a555411be02 | |
parent | 4bb9ebb9e0d556dad1aae315d2b78a86fa3746bb (diff) | |
download | wireshark-3d194979d670c81d14c2ba0c294c4a841909ba7c.tar.gz |
Add IE/Options dissection.
svn path=/trunk/; revision=45829
-rw-r--r-- | epan/dissectors/packet-gtpv2.c | 67 | ||||
-rw-r--r-- | epan/dissectors/packet-gtpv2.h | 5 | ||||
-rw-r--r-- | epan/dissectors/packet-mip6.c | 239 |
3 files changed, 271 insertions, 40 deletions
diff --git a/epan/dissectors/packet-gtpv2.c b/epan/dissectors/packet-gtpv2.c index fdf56be3bc..2a29191299 100644 --- a/epan/dissectors/packet-gtpv2.c +++ b/epan/dissectors/packet-gtpv2.c @@ -376,6 +376,9 @@ static int hf_gtpv2_time_to_data_xfer = -1; static int hf_gtpv2_arp_pvi = -1; static int hf_gtpv2_arp_pl = -1; static int hf_gtpv2_arp_pci = -1; +static int hf_gtpv2_timer_unit = -1; +static int hf_gtpv2_timer_value = -1; +static int hf_gtpv2_lapi = -1; static gint ett_gtpv2 = -1; static gint ett_gtpv2_flags = -1; @@ -974,7 +977,7 @@ static const value_string gtpv2_cause_vals[] = { {0, NULL} }; -static value_string_ext gtpv2_cause_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_cause_vals); +value_string_ext gtpv2_cause_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_cause_vals); /* Table 8.4-1: CS (Cause Source) */ static const true_false_string gtpv2_cause_cs = { @@ -4065,7 +4068,7 @@ static const value_string gtpv2_selec_mode_vals[] = { {0, NULL} }; -static void +void dissect_gtpv2_selec_mode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_) { int offset = 0; @@ -4189,7 +4192,7 @@ static const value_string gtpv2_fq_csid_type_vals[] = { }; -static void +void dissect_gtpv2_fq_csid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_) { proto_item *expert_item; @@ -4699,25 +4702,30 @@ dissect_gtpv2_arp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto } /* 8.87 EPC Timer */ -static void +static const value_string gtpv2_timer_unit_vals[] = { + {0, "value is incremented in multiples of 2 seconds"}, + {1, "value is incremented in multiples of 1 minute"}, + {2, "value is incremented in multiples of 10 minutes"}, + {3, "value is incremented in multiples of 1 hour"}, + {4, "value is incremented in multiples of 1 hour"}, + {5, "Other values shall be interpreted as multiples of 1 minute(version 10.7.0)"}, + {6, "Other values shall be interpreted as multiples of 1 minute(version 10.7.0)"}, + {7, "value indicates that the timer is infinite"}, + {0, NULL} +}; +void dissect_gtpv2_epc_timer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_) { - proto_item *expert_item; + proto_tree_add_item(tree, hf_gtpv2_timer_unit, tvb, 0, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_gtpv2_timer_value, tvb, 0, 1, ENC_BIG_ENDIAN); - expert_item = proto_tree_add_text(tree, tvb, 0, length, "IE data not dissected yet"); - expert_add_info_format(pinfo, expert_item, PI_PROTOCOL, PI_NOTE, "IE data not dissected yet"); - PROTO_ITEM_SET_GENERATED(expert_item); } /* 8.88 Signalling Priority Indication */ static void dissect_gtpv2_sig_prio_ind(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_) { - proto_item *expert_item; - - expert_item = proto_tree_add_text(tree, tvb, 0, length, "IE data not dissected yet"); - expert_add_info_format(pinfo, expert_item, PI_PROTOCOL, PI_NOTE, "IE data not dissected yet"); - PROTO_ITEM_SET_GENERATED(expert_item); + proto_tree_add_item(tree, hf_gtpv2_lapi, tvb, 0, 1, ENC_BIG_ENDIAN); } /* 8.89 Temporary Mobile Group Identity (TMGI) */ @@ -4837,11 +4845,19 @@ dissect_gtpv2_mdt_config(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree static void dissect_gtpv2_apco(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_) { - proto_item *expert_item; - - expert_item = proto_tree_add_text(tree, tvb, 0, length, "IE data not dissected yet"); - expert_add_info_format(pinfo, expert_item, PI_PROTOCOL, PI_NOTE, "IE data not dissected yet"); - PROTO_ITEM_SET_GENERATED(expert_item); + switch(message_type){ + case GTPV2_CREATE_SESSION_REQUEST: + /* PCO options as MS to network direction */ + pinfo->link_dir = P2P_DIR_UL; + break; + case GTPV2_CREATE_SESSION_RESPONSE: + /* PCO options as Network to MS direction: */ + pinfo->link_dir = P2P_DIR_DL; + break; + default: + break; + } + de_sm_pco(tvb, tree, pinfo, 0, length, NULL, 0); } /* 8.95 Absolute Time of MBMS Data Transfer */ @@ -6652,6 +6668,21 @@ void proto_register_gtpv2(void) FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x40, NULL, HFILL} }, + { &hf_gtpv2_timer_unit, + {"Timer unit", "gtpv2.timer_unit", + FT_UINT8, BASE_DEC, VALS(gtpv2_timer_unit_vals), 0xe0, + NULL, HFILL} + }, + { &hf_gtpv2_timer_value, + {"Timer value", "gtpv2.timer_value", + FT_UINT8, BASE_DEC, NULL, 0x1f, + NULL, HFILL} + }, + { &hf_gtpv2_lapi, + {"LAPI (Low Access Priority Indication)", "gtpv2.lapi", + FT_BOOLEAN, 8, NULL, 0x01, + NULL, HFILL} + }, { &hf_gtpv2_mm_context_higher_br_16mb_flg_len, {"Length of Higher bitrates than 16 Mbps flag", "gtpv2.mm_context_higher_br_16mb_flg_len", FT_UINT8, BASE_DEC, NULL, 0x0, diff --git a/epan/dissectors/packet-gtpv2.h b/epan/dissectors/packet-gtpv2.h index a1d894d89d..faa96449bb 100644 --- a/epan/dissectors/packet-gtpv2.h +++ b/epan/dissectors/packet-gtpv2.h @@ -25,3 +25,8 @@ extern void dissect_gtpv2_mbms_service_area(tvbuff_t *tvb, packet_info *pinfo _U extern void dissect_gtpv2_mbms_session_duration(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_); extern void dissect_gtpv2_mbms_time_to_data_xfer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_); extern void dissect_gtpv2_arp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_); +extern void dissect_gtpv2_fq_csid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_); +extern void dissect_gtpv2_selec_mode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_); +extern void dissect_gtpv2_epc_timer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_); + +value_string_ext gtpv2_cause_vals_ext; diff --git a/epan/dissectors/packet-mip6.c b/epan/dissectors/packet-mip6.c index 225113958a..6dc7b7c9db 100644 --- a/epan/dissectors/packet-mip6.c +++ b/epan/dissectors/packet-mip6.c @@ -57,6 +57,10 @@ #include <epan/sminmpec.h> #include "packet-ntp.h" +#include "packet-gtpv2.h" +#include "packet-e164.h" +#include "packet-e212.h" + #define UDP_PORT_PMIP6_CNTL 5436 /* Mobility Header types */ @@ -972,6 +976,21 @@ static int hf_mip6_hb_seqnr = -1; static int hf_mip6_opt_3gpp_reserved = -1; static int hf_mip6_opt_3gpp_flag_m = -1; +static int hf_mip6_opt_3gpp_spec_pmipv6_err_code = -1; +static int hf_mip6_opt_3gpp_pdn_gw_ipv4_addr = -1; +static int hf_mip6_opt_3gpp_pdn_gw_ipv6_addr = -1; +static int hf_mip6_opt_3gpp_dhcpv4_addr_all_proc_ind = -1; +static int hf_mip6_opt_3gpp_pdn_type = -1; +static int hf_mip6_opt_3gpp_pdn_ind_cause = -1; +static int hf_mip6_opt_3gpp_chg_id = -1; +static int hf_mip6_opt_3gpp_charging_characteristic = -1; +static int hf_mip6_opt_3gpp_mei = -1; +static int hf_mip6_opt_3gpp_msisdn = -1; +static int hf_mip6_opt_3gpp_apn_rest = -1; +static int hf_mip6_opt_3gpp_max_apn_rest = -1; +static int hf_mip6_opt_3gpp_imsi = -1; +static int hf_mip6_opt_3gpp_pdn_conn_id = -1; +static int hf_hf_mip6_opt_3gpp_lapi = -1; static int hf_mip6_bra_interval = -1; @@ -1584,40 +1603,141 @@ dissect_mip6_opt_vsm_3gpp(const mip6_opt *optp _U_, tvbuff_t *tvb, int offset, guint optlen, packet_info *pinfo _U_, proto_tree *opt_tree, proto_item *hdr_item _U_ ) { int len = optlen; - guint8 sub_type; + guint8 sub_type, m_flag; + tvbuff_t *next_tvb; + const gchar *mei_str; + const char *digit_str; + gchar *mcc_mnc_str; + const gchar *imsi_str; /* offset points to the sub type */ sub_type = tvb_get_guint8(tvb,offset); proto_tree_add_item(opt_tree, hf_mip6_vsm_subtype_3gpp, tvb, offset, 1, ENC_BIG_ENDIAN); proto_item_append_text(hdr_item, " %s", val_to_str_ext_const(sub_type, &mip6_vsm_subtype_3gpp_value_ext, "<unknown>")); offset++; + m_flag = tvb_get_guint8(tvb,offset) & 0x01; proto_tree_add_item(opt_tree, hf_mip6_opt_3gpp_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(opt_tree, hf_mip6_opt_3gpp_flag_m, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* set len to the length of the data section */ len = optlen - 8; + + if(m_flag){ + proto_tree_add_text(opt_tree, tvb, offset, len, "Data fragment, handling not implemented yet"); + return; + } + + /* see 3GPP TS 29.275 version 10.5.0 Release 10 */ switch (sub_type) { - /* 1, "Protocol Configuration Options */ - /* 2, "3GPP Specific PMIPv6 Error Code */ - /* 3, "PMIPv6 PDN GW IP Address */ - /* 4, "PMIPv6 DHCPv4 Address Allocation Procedure Indication */ - /* 5, "PMIPv6 Fully Qualified PDN Connection Set Identifier */ - /* 6, "PMIPv6 PDN type indication */ - /* 7, "Charging ID */ - /* 8, "Selection Mode */ - /* 9, "I-WLAN Mobility Access Point Name (APN) */ - /* 10, "Charging Characteristics */ - /* 11, "Mobile Equipment Identity (MEI) */ - /* 12, "MSISDN */ - /* 13, "Serving Network */ - /* 14, "APN Restriction */ - /* 15, "Maximum APN Restriction */ - /* 16, "Unauthenticated IMSI */ - /* 17, "PDN Connection ID */ - /* 18, "PGW Back-Off Time */ - /* 19, "Signalling Priority Indication */ - /* 20, "Additional Protocol Configuration Options */ + /* 1, Protocol Configuration Options + * 3GPP PCO data, in the format from 3GPP TS 24.008 [16] subclause 10.5.6.3, starting with octet 3 + * de_sm_pco(tvb, tree, pinfo, 0, length, NULL, 0); + * Note needs pinfo->link_dir ? + */ + /* 2, 3GPP Specific PMIPv6 Error Code */ + case 2: + proto_tree_add_item(opt_tree, hf_mip6_opt_3gpp_spec_pmipv6_err_code, tvb, offset, 4, ENC_BIG_ENDIAN); + break; + /* 3, PMIPv6 PDN GW IP Address + * PDN GW IP address, as specified in subclause 12.1.1.4 + */ + case 3: + if(len == 4){ + /* Ipv4 address */ + proto_tree_add_item(opt_tree, hf_mip6_opt_3gpp_pdn_gw_ipv4_addr, tvb, offset, 4, ENC_BIG_ENDIAN); + }else if(len == 16){ + /* IPv6 address */ + proto_tree_add_item(opt_tree, hf_mip6_opt_3gpp_pdn_gw_ipv6_addr, tvb, offset, 16, ENC_BIG_ENDIAN); + } + break; + /* 4, PMIPv6 DHCPv4 Address Allocation Procedure Indication + * DHCPv4 Address Allocation Procedure Indication, as specified in subclause 12.1.1.5 + */ + case 4: + proto_tree_add_item(opt_tree, hf_mip6_opt_3gpp_dhcpv4_addr_all_proc_ind, tvb, offset, 1, ENC_BIG_ENDIAN); + break; + /* 5, PMIPv6 Fully Qualified PDN Connection Set Identifier + * FQ-CSID as specified in subclause 12.1.1.2 + */ + case 5: + next_tvb = tvb_new_subset(tvb, offset, len, len); + dissect_gtpv2_fq_csid(next_tvb, pinfo, opt_tree, hdr_item, len, 0, 0); + break; + /* 6, PMIPv6 PDN type indication */ + case 6: + proto_tree_add_item(opt_tree, hf_mip6_opt_3gpp_pdn_type, tvb, offset, 1, ENC_BIG_ENDIAN); + offset++; + proto_tree_add_item(opt_tree, hf_mip6_opt_3gpp_pdn_ind_cause, tvb, offset, 1, ENC_BIG_ENDIAN); + break; + /* 7, Charging ID + * Charging ID as specified in subclause 12.1.1.6 + */ + case 7: + proto_tree_add_item(opt_tree, hf_mip6_opt_3gpp_chg_id, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_item_append_text(hdr_item, " %u", tvb_get_ntohl(tvb, offset)); + break; + /* 8, Selection Mode */ + case 8: + next_tvb = tvb_new_subset(tvb, offset, len, len); + dissect_gtpv2_selec_mode(next_tvb, pinfo, opt_tree, hdr_item, len, 0, 0); + break; + /* 9, I-WLAN Mobility Access Point Name (APN) */ + /* 10, Charging Characteristics */ + case 10: + proto_tree_add_item(opt_tree, hf_mip6_opt_3gpp_charging_characteristic, tvb, offset, 2, ENC_BIG_ENDIAN); + break; + /* 11, Mobile Equipment Identity (MEI) */ + case 11: + mei_str = tvb_bcd_dig_to_ep_str( tvb, offset, len, NULL, FALSE); + proto_tree_add_string(opt_tree, hf_mip6_opt_3gpp_mei, tvb, offset, len, mei_str); + proto_item_append_text(hdr_item, " %s", mei_str); + break; + /* 12, MSISDN */ + case 12: + dissect_e164_cc(tvb, opt_tree, offset, TRUE); + digit_str = tvb_bcd_dig_to_ep_str( tvb, offset, len, NULL, FALSE); + proto_tree_add_string(opt_tree, hf_mip6_opt_3gpp_msisdn, tvb, offset, len, digit_str); + proto_item_append_text(hdr_item, " %s", digit_str); + break; + /* 13, Serving Network */ + case 13: + mcc_mnc_str = dissect_e212_mcc_mnc_ep_str(tvb, pinfo, opt_tree, offset, TRUE); + proto_item_append_text(hdr_item," %s", mcc_mnc_str); + break; + /* 14, APN Restriction */ + case 14: + proto_tree_add_item(opt_tree, hf_mip6_opt_3gpp_apn_rest, tvb, offset, 1, ENC_BIG_ENDIAN); + break; + /* 15, Maximum APN Restriction */ + case 15: + proto_tree_add_item(opt_tree, hf_mip6_opt_3gpp_max_apn_rest, tvb, offset, 1, ENC_BIG_ENDIAN); + break; + /* 16, Unauthenticated IMSI */ + case 16: + imsi_str = tvb_bcd_dig_to_ep_str( tvb, offset, len, NULL, FALSE); + proto_tree_add_string(opt_tree, hf_mip6_opt_3gpp_imsi, tvb, offset, len, imsi_str); + proto_item_append_text(hdr_item," %s", imsi_str); + break; + /* 17, PDN Connection ID */ + case 17: + proto_tree_add_item(opt_tree, hf_mip6_opt_3gpp_pdn_conn_id, tvb, offset, 1, ENC_BIG_ENDIAN); + break; + /* 18, PGW Back-Off Time */ + case 18: + next_tvb = tvb_new_subset(tvb, offset, len, len); + dissect_gtpv2_epc_timer(next_tvb, pinfo, opt_tree, hdr_item, len, 0, 0); + break; + /* 19, Signalling Priority Indication */ + case 19: + proto_tree_add_item(opt_tree, hf_hf_mip6_opt_3gpp_lapi, tvb, offset, 1, ENC_BIG_ENDIAN); + break; + /* 20, Additional Protocol Configuration Options + * 12.1.1.19 Additional Protocol Configuration Options + * The Additional Protocol Configuration Options IE contains additional 3GPP protocol configuration options + * information. The IE is in the same format as the PCO IE specified in 3GPP TS 24.008 [16] subclause 10.5.6.3, starting + * with octet 3. + */ default: proto_tree_add_text(opt_tree, tvb, offset, len, "Data(Not dissected yet)"); break; @@ -3610,8 +3730,83 @@ proto_register_mip6(void) FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, + { &hf_mip6_opt_3gpp_spec_pmipv6_err_code, + { "3GPP Specific PMIPv6 Error Code", "mip6.3gpp.spec_pmipv6_err_code", + FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_cause_vals_ext, 0x0, + "GTPv2 Cause values", HFILL } + }, + { &hf_mip6_opt_3gpp_pdn_gw_ipv4_addr, + { "PDN GW IPv4 address", "mip6.3gpp.pdn_gw_ipv4_addr", + FT_IPv4, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_mip6_opt_3gpp_pdn_gw_ipv6_addr, + { "PDN GW IPv6 address", "mip6.3gpp.pdn_gw_ipv6_addr", + FT_IPv6, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_mip6_opt_3gpp_dhcpv4_addr_all_proc_ind, + { "DHCPv4 Address Allocation Procedure Indication", "mip6.3gpp.dhcpv4_addr_all_proc_ind", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_mip6_opt_3gpp_pdn_type, + { "PDN type", "mip6.3gpp.pdn_type", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_mip6_opt_3gpp_pdn_ind_cause, + { "Cause", "mip6.3gpp.pdn_ind_cause", + FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_cause_vals_ext, 0x0, + "GTPv2 Cause values", HFILL } + }, + { &hf_mip6_opt_3gpp_chg_id, + { "Charging ID", "mip6.3gpp.chg_id", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_mip6_opt_3gpp_charging_characteristic, + {"Charging Characteristic", "mip6.3gpp.charging_characteristic", + FT_UINT16, BASE_HEX, NULL, 0xffff, + NULL, HFILL} + }, + { &hf_mip6_opt_3gpp_mei, + {"Mobile Equipment Identity (MEI)", "mip6.3gpp.mei", + FT_STRING, BASE_NONE, NULL, 0, + NULL, HFILL} + }, + { &hf_mip6_opt_3gpp_msisdn, + {"MSISDN", "mip6.3gpp.msisdn", + FT_STRING, BASE_NONE, NULL, 0, + NULL, HFILL} + }, + { &hf_mip6_opt_3gpp_apn_rest, + { "APN Restriction", "mip6.3gpp.apn_rest", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_mip6_opt_3gpp_max_apn_rest, + { "Maximum APN Restriction", "mip6.3gpp.max_apn_rest", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_mip6_opt_3gpp_imsi, + {"Unauthenticated IMSI", "mip6.3gpp.imsi", + FT_STRING, BASE_NONE, NULL, 0, + NULL, HFILL} + }, + { &hf_mip6_opt_3gpp_pdn_conn_id, + { "PDN Connection ID", "mip6.3gpp.pdn_conn_id", + FT_UINT8, BASE_DEC, NULL, 0x0f, + NULL, HFILL } + }, + { &hf_hf_mip6_opt_3gpp_lapi, + {"LAPI (Low Access Priority Indication)", "mip6.3gpp.lapi", + FT_BOOLEAN, 8, NULL, 0x01, + NULL, HFILL} + }, - { &hf_mip6_bra_interval, + { &hf_mip6_bra_interval, { "Refresh interval", "mip6.bra.interval", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } |