diff --git a/lib/gtp/gtp_tlv.c b/lib/gtp/gtp_tlv.c index e31caeb72..7ea0ed3f0 100644 --- a/lib/gtp/gtp_tlv.c +++ b/lib/gtp/gtp_tlv.c @@ -26,7 +26,7 @@ /******************************************************************************* * This file had been created by gtp_tlv.py script v0.1.0 * Please do not modify this file but regenerate it via script. - * Created on: 2017-03-29 19:27:19.284563 by acetcom + * Created on: 2017-03-31 09:04:32.632717 by acetcom * from 29274-d80.docx ******************************************************************************/ @@ -1718,6 +1718,38 @@ tlv_desc_t tlv_desc_load_control_information_0 = } }; +tlv_desc_t tlv_desc_load_control_information_1 = +{ + TLV_COMPOUND, + "Load Control Information", + TLV_LOAD_CONTROL_INFORMATION_TYPE, + 0, + 1, + sizeof(tlv_load_control_information_t), + { + &tlv_desc_sequence_number_0, + &tlv_desc_metric_0, + &tlv_desc_apn_and_relative_capacity_0, + NULL, + } +}; + +tlv_desc_t tlv_desc_load_control_information_2 = +{ + TLV_COMPOUND, + "Load Control Information", + TLV_LOAD_CONTROL_INFORMATION_TYPE, + 0, + 2, + sizeof(tlv_load_control_information_t), + { + &tlv_desc_sequence_number_0, + &tlv_desc_metric_0, + &tlv_desc_apn_and_relative_capacity_0, + NULL, + } +}; + tlv_desc_t tlv_desc_remote_ue_context_0 = { TLV_COMPOUND, @@ -1835,6 +1867,47 @@ tlv_desc_t tlv_desc_create_session_request = NULL, }}; +tlv_desc_t tlv_desc_create_session_response = +{ + TLV_MESSAGE, + "Create Session Response", + 0, 0, 0, 0, { + &tlv_desc_cause_0, + &tlv_desc_change_reporting_action_0, + &tlv_desc_csg_information_reporting_action_0, + &tlv_desc_enb_information_reporting_0, + &tlv_desc_f_teid_0, + &tlv_desc_f_teid_1, + &tlv_desc_paa_0, + &tlv_desc_apn_restriction_0, + &tlv_desc_ambr_0, + &tlv_desc_ebi_0, + &tlv_desc_pco_0, + &tlv_desc_bearer_context_0, + &tlv_desc_bearer_context_1, + &tlv_desc_recovery_0, + &tlv_desc_fqdn_0, + &tlv_desc_ip_address_0, + &tlv_desc_fq_csid_0, + &tlv_desc_fq_csid_1, + &tlv_desc_ldn_0, + &tlv_desc_ldn_1, + &tlv_desc_epc_timer_0, + &tlv_desc_apco_0, + &tlv_desc_ip4cp_0, + &tlv_desc_indication_0, + &tlv_desc_presence_reporting_area_action_0, + &tlv_desc_load_control_information_0, + &tlv_desc_load_control_information_1, + &tlv_desc_load_control_information_2, + &tlv_desc_overload_control_information_0, + &tlv_desc_overload_control_information_1, + &tlv_desc_f_container_0, + &tlv_desc_charging_id_0, + &tlv_desc_epco_0, + NULL, +}}; + status_t gtp_parse_msg( c_uint8_t type, gtp_message_t *gtp_message, pkbuf_t *pkbuf) @@ -1856,6 +1929,10 @@ status_t gtp_parse_msg( rv = tlv_parse_msg(>p_message->create_session_request, &tlv_desc_create_session_request, pkbuf, TLV_MODE_T1_L2_I1); break; + case GTP_CREATE_SESSION_RESPONSE_TYPE: + rv = tlv_parse_msg(>p_message->create_session_response, + &tlv_desc_create_session_response, pkbuf, TLV_MODE_T1_L2_I1); + break; default: d_warn("Not implmeneted(type:%d)", type); break; diff --git a/lib/gtp/gtp_tlv.h b/lib/gtp/gtp_tlv.h index 3594ac60e..027e5b2c4 100644 --- a/lib/gtp/gtp_tlv.h +++ b/lib/gtp/gtp_tlv.h @@ -26,7 +26,7 @@ /******************************************************************************* * This file had been created by gtp_tlv.py script v0.1.0 * Please do not modify this file but regenerate it via script. - * Created on: 2017-03-29 19:27:19.270396 by acetcom + * Created on: 2017-03-31 09:04:32.623628 by acetcom * from 29274-d80.docx ******************************************************************************/ @@ -365,6 +365,8 @@ extern tlv_desc_t tlv_desc_overload_control_information_0; extern tlv_desc_t tlv_desc_overload_control_information_1; extern tlv_desc_t tlv_desc_overload_control_information_2; extern tlv_desc_t tlv_desc_load_control_information_0; +extern tlv_desc_t tlv_desc_load_control_information_1; +extern tlv_desc_t tlv_desc_load_control_information_2; extern tlv_desc_t tlv_desc_remote_ue_context_0; extern tlv_desc_t tlv_desc_scef_pdn_connection_0; @@ -675,11 +677,48 @@ typedef struct _gtp_create_session_request_t { tlv_port_number_t ue_tcp_port; } gtp_create_session_request_t; +typedef struct _gtp_create_session_response_t { + tlv_cause_t cause; + tlv_change_reporting_action_t change_reporting_action_; + tlv_csg_information_reporting_action_t csg_information_reporting_action; + tlv_enb_information_reporting_t hnb_information_reporting; + tlv_f_teid_t sender_f_teid_for_control_plane; + tlv_f_teid_t pgw_s5_s8__s2a_s2b_f_teid_for_pmip_based_interface_or_for_gtp_based_control_plane_interface; + tlv_paa_t pdn_address_allocation; + tlv_apn_restriction_t apn_restriction; + tlv_ambr_t aggregate_maximum_bit_rate; + tlv_ebi_t linked_eps_bearer_id; + tlv_pco_t protocol_configuration_options; + tlv_bearer_context_t bearer_contexts_created; + tlv_bearer_context_t bearer_contexts_marked_for_removal; + tlv_recovery_t recovery; + tlv_fqdn_t charging_gateway_name; + tlv_ip_address_t charging_gateway_address; + tlv_fq_csid_t pgw_fq_csid; + tlv_fq_csid_t sgw_fq_csid; + tlv_ldn_t sgw_ldn; + tlv_ldn_t pgw_ldn; + tlv_epc_timer_t pgw_back_off_time; + tlv_apco_t additional_protocol_configuration_options; + tlv_ip4cp_t trusted_wlan_ipv4_parameters_; + tlv_indication_t indication_flags; + tlv_presence_reporting_area_action_t presence_reporting_area_action; + tlv_load_control_information_t pgw_s_node_level_load_control_information; + tlv_load_control_information_t pgw_s_apn_level_load_control_information; + tlv_load_control_information_t sgw_s_node_level_load_control_information; + tlv_overload_control_information_t pgw_s_overload_control_information; + tlv_overload_control_information_t sgw_s_overload_control_information; + tlv_f_container_t nbifom_container; + tlv_charging_id_t pdn_connection_charging_id; + tlv_epco_t extended_protocol_configuration_options; +} gtp_create_session_response_t; + typedef struct _gtp_message_t { union { gtp_echo_request_t echo_request; gtp_echo_response_t echo_response; gtp_create_session_request_t create_session_request; + gtp_create_session_response_t create_session_response; }; } gtp_message_t; diff --git a/lib/gtp/support/29274-d80.docx b/lib/gtp/support/29274-d80.docx index cd18ebd39..6f98762f9 100644 Binary files a/lib/gtp/support/29274-d80.docx and b/lib/gtp/support/29274-d80.docx differ diff --git a/lib/gtp/support/cache/tlv_msg_32.py b/lib/gtp/support/cache/tlv_msg_32.py index f9c8de985..1046fbaf2 100644 --- a/lib/gtp/support/cache/tlv_msg_32.py +++ b/lib/gtp/support/cache/tlv_msg_32.py @@ -18,12 +18,10 @@ ies.append({ "ie_type" : "EBI", "ie_value" : "Linked EPS Bearer ID", "presence" ies.append({ "ie_type" : "TWMI", "ie_value" : "Trusted WLAN Mode Indication", "presence" : "CO", "instance" : "0", "comment" : "The TWAN shall include this IE on S2a interface (during initial attach, handover to TWAN with GTP on S2a procedure, UE-initiated additional PDN connectivity procedures), if the single-connection mode or multiple-connection mode is used.The TWAN shall not include this IE if transparent single-connection mode is used. The PGW shall assume that transparent single-connection mode is used if it receives this message without this IE from the TWAN."}) ies.append({ "ie_type" : "PCO", "ie_value" : "Protocol Configuration Options", "presence" : "C", "instance" : "0", "comment" : "If MME/SGSN receives PCO from the UE during the Attach, PDN connectivity or Handover to 3GPP access procedures, the MME/SGSN shall forward the PCO IE to SGW. The SGW shall also forward it to PGW."}) ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Contexts to be created", "presence" : "M", "instance" : "0", "comment" : "S Several IEs with the same type and instance value shall be included on the S4/S11 and S5/S8 interfaces as necessary to represent a list of Bearers. One single IE shall be included on the S2a/S2b interface.One bearer shall be included for E-UTRAN Initial Attach, PDP Context Activation, UE requested PDN Connectivity, Attach with GTP on S2b, UE initiated Connectivity to Additional PDN with GTP on S2b, Handovers between Untrusted Non-3GPP IP Access with GTP on S2b and 3GPP Access, Initial Attach for emergency session (GTP on S2b), Initial Attach in WLAN on GTP S2a, Handovers between TWAN with GTP on S2a and 3GPP Access and UE initiated Connectivity to Additional PDN with GTP on S2a.One or more bearers shall be included for a Handover/TAU/RAU with an SGW change. See NOTE 6 and NOTE 7."}) -type_list["Bearer Context"]["max_instance"] = "1" ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Contexts to be removed", "presence" : "C", "instance" : "1", "comment" : "This IE shall be included on the S4/S11 interfaces for the TAU/RAU/Handover cases where any of the bearers existing before the TAU/RAU/Handover procedure will be deactivated as consequence of the TAU/RAU/Handover procedure.For each of those bearers, an IE with the same type and instance value shall be included.See NOTE 6 and NOTE 7."}) ies.append({ "ie_type" : "Trace Information", "ie_value" : "Trace Information", "presence" : "C", "instance" : "0", "comment" : "This IE shall be included on the S4/S11 interface if an SGW trace is activated, and/or on the S5/S8 and S2a/2b interfaces if a PGW trace is activated. See 3GPP TS 32.422 [18]."}) ies.append({ "ie_type" : "Recovery", "ie_value" : "Recovery", "presence" : "C", "instance" : "0", "comment" : "This IE shall be included on the S4/S11, S5/S8 and S S2a/2b interfaces if contacting the peer node for the first time."}) ies.append({ "ie_type" : "FQ-CSID", "ie_value" : "MME-FQ-CSID", "presence" : "C", "instance" : "0", "comment" : "This IE shall be included by the MME on the S11 interface and shall be forwarded by an SGW on the S5/S8 interfaces according to the requirements in 3GPP TS 23.007 [17]."}) -type_list["FQ-CSID"]["max_instance"] = "1" ies.append({ "ie_type" : "FQ-CSID", "ie_value" : "SGW-FQ-CSID", "presence" : "C", "instance" : "1", "comment" : "This IE shall included by the SGW on the S5/S8 interfaces according to the requirements in 3GPP TS 23.007 [17]."}) type_list["FQ-CSID"]["max_instance"] = "2" ies.append({ "ie_type" : "FQ-CSID", "ie_value" : "ePDG-FQ-CSID", "presence" : "C", "instance" : "2", "comment" : "This IE shall be included by the ePDG on the S2b interface according to the requirements in 3GPP TS 23.007 [17]."}) @@ -33,7 +31,6 @@ ies.append({ "ie_type" : "UE Time Zone", "ie_value" : "UE Time Zone", "presence" ies.append({ "ie_type" : "UCI", "ie_value" : "User CSG Information", "presence" : "CO", "instance" : "0", "comment" : "This IE shall be included on the S4/S11 interface for E-UTRAN Initial Attach, a Handover from Trusted or Untrusted Non-3GPP IP Access to E-UTRAN, UE-requested PDN Connectivity, PDP Context Activation and a Handover from Trusted or Untrusted Non-3GPP IP Access to UTRAN using S4 procedures, if the UE is accessed via CSG cell or hybrid cell. The MME/SGSN shall also include it for TAU/RAU/Handover procedures with SGW relocation if the UE is accessed via a CSG cell or hybrid cell or leaves a CSG or hybrid cell and the PGW/PCRF has requested CSG info reporting and MME/SGSN support CSG info reporting. NOTE 11.The SGW shall include this IE on S5/S8 if it receives the User CSG information from MME/SGSN.See NOTE 10."}) ies.append({ "ie_type" : "Charging Characteristics", "ie_value" : "Charging Characteristics", "presence" : "C", "instance" : "0", "comment" : "This IE shall be included on the S4/S11, S5/S8 and S2a/S2b interfaces according to 3GPP TS 32.251 [8]"}) ies.append({ "ie_type" : "LDN", "ie_value" : "MME/S4-SGSN LDN", "presence" : "O", "instance" : "0", "comment" : "This IE is optionally sent by the MME to the SGW on the S11 interface and by the S4-SGSN to the SGW on the S4 interface (see 3GPP TS 32.423 [44]), when communicating the LDN to the peer node for the first time."}) -type_list["LDN"]["max_instance"] = "1" ies.append({ "ie_type" : "LDN", "ie_value" : "SGW LDN", "presence" : "O", "instance" : "1", "comment" : "This IE is optionally sent by the SGW to the PGW on the S5/S8 interfaces (see 3GPP TS 32.423 [44]), when communicating the LDN to the peer node for the first time."}) type_list["LDN"]["max_instance"] = "2" ies.append({ "ie_type" : "LDN", "ie_value" : "ePDG LDN", "presence" : "O", "instance" : "2", "comment" : "This IE is optionally sent by the ePDG to the PGW on the S2b interfaces (see 3GPP TS 32.423 [44]), when contacting the peer node for the first time. "}) @@ -55,7 +52,6 @@ ies.append({ "ie_type" : "IP Address", "ie_value" : "ePDG IP Address", "presence ies.append({ "ie_type" : "CN Operator Selection Entity", "ie_value" : "CN Operator Selection Entity", "presence" : "CO", "instance" : "0", "comment" : "In shared networks, the SGSN shall include this IE on the S4 interface for a PDP Context Activation, a Handover from Trusted or Untrusted Non-3GPP IP Access to UTRAN/GERAN and RAU with SGW relocation procedures, if the information is available, to indicate whether the Serving Network has been selected by the UE or by the network."}) ies.append({ "ie_type" : "Presence Reporting Area Information", "ie_value" : "Presence Reporting Area Information", "presence" : "CO", "instance" : "0", "comment" : "The MME/SGSN shall include this IE in the following procedures, if the PGW/PCRF requested reporting changes of UE presence in a Presence Reporting Area and the MME/SGSN supports such reporting:- TAU/RAU/Handover procedures with SGW relocation and MME/SGSN change. The new MME/SGSN shall then indicate whether the UE is inside or outside the Presence Reporting Area; - TAU/RAU/Handover procedures with SGW relocation and without MME/SGSN change, if the UE enters or leaves the Presence Reporting Area."}) ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "MME/S4-SGSN's Overload Control Information", "presence" : "O", "instance" : "0", "comment" : "During an overload condition, the MME/S4-SGSN may include this IE on the S11/S4 interface if the overload control feature is supported by the MME/S4-SGSN and is activated for the PLMN to which the PGW belongs (see clause 12.3.11).When present, the MME/S4-SGSN shall provide only one instance of this IE, representing its overload information."}) -type_list["Overload Control Information"]["max_instance"] = "1" ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "SGW's Overload Control Information", "presence" : "O", "instance" : "1", "comment" : "During an overload condition, the SGW may include this IE over the S5/S8 interface if the overload control feature is supported by the SGW and is activated for the PLMN to which the PGW belongs (see clause 12.3.11).When present, the SGW shall provide only one instance of this IE, representing its overload information."}) type_list["Overload Control Information"]["max_instance"] = "2" ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "TWAN/ePDG's Overload Control Information", "presence" : "O", "instance" : "2", "comment" : "During an overload condition, the TWAN/ePDG may include this IE over the S2a/S2b interface if the overload control feature is supported by the TWAN/ePDG and is activated for the PLMN to which the PGW belongs (see clause 12.3.11).When present, the TWAN/ePDG shall provide only one instance of this IE, representing its overload information."}) diff --git a/lib/gtp/support/gtp_tlv.py b/lib/gtp/support/gtp_tlv.py index b2be3d3fe..161b732de 100644 --- a/lib/gtp/support/gtp_tlv.py +++ b/lib/gtp/support/gtp_tlv.py @@ -119,6 +119,10 @@ def get_cells(cells): ie_type = 'APCO' elif ie_type.find('Charging Id') != -1: ie_type = 'Charging ID' + elif ie_type.find('H(e)NB Information Reporting') != -1: + ie_type = 'eNB Information Reporting' + elif ie_type.find('IPv4 Configuration Parameters (IP4CP)') != -1: + ie_type = 'IP4CP' if ie_type not in type_list.keys(): assert False, "Unknown IE type : [" \ + cells[3].text + "]" + "(" + ie_type + ")" @@ -311,6 +315,7 @@ else: msg_list["Echo Request"]["table"] = 6 msg_list["Echo Response"]["table"] = 7 msg_list["Create Session Request"]["table"] = 8 +msg_list["Create Session Response"]["table"] = 13 for key in msg_list.keys(): if "table" in msg_list[key].keys(): diff --git a/lib/nas/nas_decoder.c b/lib/nas/nas_decoder.c index e6e0ecca3..9cc34f6cb 100644 --- a/lib/nas/nas_decoder.c +++ b/lib/nas/nas_decoder.c @@ -26,7 +26,7 @@ /******************************************************************************* * This file had been created by gtpv2c_tlv.py script v0.1.0 * Please do not modify this file but regenerate it via script. - * Created on: 2017-03-24 21:13:36.102034 by acetcom + * Created on: 2017-03-31 08:55:14.436967 by acetcom * from 24301-d80.docx ******************************************************************************/ diff --git a/lib/nas/nas_encoder.c b/lib/nas/nas_encoder.c index d4bc16bc6..255952969 100644 --- a/lib/nas/nas_encoder.c +++ b/lib/nas/nas_encoder.c @@ -26,7 +26,7 @@ /******************************************************************************* * This file had been created by gtpv2c_tlv.py script v0.1.0 * Please do not modify this file but regenerate it via script. - * Created on: 2017-03-24 21:13:36.106370 by acetcom + * Created on: 2017-03-31 08:55:14.443538 by acetcom * from 24301-d80.docx ******************************************************************************/ diff --git a/lib/nas/nas_ies.c b/lib/nas/nas_ies.c index 0998a9252..4127450c9 100644 --- a/lib/nas/nas_ies.c +++ b/lib/nas/nas_ies.c @@ -26,7 +26,7 @@ /******************************************************************************* * This file had been created by gtpv2c_tlv.py script v0.1.0 * Please do not modify this file but regenerate it via script. - * Created on: 2017-03-24 21:13:36.092455 by acetcom + * Created on: 2017-03-31 08:55:14.424942 by acetcom * from 24301-d80.docx ******************************************************************************/ diff --git a/lib/nas/nas_ies.h b/lib/nas/nas_ies.h index d88ebeab9..02f7fd1aa 100644 --- a/lib/nas/nas_ies.h +++ b/lib/nas/nas_ies.h @@ -26,7 +26,7 @@ /******************************************************************************* * This file had been created by gtpv2c_tlv.py script v0.1.0 * Please do not modify this file but regenerate it via script. - * Created on: 2017-03-24 21:13:36.089288 by acetcom + * Created on: 2017-03-31 08:55:14.422134 by acetcom * from 24301-d80.docx ******************************************************************************/ diff --git a/lib/nas/nas_message.h b/lib/nas/nas_message.h index 7093ab1b2..93364fe43 100644 --- a/lib/nas/nas_message.h +++ b/lib/nas/nas_message.h @@ -26,7 +26,7 @@ /******************************************************************************* * This file had been created by gtpv2c_tlv.py script v0.1.0 * Please do not modify this file but regenerate it via script. - * Created on: 2017-03-24 21:13:36.097866 by acetcom + * Created on: 2017-03-31 08:55:14.430326 by acetcom * from 24301-d80.docx ******************************************************************************/ diff --git a/lib/nas/support/nas_message.py b/lib/nas/support/nas_message.py index 6cb1518cf..85b4c07f5 100644 --- a/lib/nas/support/nas_message.py +++ b/lib/nas/support/nas_message.py @@ -37,6 +37,7 @@ verbosity = 0 filename = "" outdir = './' cachedir = './cache/' +currentdir = './' FAIL = '\033[91m' INFO = '\033[93m' @@ -276,10 +277,10 @@ for (k, v) in sorted_msg_list: type_list[key] = { "reference" : ie["reference"], "presence" : ie["presence"], "format" : ie["format"], "length" : ie["length"], "message" : k, "value" : ie["value"] } d_info("[Type List]") -cachefile = cachedir + "type_list.py" -if os.path.isfile(cachefile) and os.access(cachefile, os.R_OK): - execfile(cachefile) - print "Read from " + cachefile +typefile = currentdir + "type_list.py" +if os.path.isfile(typefile) and os.access(typefile, os.R_OK): + execfile(typefile) + print "Read from " + typefile tmp = [(k, v["reference"]) for k, v in type_list.items()] sorted_type_list = sorted(tmp, key=lambda tup: tup[1]) diff --git a/lib/nas/support/cache/type_list.py b/lib/nas/support/type_list.py similarity index 100% rename from lib/nas/support/cache/type_list.py rename to lib/nas/support/type_list.py