forked from acouzens/open5gs
update it
This commit is contained in:
parent
9946846494
commit
114e6927c1
|
@ -135,6 +135,21 @@ typedef struct _qos_t {
|
|||
|
||||
} qos_t;
|
||||
|
||||
/**********************************
|
||||
* PDN Structure */
|
||||
typedef struct _pdn_t {
|
||||
c_uint32_t context_identifier;
|
||||
c_int8_t apn[MAX_APN_LEN];
|
||||
#define S6A_PDN_TYPE_IPV4 0
|
||||
#define S6A_PDN_TYPE_IPV6 1
|
||||
#define S6A_PDN_TYPE_IPV4_AND_IPV6 2
|
||||
#define S6A_PDN_TYPE_IPV4_OR_IPV6 3
|
||||
c_int8_t pdn_type;
|
||||
paa_t paa;
|
||||
|
||||
qos_t qos;
|
||||
} pdn_t;
|
||||
|
||||
/**************************************************
|
||||
* Protocol Configuration Options Structure
|
||||
* 8.13 Protocol Configuration Options (PCO)
|
||||
|
|
|
@ -612,7 +612,7 @@ status_t hss_db_subscription_data(
|
|||
while(bson_iter_next(&child1_iter))
|
||||
{
|
||||
const char *child1_key = bson_iter_key(&child1_iter);
|
||||
hss_db_pdn_t *pdn = NULL;
|
||||
pdn_t *pdn = NULL;
|
||||
|
||||
d_assert(child1_key, goto out, "PDN is not ARRAY");
|
||||
pdn_index = atoi(child1_key);
|
||||
|
|
|
@ -20,19 +20,6 @@ typedef struct _hss_db_auth_info_t {
|
|||
c_uint64_t sqn;
|
||||
} hss_db_auth_info_t;
|
||||
|
||||
typedef struct _hss_db_pdn_t {
|
||||
c_uint32_t context_identifier;
|
||||
c_int8_t apn[MAX_APN_LEN];
|
||||
#define S6A_PDN_TYPE_IPV4 0
|
||||
#define S6A_PDN_TYPE_IPV6 1
|
||||
#define S6A_PDN_TYPE_IPV4_AND_IPV6 2
|
||||
#define S6A_PDN_TYPE_IPV4_OR_IPV6 3
|
||||
c_int8_t pdn_type;
|
||||
paa_t paa;
|
||||
|
||||
qos_t qos;
|
||||
} hss_db_pdn_t;
|
||||
|
||||
typedef struct _hss_db_subscription_data_t {
|
||||
#define HSS_ACCESS_RESTRICTION_UTRAN_NOT_ALLOWED (1)
|
||||
#define HSS_ACCESS_RESTRICTION_GERAN_NOT_ALLOWED (1<<1)
|
||||
|
@ -55,7 +42,7 @@ typedef struct _hss_db_subscription_data_t {
|
|||
|
||||
c_uint32_t subscribed_rau_tau_timer; /* minutes */
|
||||
|
||||
hss_db_pdn_t pdn[MAX_NUM_OF_PDN];
|
||||
pdn_t pdn[MAX_NUM_OF_PDN];
|
||||
int num_of_pdn;
|
||||
} hss_db_subscription_data_t;
|
||||
|
||||
|
|
|
@ -330,7 +330,7 @@ static int hss_ulr_cb( struct msg **msg, struct avp *avp,
|
|||
struct avp *allocation_retention_priority, *priority_level;
|
||||
struct avp *pre_emption_capability, *pre_emption_vulnerability;
|
||||
|
||||
hss_db_pdn_t *pdn = &subscription_data.pdn[i];
|
||||
pdn_t *pdn = &subscription_data.pdn[i];
|
||||
d_assert(pdn, goto out,);
|
||||
|
||||
CHECK_FCT( fd_msg_avp_new(s6a_apn_configuration, 0,
|
||||
|
|
|
@ -31,7 +31,6 @@ index_declare(mme_ue_pool, mme_ue_t, MAX_NUM_OF_UE);
|
|||
index_declare(enb_ue_pool, enb_ue_t, MAX_NUM_OF_UE);
|
||||
index_declare(mme_sess_pool, mme_sess_t, MAX_NUM_OF_UE);
|
||||
index_declare(mme_bearer_pool, mme_bearer_t, MAX_NUM_OF_UE_BEARER);
|
||||
pool_declare(mme_pdn_pool, pdn_t, MAX_NUM_OF_UE_PDN);
|
||||
|
||||
static int context_initialized = 0;
|
||||
|
||||
|
@ -53,7 +52,6 @@ status_t mme_context_init()
|
|||
index_init(&enb_ue_pool, MAX_NUM_OF_UE);
|
||||
index_init(&mme_sess_pool, MAX_NUM_OF_UE);
|
||||
index_init(&mme_bearer_pool, MAX_NUM_OF_UE_BEARER);
|
||||
pool_init(&mme_pdn_pool, MAX_NUM_OF_UE_PDN);
|
||||
|
||||
self.mme_ue_s1ap_id_hash = hash_make();
|
||||
self.imsi_ue_hash = hash_make();
|
||||
|
@ -85,7 +83,6 @@ status_t mme_context_final()
|
|||
d_assert(self.guti_ue_hash, , "Null param");
|
||||
hash_destroy(self.guti_ue_hash);
|
||||
|
||||
pool_final(&mme_pdn_pool);
|
||||
index_final(&mme_bearer_pool);
|
||||
index_final(&mme_sess_pool);
|
||||
index_final(&mme_ue_pool);
|
||||
|
@ -1167,7 +1164,6 @@ mme_ue_t* mme_ue_add(enb_ue_t *enb_ue)
|
|||
|
||||
mme_ue->ebi = MIN_EPS_BEARER_ID - 1; /* Setup EBI Generator */
|
||||
|
||||
list_init(&mme_ue->pdn_list);
|
||||
list_init(&mme_ue->sess_list);
|
||||
|
||||
/* Create t3413 timer */
|
||||
|
@ -1787,80 +1783,42 @@ pdn_t* mme_pdn_add(mme_ue_t *mme_ue, c_int8_t *apn)
|
|||
d_assert(mme_ue, return NULL, "Null param");
|
||||
d_assert(apn, return NULL, "Null param");
|
||||
|
||||
pool_alloc_node(&mme_pdn_pool, &pdn);
|
||||
pdn = &mme_ue->pdn[mme_ue->num_of_pdn];
|
||||
d_assert(pdn, return NULL, "PDN context allocation failed");
|
||||
|
||||
memset(pdn, 0, sizeof(pdn_t));
|
||||
strcpy(pdn->apn, apn);
|
||||
|
||||
mme_ue->num_of_pdn++;
|
||||
|
||||
pdn->mme_ue = mme_ue;
|
||||
list_append(&mme_ue->pdn_list, pdn);
|
||||
|
||||
return pdn;
|
||||
}
|
||||
|
||||
status_t mme_pdn_remove(pdn_t *pdn)
|
||||
{
|
||||
mme_ue_t *mme_ue = NULL;
|
||||
|
||||
d_assert(pdn, return CORE_ERROR, "Null param");
|
||||
mme_ue = pdn->mme_ue;
|
||||
d_assert(mme_ue, return CORE_ERROR, "Null param");
|
||||
|
||||
list_remove(&mme_ue->pdn_list, pdn);
|
||||
pool_free_node(&mme_pdn_pool, pdn);
|
||||
|
||||
return CORE_OK;
|
||||
}
|
||||
|
||||
status_t mme_pdn_remove_all(mme_ue_t *mme_ue)
|
||||
{
|
||||
pdn_t *pdn = NULL, *next_pdn = NULL;
|
||||
|
||||
d_assert(mme_ue, return CORE_ERROR, "Null param");
|
||||
mme_ue->num_of_pdn = 0;
|
||||
|
||||
pdn = list_first(&mme_ue->pdn_list);
|
||||
while (pdn)
|
||||
{
|
||||
next_pdn = list_next(pdn);
|
||||
|
||||
mme_pdn_remove(pdn);
|
||||
|
||||
pdn = next_pdn;
|
||||
}
|
||||
|
||||
return CORE_OK;
|
||||
}
|
||||
|
||||
pdn_t* mme_pdn_find_by_apn(mme_ue_t *mme_ue, c_int8_t *apn)
|
||||
{
|
||||
pdn_t *pdn = NULL;
|
||||
int i = 0;
|
||||
|
||||
d_assert(mme_ue, return NULL, "Null param");
|
||||
|
||||
pdn = list_first(&mme_ue->pdn_list);
|
||||
while (pdn)
|
||||
for (i = 0; i < mme_ue->num_of_pdn; i++)
|
||||
{
|
||||
pdn = &mme_ue->pdn[i];
|
||||
if (strcmp(pdn->apn, apn) == 0)
|
||||
break;
|
||||
|
||||
pdn = list_next(pdn);
|
||||
}
|
||||
|
||||
return pdn;
|
||||
}
|
||||
|
||||
pdn_t* mme_pdn_first(mme_ue_t *mme_ue)
|
||||
{
|
||||
d_assert(mme_ue, return NULL, "Null param");
|
||||
return list_first(&mme_ue->pdn_list);
|
||||
}
|
||||
|
||||
pdn_t* mme_pdn_next(pdn_t *pdn)
|
||||
{
|
||||
return list_next(pdn);
|
||||
}
|
||||
|
||||
void mme_ue_paged(mme_ue_t *mme_ue)
|
||||
{
|
||||
d_assert(mme_ue, return , "Null param");
|
||||
|
|
|
@ -217,8 +217,9 @@ struct _mme_ue_t {
|
|||
c_uint32_t ula_flags;
|
||||
c_uint32_t max_bandwidth_ul; /* bits per seconds */
|
||||
c_uint32_t max_bandwidth_dl; /* bits per seconds */
|
||||
list_t pdn_list;
|
||||
c_uint32_t subscribed_rau_tau_timer; /* seconds */
|
||||
pdn_t pdn[MAX_NUM_OF_PDN]; /* APN Profile */
|
||||
int num_of_pdn;
|
||||
|
||||
/* ESM Info */
|
||||
c_uint8_t ebi; /* EPS Bearer ID generator */
|
||||
|
@ -241,26 +242,6 @@ struct _mme_ue_t {
|
|||
void *radio_capa;
|
||||
};
|
||||
|
||||
/**********************************
|
||||
* PDN Structure */
|
||||
typedef struct _pdn_t {
|
||||
lnode_t node; /**< A node of list_t */
|
||||
|
||||
c_uint32_t context_identifier;
|
||||
c_int8_t apn[MAX_APN_LEN];
|
||||
#define S6A_PDN_TYPE_IPV4 0
|
||||
#define S6A_PDN_TYPE_IPV6 1
|
||||
#define S6A_PDN_TYPE_IPV4_AND_IPV6 2
|
||||
#define S6A_PDN_TYPE_IPV4_OR_IPV6 3
|
||||
c_int8_t pdn_type;
|
||||
paa_t paa;
|
||||
|
||||
qos_t qos;
|
||||
|
||||
/* Related Context */
|
||||
mme_ue_t *mme_ue;
|
||||
} pdn_t;
|
||||
|
||||
typedef struct _mme_sess_t {
|
||||
lnode_t node; /**< A node of list_t */
|
||||
index_t index; /**< An index of this node */
|
||||
|
@ -386,12 +367,9 @@ CORE_DECLARE(mme_bearer_t*) mme_bearer_first(mme_sess_t *sess);
|
|||
CORE_DECLARE(mme_bearer_t*) mme_bearer_next(mme_bearer_t *bearer);
|
||||
|
||||
CORE_DECLARE(pdn_t*) mme_pdn_add(mme_ue_t *mme_ue, c_int8_t *apn);
|
||||
CORE_DECLARE(status_t) mme_pdn_remove(pdn_t *pdn);
|
||||
CORE_DECLARE(status_t) mme_pdn_remove_all(mme_ue_t *mme_ue);
|
||||
CORE_DECLARE(pdn_t*) mme_pdn_find_by_apn(
|
||||
mme_ue_t *mme_ue, c_int8_t *apn);
|
||||
CORE_DECLARE(pdn_t*) mme_pdn_first(mme_ue_t *mme_ue);
|
||||
CORE_DECLARE(pdn_t*) mme_pdn_next(pdn_t *pdn);
|
||||
|
||||
CORE_DECLARE(enb_ue_t*) enb_ue_add(mme_enb_t *enb);
|
||||
CORE_DECLARE(unsigned int) enb_ue_count();
|
||||
|
|
Loading…
Reference in New Issue