Commit 9324fa72 authored by Frédéric Leroy's avatar Frédéric Leroy

UE/ESM: move _esm_data to nas_user_t

parent d21db3d5
...@@ -110,7 +110,7 @@ int esm_proc_dedicated_eps_bearer_context_request(nas_user_t *user, int ebi, int ...@@ -110,7 +110,7 @@ int esm_proc_dedicated_eps_bearer_context_request(nas_user_t *user, int ebi, int
int *esm_cause) int *esm_cause)
{ {
LOG_FUNC_IN; LOG_FUNC_IN;
esm_data_t *esm_data = _esm_data; esm_data_t *esm_data = user->esm_data;
int rc = RETURNerror; int rc = RETURNerror;
LOG_TRACE(INFO, "ESM-PROC - Dedicated EPS bearer context activation " LOG_TRACE(INFO, "ESM-PROC - Dedicated EPS bearer context activation "
......
...@@ -109,7 +109,7 @@ int esm_proc_default_eps_bearer_context_request(nas_user_t *user, int pid, int e ...@@ -109,7 +109,7 @@ int esm_proc_default_eps_bearer_context_request(nas_user_t *user, int pid, int e
int *esm_cause) int *esm_cause)
{ {
LOG_FUNC_IN; LOG_FUNC_IN;
esm_data_t *esm_data = _esm_data; esm_data_t *esm_data = user->esm_data;
int rc = RETURNerror; int rc = RETURNerror;
LOG_TRACE(INFO, "ESM-PROC - Default EPS bearer context activation " LOG_TRACE(INFO, "ESM-PROC - Default EPS bearer context activation "
......
...@@ -102,7 +102,6 @@ static int _eps_bearer_release(nas_user_t *user, int ebi, int *pid, int *bid); ...@@ -102,7 +102,6 @@ static int _eps_bearer_release(nas_user_t *user, int ebi, int *pid, int *bid);
** gnalling between the UE and the MME ** ** gnalling between the UE and the MME **
** ebi: EPS bearer identity of the EPS bearer con- ** ** ebi: EPS bearer identity of the EPS bearer con- **
** text to be deactivated ** ** text to be deactivated **
** Others: _esm_data **
** ** ** **
** Outputs: pid: Identifier of the PDN connection the EPS ** ** Outputs: pid: Identifier of the PDN connection the EPS **
** bearer belongs to ** ** bearer belongs to **
...@@ -119,7 +118,7 @@ int esm_proc_eps_bearer_context_deactivate(nas_user_t *user, int is_local, int e ...@@ -119,7 +118,7 @@ int esm_proc_eps_bearer_context_deactivate(nas_user_t *user, int is_local, int e
int rc = RETURNerror; int rc = RETURNerror;
int i; int i;
esm_data_t *esm_data = _esm_data; esm_data_t *esm_data = user->esm_data;
if (is_local) { if (is_local) {
if (ebi != ESM_SAP_ALL_EBI) { if (ebi != ESM_SAP_ALL_EBI) {
/* Locally release the EPS bearer context */ /* Locally release the EPS bearer context */
...@@ -195,7 +194,7 @@ int esm_proc_eps_bearer_context_deactivate_request(nas_user_t *user, int ebi, in ...@@ -195,7 +194,7 @@ int esm_proc_eps_bearer_context_deactivate_request(nas_user_t *user, int ebi, in
int pid, bid; int pid, bid;
int rc = RETURNok; int rc = RETURNok;
esm_data_t *esm_data = _esm_data; esm_data_t *esm_data = user->esm_data;
LOG_TRACE(INFO, "ESM-PROC - EPS bearer context deactivation " LOG_TRACE(INFO, "ESM-PROC - EPS bearer context deactivation "
"requested by the network (ebi=%d)", ebi); "requested by the network (ebi=%d)", ebi);
......
...@@ -131,7 +131,6 @@ static void *_pdn_connectivity_t3482_handler(void *); ...@@ -131,7 +131,6 @@ static void *_pdn_connectivity_t3482_handler(void *);
** the new PDN connection or the released PDN ** ** the new PDN connection or the released PDN **
** connection ** ** connection **
** Return: RETURNok, RETURNerror ** ** Return: RETURNok, RETURNerror **
** Others: _esm_data **
** ** ** **
***************************************************************************/ ***************************************************************************/
int esm_proc_pdn_connectivity(esm_data_t *esm_data, int cid, int is_to_define, int esm_proc_pdn_connectivity(esm_data_t *esm_data, int cid, int is_to_define,
...@@ -351,7 +350,7 @@ int esm_proc_pdn_connectivity_accept(nas_user_t *user, int pti, esm_proc_pdn_typ ...@@ -351,7 +350,7 @@ int esm_proc_pdn_connectivity_accept(nas_user_t *user, int pti, esm_proc_pdn_typ
const OctetString *apn, int *esm_cause) const OctetString *apn, int *esm_cause)
{ {
LOG_FUNC_IN; LOG_FUNC_IN;
esm_data_t *esm_data = _esm_data; esm_data_t *esm_data = user->esm_data;
int rc; int rc;
int pid = RETURNerror; int pid = RETURNerror;
char apn_first_char[4]; char apn_first_char[4];
...@@ -678,11 +677,9 @@ static void *_pdn_connectivity_t3482_handler(void *args) ...@@ -678,11 +677,9 @@ static void *_pdn_connectivity_t3482_handler(void *args)
** pdn_type: PDN type (IPv4, IPv6, IPv4v6) ** ** pdn_type: PDN type (IPv4, IPv6, IPv4v6) **
** is_emergency: TRUE if the PDN connection has to be esta- ** ** is_emergency: TRUE if the PDN connection has to be esta- **
** blished for emergency bearer services ** ** blished for emergency bearer services **
** Others: _esm_data **
** ** ** **
** Outputs: None ** ** Outputs: None **
** Return: RETURNok, RETURNerror ** ** Return: RETURNok, RETURNerror **
** Others: _esm_data **
** ** ** **
***************************************************************************/ ***************************************************************************/
static int _pdn_connectivity_create(esm_data_t *esm_data, int pid, const OctetString *apn, static int _pdn_connectivity_create(esm_data_t *esm_data, int pid, const OctetString *apn,
...@@ -762,7 +759,6 @@ static int _pdn_connectivity_create(esm_data_t *esm_data, int pid, const OctetSt ...@@ -762,7 +759,6 @@ static int _pdn_connectivity_create(esm_data_t *esm_data, int pid, const OctetSt
** ** ** **
** Outputs: None ** ** Outputs: None **
** Return: RETURNok, RETURNerror ** ** Return: RETURNok, RETURNerror **
** Others: _esm_data **
** ** ** **
***************************************************************************/ ***************************************************************************/
static int _pdn_connectivity_update(esm_data_t *esm_data, int pid, const OctetString *apn, static int _pdn_connectivity_update(esm_data_t *esm_data, int pid, const OctetString *apn,
...@@ -849,14 +845,12 @@ static int _pdn_connectivity_update(esm_data_t *esm_data, int pid, const OctetSt ...@@ -849,14 +845,12 @@ static int _pdn_connectivity_update(esm_data_t *esm_data, int pid, const OctetSt
** ** ** **
** Inputs: pid: Identifier of the PDN connection to be ** ** Inputs: pid: Identifier of the PDN connection to be **
** released ** ** released **
** Others: _esm_data **
** ** ** **
** Outputs: None ** ** Outputs: None **
** Return: The identity of the procedure transaction ** ** Return: The identity of the procedure transaction **
** assigned to the PDN connection when suc- ** ** assigned to the PDN connection when suc- **
** cessfully released; ** ** cessfully released; **
** UNASSIGNED value otherwise. ** ** UNASSIGNED value otherwise. **
** Others: _esm_data **
** ** ** **
***************************************************************************/ ***************************************************************************/
static int _pdn_connectivity_delete(esm_data_t *esm_data, int pid) static int _pdn_connectivity_delete(esm_data_t *esm_data, int pid)
...@@ -912,7 +906,6 @@ static int _pdn_connectivity_delete(esm_data_t *esm_data, int pid) ...@@ -912,7 +906,6 @@ static int _pdn_connectivity_delete(esm_data_t *esm_data, int pid)
** ** ** **
** Outputs: None ** ** Outputs: None **
** Return: RETURNok, RETURNerror ** ** Return: RETURNok, RETURNerror **
** Others: _esm_data **
** ** ** **
***************************************************************************/ ***************************************************************************/
static int _pdn_connectivity_set_pti(esm_data_t *esm_data, int pid, int pti) static int _pdn_connectivity_set_pti(esm_data_t *esm_data, int pid, int pti)
...@@ -945,7 +938,6 @@ static int _pdn_connectivity_set_pti(esm_data_t *esm_data, int pid, int pti) ...@@ -945,7 +938,6 @@ static int _pdn_connectivity_set_pti(esm_data_t *esm_data, int pid, int pti)
** for the specified APN ** ** for the specified APN **
** ** ** **
** Inputs: apn: Access Point Name of the PDN connection ** ** Inputs: apn: Access Point Name of the PDN connection **
** Others: _esm_data **
** ** ** **
** Outputs: None ** ** Outputs: None **
** Return: The identifier of the PDN connection if ** ** Return: The identifier of the PDN connection if **
...@@ -986,7 +978,6 @@ static int _pdn_connectivity_find_apn(esm_data_t *esm_data, const OctetString *a ...@@ -986,7 +978,6 @@ static int _pdn_connectivity_find_apn(esm_data_t *esm_data, const OctetString *a
** ** ** **
** Inputs: apn: Access Point Name of the PDN connection ** ** Inputs: apn: Access Point Name of the PDN connection **
** pdn_type: PDN address type ** ** pdn_type: PDN address type **
** Others: _esm_data **
** ** ** **
** Outputs: None ** ** Outputs: None **
** Return: The identifier of the PDN connection if ** ** Return: The identifier of the PDN connection if **
......
...@@ -104,7 +104,6 @@ static void *_pdn_disconnect_t3492_handler(void *); ...@@ -104,7 +104,6 @@ static void *_pdn_disconnect_t3492_handler(void *);
** tifier ** ** tifier **
** ** ** **
** Inputs: cid: PDN context identifier ** ** Inputs: cid: PDN context identifier **
** Others: _esm_data **
** ** ** **
** Outputs: pti: Procedure transaction identity assigned to ** ** Outputs: pti: Procedure transaction identity assigned to **
** the PDN connection to be released ** ** the PDN connection to be released **
...@@ -287,7 +286,7 @@ int esm_proc_pdn_disconnect_accept(int pti, int *esm_cause) ...@@ -287,7 +286,7 @@ int esm_proc_pdn_disconnect_accept(int pti, int *esm_cause)
int esm_proc_pdn_disconnect_reject(nas_user_t *user, int pti, int *esm_cause) int esm_proc_pdn_disconnect_reject(nas_user_t *user, int pti, int *esm_cause)
{ {
LOG_FUNC_IN; LOG_FUNC_IN;
esm_data_t *esm_data = _esm_data; esm_data_t *esm_data = user->esm_data;
int rc; int rc;
LOG_TRACE(WARNING, "ESM-PROC - PDN disconnection rejected by the network " LOG_TRACE(WARNING, "ESM-PROC - PDN disconnection rejected by the network "
...@@ -383,7 +382,7 @@ static void *_pdn_disconnect_t3492_handler(void *args) ...@@ -383,7 +382,7 @@ static void *_pdn_disconnect_t3492_handler(void *args)
{ {
LOG_FUNC_IN; LOG_FUNC_IN;
nas_user_t *user = args; nas_user_t *user = args;
esm_data_t *esm_data = _esm_data;; esm_data_t *esm_data = user->esm_data;;
int rc; int rc;
/* Get retransmission timer parameters data */ /* Get retransmission timer parameters data */
...@@ -472,7 +471,6 @@ static void *_pdn_disconnect_t3492_handler(void *args) ...@@ -472,7 +471,6 @@ static void *_pdn_disconnect_t3492_handler(void *args)
** ven procedure transaction identity has been assigned ** ** ven procedure transaction identity has been assigned **
** ** ** **
** Inputs: pti: The procedure transaction identity ** ** Inputs: pti: The procedure transaction identity **
** Others: _esm_data **
** ** ** **
** Outputs: None ** ** Outputs: None **
** Return: The EPS bearer identity of the default EPS ** ** Return: The EPS bearer identity of the default EPS **
......
...@@ -147,8 +147,7 @@ void esm_sap_initialize(void) ...@@ -147,8 +147,7 @@ void esm_sap_initialize(void)
int esm_sap_send(nas_user_t *user, esm_sap_t *msg) int esm_sap_send(nas_user_t *user, esm_sap_t *msg)
{ {
LOG_FUNC_IN; LOG_FUNC_IN;
// FIXME esm_data_t *esm_data = user->esm_data;
esm_data_t *esm_data = _esm_data;
int rc = RETURNerror; int rc = RETURNerror;
int pid; int pid;
......
...@@ -190,12 +190,6 @@ typedef esm_data_context_t esm_data_t; ...@@ -190,12 +190,6 @@ typedef esm_data_context_t esm_data_t;
/******************** G L O B A L V A R I A B L E S ********************/ /******************** G L O B A L V A R I A B L E S ********************/
/****************************************************************************/ /****************************************************************************/
/*
* ESM internal data (used within ESM only)
* ----------------------------------------
*/
extern esm_data_t *_esm_data;
/****************************************************************************/ /****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/ /****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/ /****************************************************************************/
......
...@@ -89,14 +89,12 @@ static int _esm_ebr_context_check_precedence(const network_tft_t *, ...@@ -89,14 +89,12 @@ static int _esm_ebr_context_check_precedence(const network_tft_t *,
** bearer context ** ** bearer context **
** esm_qos: EPS bearer level QoS parameters ** ** esm_qos: EPS bearer level QoS parameters **
** tft: Traffic flow template parameters ** ** tft: Traffic flow template parameters **
** Others: _esm_data **
** ** ** **
** Outputs: None ** ** Outputs: None **
** Return: The EPS bearer identity of the default EPS ** ** Return: The EPS bearer identity of the default EPS **
** bearer associated to the new EPS bearer ** ** bearer associated to the new EPS bearer **
** context if successfully created; ** ** context if successfully created; **
** UNASSIGN EPS bearer value otherwise. ** ** UNASSIGN EPS bearer value otherwise. **
** Others: _esm_data **
** ** ** **
***************************************************************************/ ***************************************************************************/
int esm_ebr_context_create( int esm_ebr_context_create(
...@@ -318,7 +316,6 @@ int esm_ebr_context_create( ...@@ -318,7 +316,6 @@ int esm_ebr_context_create(
** ** ** **
** Inputs: ueid: UE identifier ** ** Inputs: ueid: UE identifier **
** ebi: EPS bearer identity ** ** ebi: EPS bearer identity **
** Others: _esm_data **
** ** ** **
** Outputs: pid: Identifier of the PDN connection entry the ** ** Outputs: pid: Identifier of the PDN connection entry the **
** EPS bearer context belongs to ** ** EPS bearer context belongs to **
...@@ -327,7 +324,6 @@ int esm_ebr_context_create( ...@@ -327,7 +324,6 @@ int esm_ebr_context_create(
** Return: The EPS bearer identity associated to the ** ** Return: The EPS bearer identity associated to the **
** EPS bearer context if successfully relea- ** ** EPS bearer context if successfully relea- **
** sed; UNASSIGN EPS bearer value otherwise. ** ** sed; UNASSIGN EPS bearer value otherwise. **
** Others: _esm_data **
** ** ** **
***************************************************************************/ ***************************************************************************/
int esm_ebr_context_release(nas_user_t *user, int esm_ebr_context_release(nas_user_t *user,
...@@ -341,7 +337,7 @@ int esm_ebr_context_release(nas_user_t *user, ...@@ -341,7 +337,7 @@ int esm_ebr_context_release(nas_user_t *user,
LOG_FUNC_IN; LOG_FUNC_IN;
esm_ctx = _esm_data; esm_ctx = user->esm_data;
if (ebi != ESM_EBI_UNASSIGNED) { if (ebi != ESM_EBI_UNASSIGNED) {
/* /*
...@@ -523,7 +519,6 @@ int esm_ebr_context_release(nas_user_t *user, ...@@ -523,7 +519,6 @@ int esm_ebr_context_release(nas_user_t *user,
** ** ** **
** Inputs: ebi: The EPS bearer identity of the default EPS ** ** Inputs: ebi: The EPS bearer identity of the default EPS **
** bearer context ** ** bearer context **
** Others: _esm_data **
** ** ** **
** Outputs: None ** ** Outputs: None **
** Return: The identifier of the PDN connection entry ** ** Return: The identifier of the PDN connection entry **
...@@ -575,7 +570,6 @@ int esm_ebr_context_get_pid(esm_data_t *esm_data, int ebi) ...@@ -575,7 +570,6 @@ int esm_ebr_context_get_pid(esm_data_t *esm_data, int ebi)
** tft: The traffic flow template (set of packet ** ** tft: The traffic flow template (set of packet **
** filters) to be checked ** ** filters) to be checked **
** operation: Traffic flow template operation ** ** operation: Traffic flow template operation **
** Others: _esm_data **
** ** ** **
** Outputs: None ** ** Outputs: None **
** Return: RETURNok, RETURNerror ** ** Return: RETURNok, RETURNerror **
......
...@@ -50,8 +50,6 @@ Description Defines the EPS Session Management procedure call manager, ...@@ -50,8 +50,6 @@ Description Defines the EPS Session Management procedure call manager,
/**************** E X T E R N A L D E F I N I T I O N S ****************/ /**************** E X T E R N A L D E F I N I T I O N S ****************/
/****************************************************************************/ /****************************************************************************/
esm_data_t *_esm_data = NULL;
/****************************************************************************/ /****************************************************************************/
/******************* L O C A L D E F I N I T I O N S *******************/ /******************* L O C A L D E F I N I T I O N S *******************/
/****************************************************************************/ /****************************************************************************/
...@@ -71,7 +69,6 @@ esm_data_t *_esm_data = NULL; ...@@ -71,7 +69,6 @@ esm_data_t *_esm_data = NULL;
** ** ** **
** Outputs: None ** ** Outputs: None **
** Return: None ** ** Return: None **
** Others: esm_data-> **
** ** ** **
***************************************************************************/ ***************************************************************************/
esm_data_t * esm_main_initialize(esm_indication_callback_t cb) esm_data_t * esm_main_initialize(esm_indication_callback_t cb)
...@@ -176,7 +173,6 @@ void esm_main_cleanup(esm_data_t *esm_data) ...@@ -176,7 +173,6 @@ void esm_main_cleanup(esm_data_t *esm_data)
** a defined state at the same time ** ** a defined state at the same time **
** ** ** **
** Inputs: None ** ** Inputs: None **
** Others: esm_data-> **
** ** ** **
** Outputs: None ** ** Outputs: None **
** Return: The maximum number of PDN connections that ** ** Return: The maximum number of PDN connections that **
...@@ -198,7 +194,6 @@ int esm_main_get_nb_pdns_max(esm_data_t *esm_data) ...@@ -198,7 +194,6 @@ int esm_main_get_nb_pdns_max(esm_data_t *esm_data)
** Description: Get the number of active PDN connections ** ** Description: Get the number of active PDN connections **
** ** ** **
** Inputs: None ** ** Inputs: None **
** Others: esm_data-> **
** ** ** **
** Outputs: None ** ** Outputs: None **
** Return: The number of active PDN connections ** ** Return: The number of active PDN connections **
...@@ -220,7 +215,6 @@ int esm_main_get_nb_pdns(esm_data_t *esm_data) ...@@ -220,7 +215,6 @@ int esm_main_get_nb_pdns(esm_data_t *esm_data)
** vices is established ** ** vices is established **
** ** ** **
** Inputs: None ** ** Inputs: None **
** Others: esm_data-> **
** ** ** **
** Outputs: None ** ** Outputs: None **
** Return: TRUE if a PDN connection for emergency ** ** Return: TRUE if a PDN connection for emergency **
...@@ -242,7 +236,6 @@ int esm_main_has_emergency(esm_data_t *esm_data) ...@@ -242,7 +236,6 @@ int esm_main_has_emergency(esm_data_t *esm_data)
** Description: Get the status of the specified PDN connection ** ** Description: Get the status of the specified PDN connection **
** ** ** **
** Inputs: cid: PDN connection identifier ** ** Inputs: cid: PDN connection identifier **
** Others: esm_data-> **
** ** ** **
** Outputs: state: TRUE if the current state of the PDN con- ** ** Outputs: state: TRUE if the current state of the PDN con- **
** nection is ACTIVE; FALSE otherwise. ** ** nection is ACTIVE; FALSE otherwise. **
...@@ -288,7 +281,6 @@ int esm_main_get_pdn_status(esm_data_t *esm_data, int cid, int *state) ...@@ -288,7 +281,6 @@ int esm_main_get_pdn_status(esm_data_t *esm_data, int cid, int *state)
** Description: Get parameters defined for the specified PDN connection ** ** Description: Get parameters defined for the specified PDN connection **
** ** ** **
** Inputs: cid: PDN connection identifier ** ** Inputs: cid: PDN connection identifier **
** Others: esm_data-> **
** ** ** **
** Outputs: type: PDN connection type (IPv4, IPv6, IPv4v6) ** ** Outputs: type: PDN connection type (IPv4, IPv6, IPv4v6) **
** apn: Access Point logical Name in used ** ** apn: Access Point logical Name in used **
...@@ -342,7 +334,6 @@ int esm_main_get_pdn(esm_data_t *esm_data, int cid, int *type, const char **apn, ...@@ -342,7 +334,6 @@ int esm_main_get_pdn(esm_data_t *esm_data, int cid, int *type, const char **apn,
** tion ** ** tion **
** ** ** **
** Inputs: cid: PDN connection identifier ** ** Inputs: cid: PDN connection identifier **
** Others: esm_data-> **
** ** ** **
** Outputs: ipv4adddr: IPv4 address ** ** Outputs: ipv4adddr: IPv4 address **
** ipv6adddr: IPv6 address ** ** ipv6adddr: IPv6 address **
......
...@@ -101,7 +101,7 @@ void nas_proc_initialize(nas_user_t *user, emm_indication_callback_t emm_cb, ...@@ -101,7 +101,7 @@ void nas_proc_initialize(nas_user_t *user, emm_indication_callback_t emm_cb,
emm_main_initialize(user, emm_cb, imei); emm_main_initialize(user, emm_cb, imei);
/* Initialize the ESM procedure manager */ /* Initialize the ESM procedure manager */
_esm_data = esm_main_initialize(esm_cb); user->esm_data = esm_main_initialize(esm_cb);
LOG_FUNC_OUT; LOG_FUNC_OUT;
} }
...@@ -137,7 +137,7 @@ void nas_proc_cleanup(nas_user_t *user) ...@@ -137,7 +137,7 @@ void nas_proc_cleanup(nas_user_t *user)
emm_main_cleanup(); emm_main_cleanup();
/* Perform the EPS Session Manager's clean up procedure */ /* Perform the EPS Session Manager's clean up procedure */
esm_main_cleanup(_esm_data); esm_main_cleanup(user->esm_data);
LOG_FUNC_OUT; LOG_FUNC_OUT;
} }
...@@ -780,7 +780,7 @@ int nas_proc_get_pdn_addr(nas_user_t *user, int cid, int *cids, const char **add ...@@ -780,7 +780,7 @@ int nas_proc_get_pdn_addr(nas_user_t *user, int cid, int *cids, const char **add
if (cid > 0) { if (cid > 0) {
/* Get addresses assigned to the specified PDN */ /* Get addresses assigned to the specified PDN */
rc = esm_main_get_pdn_addr(_esm_data, cid, addr1, addr2); rc = esm_main_get_pdn_addr(user->esm_data, cid, addr1, addr2);
if (rc != RETURNerror) { if (rc != RETURNerror) {
*cids = cid; *cids = cid;
...@@ -788,12 +788,12 @@ int nas_proc_get_pdn_addr(nas_user_t *user, int cid, int *cids, const char **add ...@@ -788,12 +788,12 @@ int nas_proc_get_pdn_addr(nas_user_t *user, int cid, int *cids, const char **add
} }
} else if (cid < 0) { } else if (cid < 0) {
/* Get the maximum number of supported PDN contexts */ /* Get the maximum number of supported PDN contexts */
int n_pdn = esm_main_get_nb_pdns_max(_esm_data); int n_pdn = esm_main_get_nb_pdns_max(user->esm_data);
/* For all PDN contexts */ /* For all PDN contexts */
for (cid = 1; (cid < n_pdn+1) && (n_defined_pdn < n_pdn_max); cid++) { for (cid = 1; (cid < n_pdn+1) && (n_defined_pdn < n_pdn_max); cid++) {
/* Get PDN connection addresses */ /* Get PDN connection addresses */
rc = esm_main_get_pdn_addr(_esm_data, cid, addr1, addr2); rc = esm_main_get_pdn_addr(user->esm_data, cid, addr1, addr2);
if (rc != RETURNerror) { if (rc != RETURNerror) {
/* This PDN has been defined */ /* This PDN has been defined */
...@@ -920,7 +920,7 @@ int nas_proc_deactivate_pdn(nas_user_t *user, int cid) ...@@ -920,7 +920,7 @@ int nas_proc_deactivate_pdn(nas_user_t *user, int cid)
cid = 2; cid = 2;
/* Deactivate all active PDN contexts */ /* Deactivate all active PDN contexts */
while ((rc != RETURNerror) && (cid < esm_main_get_nb_pdns_max(_esm_data)+1)) { while ((rc != RETURNerror) && (cid < esm_main_get_nb_pdns_max(user->esm_data)+1)) {
rc = _nas_proc_deactivate(user, cid++, TRUE); rc = _nas_proc_deactivate(user, cid++, TRUE);
} }
} }
...@@ -972,7 +972,7 @@ int nas_proc_activate_pdn(nas_user_t *user, int cid) ...@@ -972,7 +972,7 @@ int nas_proc_activate_pdn(nas_user_t *user, int cid)
cid = 1; cid = 1;
/* Activate all defined PDN contexts */ /* Activate all defined PDN contexts */
while ((rc != RETURNerror) && (cid < esm_main_get_nb_pdns_max(_esm_data)+1)) { while ((rc != RETURNerror) && (cid < esm_main_get_nb_pdns_max(user->esm_data)+1)) {
rc = _nas_proc_activate(user, cid++, TRUE); rc = _nas_proc_activate(user, cid++, TRUE);
} }
} }
...@@ -1291,7 +1291,7 @@ static int _nas_proc_activate(nas_user_t *user, int cid, int apply_to_all) ...@@ -1291,7 +1291,7 @@ static int _nas_proc_activate(nas_user_t *user, int cid, int apply_to_all)
esm_sap_t esm_sap; esm_sap_t esm_sap;
/* Get PDN context parameters */ /* Get PDN context parameters */
rc = esm_main_get_pdn(_esm_data, cid, &esm_sap.data.pdn_connect.pdn_type, rc = esm_main_get_pdn(user->esm_data, cid, &esm_sap.data.pdn_connect.pdn_type,
&esm_sap.data.pdn_connect.apn, &esm_sap.data.pdn_connect.apn,
&esm_sap.data.pdn_connect.is_emergency, &active); &esm_sap.data.pdn_connect.is_emergency, &active);
...@@ -1313,7 +1313,7 @@ static int _nas_proc_activate(nas_user_t *user, int cid, int apply_to_all) ...@@ -1313,7 +1313,7 @@ static int _nas_proc_activate(nas_user_t *user, int cid, int apply_to_all)
} }
if (esm_sap.data.pdn_connect.is_emergency) { if (esm_sap.data.pdn_connect.is_emergency) {
if (esm_main_has_emergency(_esm_data)) { if (esm_main_has_emergency(user->esm_data)) {
/* There is already a PDN connection for emergency /* There is already a PDN connection for emergency
* bearer services established; the UE shall not * bearer services established; the UE shall not
* request an additional PDN connection for emer- * request an additional PDN connection for emer-
...@@ -1365,7 +1365,7 @@ static int _nas_proc_deactivate(nas_user_t *user, int cid, int apply_to_all) ...@@ -1365,7 +1365,7 @@ static int _nas_proc_deactivate(nas_user_t *user, int cid, int apply_to_all)
int active = FALSE; int active = FALSE;
/* Get PDN context parameters */ /* Get PDN context parameters */
rc = esm_main_get_pdn(_esm_data, cid, &pdn_type, &apn, &emergency, &active); rc = esm_main_get_pdn(user->esm_data, cid, &pdn_type, &apn, &emergency, &active);
if (rc != RETURNok) { if (rc != RETURNok) {
/* No any context is defined for the specified PDN */ /* No any context is defined for the specified PDN */
...@@ -1383,7 +1383,7 @@ static int _nas_proc_deactivate(nas_user_t *user, int cid, int apply_to_all) ...@@ -1383,7 +1383,7 @@ static int _nas_proc_deactivate(nas_user_t *user, int cid, int apply_to_all)
LOG_FUNC_RETURN (RETURNok); LOG_FUNC_RETURN (RETURNok);
} }
if (esm_main_get_nb_pdns(_esm_data) > 1) { if (esm_main_get_nb_pdns(user->esm_data) > 1) {
/* /*
* Notify ESM that all EPS bearers towards the specified PDN * Notify ESM that all EPS bearers towards the specified PDN
* has to be released * has to be released
......
...@@ -2043,7 +2043,7 @@ static int _nas_user_proc_cgdcont(nas_user_t *user, const at_command_t *data) ...@@ -2043,7 +2043,7 @@ static int _nas_user_proc_cgdcont(nas_user_t *user, const at_command_t *data)
* Read command returns the current settings for each * Read command returns the current settings for each
* defined PDN connection/default EPS bearer context * defined PDN connection/default EPS bearer context
*/ */
cgdcont->n_pdns = nas_proc_get_pdn_param(_esm_data, cgdcont->cid, cgdcont->n_pdns = nas_proc_get_pdn_param(user->esm_data, cgdcont->cid,
cgdcont->PDP_type, cgdcont->PDP_type,
cgdcont->APN, cgdcont->APN,
AT_CGDCONT_RESP_SIZE); AT_CGDCONT_RESP_SIZE);
...@@ -2061,7 +2061,7 @@ static int _nas_user_proc_cgdcont(nas_user_t *user, const at_command_t *data) ...@@ -2061,7 +2061,7 @@ static int _nas_user_proc_cgdcont(nas_user_t *user, const at_command_t *data)
*/ */
{ {
/* Get the maximum value of a PDN context identifier */ /* Get the maximum value of a PDN context identifier */
int cid_max = nas_proc_get_pdn_range(_esm_data); int cid_max = nas_proc_get_pdn_range(user->esm_data);
if (cid_max > AT_CGDCONT_RESP_SIZE) { if (cid_max > AT_CGDCONT_RESP_SIZE) {
/* The range is defined by the user interface */ /* The range is defined by the user interface */
...@@ -2184,7 +2184,7 @@ static int _nas_user_proc_cgact(nas_user_t *user, const at_command_t *data) ...@@ -2184,7 +2184,7 @@ static int _nas_user_proc_cgact(nas_user_t *user, const at_command_t *data)
* The read command returns the current activation states for * The read command returns the current activation states for
* all the defined PDN/EPS bearer contexts * all the defined PDN/EPS bearer contexts
*/ */
cgact->n_pdns = nas_proc_get_pdn_status(_esm_data, cgact->cid, cgact->state, cgact->n_pdns = nas_proc_get_pdn_status(user->esm_data, cgact->cid, cgact->state,
AT_CGACT_RESP_SIZE); AT_CGACT_RESP_SIZE);
if (cgact->n_pdns == 0) { if (cgact->n_pdns == 0) {
......
...@@ -46,10 +46,12 @@ Description NAS type definition to manage a user equipment ...@@ -46,10 +46,12 @@ Description NAS type definition to manage a user equipment
#define __USER_DEFS_H__ #define __USER_DEFS_H__
#include "nas_proc_defs.h" #include "nas_proc_defs.h"
#include "esmData.h"
typedef struct { typedef struct {
int fd; int fd;
proc_data_t proc; proc_data_t proc;
esm_data_t *esm_data; // ESM internal data (used within ESM only)
} nas_user_t; } nas_user_t;
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment