delete indirect tunnel done..

This commit is contained in:
Sukchan Lee 2017-09-14 14:18:47 +09:00
parent 345f055dd7
commit 7a324ec8e9
19 changed files with 238 additions and 631 deletions

View File

@ -22,7 +22,6 @@ pool_declare(pkbuf_pool, pkbuf_t, MAX_NUM_OF_PKBUF);
#define SIZEOF_CLUSTER_1024 CORE_ALIGN(1024+MAX_SIZEOF_HEADROOM, BOUNDARY)
#define SIZEOF_CLUSTER_2048 CORE_ALIGN(2048+MAX_SIZEOF_HEADROOM, BOUNDARY)
#define SIZEOF_CLUSTER_8192 CORE_ALIGN(8192+MAX_SIZEOF_HEADROOM, BOUNDARY)
#define SIZEOF_CLUSTER_32768 CORE_ALIGN(32768+MAX_SIZEOF_HEADROOM, BOUNDARY)
#define MAX_NUM_OF_CLUSTER_128 256
#define MAX_NUM_OF_CLUSTER_256 32
@ -30,7 +29,6 @@ pool_declare(pkbuf_pool, pkbuf_t, MAX_NUM_OF_PKBUF);
#define MAX_NUM_OF_CLUSTER_1024 32
#define MAX_NUM_OF_CLUSTER_2048 32
#define MAX_NUM_OF_CLUSTER_8192 32
#define MAX_NUM_OF_CLUSTER_32768 8
typedef c_uint8_t cluster_128_t[SIZEOF_CLUSTER_128];
typedef c_uint8_t cluster_256_t[SIZEOF_CLUSTER_256];
@ -38,7 +36,6 @@ typedef c_uint8_t cluster_512_t[SIZEOF_CLUSTER_512];
typedef c_uint8_t cluster_1024_t[SIZEOF_CLUSTER_1024];
typedef c_uint8_t cluster_2048_t[SIZEOF_CLUSTER_2048];
typedef c_uint8_t cluster_8192_t[SIZEOF_CLUSTER_8192];
typedef c_uint8_t cluster_32768_t[SIZEOF_CLUSTER_32768];
pool_declare(cluster_128_pool, cluster_128_t, MAX_NUM_OF_CLUSTER_128);
pool_declare(cluster_256_pool, cluster_256_t, MAX_NUM_OF_CLUSTER_256);
@ -46,7 +43,6 @@ pool_declare(cluster_512_pool, cluster_512_t, MAX_NUM_OF_CLUSTER_512);
pool_declare(cluster_1024_pool, cluster_1024_t, MAX_NUM_OF_CLUSTER_1024);
pool_declare(cluster_2048_pool, cluster_2048_t, MAX_NUM_OF_CLUSTER_2048);
pool_declare(cluster_8192_pool, cluster_8192_t, MAX_NUM_OF_CLUSTER_8192);
pool_declare(cluster_32768_pool, cluster_32768_t, MAX_NUM_OF_CLUSTER_32768);
static mutex_id mutex;
@ -63,7 +59,6 @@ status_t pkbuf_init(void)
pool_init(&cluster_1024_pool, MAX_NUM_OF_CLUSTER_1024);
pool_init(&cluster_2048_pool, MAX_NUM_OF_CLUSTER_2048);
pool_init(&cluster_8192_pool, MAX_NUM_OF_CLUSTER_8192);
pool_init(&cluster_32768_pool, MAX_NUM_OF_CLUSTER_32768);
return CORE_OK;
}
@ -80,7 +75,6 @@ status_t pkbuf_final(void)
pool_final(&cluster_1024_pool);
pool_final(&cluster_2048_pool);
pool_final(&cluster_8192_pool);
pool_final(&cluster_32768_pool);
mutex_delete(mutex);
@ -152,13 +146,6 @@ void pkbuf_show(void)
d_trace(3, "%d not freed in cluster8192_pool[%d]\n",
pool_size(&cluster_8192_pool) - pool_avail(&cluster_8192_pool),
pool_size(&cluster_8192_pool));
if (pool_size(&cluster_32768_pool) != pool_avail(&cluster_32768_pool))
d_error("%d not freed in cluster32768_pool[%d]",
pool_size(&cluster_32768_pool) - pool_avail(&cluster_32768_pool),
pool_size(&cluster_32768_pool));
d_trace(3, "%d not freed in cluster32768_pool[%d]\n",
pool_size(&cluster_32768_pool) - pool_avail(&cluster_32768_pool),
pool_size(&cluster_32768_pool));
}
static clbuf_t* clbuf_alloc(c_uint16_t length);
@ -202,11 +189,6 @@ static clbuf_t* clbuf_alloc(c_uint16_t length)
pool_alloc_node(&cluster_8192_pool, &cluster);
clbuf->size = SIZEOF_CLUSTER_8192;
}
else if (length <= 32768)
{
pool_alloc_node(&cluster_32768_pool, &cluster);
clbuf->size = SIZEOF_CLUSTER_32768;
}
d_assert(cluster, pool_free_node(&clbuf_pool, clbuf); return NULL,
"No more free cluster. length:%d requested", length);
@ -242,9 +224,6 @@ static void clbuf_free(clbuf_t *clbuf)
case SIZEOF_CLUSTER_8192:
pool_free_node(&cluster_8192_pool, clbuf->cluster);
break;
case SIZEOF_CLUSTER_32768:
pool_free_node(&cluster_32768_pool, clbuf->cluster);
break;
default:
d_assert(0, return, "clbuf has invalid size %d", clbuf->size);
break;

View File

@ -20,17 +20,6 @@ void gtp_bearers_in_create_indirect_tunnel_request(
(*bearers)[8] = &req->bearer_context_8;
(*bearers)[9] = &req->bearer_context_9;
(*bearers)[10] = &req->bearer_context_10;
(*bearers)[11] = &req->bearer_context_11;
(*bearers)[12] = &req->bearer_context_12;
(*bearers)[13] = &req->bearer_context_13;
(*bearers)[14] = &req->bearer_context_14;
(*bearers)[15] = &req->bearer_context_15;
(*bearers)[16] = &req->bearer_context_16;
(*bearers)[17] = &req->bearer_context_17;
(*bearers)[18] = &req->bearer_context_18;
(*bearers)[19] = &req->bearer_context_19;
(*bearers)[20] = &req->bearer_context_20;
(*bearers)[21] = &req->bearer_context_21;
}
void gtp_bearers_in_create_indirect_tunnel_response(
@ -48,15 +37,4 @@ void gtp_bearers_in_create_indirect_tunnel_response(
(*bearers)[8] = &rsp->bearer_context_8;
(*bearers)[9] = &rsp->bearer_context_9;
(*bearers)[10] = &rsp->bearer_context_10;
(*bearers)[11] = &rsp->bearer_context_11;
(*bearers)[12] = &rsp->bearer_context_12;
(*bearers)[13] = &rsp->bearer_context_13;
(*bearers)[14] = &rsp->bearer_context_14;
(*bearers)[15] = &rsp->bearer_context_15;
(*bearers)[16] = &rsp->bearer_context_16;
(*bearers)[17] = &rsp->bearer_context_17;
(*bearers)[18] = &rsp->bearer_context_18;
(*bearers)[19] = &rsp->bearer_context_19;
(*bearers)[20] = &rsp->bearer_context_20;
(*bearers)[21] = &rsp->bearer_context_21;
}

View File

@ -7,7 +7,7 @@
extern "C" {
#endif /* __cplusplus */
#define GTP_MAX_NUM_OF_INDIRECT_TUNNEL 22
#define GTP_MAX_NUM_OF_INDIRECT_TUNNEL 11
/* Create Indirect Data Forwarding Tunnel Request/Response */
CORE_DECLARE(void) gtp_bearers_in_create_indirect_tunnel_request(

View File

@ -26,8 +26,8 @@
/*******************************************************************************
* 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-09-13 12:35:56.748758 by acetcom
* from /Users/acetcom/Documents/29274-d80.docx
* Created on: 2017-09-14 13:57:05.211841 by acetcom
* from 29274-d80.docx
******************************************************************************/
#include "core_debug.h"
@ -2002,424 +2002,6 @@ tlv_desc_t tlv_desc_bearer_context_10 =
}
};
tlv_desc_t tlv_desc_bearer_context_11 =
{
TLV_COMPOUND,
"Bearer Context",
TLV_BEARER_CONTEXT_TYPE,
0,
11,
sizeof(tlv_bearer_context_t),
{
&tlv_desc_ebi_0,
&tlv_desc_bearer_tft_0,
&tlv_desc_f_teid_0,
&tlv_desc_f_teid_1,
&tlv_desc_f_teid_2,
&tlv_desc_f_teid_3,
&tlv_desc_f_teid_4,
&tlv_desc_f_teid_5,
&tlv_desc_f_teid_6,
&tlv_desc_bearer_qos_0,
&tlv_desc_f_teid_7,
&tlv_desc_cause_0,
&tlv_desc_charging_id_0,
&tlv_desc_bearer_flags_0,
&tlv_desc_pco_0,
&tlv_desc_epco_0,
&tlv_desc_f_teid_8,
&tlv_desc_f_teid_9,
&tlv_desc_f_teid_10,
&tlv_desc_f_teid_11,
&tlv_desc_ran_nas_cause_0,
&tlv_desc_apco_0,
&tlv_desc_f_container_0,
&tlv_desc_ti_0,
&tlv_desc_packet_flow_id_0,
NULL,
}
};
tlv_desc_t tlv_desc_bearer_context_12 =
{
TLV_COMPOUND,
"Bearer Context",
TLV_BEARER_CONTEXT_TYPE,
0,
12,
sizeof(tlv_bearer_context_t),
{
&tlv_desc_ebi_0,
&tlv_desc_bearer_tft_0,
&tlv_desc_f_teid_0,
&tlv_desc_f_teid_1,
&tlv_desc_f_teid_2,
&tlv_desc_f_teid_3,
&tlv_desc_f_teid_4,
&tlv_desc_f_teid_5,
&tlv_desc_f_teid_6,
&tlv_desc_bearer_qos_0,
&tlv_desc_f_teid_7,
&tlv_desc_cause_0,
&tlv_desc_charging_id_0,
&tlv_desc_bearer_flags_0,
&tlv_desc_pco_0,
&tlv_desc_epco_0,
&tlv_desc_f_teid_8,
&tlv_desc_f_teid_9,
&tlv_desc_f_teid_10,
&tlv_desc_f_teid_11,
&tlv_desc_ran_nas_cause_0,
&tlv_desc_apco_0,
&tlv_desc_f_container_0,
&tlv_desc_ti_0,
&tlv_desc_packet_flow_id_0,
NULL,
}
};
tlv_desc_t tlv_desc_bearer_context_13 =
{
TLV_COMPOUND,
"Bearer Context",
TLV_BEARER_CONTEXT_TYPE,
0,
13,
sizeof(tlv_bearer_context_t),
{
&tlv_desc_ebi_0,
&tlv_desc_bearer_tft_0,
&tlv_desc_f_teid_0,
&tlv_desc_f_teid_1,
&tlv_desc_f_teid_2,
&tlv_desc_f_teid_3,
&tlv_desc_f_teid_4,
&tlv_desc_f_teid_5,
&tlv_desc_f_teid_6,
&tlv_desc_bearer_qos_0,
&tlv_desc_f_teid_7,
&tlv_desc_cause_0,
&tlv_desc_charging_id_0,
&tlv_desc_bearer_flags_0,
&tlv_desc_pco_0,
&tlv_desc_epco_0,
&tlv_desc_f_teid_8,
&tlv_desc_f_teid_9,
&tlv_desc_f_teid_10,
&tlv_desc_f_teid_11,
&tlv_desc_ran_nas_cause_0,
&tlv_desc_apco_0,
&tlv_desc_f_container_0,
&tlv_desc_ti_0,
&tlv_desc_packet_flow_id_0,
NULL,
}
};
tlv_desc_t tlv_desc_bearer_context_14 =
{
TLV_COMPOUND,
"Bearer Context",
TLV_BEARER_CONTEXT_TYPE,
0,
14,
sizeof(tlv_bearer_context_t),
{
&tlv_desc_ebi_0,
&tlv_desc_bearer_tft_0,
&tlv_desc_f_teid_0,
&tlv_desc_f_teid_1,
&tlv_desc_f_teid_2,
&tlv_desc_f_teid_3,
&tlv_desc_f_teid_4,
&tlv_desc_f_teid_5,
&tlv_desc_f_teid_6,
&tlv_desc_bearer_qos_0,
&tlv_desc_f_teid_7,
&tlv_desc_cause_0,
&tlv_desc_charging_id_0,
&tlv_desc_bearer_flags_0,
&tlv_desc_pco_0,
&tlv_desc_epco_0,
&tlv_desc_f_teid_8,
&tlv_desc_f_teid_9,
&tlv_desc_f_teid_10,
&tlv_desc_f_teid_11,
&tlv_desc_ran_nas_cause_0,
&tlv_desc_apco_0,
&tlv_desc_f_container_0,
&tlv_desc_ti_0,
&tlv_desc_packet_flow_id_0,
NULL,
}
};
tlv_desc_t tlv_desc_bearer_context_15 =
{
TLV_COMPOUND,
"Bearer Context",
TLV_BEARER_CONTEXT_TYPE,
0,
15,
sizeof(tlv_bearer_context_t),
{
&tlv_desc_ebi_0,
&tlv_desc_bearer_tft_0,
&tlv_desc_f_teid_0,
&tlv_desc_f_teid_1,
&tlv_desc_f_teid_2,
&tlv_desc_f_teid_3,
&tlv_desc_f_teid_4,
&tlv_desc_f_teid_5,
&tlv_desc_f_teid_6,
&tlv_desc_bearer_qos_0,
&tlv_desc_f_teid_7,
&tlv_desc_cause_0,
&tlv_desc_charging_id_0,
&tlv_desc_bearer_flags_0,
&tlv_desc_pco_0,
&tlv_desc_epco_0,
&tlv_desc_f_teid_8,
&tlv_desc_f_teid_9,
&tlv_desc_f_teid_10,
&tlv_desc_f_teid_11,
&tlv_desc_ran_nas_cause_0,
&tlv_desc_apco_0,
&tlv_desc_f_container_0,
&tlv_desc_ti_0,
&tlv_desc_packet_flow_id_0,
NULL,
}
};
tlv_desc_t tlv_desc_bearer_context_16 =
{
TLV_COMPOUND,
"Bearer Context",
TLV_BEARER_CONTEXT_TYPE,
0,
16,
sizeof(tlv_bearer_context_t),
{
&tlv_desc_ebi_0,
&tlv_desc_bearer_tft_0,
&tlv_desc_f_teid_0,
&tlv_desc_f_teid_1,
&tlv_desc_f_teid_2,
&tlv_desc_f_teid_3,
&tlv_desc_f_teid_4,
&tlv_desc_f_teid_5,
&tlv_desc_f_teid_6,
&tlv_desc_bearer_qos_0,
&tlv_desc_f_teid_7,
&tlv_desc_cause_0,
&tlv_desc_charging_id_0,
&tlv_desc_bearer_flags_0,
&tlv_desc_pco_0,
&tlv_desc_epco_0,
&tlv_desc_f_teid_8,
&tlv_desc_f_teid_9,
&tlv_desc_f_teid_10,
&tlv_desc_f_teid_11,
&tlv_desc_ran_nas_cause_0,
&tlv_desc_apco_0,
&tlv_desc_f_container_0,
&tlv_desc_ti_0,
&tlv_desc_packet_flow_id_0,
NULL,
}
};
tlv_desc_t tlv_desc_bearer_context_17 =
{
TLV_COMPOUND,
"Bearer Context",
TLV_BEARER_CONTEXT_TYPE,
0,
17,
sizeof(tlv_bearer_context_t),
{
&tlv_desc_ebi_0,
&tlv_desc_bearer_tft_0,
&tlv_desc_f_teid_0,
&tlv_desc_f_teid_1,
&tlv_desc_f_teid_2,
&tlv_desc_f_teid_3,
&tlv_desc_f_teid_4,
&tlv_desc_f_teid_5,
&tlv_desc_f_teid_6,
&tlv_desc_bearer_qos_0,
&tlv_desc_f_teid_7,
&tlv_desc_cause_0,
&tlv_desc_charging_id_0,
&tlv_desc_bearer_flags_0,
&tlv_desc_pco_0,
&tlv_desc_epco_0,
&tlv_desc_f_teid_8,
&tlv_desc_f_teid_9,
&tlv_desc_f_teid_10,
&tlv_desc_f_teid_11,
&tlv_desc_ran_nas_cause_0,
&tlv_desc_apco_0,
&tlv_desc_f_container_0,
&tlv_desc_ti_0,
&tlv_desc_packet_flow_id_0,
NULL,
}
};
tlv_desc_t tlv_desc_bearer_context_18 =
{
TLV_COMPOUND,
"Bearer Context",
TLV_BEARER_CONTEXT_TYPE,
0,
18,
sizeof(tlv_bearer_context_t),
{
&tlv_desc_ebi_0,
&tlv_desc_bearer_tft_0,
&tlv_desc_f_teid_0,
&tlv_desc_f_teid_1,
&tlv_desc_f_teid_2,
&tlv_desc_f_teid_3,
&tlv_desc_f_teid_4,
&tlv_desc_f_teid_5,
&tlv_desc_f_teid_6,
&tlv_desc_bearer_qos_0,
&tlv_desc_f_teid_7,
&tlv_desc_cause_0,
&tlv_desc_charging_id_0,
&tlv_desc_bearer_flags_0,
&tlv_desc_pco_0,
&tlv_desc_epco_0,
&tlv_desc_f_teid_8,
&tlv_desc_f_teid_9,
&tlv_desc_f_teid_10,
&tlv_desc_f_teid_11,
&tlv_desc_ran_nas_cause_0,
&tlv_desc_apco_0,
&tlv_desc_f_container_0,
&tlv_desc_ti_0,
&tlv_desc_packet_flow_id_0,
NULL,
}
};
tlv_desc_t tlv_desc_bearer_context_19 =
{
TLV_COMPOUND,
"Bearer Context",
TLV_BEARER_CONTEXT_TYPE,
0,
19,
sizeof(tlv_bearer_context_t),
{
&tlv_desc_ebi_0,
&tlv_desc_bearer_tft_0,
&tlv_desc_f_teid_0,
&tlv_desc_f_teid_1,
&tlv_desc_f_teid_2,
&tlv_desc_f_teid_3,
&tlv_desc_f_teid_4,
&tlv_desc_f_teid_5,
&tlv_desc_f_teid_6,
&tlv_desc_bearer_qos_0,
&tlv_desc_f_teid_7,
&tlv_desc_cause_0,
&tlv_desc_charging_id_0,
&tlv_desc_bearer_flags_0,
&tlv_desc_pco_0,
&tlv_desc_epco_0,
&tlv_desc_f_teid_8,
&tlv_desc_f_teid_9,
&tlv_desc_f_teid_10,
&tlv_desc_f_teid_11,
&tlv_desc_ran_nas_cause_0,
&tlv_desc_apco_0,
&tlv_desc_f_container_0,
&tlv_desc_ti_0,
&tlv_desc_packet_flow_id_0,
NULL,
}
};
tlv_desc_t tlv_desc_bearer_context_20 =
{
TLV_COMPOUND,
"Bearer Context",
TLV_BEARER_CONTEXT_TYPE,
0,
20,
sizeof(tlv_bearer_context_t),
{
&tlv_desc_ebi_0,
&tlv_desc_bearer_tft_0,
&tlv_desc_f_teid_0,
&tlv_desc_f_teid_1,
&tlv_desc_f_teid_2,
&tlv_desc_f_teid_3,
&tlv_desc_f_teid_4,
&tlv_desc_f_teid_5,
&tlv_desc_f_teid_6,
&tlv_desc_bearer_qos_0,
&tlv_desc_f_teid_7,
&tlv_desc_cause_0,
&tlv_desc_charging_id_0,
&tlv_desc_bearer_flags_0,
&tlv_desc_pco_0,
&tlv_desc_epco_0,
&tlv_desc_f_teid_8,
&tlv_desc_f_teid_9,
&tlv_desc_f_teid_10,
&tlv_desc_f_teid_11,
&tlv_desc_ran_nas_cause_0,
&tlv_desc_apco_0,
&tlv_desc_f_container_0,
&tlv_desc_ti_0,
&tlv_desc_packet_flow_id_0,
NULL,
}
};
tlv_desc_t tlv_desc_bearer_context_21 =
{
TLV_COMPOUND,
"Bearer Context",
TLV_BEARER_CONTEXT_TYPE,
0,
21,
sizeof(tlv_bearer_context_t),
{
&tlv_desc_ebi_0,
&tlv_desc_bearer_tft_0,
&tlv_desc_f_teid_0,
&tlv_desc_f_teid_1,
&tlv_desc_f_teid_2,
&tlv_desc_f_teid_3,
&tlv_desc_f_teid_4,
&tlv_desc_f_teid_5,
&tlv_desc_f_teid_6,
&tlv_desc_bearer_qos_0,
&tlv_desc_f_teid_7,
&tlv_desc_cause_0,
&tlv_desc_charging_id_0,
&tlv_desc_bearer_flags_0,
&tlv_desc_pco_0,
&tlv_desc_epco_0,
&tlv_desc_f_teid_8,
&tlv_desc_f_teid_9,
&tlv_desc_f_teid_10,
&tlv_desc_f_teid_11,
&tlv_desc_ran_nas_cause_0,
&tlv_desc_apco_0,
&tlv_desc_f_container_0,
&tlv_desc_ti_0,
&tlv_desc_packet_flow_id_0,
NULL,
}
};
tlv_desc_t tlv_desc_pdn_connection_0 =
{
TLV_COMPOUND,
@ -3056,17 +2638,6 @@ tlv_desc_t tlv_desc_create_indirect_data_forwarding_tunnel_request =
&tlv_desc_bearer_context_8,
&tlv_desc_bearer_context_9,
&tlv_desc_bearer_context_10,
&tlv_desc_bearer_context_11,
&tlv_desc_bearer_context_12,
&tlv_desc_bearer_context_13,
&tlv_desc_bearer_context_14,
&tlv_desc_bearer_context_15,
&tlv_desc_bearer_context_16,
&tlv_desc_bearer_context_17,
&tlv_desc_bearer_context_18,
&tlv_desc_bearer_context_19,
&tlv_desc_bearer_context_20,
&tlv_desc_bearer_context_21,
&tlv_desc_recovery_0,
NULL,
}};
@ -3089,17 +2660,6 @@ tlv_desc_t tlv_desc_create_indirect_data_forwarding_tunnel_response =
&tlv_desc_bearer_context_8,
&tlv_desc_bearer_context_9,
&tlv_desc_bearer_context_10,
&tlv_desc_bearer_context_11,
&tlv_desc_bearer_context_12,
&tlv_desc_bearer_context_13,
&tlv_desc_bearer_context_14,
&tlv_desc_bearer_context_15,
&tlv_desc_bearer_context_16,
&tlv_desc_bearer_context_17,
&tlv_desc_bearer_context_18,
&tlv_desc_bearer_context_19,
&tlv_desc_bearer_context_20,
&tlv_desc_bearer_context_21,
&tlv_desc_recovery_0,
NULL,
}};
@ -3235,6 +2795,9 @@ status_t gtp_parse_msg(gtp_message_t *gtp_message, pkbuf_t *pkbuf)
if (h->teid_presence)
gtp_message->h.teid = ntohl(gtp_message->h.teid);
if (pkbuf->len == 0)
return CORE_OK;
switch(gtp_message->h.type)
{
case GTP_ECHO_REQUEST_TYPE:

View File

@ -26,8 +26,8 @@
/*******************************************************************************
* 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-09-13 12:35:56.716193 by acetcom
* from /Users/acetcom/Documents/29274-d80.docx
* Created on: 2017-09-14 13:57:05.194620 by acetcom
* from 29274-d80.docx
******************************************************************************/
#ifndef __GTP_TLV_H__
@ -412,17 +412,6 @@ extern tlv_desc_t tlv_desc_bearer_context_7;
extern tlv_desc_t tlv_desc_bearer_context_8;
extern tlv_desc_t tlv_desc_bearer_context_9;
extern tlv_desc_t tlv_desc_bearer_context_10;
extern tlv_desc_t tlv_desc_bearer_context_11;
extern tlv_desc_t tlv_desc_bearer_context_12;
extern tlv_desc_t tlv_desc_bearer_context_13;
extern tlv_desc_t tlv_desc_bearer_context_14;
extern tlv_desc_t tlv_desc_bearer_context_15;
extern tlv_desc_t tlv_desc_bearer_context_16;
extern tlv_desc_t tlv_desc_bearer_context_17;
extern tlv_desc_t tlv_desc_bearer_context_18;
extern tlv_desc_t tlv_desc_bearer_context_19;
extern tlv_desc_t tlv_desc_bearer_context_20;
extern tlv_desc_t tlv_desc_bearer_context_21;
extern tlv_desc_t tlv_desc_pdn_connection_0;
extern tlv_desc_t tlv_desc_overload_control_information_0;
extern tlv_desc_t tlv_desc_overload_control_information_1;
@ -1063,17 +1052,6 @@ typedef struct _gtp_create_indirect_data_forwarding_tunnel_request_t {
tlv_bearer_context_t bearer_context_8;
tlv_bearer_context_t bearer_context_9;
tlv_bearer_context_t bearer_context_10;
tlv_bearer_context_t bearer_context_11;
tlv_bearer_context_t bearer_context_12;
tlv_bearer_context_t bearer_context_13;
tlv_bearer_context_t bearer_context_14;
tlv_bearer_context_t bearer_context_15;
tlv_bearer_context_t bearer_context_16;
tlv_bearer_context_t bearer_context_17;
tlv_bearer_context_t bearer_context_18;
tlv_bearer_context_t bearer_context_19;
tlv_bearer_context_t bearer_context_20;
tlv_bearer_context_t bearer_context_21;
tlv_recovery_t recovery;
} gtp_create_indirect_data_forwarding_tunnel_request_t;
@ -1091,17 +1069,6 @@ typedef struct _gtp_create_indirect_data_forwarding_tunnel_response_t {
tlv_bearer_context_t bearer_context_8;
tlv_bearer_context_t bearer_context_9;
tlv_bearer_context_t bearer_context_10;
tlv_bearer_context_t bearer_context_11;
tlv_bearer_context_t bearer_context_12;
tlv_bearer_context_t bearer_context_13;
tlv_bearer_context_t bearer_context_14;
tlv_bearer_context_t bearer_context_15;
tlv_bearer_context_t bearer_context_16;
tlv_bearer_context_t bearer_context_17;
tlv_bearer_context_t bearer_context_18;
tlv_bearer_context_t bearer_context_19;
tlv_bearer_context_t bearer_context_20;
tlv_bearer_context_t bearer_context_21;
tlv_recovery_t recovery;
} gtp_create_indirect_data_forwarding_tunnel_response_t;

Binary file not shown.

View File

@ -14,16 +14,5 @@ ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 7", "pre
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 8", "presence" : "O", "instance" : "8", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 9", "presence" : "O", "instance" : "9", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 10", "presence" : "O", "instance" : "10", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 11", "presence" : "O", "instance" : "11", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 12", "presence" : "O", "instance" : "12", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 13", "presence" : "O", "instance" : "13", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 14", "presence" : "O", "instance" : "14", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 15", "presence" : "O", "instance" : "15", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 16", "presence" : "O", "instance" : "16", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 17", "presence" : "O", "instance" : "17", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 18", "presence" : "O", "instance" : "18", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 19", "presence" : "O", "instance" : "19", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 20", "presence" : "O", "instance" : "20", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 21", "presence" : "O", "instance" : "21", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
ies.append({ "ie_type" : "Recovery", "ie_value" : "Recovery", "presence" : "CO", "instance" : "0", "comment" : "This IE shall be included if contacting the peer for the first time."})
msg_list[key]["ies"] = ies

View File

@ -21,27 +21,5 @@ type_list["Bearer Context"]["max_instance"] = "9"
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 9", "presence" : "O", "instance" : "9", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
type_list["Bearer Context"]["max_instance"] = "10"
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 10", "presence" : "O", "instance" : "10", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
type_list["Bearer Context"]["max_instance"] = "11"
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 11", "presence" : "O", "instance" : "11", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
type_list["Bearer Context"]["max_instance"] = "12"
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 12", "presence" : "O", "instance" : "12", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
type_list["Bearer Context"]["max_instance"] = "13"
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 13", "presence" : "O", "instance" : "13", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
type_list["Bearer Context"]["max_instance"] = "14"
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 14", "presence" : "O", "instance" : "14", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
type_list["Bearer Context"]["max_instance"] = "15"
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 15", "presence" : "O", "instance" : "15", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
type_list["Bearer Context"]["max_instance"] = "16"
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 16", "presence" : "O", "instance" : "16", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
type_list["Bearer Context"]["max_instance"] = "17"
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 17", "presence" : "O", "instance" : "17", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
type_list["Bearer Context"]["max_instance"] = "18"
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 18", "presence" : "O", "instance" : "18", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
type_list["Bearer Context"]["max_instance"] = "19"
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 19", "presence" : "O", "instance" : "19", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
type_list["Bearer Context"]["max_instance"] = "20"
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 20", "presence" : "O", "instance" : "20", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
type_list["Bearer Context"]["max_instance"] = "21"
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Context 21", "presence" : "O", "instance" : "21", "comment" : "Several IEs with this type and instance value may be included as necessary to represent a list of Bearers"})
ies.append({ "ie_type" : "Recovery", "ie_value" : "Recovery", "presence" : "CO", "instance" : "0", "comment" : "This IE shall be included if contacting the peer for the first time"})
msg_list[key]["ies"] = ies

View File

@ -638,6 +638,9 @@ f.write("""status_t gtp_parse_msg(gtp_message_t *gtp_message, pkbuf_t *pkbuf)
if (h->teid_presence)
gtp_message->h.teid = ntohl(gtp_message->h.teid);
if (pkbuf->len == 0)
return CORE_OK;
switch(gtp_message->h.type)
{
""")

View File

@ -372,29 +372,17 @@ typedef struct _mme_sess_t {
((__bEARER) && ((__bEARER)->sgw_dl_teid) && ((__bEARER)->sgw_dl_addr))
#define MME_HAVE_SGW_UL_INDIRECT_TUNNEL(__bEARER) \
((__bEARER) && ((__bEARER)->sgw_ul_teid) && ((__bEARER)->sgw_ul_addr))
#define CLEAR_INDIRECT_TUNNEL(__mME) \
#define CLEAR_INDIRECT_TUNNEL(__bEARER) \
do { \
mme_sess_t *sess = NULL; \
mme_bearer_t *bearer = NULL; \
d_assert((__mME), break, "Null param"); \
sess = mme_sess_first(__mME); \
while (sess != NULL) \
{ \
bearer = mme_bearer_first(sess); \
while(bearer != NULL) \
{ \
bearer->enb_dl_teid = 0; \
bearer->enb_dl_addr = 0; \
bearer->enb_ul_teid = 0; \
bearer->enb_ul_addr = 0; \
bearer->sgw_dl_teid = 0; \
bearer->sgw_dl_addr = 0; \
bearer->sgw_ul_teid = 0; \
bearer->sgw_ul_addr = 0; \
bearer = mme_bearer_next(bearer); \
} \
sess = mme_sess_next(sess); \
} \
d_assert((__bEARER), break, "Null param"); \
(__bEARER)->enb_dl_teid = 0; \
(__bEARER)->enb_dl_addr = 0; \
(__bEARER)->enb_ul_teid = 0; \
(__bEARER)->enb_ul_addr = 0; \
(__bEARER)->sgw_dl_teid = 0; \
(__bEARER)->sgw_dl_addr = 0; \
(__bEARER)->sgw_ul_teid = 0; \
(__bEARER)->sgw_ul_addr = 0; \
} while(0)
typedef struct _mme_bearer_t {
lnode_t node; /* A node of list_t */

View File

@ -312,3 +312,32 @@ status_t mme_gtp_send_create_indirect_data_forwarding_tunnel_request(
return CORE_OK;
}
status_t mme_gtp_send_delete_indirect_data_forwarding_tunnel_request(
mme_ue_t *mme_ue)
{
status_t rv;
gtp_header_t h;
pkbuf_t *pkbuf = NULL;
gtp_xact_t *xact = NULL;
mme_sess_t *sess = NULL;
d_assert(mme_ue, return CORE_ERROR, "Null param");
sess = mme_sess_first(mme_ue);
d_assert(sess, return CORE_ERROR, "Null param");
memset(&h, 0, sizeof(gtp_header_t));
h.type = GTP_DELETE_INDIRECT_DATA_FORWARDING_TUNNEL_REQUEST_TYPE;
h.teid = mme_ue->sgw_s11_teid;
pkbuf = pkbuf_alloc(TLV_MAX_HEADROOM, 0);
d_assert(pkbuf, return CORE_ERROR, "S11 build error");
xact = gtp_xact_local_create(sess->sgw, &h, pkbuf);
d_assert(xact, return CORE_ERROR, "Null param");
rv = gtp_xact_commit(xact);
d_assert(rv == CORE_OK, return CORE_ERROR, "xact_commit error");
return CORE_OK;
}

View File

@ -21,9 +21,13 @@ CORE_DECLARE(status_t) mme_gtp_send_create_bearer_response(
mme_bearer_t *bearer);
CORE_DECLARE(status_t) mme_gtp_send_release_access_bearers_request(
mme_ue_t *mme_ue);
CORE_DECLARE(status_t)
mme_gtp_send_create_indirect_data_forwarding_tunnel_request(
mme_ue_t *mme_ue);
CORE_DECLARE(status_t)
mme_gtp_send_delete_indirect_data_forwarding_tunnel_request(
mme_ue_t *mme_ue);
#ifdef __cplusplus
}

View File

@ -403,7 +403,8 @@ status_t mme_s11_build_create_indirect_data_forwarding_tunnel_request(
&gtp_message.create_indirect_data_forwarding_tunnel_request;
tlv_bearer_context_t *bearers[GTP_MAX_NUM_OF_INDIRECT_TUNNEL];
gtp_f_teid_t tunnel_teid[GTP_MAX_NUM_OF_INDIRECT_TUNNEL];
gtp_f_teid_t dl_teid[GTP_MAX_NUM_OF_INDIRECT_TUNNEL];
gtp_f_teid_t ul_teid[GTP_MAX_NUM_OF_INDIRECT_TUNNEL];
d_assert(mme_ue, return CORE_ERROR, "Null param");
@ -419,39 +420,38 @@ status_t mme_s11_build_create_indirect_data_forwarding_tunnel_request(
{
if (MME_HAVE_ENB_DL_INDIRECT_TUNNEL(bearer))
{
bearers[i]->presence = 1;
bearers[i]->eps_bearer_id.presence = 1;
bearers[i]->eps_bearer_id.u8 = bearer->ebi;
memset(&tunnel_teid[i], 0, sizeof(gtp_f_teid_t));
tunnel_teid[i].ipv4 = 1;
tunnel_teid[i].interface_type =
memset(&dl_teid[i], 0, sizeof(gtp_f_teid_t));
dl_teid[i].ipv4 = 1;
dl_teid[i].interface_type =
GTP_F_TEID_ENODEB_GTP_U_FOR_DL_DATA_FORWARDING;
tunnel_teid[i].ipv4_addr = bearer->enb_dl_addr;
tunnel_teid[i].teid = htonl(bearer->enb_dl_teid);
dl_teid[i].ipv4_addr = bearer->enb_dl_addr;
dl_teid[i].teid = htonl(bearer->enb_dl_teid);
d_assert(bearers[i], return CORE_ERROR,);
bearers[i]->s1_u_enodeb_f_teid.presence = 1;
bearers[i]->s1_u_enodeb_f_teid.data = &tunnel_teid[i];
bearers[i]->s1_u_enodeb_f_teid.data = &dl_teid[i];
bearers[i]->s1_u_enodeb_f_teid.len = GTP_F_TEID_IPV4_LEN;
i++;
}
if (MME_HAVE_ENB_UL_INDIRECT_TUNNEL(bearer))
{
memset(&ul_teid[i], 0, sizeof(gtp_f_teid_t));
ul_teid[i].ipv4 = 1;
ul_teid[i].interface_type =
GTP_F_TEID_ENODEB_GTP_U_FOR_UL_DATA_FORWARDING;
ul_teid[i].ipv4_addr = bearer->enb_ul_addr;
ul_teid[i].teid = htonl(bearer->enb_ul_teid);
d_assert(bearers[i], return CORE_ERROR,);
bearers[i]->s12_rnc_f_teid.presence = 1;
bearers[i]->s12_rnc_f_teid.data = &ul_teid[i];
bearers[i]->s12_rnc_f_teid.len = GTP_F_TEID_IPV4_LEN;
}
if (MME_HAVE_ENB_DL_INDIRECT_TUNNEL(bearer) ||
MME_HAVE_ENB_UL_INDIRECT_TUNNEL(bearer))
{
bearers[i]->presence = 1;
bearers[i]->eps_bearer_id.presence = 1;
bearers[i]->eps_bearer_id.u8 = bearer->ebi;
memset(&tunnel_teid[i], 0, sizeof(gtp_f_teid_t));
tunnel_teid[i].ipv4 = 1;
tunnel_teid[i].interface_type =
GTP_F_TEID_ENODEB_GTP_U_FOR_UL_DATA_FORWARDING;
tunnel_teid[i].ipv4_addr = bearer->enb_ul_addr;
tunnel_teid[i].teid = htonl(bearer->enb_ul_teid);
d_assert(bearers[i], return CORE_ERROR,);
bearers[i]->s12_rnc_f_teid.presence = 1;
bearers[i]->s12_rnc_f_teid.data = &tunnel_teid[i];
bearers[i]->s12_rnc_f_teid.len = GTP_F_TEID_IPV4_LEN;
i++;
}

View File

@ -127,7 +127,9 @@ void mme_s11_handle_modify_bearer_response(
);
GTP_COUNTER_CHECK(mme_ue, GTP_COUNTER_MODIFY_BEARER_BY_HANDOVER_NOTIFY,
printf("Handover Notify\n");
rv = mme_gtp_send_delete_indirect_data_forwarding_tunnel_request(
mme_ue);
d_assert(rv == CORE_OK, return, "gtp send error");
);
}
@ -387,7 +389,7 @@ void mme_s11_handle_create_indirect_data_forwarding_tunnel_response(
bearer->sgw_dl_teid = ntohl(teid->teid);
bearer->sgw_dl_addr = teid->ipv4_addr;
}
else if (bearers[i]->s2b_u_epdg_f_teid_5.presence)
if (bearers[i]->s2b_u_epdg_f_teid_5.presence)
{
teid = bearers[i]->s2b_u_epdg_f_teid_5.data;
d_assert(teid, return,);
@ -395,10 +397,47 @@ void mme_s11_handle_create_indirect_data_forwarding_tunnel_response(
bearer->sgw_ul_teid = ntohl(teid->teid);
bearer->sgw_ul_addr = teid->ipv4_addr;
}
else
d_assert(0, return, "Not Supported");
}
rv = s1ap_send_handover_command(mme_ue);
d_assert(rv == CORE_OK,, "s1ap send error");
}
void mme_s11_handle_delete_indirect_data_forwarding_tunnel_response(
gtp_xact_t *xact, mme_ue_t *mme_ue,
gtp_delete_indirect_data_forwarding_tunnel_response_t *rsp)
{
status_t rv;
mme_sess_t *sess = NULL;
mme_bearer_t *bearer = NULL;
d_assert(xact, return, "Null param");
d_assert(mme_ue, return, "Null param");
d_assert(rsp, return, "Null param");
if (rsp->cause.presence == 0)
{
d_error("No Cause");
return;
}
d_trace(3, "[GTP] Delete Indirect Data Forwarding Tunnel Response : "
"MME[%d] <-- SGW[%d]\n", mme_ue->mme_s11_teid, mme_ue->sgw_s11_teid);
rv = gtp_xact_commit(xact);
d_assert(rv == CORE_OK, return, "xact_commit error");
sess = mme_sess_first(mme_ue);
while(sess)
{
bearer = mme_bearer_first(sess);
while(bearer)
{
CLEAR_INDIRECT_TUNNEL(bearer);
bearer = mme_bearer_next(bearer);
}
sess = mme_sess_next(sess);
}
}

View File

@ -27,6 +27,9 @@ CORE_DECLARE(void) mme_s11_handle_downlink_data_notification(
CORE_DECLARE(void) mme_s11_handle_create_indirect_data_forwarding_tunnel_response(
gtp_xact_t *xact, mme_ue_t *mme_ue,
gtp_create_indirect_data_forwarding_tunnel_response_t *rsp);
CORE_DECLARE(void) mme_s11_handle_delete_indirect_data_forwarding_tunnel_response(
gtp_xact_t *xact, mme_ue_t *mme_ue,
gtp_delete_indirect_data_forwarding_tunnel_response_t *rsp);
#ifdef __cplusplus
}

View File

@ -360,6 +360,11 @@ void mme_state_operational(fsm_t *s, event_t *e)
xact, mme_ue,
&message.create_indirect_data_forwarding_tunnel_response);
break;
case GTP_DELETE_INDIRECT_DATA_FORWARDING_TUNNEL_RESPONSE_TYPE:
mme_s11_handle_delete_indirect_data_forwarding_tunnel_response(
xact, mme_ue,
&message.delete_indirect_data_forwarding_tunnel_response);
break;
default:
d_warn("Not implmeneted(type:%d)", message.h.type);
break;

View File

@ -540,7 +540,8 @@ void sgw_s11_handle_create_indirect_data_forwarding_tunnel_request(
tlv_bearer_context_t *req_bearers[GTP_MAX_NUM_OF_INDIRECT_TUNNEL];
tlv_bearer_context_t *rsp_bearers[GTP_MAX_NUM_OF_INDIRECT_TUNNEL];
gtp_f_teid_t *req_teid = NULL;
gtp_f_teid_t rsp_teid[GTP_MAX_NUM_OF_INDIRECT_TUNNEL];
gtp_f_teid_t rsp_dl_teid[GTP_MAX_NUM_OF_INDIRECT_TUNNEL];
gtp_f_teid_t rsp_ul_teid[GTP_MAX_NUM_OF_INDIRECT_TUNNEL];
d_assert(sgw_ue, return, "Null param");
d_assert(s11_xact, return, "Null param");
@ -580,8 +581,21 @@ void sgw_s11_handle_create_indirect_data_forwarding_tunnel_request(
GTP_F_TEID_SGW_GTP_U_FOR_DL_DATA_FORWARDING);
d_assert(tunnel, return, "No Tunnel Context");
tunnel->remote_teid = ntohl(req_teid->teid);
tunnel->remote_addr = req_teid->ipv4_addr;
memset(&rsp_dl_teid[i], 0, sizeof(gtp_f_teid_t));
rsp_dl_teid[i].ipv4 = 1;
rsp_dl_teid[i].ipv4_addr = tunnel->local_addr;
rsp_dl_teid[i].teid = htonl(tunnel->local_teid);
rsp_dl_teid[i].interface_type = tunnel->interface_type;
rsp_bearers[i]->s4_u_sgsn_f_teid.presence = 1;
rsp_bearers[i]->s4_u_sgsn_f_teid.data = &rsp_dl_teid[i];
rsp_bearers[i]->s4_u_sgsn_f_teid.len = GTP_F_TEID_IPV4_LEN;
}
else if (req_bearers[i]->s12_rnc_f_teid.presence)
if (req_bearers[i]->s12_rnc_f_teid.presence)
{
req_teid = req_bearers[i]->s12_rnc_f_teid.data;
d_assert(req_teid, return,);
@ -589,38 +603,28 @@ void sgw_s11_handle_create_indirect_data_forwarding_tunnel_request(
tunnel = sgw_tunnel_add(bearer,
GTP_F_TEID_SGW_GTP_U_FOR_UL_DATA_FORWARDING);
d_assert(tunnel, return, "No Tunnel Context");
}
else
d_assert(0, return, "Not Supported");
tunnel->remote_teid = ntohl(req_teid->teid);
tunnel->remote_addr = req_teid->ipv4_addr;
tunnel->remote_teid = ntohl(req_teid->teid);
tunnel->remote_addr = req_teid->ipv4_addr;
d_assert(rsp_bearers[i], return,);
rsp_bearers[i]->presence = 1;
rsp_bearers[i]->eps_bearer_id.presence = 1;
rsp_bearers[i]->eps_bearer_id.u8 = bearer->ebi;
memset(&rsp_ul_teid[i], 0, sizeof(gtp_f_teid_t));
rsp_ul_teid[i].ipv4 = 1;
rsp_ul_teid[i].ipv4_addr = tunnel->local_addr;
rsp_ul_teid[i].teid = htonl(tunnel->local_teid);
rsp_ul_teid[i].interface_type = tunnel->interface_type;
memset(&rsp_teid[i], 0, sizeof(gtp_f_teid_t));
rsp_teid[i].ipv4 = 1;
rsp_teid[i].ipv4_addr = tunnel->local_addr;
rsp_teid[i].teid = htonl(tunnel->local_teid);
rsp_teid[i].interface_type = tunnel->interface_type;
if (tunnel->interface_type ==
GTP_F_TEID_SGW_GTP_U_FOR_DL_DATA_FORWARDING)
{
rsp_bearers[i]->s4_u_sgsn_f_teid.presence = 1;
rsp_bearers[i]->s4_u_sgsn_f_teid.data = &rsp_teid[i];
rsp_bearers[i]->s4_u_sgsn_f_teid.len = GTP_F_TEID_IPV4_LEN;
}
else if (tunnel->interface_type ==
GTP_F_TEID_SGW_GTP_U_FOR_UL_DATA_FORWARDING)
{
rsp_bearers[i]->s2b_u_epdg_f_teid_5.presence = 1;
rsp_bearers[i]->s2b_u_epdg_f_teid_5.data = &rsp_teid[i];
rsp_bearers[i]->s2b_u_epdg_f_teid_5.data = &rsp_ul_teid[i];
rsp_bearers[i]->s2b_u_epdg_f_teid_5.len = GTP_F_TEID_IPV4_LEN;
}
if (req_bearers[i]->s1_u_enodeb_f_teid.presence ||
req_bearers[i]->s12_rnc_f_teid.presence)
{
rsp_bearers[i]->presence = 1;
rsp_bearers[i]->eps_bearer_id.presence = 1;
rsp_bearers[i]->eps_bearer_id.u8 = bearer->ebi;
}
}
gtp_message.h.type =
@ -639,3 +643,75 @@ void sgw_s11_handle_create_indirect_data_forwarding_tunnel_request(
d_trace(3, "[GTP] Create Indirect Data Forwarding Tunnel Response : "
"MME[%d] --> SGW[%d]\n", sgw_ue->mme_s11_teid, sgw_ue->sgw_s11_teid);
}
void sgw_s11_handle_delete_indirect_data_forwarding_tunnel_request(
gtp_xact_t *s11_xact, sgw_ue_t *sgw_ue)
{
status_t rv;
gtp_delete_indirect_data_forwarding_tunnel_response_t *rsp = NULL;
pkbuf_t *pkbuf = NULL;
gtp_message_t gtp_message;
sgw_sess_t *sess = NULL;
sgw_bearer_t *bearer = NULL;
sgw_tunnel_t *tunnel = NULL, *next_tunnel;
gtp_cause_t cause;
d_assert(sgw_ue, return, "Null param");
d_assert(s11_xact, return, "Null param");
/* Delete Indirect Tunnel */
sess = sgw_sess_first(sgw_ue);
while (sess)
{
bearer = sgw_bearer_first(sess);
while (bearer)
{
tunnel = sgw_tunnel_first(bearer);
while(tunnel)
{
next_tunnel = sgw_tunnel_next(tunnel);
if (tunnel->interface_type ==
GTP_F_TEID_SGW_GTP_U_FOR_DL_DATA_FORWARDING ||
tunnel->interface_type ==
GTP_F_TEID_SGW_GTP_U_FOR_UL_DATA_FORWARDING)
sgw_tunnel_remove(tunnel);
tunnel = next_tunnel;
}
bearer = sgw_bearer_next(bearer);
}
sess = sgw_sess_next(sess);
}
rsp = &gtp_message.delete_indirect_data_forwarding_tunnel_response;
memset(&gtp_message, 0, sizeof(gtp_message_t));
memset(&cause, 0, sizeof(cause));
cause.value = GTP_CAUSE_REQUEST_ACCEPTED;
rsp->cause.presence = 1;
rsp->cause.data = &cause;
rsp->cause.len = sizeof(cause);
gtp_message.h.type =
GTP_DELETE_INDIRECT_DATA_FORWARDING_TUNNEL_RESPONSE_TYPE;
gtp_message.h.teid = sgw_ue->mme_s11_teid;
rv = gtp_build_msg(&pkbuf, &gtp_message);
d_assert(rv == CORE_OK, return, "gtp build failed");
rv = gtp_xact_update_tx(s11_xact, &gtp_message.h, pkbuf);
d_assert(rv == CORE_OK, return, "gtp_xact_update_tx error");
rv = gtp_xact_commit(s11_xact);
d_assert(rv == CORE_OK, return, "xact_commit error");
d_trace(3, "[GTP] Delete Indirect Data Forwarding Tunnel Response : "
"MME[%d] --> SGW[%d]\n", sgw_ue->mme_s11_teid, sgw_ue->sgw_s11_teid);
}

View File

@ -28,6 +28,8 @@ CORE_DECLARE(void) sgw_s11_handle_downlink_data_notification_ack(
CORE_DECLARE(void) sgw_s11_handle_create_indirect_data_forwarding_tunnel_request(
gtp_xact_t *s11_xact, sgw_ue_t *sgw_ue,
gtp_create_indirect_data_forwarding_tunnel_request_t *req);
CORE_DECLARE(void) sgw_s11_handle_delete_indirect_data_forwarding_tunnel_request(
gtp_xact_t *s11_xact, sgw_ue_t *sgw_ue);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -107,6 +107,10 @@ void sgw_state_operational(fsm_t *s, event_t *e)
&message.
create_indirect_data_forwarding_tunnel_request);
break;
case GTP_DELETE_INDIRECT_DATA_FORWARDING_TUNNEL_REQUEST_TYPE:
sgw_s11_handle_delete_indirect_data_forwarding_tunnel_request(
xact, sgw_ue);
break;
default:
d_warn("Not implmeneted(type:%d)", message.h.type);
break;