forked from acouzens/open5gs
update it
This commit is contained in:
parent
281718e3e0
commit
b1f84eed5d
|
@ -26,10 +26,11 @@
|
|||
/*******************************************************************************
|
||||
* 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-24 23:41:03.992079 by acetcom
|
||||
* Created on: 2017-03-29 19:27:19.284563 by acetcom
|
||||
* from 29274-d80.docx
|
||||
******************************************************************************/
|
||||
|
||||
#include "core_debug.h"
|
||||
#include "gtp_tlv.h"
|
||||
|
||||
tlv_desc_t tlv_desc_imsi_0 =
|
||||
|
@ -1768,14 +1769,6 @@ tlv_desc_t tlv_desc_echo_response =
|
|||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_version_not_supported_indication =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Version Not Supported Indication",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_create_session_request =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
|
@ -1842,396 +1835,32 @@ tlv_desc_t tlv_desc_create_session_request =
|
|||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_create_session_response =
|
||||
|
||||
status_t gtp_parse_msg(
|
||||
c_uint8_t type, gtp_message_t *gtp_message, pkbuf_t *pkbuf)
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Create Session Response",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_modify_bearer_request =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Modify Bearer Request",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_modify_bearer_response =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Modify Bearer Response",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_delete_session_request =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Delete Session Request",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_delete_session_response =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Delete Session Response",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_change_notification_request =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Change Notification Request",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_change_notification_response =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Change Notification Response",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_remote_ue_report_notification =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Remote UE Report Notification",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_remote_ue_report_acknowledge =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Remote UE Report Acknowledge",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_modify_bearer_command =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Modify Bearer Command",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_modify_bearer_failure_indication =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Modify Bearer Failure Indication",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_delete_bearer_command =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Delete Bearer Command",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_delete_bearer_failure_indication =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Delete Bearer Failure Indication",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_bearer_resource_command =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Bearer Resource Command",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_bearer_resource_failure_indication =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Bearer Resource Failure Indication",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_downlink_data_notification_failure_indication =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Downlink Data Notification Failure Indication",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_trace_session_activation =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Trace Session Activation",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_trace_session_deactivation =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Trace Session Deactivation",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_stop_paging_indication =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Stop Paging Indication",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_create_bearer_request =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Create Bearer Request",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_create_bearer_response =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Create Bearer Response",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_update_bearer_request =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Update Bearer Request",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_update_bearer_response =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Update Bearer Response",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_delete_bearer_request =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Delete Bearer Request",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_delete_bearer_response =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Delete Bearer Response",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_delete_pdn_connection_set_request =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Delete PDN Connection Set Request",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_delete_pdn_connection_set_response =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Delete PDN Connection Set Response",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_pgw_downlink_triggering_notification =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"PGW Downlink Triggering Notification",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_pgw_downlink_triggering_acknowledge =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"PGW Downlink Triggering Acknowledge",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_create_forwarding_tunnel_request =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Create Forwarding Tunnel Request",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_create_forwarding_tunnel_response =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Create Forwarding Tunnel Response",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_suspend_notification =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Suspend Notification",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_suspend_acknowledge =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Suspend Acknowledge",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_resume_notification =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Resume Notification",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_resume_acknowledge =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Resume Acknowledge",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_create_indirect_data_forwarding_tunnel_request =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Create Indirect Data Forwarding Tunnel Request",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_create_indirect_data_forwarding_tunnel_response =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Create Indirect Data Forwarding Tunnel Response",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_delete_indirect_data_forwarding_tunnel_request =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Delete Indirect Data Forwarding Tunnel Request",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_delete_indirect_data_forwarding_tunnel_response =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Delete Indirect Data Forwarding Tunnel Response",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_release_access_bearers_request =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Release Access Bearers Request",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_release_access_bearers_response =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Release Access Bearers Response",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_downlink_data_notification =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Downlink Data Notification",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_downlink_data_notification_acknowledge =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Downlink Data Notification Acknowledge",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_pgw_restart_notification =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"PGW Restart Notification",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_pgw_restart_notification_acknowledge =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"PGW Restart Notification Acknowledge",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_update_pdn_connection_set_request =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Update PDN Connection Set Request",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_update_pdn_connection_set_response =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Update PDN Connection Set Response",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_modify_access_bearers_request =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Modify Access Bearers Request",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
|
||||
tlv_desc_t tlv_desc_modify_access_bearers_response =
|
||||
{
|
||||
TLV_MESSAGE,
|
||||
"Modify Access Bearers Response",
|
||||
0, 0, 0, 0, {
|
||||
NULL,
|
||||
}};
|
||||
status_t rv = CORE_ERROR;
|
||||
|
||||
memset(gtp_message, 0, sizeof(gtp_message_t));
|
||||
switch(type)
|
||||
{
|
||||
case GTP_ECHO_REQUEST_TYPE:
|
||||
rv = tlv_parse_msg(>p_message->echo_request,
|
||||
&tlv_desc_echo_request, pkbuf, TLV_MODE_T1_L2_I1);
|
||||
break;
|
||||
case GTP_ECHO_RESPONSE_TYPE:
|
||||
rv = tlv_parse_msg(>p_message->echo_response,
|
||||
&tlv_desc_echo_response, pkbuf, TLV_MODE_T1_L2_I1);
|
||||
break;
|
||||
case GTP_CREATE_SESSION_REQUEST_TYPE:
|
||||
rv = tlv_parse_msg(>p_message->create_session_request,
|
||||
&tlv_desc_create_session_request, pkbuf, TLV_MODE_T1_L2_I1);
|
||||
break;
|
||||
default:
|
||||
d_warn("Not implmeneted(type:%d)", type);
|
||||
break;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
@ -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-24 23:41:03.983123 by acetcom
|
||||
* Created on: 2017-03-29 19:27:19.270396 by acetcom
|
||||
* from 29274-d80.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -614,9 +614,6 @@ typedef struct _gtp_echo_response_t {
|
|||
tlv_node_features_t sending_node_features;
|
||||
} gtp_echo_response_t;
|
||||
|
||||
typedef struct _gtp_version_not_supported_indication_t {
|
||||
} gtp_version_not_supported_indication_t;
|
||||
|
||||
typedef struct _gtp_create_session_request_t {
|
||||
tlv_imsi_t imsi;
|
||||
tlv_msisdn_t msisdn;
|
||||
|
@ -678,152 +675,16 @@ 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 {
|
||||
} 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_message_t;
|
||||
|
||||
typedef struct _gtp_modify_bearer_request_t {
|
||||
} gtp_modify_bearer_request_t;
|
||||
|
||||
typedef struct _gtp_modify_bearer_response_t {
|
||||
} gtp_modify_bearer_response_t;
|
||||
|
||||
typedef struct _gtp_delete_session_request_t {
|
||||
} gtp_delete_session_request_t;
|
||||
|
||||
typedef struct _gtp_delete_session_response_t {
|
||||
} gtp_delete_session_response_t;
|
||||
|
||||
typedef struct _gtp_change_notification_request_t {
|
||||
} gtp_change_notification_request_t;
|
||||
|
||||
typedef struct _gtp_change_notification_response_t {
|
||||
} gtp_change_notification_response_t;
|
||||
|
||||
typedef struct _gtp_remote_ue_report_notification_t {
|
||||
} gtp_remote_ue_report_notification_t;
|
||||
|
||||
typedef struct _gtp_remote_ue_report_acknowledge_t {
|
||||
} gtp_remote_ue_report_acknowledge_t;
|
||||
|
||||
typedef struct _gtp_modify_bearer_command_t {
|
||||
} gtp_modify_bearer_command_t;
|
||||
|
||||
typedef struct _gtp_modify_bearer_failure_indication_t {
|
||||
} gtp_modify_bearer_failure_indication_t;
|
||||
|
||||
typedef struct _gtp_delete_bearer_command_t {
|
||||
} gtp_delete_bearer_command_t;
|
||||
|
||||
typedef struct _gtp_delete_bearer_failure_indication_t {
|
||||
} gtp_delete_bearer_failure_indication_t;
|
||||
|
||||
typedef struct _gtp_bearer_resource_command_t {
|
||||
} gtp_bearer_resource_command_t;
|
||||
|
||||
typedef struct _gtp_bearer_resource_failure_indication_t {
|
||||
} gtp_bearer_resource_failure_indication_t;
|
||||
|
||||
typedef struct _gtp_downlink_data_notification_failure_indication_t {
|
||||
} gtp_downlink_data_notification_failure_indication_t;
|
||||
|
||||
typedef struct _gtp_trace_session_activation_t {
|
||||
} gtp_trace_session_activation_t;
|
||||
|
||||
typedef struct _gtp_trace_session_deactivation_t {
|
||||
} gtp_trace_session_deactivation_t;
|
||||
|
||||
typedef struct _gtp_stop_paging_indication_t {
|
||||
} gtp_stop_paging_indication_t;
|
||||
|
||||
typedef struct _gtp_create_bearer_request_t {
|
||||
} gtp_create_bearer_request_t;
|
||||
|
||||
typedef struct _gtp_create_bearer_response_t {
|
||||
} gtp_create_bearer_response_t;
|
||||
|
||||
typedef struct _gtp_update_bearer_request_t {
|
||||
} gtp_update_bearer_request_t;
|
||||
|
||||
typedef struct _gtp_update_bearer_response_t {
|
||||
} gtp_update_bearer_response_t;
|
||||
|
||||
typedef struct _gtp_delete_bearer_request_t {
|
||||
} gtp_delete_bearer_request_t;
|
||||
|
||||
typedef struct _gtp_delete_bearer_response_t {
|
||||
} gtp_delete_bearer_response_t;
|
||||
|
||||
typedef struct _gtp_delete_pdn_connection_set_request_t {
|
||||
} gtp_delete_pdn_connection_set_request_t;
|
||||
|
||||
typedef struct _gtp_delete_pdn_connection_set_response_t {
|
||||
} gtp_delete_pdn_connection_set_response_t;
|
||||
|
||||
typedef struct _gtp_pgw_downlink_triggering_notification_t {
|
||||
} gtp_pgw_downlink_triggering_notification_t;
|
||||
|
||||
typedef struct _gtp_pgw_downlink_triggering_acknowledge_t {
|
||||
} gtp_pgw_downlink_triggering_acknowledge_t;
|
||||
|
||||
typedef struct _gtp_create_forwarding_tunnel_request_t {
|
||||
} gtp_create_forwarding_tunnel_request_t;
|
||||
|
||||
typedef struct _gtp_create_forwarding_tunnel_response_t {
|
||||
} gtp_create_forwarding_tunnel_response_t;
|
||||
|
||||
typedef struct _gtp_suspend_notification_t {
|
||||
} gtp_suspend_notification_t;
|
||||
|
||||
typedef struct _gtp_suspend_acknowledge_t {
|
||||
} gtp_suspend_acknowledge_t;
|
||||
|
||||
typedef struct _gtp_resume_notification_t {
|
||||
} gtp_resume_notification_t;
|
||||
|
||||
typedef struct _gtp_resume_acknowledge_t {
|
||||
} gtp_resume_acknowledge_t;
|
||||
|
||||
typedef struct _gtp_create_indirect_data_forwarding_tunnel_request_t {
|
||||
} gtp_create_indirect_data_forwarding_tunnel_request_t;
|
||||
|
||||
typedef struct _gtp_create_indirect_data_forwarding_tunnel_response_t {
|
||||
} gtp_create_indirect_data_forwarding_tunnel_response_t;
|
||||
|
||||
typedef struct _gtp_delete_indirect_data_forwarding_tunnel_request_t {
|
||||
} gtp_delete_indirect_data_forwarding_tunnel_request_t;
|
||||
|
||||
typedef struct _gtp_delete_indirect_data_forwarding_tunnel_response_t {
|
||||
} gtp_delete_indirect_data_forwarding_tunnel_response_t;
|
||||
|
||||
typedef struct _gtp_release_access_bearers_request_t {
|
||||
} gtp_release_access_bearers_request_t;
|
||||
|
||||
typedef struct _gtp_release_access_bearers_response_t {
|
||||
} gtp_release_access_bearers_response_t;
|
||||
|
||||
typedef struct _gtp_downlink_data_notification_t {
|
||||
} gtp_downlink_data_notification_t;
|
||||
|
||||
typedef struct _gtp_downlink_data_notification_acknowledge_t {
|
||||
} gtp_downlink_data_notification_acknowledge_t;
|
||||
|
||||
typedef struct _gtp_pgw_restart_notification_t {
|
||||
} gtp_pgw_restart_notification_t;
|
||||
|
||||
typedef struct _gtp_pgw_restart_notification_acknowledge_t {
|
||||
} gtp_pgw_restart_notification_acknowledge_t;
|
||||
|
||||
typedef struct _gtp_update_pdn_connection_set_request_t {
|
||||
} gtp_update_pdn_connection_set_request_t;
|
||||
|
||||
typedef struct _gtp_update_pdn_connection_set_response_t {
|
||||
} gtp_update_pdn_connection_set_response_t;
|
||||
|
||||
typedef struct _gtp_modify_access_bearers_request_t {
|
||||
} gtp_modify_access_bearers_request_t;
|
||||
|
||||
typedef struct _gtp_modify_access_bearers_response_t {
|
||||
} gtp_modify_access_bearers_response_t;
|
||||
CORE_DECLARE(status_t) gtp_parse_msg(
|
||||
c_uint8_t type, gtp_message_t *gtp_message, pkbuf_t *pkbuf);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -10,6 +10,9 @@ extern "C" {
|
|||
#endif /* __cplusplus */
|
||||
|
||||
/* 5.1 General format */
|
||||
#define GTPV2C_HEADER_LEN 12
|
||||
#define GTPV2C_TEID_LEN 4
|
||||
|
||||
typedef struct _gtpv2c_header_t {
|
||||
ED4(c_uint8_t version:3;,
|
||||
c_uint8_t piggybacked:1;,
|
||||
|
|
|
@ -15,9 +15,6 @@
|
|||
((__id2) > (__id1) ? ((__id2) - (__id1) < 0x7fffff ? -1 : 1) : \
|
||||
(__id1) > (__id2) ? ((__id1) - (__id2) < 0x7fffff ? 1 : -1) : 0)
|
||||
|
||||
#define GTPV2C_HEADER_LEN 12
|
||||
#define GTPV2C_TEID_LEN 4
|
||||
|
||||
#define GTP_XID_TO_SQN(__xid) ((__xid) << 8)
|
||||
#define GTP_SQN_TO_XID(__sqn) ((__sqn) >> 8)
|
||||
|
||||
|
|
|
@ -440,15 +440,26 @@ for (k, v) in sorted_group_list:
|
|||
|
||||
f.write("/* Structure for Message */\n")
|
||||
for (k, v) in sorted_msg_list:
|
||||
f.write("typedef struct _gtp_" + v_lower(k) + "_t {\n")
|
||||
if "ies" in msg_list[k]:
|
||||
f.write("typedef struct _gtp_" + v_lower(k) + "_t {\n")
|
||||
for ies in msg_list[k]["ies"]:
|
||||
f.write(" tlv_" + v_lower(ies["ie_type"]) + "_t " + \
|
||||
v_lower(ies["ie_value"]) + ";\n")
|
||||
f.write("} gtp_" + v_lower(k) + "_t;\n")
|
||||
f.write("\n")
|
||||
f.write("} gtp_" + v_lower(k) + "_t;\n")
|
||||
f.write("\n")
|
||||
|
||||
f.write("""#ifdef __cplusplus
|
||||
f.write("typedef struct _gtp_message_t {\n")
|
||||
f.write(" union {\n")
|
||||
for (k, v) in sorted_msg_list:
|
||||
if "ies" in msg_list[k]:
|
||||
f.write(" gtp_" + v_lower(k) + "_t " + v_lower(k) + ";\n");
|
||||
f.write(" };\n");
|
||||
f.write("} gtp_message_t;\n\n")
|
||||
|
||||
f.write("""CORE_DECLARE(status_t) gtp_parse_msg(
|
||||
c_uint8_t type, gtp_message_t *gtp_message, pkbuf_t *pkbuf);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
@ -458,7 +469,8 @@ f.close()
|
|||
|
||||
f = open(outdir + 'gtp_tlv.c', 'w')
|
||||
output_header_to_file(f)
|
||||
f.write("""#include "gtp_tlv.h"
|
||||
f.write("""#include "core_debug.h"
|
||||
#include "gtp_tlv.h"
|
||||
|
||||
""")
|
||||
|
||||
|
@ -510,16 +522,41 @@ for (k, v) in sorted_group_list:
|
|||
f.write("};\n\n")
|
||||
|
||||
for (k, v) in sorted_msg_list:
|
||||
f.write("tlv_desc_t tlv_desc_%s =\n" % v_lower(k))
|
||||
f.write("{\n")
|
||||
f.write(" TLV_MESSAGE,\n")
|
||||
f.write(" \"%s\",\n" % k)
|
||||
f.write(" 0, 0, 0, 0, {\n")
|
||||
if "ies" in msg_list[k]:
|
||||
f.write("tlv_desc_t tlv_desc_%s =\n" % v_lower(k))
|
||||
f.write("{\n")
|
||||
f.write(" TLV_MESSAGE,\n")
|
||||
f.write(" \"%s\",\n" % k)
|
||||
f.write(" 0, 0, 0, 0, {\n")
|
||||
for ies in msg_list[k]["ies"]:
|
||||
f.write(" &tlv_desc_%s_%s,\n" % (v_lower(ies["ie_type"]), v_lower(ies["instance"])))
|
||||
f.write(" NULL,\n")
|
||||
f.write("}};\n\n")
|
||||
f.write(" NULL,\n")
|
||||
f.write("}};\n\n")
|
||||
f.write("\n")
|
||||
|
||||
f.write("""status_t gtp_parse_msg(
|
||||
c_uint8_t type, gtp_message_t *gtp_message, pkbuf_t *pkbuf)
|
||||
{
|
||||
status_t rv = CORE_ERROR;
|
||||
|
||||
memset(gtp_message, 0, sizeof(gtp_message_t));
|
||||
switch(type)
|
||||
{
|
||||
""")
|
||||
for (k, v) in sorted_msg_list:
|
||||
if "ies" in msg_list[k]:
|
||||
f.write(" case GTP_%s_TYPE:\n" % v_upper(k))
|
||||
f.write(" rv = tlv_parse_msg(>p_message->%s,\n" % v_lower(k))
|
||||
f.write(" &tlv_desc_%s, pkbuf, TLV_MODE_T1_L2_I1);\n" % v_lower(k))
|
||||
f.write(" break;\n")
|
||||
f.write(""" default:
|
||||
d_warn("Not implmeneted(type:%d)", type);
|
||||
break;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
""")
|
||||
|
||||
f.write("\n")
|
||||
|
||||
|
|
|
@ -4,13 +4,11 @@ noinst_LTLIBRARIES = libsgw.la
|
|||
|
||||
libsgw_la_SOURCES = \
|
||||
event.h context.h \
|
||||
sgw_path.h \
|
||||
sm.h
|
||||
sgw_path.h sm.h s11_handler.h
|
||||
|
||||
nodist_libsgw_la_SOURCES = \
|
||||
init.c event.c context.c \
|
||||
sgw_path.c \
|
||||
sgw_sm.c
|
||||
sgw_path.c sgw_sm.c s11_handler.c
|
||||
|
||||
libsgw_la_DEPENDENCIES = \
|
||||
$(top_srcdir)/lib/core/src/libcore.la \
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
#define TRACE_MODULE _sgw_handler
|
||||
|
||||
#include "core_debug.h"
|
||||
|
||||
#include "event.h"
|
||||
|
||||
#include "s11_handler.h"
|
||||
|
||||
void sgw_handle_create_session_request(
|
||||
gtp_xact_t *xact, gtp_create_session_request_t *req)
|
||||
{
|
||||
d_info("sgw_handle_create_session_request");
|
||||
d_print_hex(req->imsi.data, req->imsi.len);
|
||||
d_print_hex(req->msisdn.data, req->msisdn.len);
|
||||
d_print_hex(req->me_identity.data, req->me_identity.len);
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
#ifndef __SGW_HANDLER_H__
|
||||
#define __SGW_HANDLER_H__
|
||||
|
||||
#include "gtp_tlv.h"
|
||||
#include "context.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
CORE_DECLARE(void) sgw_handle_create_session_request(
|
||||
gtp_xact_t *xact, gtp_create_session_request_t *req);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __SGW_HANDLER_H__ */
|
|
@ -7,6 +7,7 @@
|
|||
#include "context.h"
|
||||
#include "event.h"
|
||||
#include "sgw_path.h"
|
||||
#include "s11_handler.h"
|
||||
|
||||
void sgw_state_initial(sgw_sm_t *s, event_t *e)
|
||||
{
|
||||
|
@ -64,9 +65,15 @@ void sgw_state_operational(sgw_sm_t *s, event_t *e)
|
|||
gtp_node_t *gnode = (gtp_node_t *)event_get_param2(e);
|
||||
pkbuf_t *pkbuf = (pkbuf_t *)event_get_param3(e);
|
||||
gtp_xact_t *xact = NULL;
|
||||
gtpv2c_header_t *h = NULL;
|
||||
gtp_message_t gtp_message;
|
||||
|
||||
d_assert(sock, break, "Null param");
|
||||
d_assert(gnode, break, "Null param");
|
||||
d_assert(pkbuf, break, "Null param");
|
||||
|
||||
h = pkbuf->payload;
|
||||
d_assert(h, break, "Null param");
|
||||
|
||||
xact = gtp_xact_find(gnode, pkbuf);
|
||||
if (!xact)
|
||||
|
@ -75,6 +82,29 @@ void sgw_state_operational(sgw_sm_t *s, event_t *e)
|
|||
sock, gnode, pkbuf);
|
||||
}
|
||||
|
||||
if (h->teid_presence)
|
||||
pkbuf_header(pkbuf, -GTPV2C_HEADER_LEN);
|
||||
else
|
||||
pkbuf_header(pkbuf, -(GTPV2C_HEADER_LEN-GTPV2C_TEID_LEN));
|
||||
|
||||
rv = gtp_parse_msg(h->type, >p_message, pkbuf);
|
||||
if (rv != CORE_OK)
|
||||
{
|
||||
d_error("failed to parse GTPv2-C TLV message(type:%d)",
|
||||
h->type);
|
||||
pkbuf_free(pkbuf);
|
||||
}
|
||||
|
||||
switch(h->type)
|
||||
{
|
||||
case GTP_CREATE_SESSION_REQUEST_TYPE:
|
||||
{
|
||||
sgw_handle_create_session_request(
|
||||
xact, >p_message.create_session_request);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pkbuf_free(pkbuf);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue