mirror of
https://github.com/nextepc/nextepc-oss.git
synced 2025-11-03 05:13:15 +00:00
pool allocation is changed with new method
This commit is contained in:
@@ -37,9 +37,6 @@ static int context_initialized = 0;
|
||||
|
||||
status_t mme_context_init()
|
||||
{
|
||||
printf("%ld\n", sizeof mme_bearer_pool);
|
||||
printf("%ld\n", sizeof mme_sess_pool);
|
||||
printf("%ld\n", sizeof mme_ue_pool);
|
||||
d_assert(context_initialized == 0, return CORE_ERROR,
|
||||
"MME context already has been context_initialized");
|
||||
|
||||
|
||||
@@ -887,8 +887,8 @@ pgw_sess_t *pgw_sess_add(
|
||||
"Can't add default bearer context");
|
||||
bearer->ebi = ebi;
|
||||
|
||||
sess->ip_pool = pgw_ip_pool_alloc();
|
||||
d_assert(sess->ip_pool, pgw_sess_remove(sess); return NULL,
|
||||
sess->ue_ip = pgw_ue_ip_alloc(AF_INET, apn);
|
||||
d_assert(sess->ue_ip, pgw_sess_remove(sess); return NULL,
|
||||
"Can't add default bearer context");
|
||||
|
||||
/* Generate Hash Key : IMSI + APN */
|
||||
@@ -906,7 +906,7 @@ status_t pgw_sess_remove(pgw_sess_t *sess)
|
||||
|
||||
hash_set(self.sess_hash, sess->hash_keybuf, sess->hash_keylen, NULL);
|
||||
|
||||
pgw_ip_pool_free(sess->ip_pool);
|
||||
pgw_ue_ip_free(sess->ue_ip);
|
||||
|
||||
pgw_bearer_remove_all(sess);
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ typedef struct _pgw_sess_t {
|
||||
|
||||
/* APN Configuration */
|
||||
pdn_t pdn;
|
||||
pgw_ip_pool_t* ip_pool;
|
||||
pgw_ue_ip_t* ue_ip;
|
||||
|
||||
/* User-Lication-Info */
|
||||
tai_t tai;
|
||||
|
||||
@@ -39,7 +39,7 @@ void pgw_gx_send_ccr(gtp_xact_t *xact, pgw_sess_t *sess,
|
||||
struct session *session = NULL;
|
||||
|
||||
d_assert(sess, return, "Null param");
|
||||
d_assert(sess->ip_pool, return, "Null param");
|
||||
d_assert(sess->ue_ip, return, "Null param");
|
||||
|
||||
/* Create the random value to store with the session */
|
||||
pool_alloc_node(&pgw_gx_sess_pool, &mi);
|
||||
@@ -138,8 +138,8 @@ void pgw_gx_send_ccr(gtp_xact_t *xact, pgw_sess_t *sess,
|
||||
/* Set Framed-IP-Address */
|
||||
CHECK_FCT_DO( fd_msg_avp_new(gx_framed_ip_address, 0, &avp),
|
||||
goto out );
|
||||
val.os.data = (c_uint8_t*)&sess->ip_pool->ue_addr;
|
||||
val.os.len = sizeof(sess->ip_pool->ue_addr);
|
||||
val.os.data = (c_uint8_t*)&sess->ue_ip->addr[0];
|
||||
val.os.len = sizeof(sess->ue_ip->addr[0]);
|
||||
CHECK_FCT_DO( fd_msg_avp_setvalue(avp, &val), goto out );
|
||||
CHECK_FCT_DO( fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp), goto out );
|
||||
|
||||
|
||||
@@ -59,9 +59,9 @@ status_t pgw_s5c_build_create_session_response(
|
||||
len = len;
|
||||
|
||||
/* PDN Address Allocation */
|
||||
d_assert(sess->ip_pool, return CORE_ERROR, "No IP Pool");
|
||||
d_assert(sess->ue_ip, return CORE_ERROR, "No IP Pool");
|
||||
sess->pdn.paa.pdn_type = GTP_PDN_TYPE_IPV4;
|
||||
sess->pdn.paa.addr = sess->ip_pool->ue_addr;
|
||||
sess->pdn.paa.addr = sess->ue_ip->addr[0];
|
||||
|
||||
rsp->pdn_address_allocation.presence = 1;
|
||||
rsp->pdn_address_allocation.data = &sess->pdn.paa;
|
||||
|
||||
@@ -321,7 +321,7 @@ pgw:
|
||||
# apn: volte
|
||||
#
|
||||
ue_pool:
|
||||
- addr: 172.16.0.1/16
|
||||
- addr: 45.45.0.1/16
|
||||
- addr: cafe::1/64
|
||||
|
||||
ue_network:
|
||||
|
||||
Reference in New Issue
Block a user