Commit 490d0f0f authored by winckel's avatar winckel

Modified makefiles to integrate UE NAS lib.

Corrected some NAS file to compile without C99 mode option.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4633 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 15e3d8cb
...@@ -372,6 +372,8 @@ int emm_proc_attach_accept(long t3412, long t3402, long t3423, ...@@ -372,6 +372,8 @@ int emm_proc_attach_accept(long t3412, long t3402, long t3423,
emm_sap_t emm_sap; emm_sap_t emm_sap;
esm_sap_t esm_sap; esm_sap_t esm_sap;
int rc; int rc;
int i;
int j;
LOG_TRACE(INFO, "EMM-PROC - EPS attach accepted by the network"); LOG_TRACE(INFO, "EMM-PROC - EPS attach accepted by the network");
...@@ -381,7 +383,7 @@ int emm_proc_attach_accept(long t3412, long t3402, long t3423, ...@@ -381,7 +383,7 @@ int emm_proc_attach_accept(long t3412, long t3402, long t3423,
/* Delete old TAI list and store the received TAI list */ /* Delete old TAI list and store the received TAI list */
_emm_data.ltai.n_tais = n_tais; _emm_data.ltai.n_tais = n_tais;
for (int i = 0; (i < n_tais) && (i < EMM_DATA_TAI_MAX); i++) { for (i = 0; (i < n_tais) && (i < EMM_DATA_TAI_MAX); i++) {
_emm_data.ltai.tai[i] = tai[i]; _emm_data.ltai.tai[i] = tai[i];
} }
...@@ -404,13 +406,13 @@ int emm_proc_attach_accept(long t3412, long t3402, long t3423, ...@@ -404,13 +406,13 @@ int emm_proc_attach_accept(long t3412, long t3402, long t3423,
/* Update the stored list of equivalent PLMNs */ /* Update the stored list of equivalent PLMNs */
_emm_data.nvdata.eplmn.n_plmns = 0; _emm_data.nvdata.eplmn.n_plmns = 0;
if (n_eplmns > 0) { if (n_eplmns > 0) {
for (int i = 0; (i < n_eplmns) && (i < EMM_DATA_EPLMN_MAX); i++) { for (i = 0; (i < n_eplmns) && (i < EMM_DATA_EPLMN_MAX); i++) {
int is_forbidden = FALSE; int is_forbidden = FALSE;
if (!_emm_data.is_emergency) { if (!_emm_data.is_emergency) {
/* If the attach procedure is not for emergency bearer /* If the attach procedure is not for emergency bearer
* services, the UE shall remove from the list any PLMN * services, the UE shall remove from the list any PLMN
* code that is already in the list of forbidden PLMNs */ * code that is already in the list of forbidden PLMNs */
for (int j = 0; j < _emm_data.fplmn.n_plmns; j++) { for (j = 0; j < _emm_data.fplmn.n_plmns; j++) {
if (PLMNS_ARE_EQUAL(eplmn[i], _emm_data.fplmn.plmn[j])) { if (PLMNS_ARE_EQUAL(eplmn[i], _emm_data.fplmn.plmn[j])) {
is_forbidden = TRUE; is_forbidden = TRUE;
break; break;
......
...@@ -384,8 +384,10 @@ const char *IdleMode_get_plmn_id(const plmn_t *plmn, int index, size_t *len) ...@@ -384,8 +384,10 @@ const char *IdleMode_get_plmn_id(const plmn_t *plmn, int index, size_t *len)
***************************************************************************/ ***************************************************************************/
int IdleMode_get_plmn_fullname_index(const char *plmn) int IdleMode_get_plmn_fullname_index(const char *plmn)
{ {
int index;
/* Get the index of the PLMN identifier with specified full name */ /* Get the index of the PLMN identifier with specified full name */
for (int index = 0; index < _emm_plmn_list.n_plmns; index++) { for (index = 0; index < _emm_plmn_list.n_plmns; index++) {
if ( strncmp(plmn, _emm_plmn_list.param[index].fullname, if ( strncmp(plmn, _emm_plmn_list.param[index].fullname,
NET_FORMAT_LONG_SIZE) != 0 ) { NET_FORMAT_LONG_SIZE) != 0 ) {
continue; continue;
...@@ -413,8 +415,10 @@ int IdleMode_get_plmn_fullname_index(const char *plmn) ...@@ -413,8 +415,10 @@ int IdleMode_get_plmn_fullname_index(const char *plmn)
***************************************************************************/ ***************************************************************************/
int IdleMode_get_plmn_shortname_index(const char *plmn) int IdleMode_get_plmn_shortname_index(const char *plmn)
{ {
int index;
/* Get the index of the PLMN identifier with specified short name */ /* Get the index of the PLMN identifier with specified short name */
for (int index = 0; index < _emm_plmn_list.n_plmns; index++) { for (index = 0; index < _emm_plmn_list.n_plmns; index++) {
if ( !strncmp(plmn, _emm_plmn_list.param[index].shortname, if ( !strncmp(plmn, _emm_plmn_list.param[index].shortname,
NET_FORMAT_SHORT_SIZE) ) { NET_FORMAT_SHORT_SIZE) ) {
continue; continue;
...@@ -442,8 +446,10 @@ int IdleMode_get_plmn_shortname_index(const char *plmn) ...@@ -442,8 +446,10 @@ int IdleMode_get_plmn_shortname_index(const char *plmn)
***************************************************************************/ ***************************************************************************/
int IdleMode_get_plmn_id_index(const char *plmn) int IdleMode_get_plmn_id_index(const char *plmn)
{ {
int index;
/* Get the index of the PLMN identifier with specified numeric identifier */ /* Get the index of the PLMN identifier with specified numeric identifier */
for (int index = 0; index < _emm_plmn_list.n_plmns; index++) { for (index = 0; index < _emm_plmn_list.n_plmns; index++) {
if ( !strncmp(plmn, _emm_plmn_list.param[index].num, if ( !strncmp(plmn, _emm_plmn_list.param[index].num,
NET_FORMAT_LONG_SIZE) ) { NET_FORMAT_LONG_SIZE) ) {
continue; continue;
...@@ -480,6 +486,7 @@ int emm_proc_initialize(void) ...@@ -480,6 +486,7 @@ int emm_proc_initialize(void)
emm_sap_t emm_sap; emm_sap_t emm_sap;
int rc; int rc;
int i;
if (!_emm_data.usim_is_valid) { if (!_emm_data.usim_is_valid) {
/* The USIM application is not present or not valid */ /* The USIM application is not present or not valid */
...@@ -489,7 +496,7 @@ int emm_proc_initialize(void) ...@@ -489,7 +496,7 @@ int emm_proc_initialize(void)
/* The highest priority is given to either the "equivalent PLMNs" /* The highest priority is given to either the "equivalent PLMNs"
* if available, or the last registered PLMN */ * if available, or the last registered PLMN */
if (_emm_data.nvdata.eplmn.n_plmns > 0) { if (_emm_data.nvdata.eplmn.n_plmns > 0) {
for (int i=0; i < _emm_data.nvdata.eplmn.n_plmns; i++) { for (i=0; i < _emm_data.nvdata.eplmn.n_plmns; i++) {
_emm_plmn_list.plmn[_emm_plmn_list.n_plmns++] = _emm_plmn_list.plmn[_emm_plmn_list.n_plmns++] =
&_emm_data.nvdata.eplmn.plmn[i]; &_emm_data.nvdata.eplmn.plmn[i];
} }
...@@ -515,14 +522,14 @@ int emm_proc_initialize(void) ...@@ -515,14 +522,14 @@ int emm_proc_initialize(void)
/* Each PLMN/access technology combination in the "User /* Each PLMN/access technology combination in the "User
* Controlled PLMN Selector with Access Technology" */ * Controlled PLMN Selector with Access Technology" */
for (int i=0; i < _emm_data.plmn.n_plmns; i++) { for (i=0; i < _emm_data.plmn.n_plmns; i++) {
_emm_plmn_list.plmn[_emm_plmn_list.n_plmns++] = _emm_plmn_list.plmn[_emm_plmn_list.n_plmns++] =
&_emm_data.plmn.plmn[i]; &_emm_data.plmn.plmn[i];
} }
/* Each PLMN/access technology combination in the "Operator /* Each PLMN/access technology combination in the "Operator
* Controlled PLMN Selector with Access Technology" */ * Controlled PLMN Selector with Access Technology" */
for (int i=0; i < _emm_data.oplmn.n_plmns; i++) { for (i=0; i < _emm_data.oplmn.n_plmns; i++) {
_emm_plmn_list.plmn[_emm_plmn_list.n_plmns++] = _emm_plmn_list.plmn[_emm_plmn_list.n_plmns++] =
&_emm_data.oplmn.plmn[i]; &_emm_data.oplmn.plmn[i];
} }
...@@ -536,7 +543,7 @@ int emm_proc_initialize(void) ...@@ -536,7 +543,7 @@ int emm_proc_initialize(void)
/* TODO: Schedule periodic network selection attemps (hpplmn timer) */ /* TODO: Schedule periodic network selection attemps (hpplmn timer) */
/* Initialize the PLMNs' parameters */ /* Initialize the PLMNs' parameters */
for (int i=0; i < _emm_plmn_list.n_plmns; i++) { for (i=0; i < _emm_plmn_list.n_plmns; i++) {
struct plmn_param_t *plmn = &(_emm_plmn_list.param[i]); struct plmn_param_t *plmn = &(_emm_plmn_list.param[i]);
int id = _IldlMode_get_opnn_id(_emm_plmn_list.plmn[i]); int id = _IldlMode_get_opnn_id(_emm_plmn_list.plmn[i]);
if (id < 0) { if (id < 0) {
...@@ -1077,7 +1084,9 @@ static int _IdleMode_plmn_str(char *plmn_str, const plmn_t *plmn) ...@@ -1077,7 +1084,9 @@ static int _IdleMode_plmn_str(char *plmn_str, const plmn_t *plmn)
***************************************************************************/ ***************************************************************************/
static int _IldlMode_get_opnn_id(const plmn_t *plmn) static int _IldlMode_get_opnn_id(const plmn_t *plmn)
{ {
for (int i = 0; i < _emm_data.n_opnns; i++) { int i;
for (i = 0; i < _emm_data.n_opnns; i++) {
if (plmn->MCCdigit1 != _emm_data.opnn[i].plmn->MCCdigit1) { if (plmn->MCCdigit1 != _emm_data.opnn[i].plmn->MCCdigit1) {
continue; continue;
} }
......
...@@ -967,10 +967,12 @@ static int _emm_main_get_imei(imei_t *imei, const char *imei_str) ...@@ -967,10 +967,12 @@ static int _emm_main_get_imei(imei_t *imei, const char *imei_str)
***************************************************************************/ ***************************************************************************/
static int _emm_main_imsi_cmp(imsi_t *imsi1, imsi_t *imsi2) static int _emm_main_imsi_cmp(imsi_t *imsi1, imsi_t *imsi2)
{ {
int i;
if (imsi1->length != imsi2->length) { if (imsi1->length != imsi2->length) {
return FALSE; return FALSE;
} }
for (int i = 0; i < imsi1->length; i++) { for (i = 0; i < imsi1->length; i++) {
if (imsi1->u.value[i] != imsi2->u.value[i]) { if (imsi1->u.value[i] != imsi2->u.value[i]) {
return FALSE; return FALSE;
} }
......
...@@ -112,6 +112,7 @@ int emm_recv_attach_accept(attach_accept_msg *msg, int *emm_cause) ...@@ -112,6 +112,7 @@ int emm_recv_attach_accept(attach_accept_msg *msg, int *emm_cause)
LOG_FUNC_IN; LOG_FUNC_IN;
int rc; int rc;
int i;
LOG_TRACE(INFO, "EMMAS-SAP - Received Attach Accept message"); LOG_TRACE(INFO, "EMMAS-SAP - Received Attach Accept message");
...@@ -152,7 +153,7 @@ int emm_recv_attach_accept(attach_accept_msg *msg, int *emm_cause) ...@@ -152,7 +153,7 @@ int emm_recv_attach_accept(attach_accept_msg *msg, int *emm_cause)
/* Get the tracking area list the UE is registered to */ /* Get the tracking area list the UE is registered to */
int n_tais = msg->tailist.numberofelements; int n_tais = msg->tailist.numberofelements;
tai_t tai[n_tais]; tai_t tai[n_tais];
for (int i = 0; i < n_tais; i++) { for (i = 0; i < n_tais; i++) {
tai[i].plmn.MCCdigit1 = msg->tailist.mccdigit1; tai[i].plmn.MCCdigit1 = msg->tailist.mccdigit1;
tai[i].plmn.MCCdigit2 = msg->tailist.mccdigit2; tai[i].plmn.MCCdigit2 = msg->tailist.mccdigit2;
tai[i].plmn.MCCdigit3 = msg->tailist.mccdigit3; tai[i].plmn.MCCdigit3 = msg->tailist.mccdigit3;
......
...@@ -327,6 +327,7 @@ int esm_proc_eps_bearer_context_deactivate(int is_local, int ebi, ...@@ -327,6 +327,7 @@ int esm_proc_eps_bearer_context_deactivate(int is_local, int ebi,
LOG_FUNC_IN; LOG_FUNC_IN;
int rc = RETURNerror; int rc = RETURNerror;
int i;
if (is_local) { if (is_local) {
if (ebi != ESM_SAP_ALL_EBI) { if (ebi != ESM_SAP_ALL_EBI) {
...@@ -362,7 +363,7 @@ int esm_proc_eps_bearer_context_deactivate(int is_local, int ebi, ...@@ -362,7 +363,7 @@ int esm_proc_eps_bearer_context_deactivate(int is_local, int ebi,
*pid); *pid);
} else { } else {
esm_pdn_t *pdn = _esm_data.pdn[*pid].data; esm_pdn_t *pdn = _esm_data.pdn[*pid].data;
for (int i = 0; i < pdn->n_bearers; i++) { for (i = 0; i < pdn->n_bearers; i++) {
if (pdn->bearer[i]->ebi != ebi) { if (pdn->bearer[i]->ebi != ebi) {
continue; continue;
} }
......
...@@ -630,8 +630,9 @@ static void *_pdn_disconnect_t3492_handler(void *args) ...@@ -630,8 +630,9 @@ static void *_pdn_disconnect_t3492_handler(void *args)
static int _pdn_disconnect_get_default_ebi(int pti) static int _pdn_disconnect_get_default_ebi(int pti)
{ {
int ebi = -1; int ebi = -1;
int i;
for (int i = 0; i < ESM_DATA_PDN_MAX; i++) { for (i = 0; i < ESM_DATA_PDN_MAX; i++) {
if ( (_esm_data.pdn[i].pid != -1) && _esm_data.pdn[i].data ) { if ( (_esm_data.pdn[i].pid != -1) && _esm_data.pdn[i].data ) {
if (_esm_data.pdn[i].data->pti != pti) { if (_esm_data.pdn[i].data->pti != pti) {
continue; continue;
......
...@@ -482,6 +482,7 @@ int esm_ebr_context_check_tft(int pid, int ebi, ...@@ -482,6 +482,7 @@ int esm_ebr_context_check_tft(int pid, int ebi,
LOG_FUNC_IN; LOG_FUNC_IN;
int rc = RETURNerror; int rc = RETURNerror;
int i;
if (pid < ESM_DATA_PDN_MAX) { if (pid < ESM_DATA_PDN_MAX) {
if (pid != _esm_data.pdn[pid].pid) { if (pid != _esm_data.pdn[pid].pid) {
...@@ -493,7 +494,7 @@ int esm_ebr_context_check_tft(int pid, int ebi, ...@@ -493,7 +494,7 @@ int esm_ebr_context_check_tft(int pid, int ebi,
} else if (operation == ESM_EBR_CONTEXT_TFT_CREATE) { } else if (operation == ESM_EBR_CONTEXT_TFT_CREATE) {
esm_pdn_t *pdn = _esm_data.pdn[pid].data; esm_pdn_t *pdn = _esm_data.pdn[pid].data;
/* For each EPS bearer context associated to the PDN connection */ /* For each EPS bearer context associated to the PDN connection */
for (int i = 0; i < pdn->n_bearers; i++) { for (i = 0; i < pdn->n_bearers; i++) {
if (pdn->bearer[i]) { if (pdn->bearer[i]) {
if (pdn->bearer[i]->ebi == ebi) { if (pdn->bearer[i]->ebi == ebi) {
/* Check the packet filter identifiers */ /* Check the packet filter identifiers */
...@@ -545,11 +546,14 @@ int esm_ebr_context_check_tft(int pid, int ebi, ...@@ -545,11 +546,14 @@ int esm_ebr_context_check_tft(int pid, int ebi,
static int _esm_ebr_context_check_identifiers(const network_tft_t *tft1, static int _esm_ebr_context_check_identifiers(const network_tft_t *tft1,
const network_tft_t *tft2) const network_tft_t *tft2)
{ {
int i;
int j;
if ( (tft1 == NULL) || (tft2 == NULL) ) { if ( (tft1 == NULL) || (tft2 == NULL) ) {
return (RETURNok); return (RETURNok);
} }
for (int i = 0; i < tft1->n_pkfs; i++) { for (i = 0; i < tft1->n_pkfs; i++) {
for (int j = 0; j < tft2->n_pkfs; j++) { for (j = 0; j < tft2->n_pkfs; j++) {
/* Packet filters should have been allocated */ /* Packet filters should have been allocated */
if (tft1->pkf[i]->id == tft2->pkf[i]->id) { if (tft1->pkf[i]->id == tft2->pkf[i]->id) {
/* 3GPP TS 24.301, section 6.4.2.5, abnormal cases d.1 /* 3GPP TS 24.301, section 6.4.2.5, abnormal cases d.1
...@@ -582,11 +586,14 @@ static int _esm_ebr_context_check_identifiers(const network_tft_t *tft1, ...@@ -582,11 +586,14 @@ static int _esm_ebr_context_check_identifiers(const network_tft_t *tft1,
static int _esm_ebr_context_check_precedence(const network_tft_t *tft1, static int _esm_ebr_context_check_precedence(const network_tft_t *tft1,
const network_tft_t *tft2) const network_tft_t *tft2)
{ {
int i;
int j;
if ( (tft1 == NULL) || (tft2 == NULL) ) { if ( (tft1 == NULL) || (tft2 == NULL) ) {
return (RETURNok); return (RETURNok);
} }
for (int i = 0; i < tft1->n_pkfs; i++) { for (i = 0; i < tft1->n_pkfs; i++) {
for (int j = 0; j < tft2->n_pkfs; j++) { for (j = 0; j < tft2->n_pkfs; j++) {
/* Packet filters should have been allocated */ /* Packet filters should have been allocated */
if (tft1->pkf[i]->precedence == tft2->pkf[i]->precedence) { if (tft1->pkf[i]->precedence == tft2->pkf[i]->precedence) {
/* 3GPP TS 24.301, section 6.4.2.5, abnormal cases d.2 /* 3GPP TS 24.301, section 6.4.2.5, abnormal cases d.2
......
...@@ -58,11 +58,13 @@ void esm_main_initialize(esm_indication_callback_t cb) ...@@ -58,11 +58,13 @@ void esm_main_initialize(esm_indication_callback_t cb)
{ {
LOG_FUNC_IN; LOG_FUNC_IN;
int i;
/* Total number of active EPS bearer contexts */ /* Total number of active EPS bearer contexts */
_esm_data.n_ebrs = 0; _esm_data.n_ebrs = 0;
/* List of active PDN connections */ /* List of active PDN connections */
_esm_data.n_pdns = 0; _esm_data.n_pdns = 0;
for (int i = 0; i < ESM_DATA_PDN_MAX + 1; i++) { for (i = 0; i < ESM_DATA_PDN_MAX + 1; i++) {
_esm_data.pdn[i].pid = -1; _esm_data.pdn[i].pid = -1;
_esm_data.pdn[i].is_active = FALSE; _esm_data.pdn[i].is_active = FALSE;
_esm_data.pdn[i].data = NULL; _esm_data.pdn[i].data = NULL;
...@@ -135,21 +137,25 @@ void esm_main_cleanup(void) ...@@ -135,21 +137,25 @@ void esm_main_cleanup(void)
{ {
LOG_FUNC_IN; LOG_FUNC_IN;
#ifdef NAS_UE int i;
int pid;
int bid;
#ifdef NAS_UE
/* De-activate EPS bearers and clean up PDN connections */ /* De-activate EPS bearers and clean up PDN connections */
for (int pid = 0; pid < ESM_DATA_PDN_MAX; pid++) { for (pid = 0; pid < ESM_DATA_PDN_MAX; pid++) {
if (_esm_data.pdn[pid].data) { if (_esm_data.pdn[pid].data) {
esm_pdn_t *pdn = _esm_data.pdn[pid].data; esm_pdn_t *pdn = _esm_data.pdn[pid].data;
if (pdn->apn.length > 0) { if (pdn->apn.length > 0) {
free(pdn->apn.value); free(pdn->apn.value);
} }
/* Release EPS bearer contexts */ /* Release EPS bearer contexts */
for (int bid = 0; bid < pdn->n_bearers; bid++) { for (bid = 0; bid < pdn->n_bearers; bid++) {
if (pdn->bearer[bid]) { if (pdn->bearer[bid]) {
LOG_TRACE(WARNING, "ESM-MAIN - Release EPS bearer " LOG_TRACE(WARNING, "ESM-MAIN - Release EPS bearer "
"context (ebi=%d)", pdn->bearer[bid]->ebi); "context (ebi=%d)", pdn->bearer[bid]->ebi);
/* Delete the TFT */ /* Delete the TFT */
for (int i = 0; i < pdn->bearer[bid]->tft.n_pkfs; i++) { for (i = 0; i < pdn->bearer[bid]->tft.n_pkfs; i++) {
if (pdn->bearer[bid]->tft.pkf[i]) { if (pdn->bearer[bid]->tft.pkf[i]) {
free(pdn->bearer[bid]->tft.pkf[i]); free(pdn->bearer[bid]->tft.pkf[i]);
} }
......
...@@ -103,8 +103,10 @@ void esm_pt_initialize(void) ...@@ -103,8 +103,10 @@ void esm_pt_initialize(void)
{ {
LOG_FUNC_IN; LOG_FUNC_IN;
int i;
_esm_pt_data.index = 0; _esm_pt_data.index = 0;
for (int i = 0; i < ESM_PT_DATA_SIZE + 1; i++) { for (i = 0; i < ESM_PT_DATA_SIZE + 1; i++) {
_esm_pt_data.context[i] = NULL; _esm_pt_data.context[i] = NULL;
} }
......
...@@ -399,6 +399,8 @@ int esm_recv_activate_dedicated_eps_bearer_context_request(int pti, int ebi, ...@@ -399,6 +399,8 @@ int esm_recv_activate_dedicated_eps_bearer_context_request(int pti, int ebi,
LOG_FUNC_IN; LOG_FUNC_IN;
int esm_cause = ESM_CAUSE_SUCCESS; int esm_cause = ESM_CAUSE_SUCCESS;
int i;
int j;
LOG_TRACE(INFO, "ESM-SAP - Received Activate Dedicated EPS Bearer " LOG_TRACE(INFO, "ESM-SAP - Received Activate Dedicated EPS Bearer "
"Context Request message (pti=%d, ebi=%d)", pti, ebi); "Context Request message (pti=%d, ebi=%d)", pti, ebi);
...@@ -481,7 +483,7 @@ int esm_recv_activate_dedicated_eps_bearer_context_request(int pti, int ebi, ...@@ -481,7 +483,7 @@ int esm_recv_activate_dedicated_eps_bearer_context_request(int pti, int ebi,
esm_proc_tft_t tft = {0, {NULL}}; esm_proc_tft_t tft = {0, {NULL}};
/* Get the list of packet filters */ /* Get the list of packet filters */
const PacketFilters *pkfs = &(msg->tft.packetfilterlist.createtft); const PacketFilters *pkfs = &(msg->tft.packetfilterlist.createtft);
for (int i = 0; i < msg->tft.numberofpacketfilters; i++) { for (i = 0; i < msg->tft.numberofpacketfilters; i++) {
/* Create new temporary packet filter */ /* Create new temporary packet filter */
tft.pkf[i] = (network_pkf_t *)malloc(sizeof(network_pkf_t)); tft.pkf[i] = (network_pkf_t *)malloc(sizeof(network_pkf_t));
if (tft.pkf[i] != NULL) { if (tft.pkf[i] != NULL) {
...@@ -500,7 +502,7 @@ int esm_recv_activate_dedicated_eps_bearer_context_request(int pti, int ebi, ...@@ -500,7 +502,7 @@ int esm_recv_activate_dedicated_eps_bearer_context_request(int pti, int ebi,
const PacketFilter *pkf = &(pkfs[i]->packetfilter); const PacketFilter *pkf = &(pkfs[i]->packetfilter);
if (pkf->flags & TRAFFIC_FLOW_TEMPLATE_IPV4_REMOTE_ADDR_FLAG) { if (pkf->flags & TRAFFIC_FLOW_TEMPLATE_IPV4_REMOTE_ADDR_FLAG) {
/* IPv4 remote address component */ /* IPv4 remote address component */
for (int j = 0; for (j = 0;
(j < TRAFFIC_FLOW_TEMPLATE_IPV4_ADDR_SIZE) (j < TRAFFIC_FLOW_TEMPLATE_IPV4_ADDR_SIZE)
&& (j < NET_PACKET_FILTER_IPV4_ADDR_SIZE); j++) { && (j < NET_PACKET_FILTER_IPV4_ADDR_SIZE); j++) {
tft.pkf[i]->data.ipv4.addr[j] = pkf->ipv4remoteaddr[j].addr; tft.pkf[i]->data.ipv4.addr[j] = pkf->ipv4remoteaddr[j].addr;
...@@ -508,7 +510,7 @@ int esm_recv_activate_dedicated_eps_bearer_context_request(int pti, int ebi, ...@@ -508,7 +510,7 @@ int esm_recv_activate_dedicated_eps_bearer_context_request(int pti, int ebi,
} }
} else if (pkf->flags & TRAFFIC_FLOW_TEMPLATE_IPV6_REMOTE_ADDR_FLAG) { } else if (pkf->flags & TRAFFIC_FLOW_TEMPLATE_IPV6_REMOTE_ADDR_FLAG) {
/* IPv6 remote address component */ /* IPv6 remote address component */
for (int j = 0; for (j = 0;
(j < TRAFFIC_FLOW_TEMPLATE_IPV6_ADDR_SIZE) (j < TRAFFIC_FLOW_TEMPLATE_IPV6_ADDR_SIZE)
&& (j < NET_PACKET_FILTER_IPV6_ADDR_SIZE); j++) { && (j < NET_PACKET_FILTER_IPV6_ADDR_SIZE); j++) {
tft.pkf[i]->data.ipv6.addr[j] = pkf->ipv6remoteaddr[j].addr; tft.pkf[i]->data.ipv6.addr[j] = pkf->ipv6remoteaddr[j].addr;
...@@ -560,7 +562,7 @@ int esm_recv_activate_dedicated_eps_bearer_context_request(int pti, int ebi, ...@@ -560,7 +562,7 @@ int esm_recv_activate_dedicated_eps_bearer_context_request(int pti, int ebi,
esm_cause = ESM_CAUSE_SUCCESS; esm_cause = ESM_CAUSE_SUCCESS;
} }
/* Release temporary traffic flow template data */ /* Release temporary traffic flow template data */
for (int i = 0; i < tft.n_pkfs; i++) { for (i = 0; i < tft.n_pkfs; i++) {
free(tft.pkf[i]); free(tft.pkf[i]);
} }
/* Return the ESM cause value */ /* Return the ESM cause value */
......
...@@ -711,13 +711,14 @@ int nas_proc_get_pdn_status(int *cids, int *states, int n_pdn_max) ...@@ -711,13 +711,14 @@ int nas_proc_get_pdn_status(int *cids, int *states, int n_pdn_max)
{ {
LOG_FUNC_IN; LOG_FUNC_IN;
int cid;
int n_defined_pdn = 0; int n_defined_pdn = 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(); int n_pdn = esm_main_get_nb_pdns_max();
/* For all PDN contexts */ /* For all PDN contexts */
for (int 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 the status of this PDN */ /* Get the status of this PDN */
int state = FALSE; int state = FALSE;
int is_defined = esm_main_get_pdn_status(cid, &state); int is_defined = esm_main_get_pdn_status(cid, &state);
...@@ -754,13 +755,14 @@ int nas_proc_get_pdn_param(int *cids, int *types, const char **apns, ...@@ -754,13 +755,14 @@ int nas_proc_get_pdn_param(int *cids, int *types, const char **apns,
{ {
LOG_FUNC_IN; LOG_FUNC_IN;
int cid;
int n_defined_pdn = 0; int n_defined_pdn = 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(); int n_pdn = esm_main_get_nb_pdns_max();
/* For all PDN contexts */ /* For all PDN contexts */
for (int 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++) {
int emergency, active; int emergency, active;
/* Get PDN connection parameters */ /* Get PDN connection parameters */
int rc = esm_main_get_pdn(cid, types, apns, &emergency, &active); int rc = esm_main_get_pdn(cid, types, apns, &emergency, &active);
......
...@@ -26,14 +26,12 @@ Description Timer utilities ...@@ -26,14 +26,12 @@ Description Timer utilities
#include <stdlib.h> // malloc, free #include <stdlib.h> // malloc, free
#include <sys/time.h> // setitimer #include <sys/time.h> // setitimer
#if !defined(EPC_BUILD) #if defined(ENABLE_ITTI)
# include <signal.h>
# include <time.h> // clock_gettime
#endif
#if defined(NAS_MME) && defined(EPC_BUILD)
# include "intertask_interface.h" # include "intertask_interface.h"
# include "timer.h" # include "timer.h"
#else
# include <signal.h>
# include <time.h> // clock_gettime
#endif #endif
#include "nas_timer.h" #include "nas_timer.h"
#include "commonDef.h" #include "commonDef.h"
......
This diff is collapsed.
...@@ -2,26 +2,27 @@ noinst_LTLIBRARIES = libnas.la ...@@ -2,26 +2,27 @@ noinst_LTLIBRARIES = libnas.la
libnas_la_LDFLAGS = -all-static libnas_la_LDFLAGS = -all-static
AM_CFLAGS = \ AM_CFLAGS = \
@ADD_CFLAGS@ \ @ADD_CFLAGS@ \
-DNAS_MME \ -DNAS_MME \
-DEPC_BUILD \ -DEPC_BUILD \
-I$(top_srcdir)/COMMON \ -DENABLE_ITTI \
-I$(top_srcdir)/INTERTASK_INTERFACE \ -I$(top_srcdir)/COMMON \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/user \ -I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/mme \ -I$(top_srcdir)/NAS/EURECOM-NAS/src/api/user \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \ -I$(top_srcdir)/NAS/EURECOM-NAS/src/api/mme \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/emm/msg \ -I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/emm/sap \ -I$(top_srcdir)/NAS/EURECOM-NAS/src/emm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/emm \ -I$(top_srcdir)/NAS/EURECOM-NAS/src/emm/sap \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/esm/msg \ -I$(top_srcdir)/NAS/EURECOM-NAS/src/emm \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/esm/sap/msg \ -I$(top_srcdir)/NAS/EURECOM-NAS/src/esm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/esm/sap \ -I$(top_srcdir)/NAS/EURECOM-NAS/src/esm/sap/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/esm \ -I$(top_srcdir)/NAS/EURECOM-NAS/src/esm/sap \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/ies \ -I$(top_srcdir)/NAS/EURECOM-NAS/src/esm \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \ -I$(top_srcdir)/NAS/EURECOM-NAS/src/ies \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/util \ -I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/ \ -I$(top_srcdir)/NAS/EURECOM-NAS/src/util \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/ \
-I$(top_srcdir)/UTILS -I$(top_srcdir)/UTILS
if DISABLE_USE_NAS if DISABLE_USE_NAS
...@@ -29,8 +30,9 @@ libnas_la_SOURCES = \ ...@@ -29,8 +30,9 @@ libnas_la_SOURCES = \
nas_main.c nas_main.c
else else
include Makefile.inc include Makefile.inc
libnas_la_SOURCES = \ libnas_la_SOURCES = \
nas_main.c \ nas_main.c \
nas_itti_messaging.c nas_itti_messaging.h \ nas_itti_messaging.c \
nas_itti_messaging.h \
$(libnas_SRCS) $(libnas_SRCS)
endif endif
\ No newline at end of file
This diff is collapsed.
...@@ -23,20 +23,27 @@ $(ITTI_MESSAGES_H): $(ITTI_MESSAGES_XML) ...@@ -23,20 +23,27 @@ $(ITTI_MESSAGES_H): $(ITTI_MESSAGES_XML)
@sed -e 's/[ ]*//' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$$/\\n"/' $< > $@ @sed -e 's/[ ]*//' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$$/\\n"/' $< > $@
ifdef USE_MME ifdef USE_MME
CFLAGS += -DENB_MODE -DENABLE_USE_MME -DENABLE_EVENT_FD -I$(S1AP_DIR) -I$(SCTP_DIR) LIBS += $(UE_NAS_OBJ_DIR)/libuenas.a
S1AP_CFLAGS = $(CFLAGS) -I$(TOP_DIR) $(L2_incl) $(UTIL_incl) $(UTILS_incl)
LIBS += $(S1AP_OBJ_DIR)/libs1ap.a $(SCTP_OBJ_DIR)/libsctp.a -lsctp -lcrypt LIBS += $(S1AP_OBJ_DIR)/libs1ap.a $(SCTP_OBJ_DIR)/libsctp.a -lsctp -lcrypt
SHARED_DEPENDENCIES = $(S1AP_OBJ_DIR)/libs1ap.a $(SCTP_OBJ_DIR)/libsctp.a SHARED_DEPENDENCIES = $(UE_NAS_OBJ_DIR)/libuenas.a $(S1AP_OBJ_DIR)/libs1ap.a $(SCTP_OBJ_DIR)/libsctp.a
export S1AP_CFLAGS
ENABLE_ITTI = 1 ENABLE_ITTI = 1
CFLAGS += -DENABLE_ITTI -DENABLE_USE_MME
export CFLAGS
$(UE_NAS_OBJ_DIR)/libuenas.a: force_look
@$(MAKE) -C $(UE_NAS_DIR) -f Makefile.UE $(UE_NAS_OBJ_DIR)/libuenas.a OUTDIR=$(UE_NAS_OBJ_DIR)
CFLAGS += -DENB_MODE -I$(S1AP_DIR) -I$(SCTP_DIR)
S1AP_CFLAGS = $(CFLAGS) -I$(TOP_DIR) $(L2_incl) $(UTIL_incl) $(UTILS_incl)
export S1AP_CFLAGS
$(S1AP_OBJ_DIR)/libs1ap.a: force_look $(S1AP_OBJ_DIR)/libs1ap.a: force_look
@$(MAKE) -C $(S1AP_DIR) -f Makefile.eNB $(S1AP_OBJ_DIR)/libs1ap.a OUTDIR=$(S1AP_OBJ_DIR) @$(MAKE) -C $(S1AP_DIR) -f Makefile.eNB $(S1AP_OBJ_DIR)/libs1ap.a OUTDIR=$(S1AP_OBJ_DIR)
$(SCTP_OBJ_DIR)/libsctp.a: force_look $(SCTP_OBJ_DIR)/libsctp.a: force_look
@$(MAKE) -C $(SCTP_DIR) -f Makefile.eNB $(SCTP_OBJ_DIR)/libsctp.a OUTDIR=$(SCTP_OBJ_DIR) @$(MAKE) -C $(SCTP_DIR) -f Makefile.eNB $(SCTP_OBJ_DIR)/libsctp.a OUTDIR=$(SCTP_OBJ_DIR)
CFLAGS += $(NAS_UE_incl) CFLAGS += $(NAS_UE_incl)
OBJ = $(NAS_UE_OBJS) OBJ = $(NAS_UE_OBJS)
......
...@@ -60,10 +60,15 @@ COMMON_CFLAGS = \ ...@@ -60,10 +60,15 @@ COMMON_CFLAGS = \
-O2 -O2
COMMON_UTILS_DIR = $(OPENAIR_HOME)/common/utils COMMON_UTILS_DIR = $(OPENAIR_HOME)/common/utils
UE_NAS_DIR = $(OPENAIR_HOME)/openair-cn/NAS
S1AP_DIR = $(OPENAIR_HOME)/openair-cn/S1AP S1AP_DIR = $(OPENAIR_HOME)/openair-cn/S1AP
SCTP_DIR = $(OPENAIR_HOME)/openair-cn/SCTP SCTP_DIR = $(OPENAIR_HOME)/openair-cn/SCTP
UE_NAS_OBJ_DIR = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(UE_NAS_DIR))
S1AP_OBJ_DIR = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(S1AP_DIR)) S1AP_OBJ_DIR = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(S1AP_DIR))
SCTP_OBJ_DIR = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(SCTP_DIR)) SCTP_OBJ_DIR = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(SCTP_DIR))
export S1AP_DIR
export COMMON_UTILS_DIR export COMMON_UTILS_DIR
export UE_NAS_DIR
export S1AP_DIR
export SCTP_DIR
...@@ -367,7 +367,9 @@ rrm_std_cellular: ...@@ -367,7 +367,9 @@ rrm_std_cellular:
( cd $(OPENAIR2_DIR)/NAS/SIMU_CELLULAR && make cell_rrm CELL_RRM=1 CELLULAR=1 NO_RRM=1) ( cd $(OPENAIR2_DIR)/NAS/SIMU_CELLULAR && make cell_rrm CELL_RRM=1 CELLULAR=1 NO_RRM=1)
cleanall: clean cleanasn1 cleanall: clean cleanasn1
@if [ -d $(UE_NAS_DIR) ]; then $(MAKE) -C $(UE_NAS_DIR) -f Makefile.UE cleanall OUTDIR=$(UE_NAS_OBJ_DIR); fi
@if [ -d $(S1AP_DIR) ]; then $(MAKE) -C $(S1AP_DIR) -f Makefile.eNB cleanall OUTDIR=$(S1AP_OBJ_DIR); fi @if [ -d $(S1AP_DIR) ]; then $(MAKE) -C $(S1AP_DIR) -f Makefile.eNB cleanall OUTDIR=$(S1AP_OBJ_DIR); fi
@if [ -d $(SCTP_DIR) ]; then $(MAKE) -C $(SCTP_DIR) -f Makefile.eNB cleanall OUTDIR=$(SCTP_OBJ_DIR); fi
cleanalmostall: clean cleanalmostall: clean
rm -f $(ASN1_MSG_OBJS1) rm -f $(ASN1_MSG_OBJS1)
......
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