fixed #320 issue
This commit is contained in:
@@ -31,10 +31,6 @@
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#if 0
|
||||
#include "queue.h"
|
||||
#endif
|
||||
|
||||
#ifndef SECURITY_TYPES_H_
|
||||
#define SECURITY_TYPES_H_
|
||||
|
||||
@@ -113,11 +109,6 @@ typedef struct eutran_vector_s {
|
||||
res_t xres;
|
||||
uint8_t autn[AUTN_LENGTH_OCTETS];
|
||||
uint8_t kasme[KASME_LENGTH_OCTETS];
|
||||
|
||||
/* one UE can have multiple vectors so use STAILQ lists for easy management */
|
||||
#if 0
|
||||
STAILQ_ENTRY(eutran_vector_s) entries;
|
||||
#endif
|
||||
} eutran_vector_t;
|
||||
|
||||
#define FC_KASME (0x10)
|
||||
|
||||
@@ -290,31 +290,6 @@ int encode_activate_default_eps_bearer_context_request(activate_default_eps_bear
|
||||
encoded += encode_result;
|
||||
}
|
||||
|
||||
#if 0 /* LW: force Protocol Configuration Options to be included in the ESM message */
|
||||
{
|
||||
#define CONFIGURATION_PROTOCOL_PPP 0
|
||||
|
||||
#define PROTOCOL_ID_IPCP 0x8021
|
||||
#define PROTOCOL_ID_DNS_SERVER_IPV4_ADDRESS 0x000D
|
||||
|
||||
/* Force this item to be present */
|
||||
activate_default_eps_bearer_context_request->presencemask |= ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT;
|
||||
/* Fill this item with data from PFT trace */
|
||||
activate_default_eps_bearer_context_request->protocolconfigurationoptions.configurationprotol = CONFIGURATION_PROTOCOL_PPP;
|
||||
activate_default_eps_bearer_context_request->protocolconfigurationoptions.protocolid = PROTOCOL_ID_IPCP;
|
||||
activate_default_eps_bearer_context_request->protocolconfigurationoptions.lengthofprotocolid = 16; /* Size of PROTOCOL_ID_IPCP */
|
||||
activate_default_eps_bearer_context_request->protocolconfigurationoptions.protocolidcontents.value = (uint8_t *)
|
||||
/* PROTOCOL_ID_IPCP data */
|
||||
"\x03\x00\x00\x10\x81\x06\xC0\xA8\x0C\x64\x83\x06\xC0\xA8\x6A\x0C";
|
||||
/* Additional parameters PROTOCOL_ID_DNS_SERVER_IPV4_ADDRESS data */
|
||||
//"\x00\x0d\x04\x52\x61\x00\x78"
|
||||
/* Additional parameters PROTOCOL_ID_DNS_SERVER_IPV4_ADDRESS data */
|
||||
//"\x00\x0d\x04\x52\x61\x01\x78";
|
||||
//activate_default_eps_bearer_context_request->protocolconfigurationoptions.protocolidcontents.length = 16 + 7 + 7;
|
||||
activate_default_eps_bearer_context_request->protocolconfigurationoptions.protocolidcontents.length = 16;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((activate_default_eps_bearer_context_request->presencemask & ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT)
|
||||
== ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT) {
|
||||
if ((encode_result =
|
||||
|
||||
@@ -86,10 +86,6 @@ int encode_esm_message_container(EsmMessageContainer *esmmessagecontainer, uint8
|
||||
encoded += encode_result;
|
||||
|
||||
ENCODE_U16(lenPtr, encode_result, encoded);
|
||||
#if 0
|
||||
lenPtr[1] = (((encoded - 2 - ((iei > 0) ? 1: 0))) & 0x0000ff00) >> 8;
|
||||
lenPtr[0] = ((encoded - 2 - ((iei > 0) ? 1: 0))) & 0x000000ff;
|
||||
#endif
|
||||
return encoded;
|
||||
}
|
||||
|
||||
|
||||
@@ -97,37 +97,6 @@ typedef struct imeisv_s{
|
||||
uint8_t parity:4;
|
||||
} imeisv_t;
|
||||
|
||||
#if 0
|
||||
typedef struct imeisv_s {
|
||||
uint8_t length;
|
||||
union {
|
||||
struct {
|
||||
uint8_t tac2:4;
|
||||
uint8_t tac1:4;
|
||||
uint8_t tac4:4;
|
||||
uint8_t tac3:4;
|
||||
uint8_t tac6:4;
|
||||
uint8_t tac5:4;
|
||||
uint8_t tac8:4;
|
||||
uint8_t tac7:4;
|
||||
uint8_t snr2:4;
|
||||
uint8_t snr1:4;
|
||||
uint8_t snr4:4;
|
||||
uint8_t snr3:4;
|
||||
uint8_t snr6:4;
|
||||
uint8_t snr5:4;
|
||||
uint8_t svn2:4;
|
||||
uint8_t svn1:4;
|
||||
#define EVEN_PARITY 0
|
||||
#define IMEI_ODD_PARITY 0xf
|
||||
uint8_t parity:4;
|
||||
} num;
|
||||
#define IMEISV_BCD8_SIZE 9
|
||||
uint8_t value[IMEISV_BCD8_SIZE];
|
||||
} u;
|
||||
} imeisv_t;
|
||||
#endif
|
||||
|
||||
typedef ImsiMobileIdentity_t ImeiMobileIdentity_t;
|
||||
typedef imeisv_t ImeisvMobileIdentity_t;
|
||||
typedef ImsiMobileIdentity_t TmsiMobileIdentity_t;
|
||||
|
||||
@@ -175,16 +175,6 @@ void device_close(void* id)
|
||||
ssize_t device_read(void* id, char* buffer, size_t len)
|
||||
{
|
||||
const device_id_t* devid = (device_id_t*)(id);
|
||||
#if 0
|
||||
ssize_t rbytes = read(devid->fd, buffer, len);
|
||||
|
||||
if (rbytes < 0) {
|
||||
return RETURNerror;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//#if 0
|
||||
ssize_t rbytes = 0;
|
||||
|
||||
do {
|
||||
@@ -198,8 +188,6 @@ ssize_t device_read(void* id, char* buffer, size_t len)
|
||||
} while ( (buffer[rbytes-1] != '\r') && (buffer[rbytes-1] != '\n')
|
||||
&& (buffer[rbytes-1] != '\0') );
|
||||
|
||||
//#endif
|
||||
|
||||
return rbytes;
|
||||
}
|
||||
|
||||
|
||||
@@ -314,17 +314,6 @@ typedef struct {
|
||||
*/
|
||||
#define TAI_LIST_T(SIZE) struct {Byte_t n_tais; tai_t tai[SIZE];}
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* User notification callback, executed whenever a change of data with
|
||||
* respect of network information (e.g. network registration and/or
|
||||
* location change, new PLMN becomes available) is notified by the
|
||||
* EPS Mobility Management sublayer
|
||||
*/
|
||||
typedef int (*emm_indication_callback_t) (Stat_t, tac_t, ci_t, AcT_t,
|
||||
const char*, size_t);
|
||||
#endif
|
||||
|
||||
typedef enum eps_protocol_discriminator_e {
|
||||
/* Protocol discriminator identifier for EPS Mobility Management */
|
||||
EPS_MOBILITY_MANAGEMENT_MESSAGE = 0x7,
|
||||
|
||||
@@ -260,15 +260,6 @@ typedef struct {
|
||||
network_pkf_t* pkf[NET_PACKET_FILTER_MAX];
|
||||
} network_tft_t;
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* User notification callback, executed whenever a change of status with
|
||||
* respect of PDN connection or EPS bearer context is notified by the EPS
|
||||
* Session Management sublayer
|
||||
*/
|
||||
typedef int (*esm_indication_callback_t) (int, network_pdn_state_t);
|
||||
#endif
|
||||
|
||||
/****************************************************************************/
|
||||
/******************** G L O B A L V A R I A B L E S ********************/
|
||||
/****************************************************************************/
|
||||
|
||||
@@ -338,14 +338,8 @@ _attach_accept(
|
||||
{
|
||||
int index = 0;
|
||||
|
||||
#if 0
|
||||
/* T3412 timer value */
|
||||
index += snprintf(buffer + index, length - index, "T3412 = ");
|
||||
index += gprsTimer(buffer + index, length - index, &msg->t3412value);
|
||||
/* TAI list */
|
||||
index += snprintf(buffer + index, length - index, ", ");
|
||||
index += taiList(buffer + index, length - index, &msg->tailist);
|
||||
#endif
|
||||
/* T3412 timer value (TBD) */
|
||||
/* TAI list (TBD) */
|
||||
|
||||
/* GUTI */
|
||||
if (msg->presencemask & ATTACH_ACCEPT_GUTI_PRESENT) {
|
||||
|
||||
@@ -225,23 +225,6 @@ int main (int argc, const char* argv[])
|
||||
break;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* Send the AT command one byte at a time (serial port simulation) */
|
||||
const char* pbuffer = _user_simulator_send_buffer;
|
||||
|
||||
while (*pbuffer) {
|
||||
int sbytes = USER_SEND(pbuffer++, 1);
|
||||
|
||||
if (sbytes == RETURNerror) {
|
||||
perror("ERROR\t: Failed to send data to the NAS sublayer");
|
||||
break;
|
||||
}
|
||||
|
||||
(void)poll(0, 0, 10);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
(void)poll(0, 0, 100);
|
||||
}
|
||||
|
||||
|
||||
@@ -384,60 +384,6 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
|
||||
mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb ++;
|
||||
s1ap_handle_s1_setup_message(mme_desc_p, 0);
|
||||
|
||||
#if 0
|
||||
/* We call back our self
|
||||
* -> generate a dummy initial UE message
|
||||
*/
|
||||
{
|
||||
s1ap_nas_first_req_t s1ap_nas_first_req;
|
||||
|
||||
memset(&s1ap_nas_first_req, 0, sizeof(s1ap_nas_first_req_t));
|
||||
|
||||
s1ap_nas_first_req.rnti = 0xC03A;
|
||||
s1ap_nas_first_req.establishment_cause = RRC_CAUSE_MO_DATA;
|
||||
s1ap_nas_first_req.ue_identity.presenceMask = UE_IDENTITIES_gummei;
|
||||
|
||||
s1ap_nas_first_req.ue_identity.gummei.mcc = 208;
|
||||
s1ap_nas_first_req.ue_identity.gummei.mnc = 34;
|
||||
s1ap_nas_first_req.ue_identity.gummei.mme_code = 0;
|
||||
s1ap_nas_first_req.ue_identity.gummei.mme_group_id = 0;
|
||||
|
||||
/* NAS Attach request with IMSI */
|
||||
static uint8_t nas_attach_req_imsi[] = {
|
||||
0x07, 0x41,
|
||||
/* EPS Mobile identity = IMSI */
|
||||
0x71, 0x08, 0x29, 0x80, 0x43, 0x21, 0x43, 0x65, 0x87,
|
||||
0xF9,
|
||||
/* End of EPS Mobile Identity */
|
||||
0x02, 0xE0, 0xE0, 0x00, 0x20, 0x02, 0x03,
|
||||
0xD0, 0x11, 0x27, 0x1A, 0x80, 0x80, 0x21, 0x10, 0x01, 0x00, 0x00,
|
||||
0x10, 0x81, 0x06, 0x00, 0x00, 0x00, 0x00, 0x83, 0x06, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x0A, 0x00, 0x52, 0x12, 0xF2,
|
||||
0x01, 0x27, 0x11,
|
||||
};
|
||||
|
||||
/* NAS Attach request with GUTI */
|
||||
static uint8_t nas_attach_req_guti[] = {
|
||||
0x07, 0x41,
|
||||
/* EPS Mobile identity = IMSI */
|
||||
0x71, 0x0B, 0xF6, 0x12, 0xF2, 0x01, 0x80, 0x00, 0x01, 0xE0, 0x00,
|
||||
0xDA, 0x1F,
|
||||
/* End of EPS Mobile Identity */
|
||||
0x02, 0xE0, 0xE0, 0x00, 0x20, 0x02, 0x03,
|
||||
0xD0, 0x11, 0x27, 0x1A, 0x80, 0x80, 0x21, 0x10, 0x01, 0x00, 0x00,
|
||||
0x10, 0x81, 0x06, 0x00, 0x00, 0x00, 0x00, 0x83, 0x06, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x0A, 0x00, 0x52, 0x12, 0xF2,
|
||||
0x01, 0x27, 0x11,
|
||||
};
|
||||
|
||||
s1ap_nas_first_req.nas_pdu.buffer = nas_attach_req_guti;
|
||||
s1ap_nas_first_req.nas_pdu.length = sizeof(nas_attach_req_guti);
|
||||
|
||||
s1ap_eNB_handle_nas_first_req(mme_desc_p->s1ap_eNB_instance->instance,
|
||||
&s1ap_nas_first_req);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1078,29 +1024,6 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id,
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* convert Paging DRX(optional) */
|
||||
if (paging_p->presenceMask & S1AP_PAGINGIES_PAGINGDRX_PRESENT) {
|
||||
switch(paging_p->pagingDRX) {
|
||||
case S1ap_PagingDRX_v32:
|
||||
S1AP_PAGING_IND(message_p).paging_drx = PAGING_DRX_32;
|
||||
break;
|
||||
case S1ap_PagingDRX_v64:
|
||||
S1AP_PAGING_IND(message_p).paging_drx = PAGING_DRX_64;
|
||||
break;
|
||||
case S1ap_PagingDRX_v128:
|
||||
S1AP_PAGING_IND(message_p).paging_drx = PAGING_DRX_128;
|
||||
break;
|
||||
case S1ap_PagingDRX_v256:
|
||||
S1AP_PAGING_IND(message_p).paging_drx = PAGING_DRX_256;
|
||||
break;
|
||||
default:
|
||||
// when UE Paging DRX is no value
|
||||
S1AP_PAGING_IND(message_p).paging_drx = PAGING_DRX_256;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
S1AP_PAGING_IND(message_p).paging_drx = PAGING_DRX_256;
|
||||
|
||||
/* convert cnDomain */
|
||||
@@ -1133,46 +1056,6 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id,
|
||||
S1AP_DEBUG("[SCTP %d] Received Paging: MCC %d, MNC %d, TAC %d\n", assoc_id, S1AP_PAGING_IND(message_p).plmn_identity[i].mcc, S1AP_PAGING_IND(message_p).plmn_identity[i].mnc, S1AP_PAGING_IND(message_p).tac[i]);
|
||||
}
|
||||
|
||||
#if 0
|
||||
// CSG Id(optional) List is not used
|
||||
if (paging_p->presenceMask & S1AP_PAGINGIES_CSG_IDLIST_PRESENT) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
/* convert pagingPriority (optional) if has value */
|
||||
if (paging_p->presenceMask & S1AP_PAGINGIES_PAGINGPRIORITY_PRESENT) {
|
||||
switch(paging_p->pagingPriority) {
|
||||
case S1ap_PagingPriority_priolevel1:
|
||||
S1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL1;
|
||||
break;
|
||||
case S1ap_PagingPriority_priolevel2:
|
||||
S1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL2;
|
||||
break;
|
||||
case S1ap_PagingPriority_priolevel3:
|
||||
S1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL3;
|
||||
break;
|
||||
case S1ap_PagingPriority_priolevel4:
|
||||
S1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL4;
|
||||
break;
|
||||
case S1ap_PagingPriority_priolevel5:
|
||||
S1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL5;
|
||||
break;
|
||||
case S1ap_PagingPriority_priolevel6:
|
||||
S1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL6;
|
||||
break;
|
||||
case S1ap_PagingPriority_priolevel7:
|
||||
S1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL7;
|
||||
break;
|
||||
case S1ap_PagingPriority_priolevel8:
|
||||
S1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL8;
|
||||
break;
|
||||
default:
|
||||
/* invalid paging_p->pagingPriority */
|
||||
S1AP_ERROR("[SCTP %d] Received paging : pagingPriority(%ld) is invalid\n", assoc_id, paging_p->pagingPriority);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
//paging parameter values
|
||||
S1AP_DEBUG("[SCTP %d] Received Paging parameters: ue_index_value %d cn_domain %d paging_drx %d paging_priority %d\n",assoc_id,
|
||||
S1AP_PAGING_IND(message_p).ue_index_value, S1AP_PAGING_IND(message_p).cn_domain,
|
||||
|
||||
@@ -203,19 +203,6 @@ sctp_handle_new_association_req(
|
||||
|
||||
if (s > 0 ) {
|
||||
if (((struct sockaddr_in*)ifa->ifa_addr)->sin_addr.s_addr == in.s_addr) {
|
||||
#if 0
|
||||
memset(&ifr, 0, sizeof(ifr));
|
||||
snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s",ifa->ifa_name);
|
||||
|
||||
if (setsockopt(sd, SOL_SOCKET, SO_BINDTODEVICE, (void *)&ifr, sizeof(ifr)) < 0) {
|
||||
SCTP_ERROR("Setsockopt SOL_SOCKET failed: %s\n",
|
||||
strerror(errno));
|
||||
} else {
|
||||
SCTP_DEBUG("Setsockopt SOL_SOCKET socket bound to : %s\n",
|
||||
ifa->ifa_name);
|
||||
}
|
||||
|
||||
#else
|
||||
struct sockaddr_in locaddr;
|
||||
locaddr.sin_family = AF_INET;
|
||||
locaddr.sin_port = htons(sctp_new_association_req_p->port);
|
||||
@@ -228,8 +215,6 @@ sctp_handle_new_association_req(
|
||||
SCTP_DEBUG("sctp_bindx SCTP_BINDX_ADD_ADDR socket bound to : %s\n",
|
||||
inet_ntoa(locaddr.sin_addr));
|
||||
}
|
||||
|
||||
#endif
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
@@ -276,13 +276,10 @@ void udp_eNB_receiver(struct udp_socket_desc_s *udp_sock_pP)
|
||||
* if the queue is full.
|
||||
*/
|
||||
/* look for HACK_RLC_UM_LIMIT for others places related to the hack. Please do not remove this comment. */
|
||||
//if (itti_send_msg_to_task(udp_sock_pP->task_id, INSTANCE_DEFAULT, message_p) < 0) {
|
||||
if (itti_try_send_msg_to_task(udp_sock_pP->task_id, INSTANCE_DEFAULT, message_p) < 0) {
|
||||
#if 0
|
||||
LOG_I(UDP_, "Failed to send message %d to task %d\n",
|
||||
LOG_E(UDP_, "Failed to send message %d to task %d\n",
|
||||
UDP_DATA_IND,
|
||||
udp_sock_pP->task_id);
|
||||
#endif
|
||||
itti_free(TASK_UDP, message_p);
|
||||
itti_free(TASK_UDP, forwarded_buffer);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user