Commit 027e381f authored by winckel's avatar winckel
Browse files

Corrected some NAS file to compile without C99 mode option.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4652 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 045f2854
......@@ -491,6 +491,7 @@ static int _at_response_encode_clac(char* buffer, const at_response_t* data)
const at_clac_resp_t * clac = &(data->response.clac);
int offset = 0;
int i;
if (data->type == AT_COMMAND_ACT) {
if (clac->n_acs > 0) {
......@@ -498,7 +499,7 @@ static int _at_response_encode_clac(char* buffer, const at_response_t* data)
offset += sprintf(buffer, "\r\n");
}
offset += sprintf(buffer+offset, "%s", clac->ac[0]);
for (int i = 1; i < clac->n_acs; i++) {
for (i = 1; i < clac->n_acs; i++) {
offset += sprintf(buffer+offset, "\r\n%s", clac->ac[i]);
}
}
......@@ -872,6 +873,7 @@ static int _at_response_encode_cgdcont(char* buffer, const at_response_t* data)
LOG_FUNC_IN;
int offset = 0;
int i;
if (data->type == AT_COMMAND_GET)
{
......@@ -881,7 +883,7 @@ static int _at_response_encode_cgdcont(char* buffer, const at_response_t* data)
}
/* Display the list of defined PDN contexts */
for (int i = 0; i < cgdcont->n_pdns; i++) {
for (i = 0; i < cgdcont->n_pdns; i++) {
offset += sprintf(buffer+offset, "+CGDCONT: %u", cgdcont->cid[i]);
if (cgdcont->PDP_type[i] == NET_PDN_TYPE_IPV4) {
offset += sprintf(buffer+offset, ",IP");
......@@ -950,6 +952,7 @@ static int _at_response_encode_cgact(char* buffer, const at_response_t* data)
LOG_FUNC_IN;
int offset = 0;
int i;
if (data->type == AT_COMMAND_GET)
{
......@@ -958,7 +961,7 @@ static int _at_response_encode_cgact(char* buffer, const at_response_t* data)
offset += sprintf(buffer, "\r\n");
}
/* Display the list of defined PDN status */
for (int i = 0; i < cgact->n_pdns; i++) {
for (i = 0; i < cgact->n_pdns; i++) {
offset += sprintf(buffer+offset, "+CGACT: %u,%u\r\n",
cgact->cid[i], cgact->state[i]);
}
......@@ -996,6 +999,7 @@ static int _at_response_encode_cgpaddr(char* buffer, const at_response_t* data)
int offset = 0;
const at_cgpaddr_resp_t * cgpaddr = &(data->response.cgpaddr);
int i;
if (data->type == AT_COMMAND_SET)
{
......@@ -1004,7 +1008,7 @@ static int _at_response_encode_cgpaddr(char* buffer, const at_response_t* data)
}
/* Display the list of IP addresses assigned to each defined PDN
* connections */
for (int i = 0; i < cgpaddr->n_pdns; i++) {
for (i = 0; i < cgpaddr->n_pdns; i++) {
offset += sprintf(buffer+offset, "+CGPADDR: %u", cgpaddr->cid[i]);
if (cgpaddr->PDP_addr_1[i] != NULL) {
/* IPv4 address */
......@@ -1042,7 +1046,7 @@ static int _at_response_encode_cgpaddr(char* buffer, const at_response_t* data)
offset += sprintf(buffer, "\r\n");
}
offset += sprintf(buffer+offset, "+CGPADDR: %u", cgpaddr->cid[0]);
for (int i = 1; i < cgpaddr->n_pdns; i++) {
for (i = 1; i < cgpaddr->n_pdns; i++) {
offset += sprintf(buffer+offset, ",%u", cgpaddr->cid[i]);
}
offset += sprintf(buffer+offset, "\r\n");
......
......@@ -190,6 +190,7 @@ int usim_api_authenticate(const OctetString* rand, const OctetString* autn,
LOG_FUNC_IN;
int rc;
int i;
/* Compute the authentication response RES = f2K (RAND) */
/* Compute the cipher key CK = f3K (RAND) */
......@@ -203,7 +204,7 @@ int usim_api_authenticate(const OctetString* rand, const OctetString* autn,
/* Retrieve the sequence number SQN = (SQN ⊕ AK) ⊕ AK */
#define USIM_API_SQN_SIZE USIM_API_AK_SIZE
u8 sqn[USIM_API_SQN_SIZE];
for (int i = 0; i < USIM_API_SQN_SIZE; i++) {
for (i = 0; i < USIM_API_SQN_SIZE; i++) {
sqn[i] = rand->value[i] ^ ak[i];
}
......@@ -234,13 +235,13 @@ int usim_api_authenticate(const OctetString* rand, const OctetString* autn,
u8 sqn_ms[USIM_API_SQNMS_SIZE];
memset(sqn_ms, 0, USIM_API_SQNMS_SIZE);
#define USIM_API_SQN_MS_SIZE 3
for (int i = 0; i < USIM_API_SQN_MS_SIZE; i++) {
for (i = 0; i < USIM_API_SQN_MS_SIZE; i++) {
sqn_ms[USIM_API_SQNMS_SIZE - i] =
((UInt8_t*)(_usim_api_data.sqn_ms))[USIM_API_SQN_MS_SIZE - i];
}
u8 sqnms[USIM_API_SQNMS_SIZE];
for (int i = 0; i < USIM_API_SQNMS_SIZE; i++) {
for (i = 0; i < USIM_API_SQNMS_SIZE; i++) {
sqnms[i] = sqn_ms[i] ^ ak[i];
}
......
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