Commit 117f955d authored by Cedric Roux's avatar Cedric Roux

- Fixed initial tac/mcc/mnc

- Trigger a dummy initial ue message when receiving s1 setup response
- Added new S1AP <-> RRC messages
- Fixed almost all S1AP messages to integrate ITTI

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4347 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 7535f20c
...@@ -421,12 +421,6 @@ struct s1ap_message_s; ...@@ -421,12 +421,6 @@ struct s1ap_message_s;
/** \brief Function callback prototype. /** \brief Function callback prototype.
**/ **/
// typedef int (*s1ap_message_decoded_callback)(
// eNB_mme_desc_t *eNB_desc_p,
// sctp_queue_item_t *packet_p,
// struct s1ap_message_s *message_p
// );
typedef int (*s1ap_message_decoded_callback)( typedef int (*s1ap_message_decoded_callback)(
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
......
This diff is collapsed.
...@@ -82,46 +82,6 @@ typedef enum { ...@@ -82,46 +82,6 @@ typedef enum {
S1AP_OVERLOAD_MAX, S1AP_OVERLOAD_MAX,
} s1ap_overload_state_t; } s1ap_overload_state_t;
// typedef enum {
// PAGING_DRX_32 = 0x0,
// PAGING_DRX_64 = 0x1,
// PAGING_DRX_128 = 0x2,
// PAGING_DRX_256 = 0x3,
// } paging_drx_t;
typedef struct {
/* Octet string data */
uint8_t *buffer;
/* Length of the octet string */
uint32_t length;
} nas_pdu_t, ue_radio_cap_t;
typedef struct {
uint16_t mcc;
uint16_t mnc;
uint8_t mme_code;
uint16_t mme_group_id;
} gummei_t;
typedef struct {
uint8_t mme_code;
uint32_t m_tmsi;
} s_tmsi_t;
/* Provides the establishment cause for the RRC connection request as provided
* by the upper layers. W.r.t. the cause value names: highPriorityAccess
* concerns AC11..AC15, ‘mt’ stands for ‘Mobile Terminating’ and ‘mo’ for
* 'Mobile Originating'. Defined in TS 36.331.
*/
typedef enum {
RRC_CAUSE_EMERGENCY = 0x0,
RRC_CAUSE_HIGH_PRIO_ACCESS = 0x1,
RRC_CAUSE_MT_ACCESS = 0x2,
RRC_CAUSE_MO_SIGNALLING = 0x3,
RRC_CAUSE_MO_DATA = 0x4,
RRC_CAUSE_MAX = RRC_CAUSE_MO_DATA,
} rrc_establishment_cause_t;
typedef struct { typedef struct {
uint8_t qci; uint8_t qci;
...@@ -166,16 +126,6 @@ typedef struct { ...@@ -166,16 +126,6 @@ typedef struct {
// cause_t cause; // cause_t cause;
} e_rab_failed_t; } e_rab_failed_t;
typedef struct {
#define S_TMSI_PROVIDED 0x0
#define GUMMEI_PROVIDED 0x1
unsigned present:1;
union {
gummei_t gummei;
s_tmsi_t s_tmsi;
} identity;
} ue_identity_t;
/* Served PLMN identity element */ /* Served PLMN identity element */
struct plmn_identity_s { struct plmn_identity_s {
uint16_t mcc; uint16_t mcc;
......
...@@ -58,6 +58,7 @@ static ...@@ -58,6 +58,7 @@ static
int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id, int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
struct s1ap_message_s *message_p); struct s1ap_message_s *message_p);
static
int s1ap_eNB_handle_s1_setup_failure(uint32_t assoc_id, int s1ap_eNB_handle_s1_setup_failure(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
struct s1ap_message_s *message_p); struct s1ap_message_s *message_p);
...@@ -164,6 +165,7 @@ int s1ap_eNB_handle_message(uint32_t assoc_id, int32_t stream, ...@@ -164,6 +165,7 @@ int s1ap_eNB_handle_message(uint32_t assoc_id, int32_t stream,
(assoc_id, stream, &message); (assoc_id, stream, &message);
} }
static
int s1ap_eNB_handle_s1_setup_failure(uint32_t assoc_id, int s1ap_eNB_handle_s1_setup_failure(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
struct s1ap_message_s *message_p) struct s1ap_message_s *message_p)
...@@ -173,14 +175,11 @@ int s1ap_eNB_handle_s1_setup_failure(uint32_t assoc_id, ...@@ -173,14 +175,11 @@ int s1ap_eNB_handle_s1_setup_failure(uint32_t assoc_id,
S1AP_WARN("[SCTP %d] Received s1 setup failure on stream != 0 (%d)\n", S1AP_WARN("[SCTP %d] Received s1 setup failure on stream != 0 (%d)\n",
assoc_id, stream); assoc_id, stream);
} }
S1AP_DEBUG("Received s1 setup failure for MME... please check your parameters\n"); S1AP_ERROR("Received s1 setup failure for MME... please check your parameters\n");
return 0; return 0;
} }
// int s1ap_eNB_handle_s1_setup_response(eNB_mme_desc_t *eNB_desc_p,
// sctp_queue_item_t *packet_p,
// struct s1ap_message_s *message_p)
static static
int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id, int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
...@@ -277,71 +276,62 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id, ...@@ -277,71 +276,62 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
*/ */
mme_desc_p->state = S1AP_ENB_STATE_CONNECTED; mme_desc_p->state = S1AP_ENB_STATE_CONNECTED;
// /* We call back our self /* We call back our self
// * -> generate a dummy initial UE message * -> generate a dummy initial UE message
// */ */
// { {
// extern int s1ap_eNB_handle_api_req(eNB_mme_desc_t *eNB_desc_p, s1ap_nas_first_req_t s1ap_nas_first_req;
// s1ap_rrc_api_req_t *api_req_p);
// s1ap_rrc_api_req_t api_req; memset(&s1ap_nas_first_req, 0, sizeof(s1ap_nas_first_req_t));
// s1ap_nas_first_req_t *nas_req_p;
// s1ap_nas_first_req.rnti = 0xC03A;
// memset(&api_req, 0, sizeof(s1ap_rrc_api_req_t)); s1ap_nas_first_req.establishment_cause = RRC_CAUSE_MO_DATA;
// s1ap_nas_first_req.ue_identity.present = GUMMEI_PROVIDED;
// nas_req_p = &api_req.msg.first_nas_req;
// api_req.api_req = S1AP_API_NAS_FIRST_REQ; s1ap_nas_first_req.ue_identity.identity.gummei.mcc = 208;
// s1ap_nas_first_req.ue_identity.identity.gummei.mnc = 34;
// nas_req_p->rnti = 0xC03A; s1ap_nas_first_req.ue_identity.identity.gummei.mme_code = 0;
// nas_req_p->establishment_cause = RRC_CAUSE_MO_DATA; s1ap_nas_first_req.ue_identity.identity.gummei.mme_group_id = 0;
// nas_req_p->ue_identity.present = GUMMEI_PROVIDED;
// /* NAS Attach request with IMSI */
// nas_req_p->ue_identity.identity.gummei.mcc = 208; uint8_t nas_attach_req_imsi[] =
// nas_req_p->ue_identity.identity.gummei.mnc = 34; {
// nas_req_p->ue_identity.identity.gummei.mme_code = 0; 0x07, 0x41,
// nas_req_p->ue_identity.identity.gummei.mme_group_id = 0; /* EPS Mobile identity = IMSI */
// 0x71, 0x08, 0x29, 0x80, 0x43, 0x21, 0x43, 0x65, 0x87,
// /* NAS Attach request with IMSI */ 0xF9,
// uint8_t nas_attach_req_imsi[] = /* End of EPS Mobile Identity */
// { 0x02, 0xE0, 0xE0, 0x00, 0x20, 0x02, 0x03,
// 0x07, 0x41, 0xD0, 0x11, 0x27, 0x1A, 0x80, 0x80, 0x21, 0x10, 0x01, 0x00, 0x00,
// /* EPS Mobile identity = IMSI */ 0x10, 0x81, 0x06, 0x00, 0x00, 0x00, 0x00, 0x83, 0x06, 0x00, 0x00,
// 0x71, 0x08, 0x29, 0x80, 0x43, 0x21, 0x43, 0x65, 0x87, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x0A, 0x00, 0x52, 0x12, 0xF2,
// 0xF9, 0x01, 0x27, 0x11,
// /* End of EPS Mobile Identity */ };
// 0x02, 0xE0, 0xE0, 0x00, 0x20, 0x02, 0x03,
// 0xD0, 0x11, 0x27, 0x1A, 0x80, 0x80, 0x21, 0x10, 0x01, 0x00, 0x00, /* NAS Attach request with GUTI */
// 0x10, 0x81, 0x06, 0x00, 0x00, 0x00, 0x00, 0x83, 0x06, 0x00, 0x00, uint8_t nas_attach_req_guti[] =
// 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x0A, 0x00, 0x52, 0x12, 0xF2, {
// 0x01, 0x27, 0x11, 0x07, 0x41,
// }; /* EPS Mobile identity = IMSI */
// 0x71, 0x0B, 0xF6, 0x12, 0xF2, 0x01, 0x80, 0x00, 0x01, 0xE0, 0x00,
// /* NAS Attach request with GUTI */ 0xDA, 0x1F,
// uint8_t nas_attach_req_guti[] = /* End of EPS Mobile Identity */
// { 0x02, 0xE0, 0xE0, 0x00, 0x20, 0x02, 0x03,
// 0x07, 0x41, 0xD0, 0x11, 0x27, 0x1A, 0x80, 0x80, 0x21, 0x10, 0x01, 0x00, 0x00,
// /* EPS Mobile identity = IMSI */ 0x10, 0x81, 0x06, 0x00, 0x00, 0x00, 0x00, 0x83, 0x06, 0x00, 0x00,
// 0x71, 0x0B, 0xF6, 0x12, 0xF2, 0x01, 0x80, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x0A, 0x00, 0x52, 0x12, 0xF2,
// 0xDA, 0x1F, 0x01, 0x27, 0x11,
// /* End of EPS Mobile Identity */ };
// 0x02, 0xE0, 0xE0, 0x00, 0x20, 0x02, 0x03,
// 0xD0, 0x11, 0x27, 0x1A, 0x80, 0x80, 0x21, 0x10, 0x01, 0x00, 0x00, s1ap_nas_first_req.nas_pdu.buffer = nas_attach_req_guti;
// 0x10, 0x81, 0x06, 0x00, 0x00, 0x00, 0x00, 0x83, 0x06, 0x00, 0x00, s1ap_nas_first_req.nas_pdu.length = sizeof(nas_attach_req_guti);
// 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x0A, 0x00, 0x52, 0x12, 0xF2,
// 0x01, 0x27, 0x11, s1ap_eNB_handle_nas_first_req(&s1ap_nas_first_req);
// }; }
//
// nas_req_p->nas_pdu.buffer = nas_attach_req_guti;
// nas_req_p->nas_pdu.length = sizeof(nas_attach_req_guti);
//
// s1ap_eNB_handle_api_req(eNB_desc_p, &api_req);
// }
return 0; return 0;
} }
// int s1ap_eNB_handle_initial_context_request(eNB_mme_desc_t *eNB_desc_p,
// sctp_queue_item_t *packet_p,
// struct s1ap_message_s *message_p)
static static
int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id, int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
...@@ -351,30 +341,28 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id, ...@@ -351,30 +341,28 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
s1ap_eNB_ue_context_t *ue_desc_p; s1ap_eNB_ue_context_t *ue_desc_p;
InitialContextSetupRequestIEs_t *initialContextSetupRequest_p; InitialContextSetupRequestIEs_t *initialContextSetupRequest_p;
// DevAssert(eNB_desc_p != NULL);
DevAssert(message_p != NULL); DevAssert(message_p != NULL);
initialContextSetupRequest_p = &message_p->msg.initialContextSetupRequestIEs; initialContextSetupRequest_p = &message_p->msg.initialContextSetupRequestIEs;
/* Initial context request = UE-related procedure -> stream != 0 */ if ((mme_desc_p = s1ap_eNB_get_MME(NULL, assoc_id, 0)) == NULL) {
if (stream == 0) { S1AP_ERROR("[SCTP %d] Received initial context setup request for non "
S1AP_ERROR("[SCTP %d] Received UE-related procedure on stream = 0 (%d)\n", "existing MME context\n", assoc_id);
assoc_id, stream); return -1;
}
if ((ue_desc_p = s1ap_eNB_get_ue_context(mme_desc_p->s1ap_eNB_instance,
initialContextSetupRequest_p->eNB_UE_S1AP_ID)) == NULL) {
S1AP_ERROR("[SCTP %d] Received initial context setup request for non "
"existing UE context\n", assoc_id);
return -1; return -1;
} }
// if ((mme_desc_p = s1ap_eNB_get_MME(eNB_desc_p, assoc_id)) == NULL) { /* Initial context request = UE-related procedure -> stream != 0 */
// S1AP_ERROR("[SCTP %d] Received initial context setup request for non " if (stream != ue_desc_p->stream) {
// "existing MME context\n", packet_p->assoc_id); S1AP_ERROR("[SCTP %d] Received UE-related procedure on stream (%d) whereas expecting (%d)\n",
// return -1; assoc_id, stream, ue_desc_p->stream);
// } return -1;
// if ((ue_desc_p = s1ap_eNB_get_ue_context(eNB_desc_p, }
// initialContextSetupRequest_p->eNB_UE_S1AP_ID)) == NULL) {
// S1AP_ERROR("[SCTP %d] Received initial context setup request for non "
// "existing UE context\n", packet_p->assoc_id);
// return -1;
// }
ue_desc_p->mme_ue_s1ap_id = initialContextSetupRequest_p->mme_ue_s1ap_id; ue_desc_p->mme_ue_s1ap_id = initialContextSetupRequest_p->mme_ue_s1ap_id;
......
...@@ -19,3 +19,20 @@ void s1ap_eNB_itti_send_sctp_data_req(int32_t assoc_id, uint8_t *buffer, ...@@ -19,3 +19,20 @@ void s1ap_eNB_itti_send_sctp_data_req(int32_t assoc_id, uint8_t *buffer,
itti_send_msg_to_task(TASK_SCTP, INSTANCE_DEFAULT, message_p); itti_send_msg_to_task(TASK_SCTP, INSTANCE_DEFAULT, message_p);
} }
void s1ap_eNB_itti_send_nas_downlink_ind(uint8_t mod_id, uint8_t *nas_pdu,
uint32_t nas_pdu_length)
{
MessageDef *message_p;
s1ap_downlink_nas_t *s1ap_downlink_nas;
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_DOWNLINK_NAS);
s1ap_downlink_nas = &message_p->msg.s1ap_downlink_nas;
s1ap_downlink_nas->mod_id = mod_id;
s1ap_downlink_nas->nas_pdu.buffer = nas_pdu;
s1ap_downlink_nas->nas_pdu.length = nas_pdu_length;
itti_send_msg_to_task(TASK_RRC_ENB, INSTANCE_DEFAULT, message_p);
}
...@@ -4,4 +4,7 @@ ...@@ -4,4 +4,7 @@
void s1ap_eNB_itti_send_sctp_data_req(int32_t assoc_id, uint8_t *buffer, void s1ap_eNB_itti_send_sctp_data_req(int32_t assoc_id, uint8_t *buffer,
uint32_t buffer_length, uint16_t stream); uint32_t buffer_length, uint16_t stream);
void s1ap_eNB_itti_send_nas_downlink_ind(uint8_t mod_id, uint8_t *nas_pdu,
uint32_t nas_pdu_length);
#endif /* S1AP_ENB_ITTI_MESSAGING_H_ */ #endif /* S1AP_ENB_ITTI_MESSAGING_H_ */
...@@ -35,17 +35,104 @@ ...@@ -35,17 +35,104 @@
#include "intertask_interface.h" #include "intertask_interface.h"
#include "assertions.h" #include "assertions.h"
// #include "conversions.h" #include "conversions.h"
#include "s1ap_common.h" #include "s1ap_common.h"
#include "s1ap_ies_defs.h"
#include "s1ap_eNB_defs.h" #include "s1ap_eNB_defs.h"
#include "s1ap_eNB.h" #include "s1ap_eNB.h"
#include "s1ap_eNB_encoder.h" s1ap_eNB_internal_data_t s1ap_eNB_internal_data;
#include "s1ap_eNB_management_procedures.h"
#include "sctp_primitives_client.h" static int s1ap_eNB_generate_s1_setup_request(
s1ap_eNB_instance_t *instance_p, s1ap_eNB_mme_data_t *s1ap_mme_data_p);
RB_GENERATE(s1ap_mme_map, s1ap_eNB_mme_data_s, entry, s1ap_eNB_compare_assoc_id);
inline int s1ap_eNB_compare_assoc_id(
struct s1ap_eNB_mme_data_s *p1, struct s1ap_eNB_mme_data_s *p2)
{
if (p1->assoc_id == -1) {
if (p1->cnx_id < p2->cnx_id) {
return -1;
}
if (p1->cnx_id > p2->cnx_id) {
return 1;
}
} else {
if (p1->assoc_id < p2->assoc_id) {
return -1;
}
if (p1->assoc_id > p2->assoc_id) {
return 1;
}
}
/* Matching reference */
return 0;
}
uint16_t s1ap_eNB_fetch_add_global_cnx_id(void)
{
return ++s1ap_eNB_internal_data.global_cnx_id;
}
void s1ap_eNB_prepare_internal_data(void)
{
memset(&s1ap_eNB_internal_data, 0, sizeof(s1ap_eNB_internal_data));
STAILQ_INIT(&s1ap_eNB_internal_data.s1ap_eNB_instances_head);
}
void s1ap_eNB_insert_new_instance(s1ap_eNB_instance_t *new_instance_p)
{
DevAssert(new_instance_p != NULL);
STAILQ_INSERT_TAIL(&s1ap_eNB_internal_data.s1ap_eNB_instances_head,
new_instance_p, s1ap_eNB_entries);
}
inline struct s1ap_eNB_mme_data_s *s1ap_eNB_get_MME(
s1ap_eNB_instance_t *instance_p,
int32_t assoc_id, uint16_t cnx_id)
{
struct s1ap_eNB_mme_data_s temp;
struct s1ap_eNB_mme_data_s *found;
memset(&temp, 0, sizeof(struct s1ap_eNB_mme_data_s));
temp.assoc_id = assoc_id;
temp.cnx_id = cnx_id;
if (instance_p == NULL) {
STAILQ_FOREACH(instance_p, &s1ap_eNB_internal_data.s1ap_eNB_instances_head,
s1ap_eNB_entries)
{
found = RB_FIND(s1ap_mme_map, &instance_p->s1ap_mme_head, &temp);
if (found != NULL) {
return found;
}
}
} else {
return RB_FIND(s1ap_mme_map, &instance_p->s1ap_mme_head, &temp);
}
return NULL;
}
s1ap_eNB_instance_t *s1ap_eNB_get_instance(uint8_t mod_id)
{
s1ap_eNB_instance_t *temp = NULL;
STAILQ_FOREACH(temp, &s1ap_eNB_internal_data.s1ap_eNB_instances_head,
s1ap_eNB_entries)
{
if (temp->mod_id == mod_id) {
/* Matching occurence */
return temp;
}
}
return NULL;
}
// int s1ap_eNB_ue_capabilities(eNB_mme_desc_t *eNB_desc_p, // int s1ap_eNB_ue_capabilities(eNB_mme_desc_t *eNB_desc_p,
// s1ap_ue_cap_info_ind_t *ue_cap_info_ind_p) // s1ap_ue_cap_info_ind_t *ue_cap_info_ind_p)
......
...@@ -31,7 +31,16 @@ ...@@ -31,7 +31,16 @@
#ifndef S1AP_ENB_MANAGEMENT_PROCEDURES_H_ #ifndef S1AP_ENB_MANAGEMENT_PROCEDURES_H_
#define S1AP_ENB_MANAGEMENT_PROCEDURES_H_ #define S1AP_ENB_MANAGEMENT_PROCEDURES_H_
// int s1ap_eNB_ue_capabilities(eNB_mme_desc_t *eNB_desc_p, inline struct s1ap_eNB_mme_data_s *s1ap_eNB_get_MME(
// s1ap_ue_cap_info_ind_t *ue_cap_info_ind_p); s1ap_eNB_instance_t *instance_p,
int32_t assoc_id, uint16_t cnx_id);
void s1ap_eNB_insert_new_instance(s1ap_eNB_instance_t *new_instance_p);
s1ap_eNB_instance_t *s1ap_eNB_get_instance(uint8_t mod_id);
uint16_t s1ap_eNB_fetch_add_global_cnx_id(void);
void s1ap_eNB_prepare_internal_data(void);
#endif /* S1AP_ENB_MANAGEMENT_PROCEDURES_H_ */ #endif /* S1AP_ENB_MANAGEMENT_PROCEDURES_H_ */
This diff is collapsed.
...@@ -35,6 +35,8 @@ int s1ap_eNB_handle_nas_downlink(uint32_t assoc_id, ...@@ -35,6 +35,8 @@ int s1ap_eNB_handle_nas_downlink(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
struct s1ap_message_s *message_p); struct s1ap_message_s *message_p);
int s1ap_eNB_handle_nas_first_req(s1ap_nas_first_req_t *s1ap_nas_first_req_p);
// int s1ap_eNB_initial_ctxt_resp(eNB_mme_desc_t *eNB_desc_p, // int s1ap_eNB_initial_ctxt_resp(eNB_mme_desc_t *eNB_desc_p,
// s1ap_initial_ctxt_setup_resp_t *initial_ctxt_resp_p); // s1ap_initial_ctxt_setup_resp_t *initial_ctxt_resp_p);
......
...@@ -28,11 +28,6 @@ ...@@ -28,11 +28,6 @@
*******************************************************************************/ *******************************************************************************/
/** @defgroup _s1ap_impl_ S1AP Layer Reference Implementation
* @ingroup _ref_implementation_
* @{
*/
#ifndef S1AP_ENB_NNSF_H_ #ifndef S1AP_ENB_NNSF_H_
#define S1AP_ENB_NNSF_H_ #define S1AP_ENB_NNSF_H_
......
...@@ -54,9 +54,6 @@ ...@@ -54,9 +54,6 @@
#include "assertions.h" #include "assertions.h"
// int s1ap_eNB_handle_overload_start(eNB_mme_desc_t *eNB_desc_p,
// sctp_queue_item_t *packet_p,
// struct s1ap_message_s *message_p)
int s1ap_eNB_handle_overload_start(uint32_t assoc_id, int s1ap_eNB_handle_overload_start(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
struct s1ap_message_s *message_p) struct s1ap_message_s *message_p)
...@@ -68,25 +65,24 @@ int s1ap_eNB_handle_overload_start(uint32_t assoc_id, ...@@ -68,25 +65,24 @@ int s1ap_eNB_handle_overload_start(uint32_t assoc_id,
overload_start_p = &message_p->msg.overloadStartIEs; overload_start_p = &message_p->msg.overloadStartIEs;
// DevCheck(overload_start_p->overloadResponse.present == DevCheck(overload_start_p->overloadResponse.present ==
// OverloadResponse_PR_overloadAction, OverloadResponse_PR_overloadAction,
// OverloadResponse_PR_overloadAction, 0, 0); OverloadResponse_PR_overloadAction, 0, 0);
//
// /* Non UE-associated signalling -> stream 0 */ /* Non UE-associated signalling -> stream 0 */
// DevCheck(packet_p->local_stream == 0, packet_p->local_stream, DevCheck(stream == 0, stream, 0, 0);
// packet_p->remote_port, packet_p->assoc_id);
// if ((mme_desc_p = s1ap_eNB_get_MME(NULL, assoc_id, 0)) == NULL) {
// if ((mme_desc_p = s1ap_eNB_get_MME(eNB_desc_p, packet_p->assoc_id)) == NULL) { /* No MME context associated */
// /* No MME context associated */ return -1;
// return -1; }
// }
// /* Mark the MME as overloaded and set the overload state according to
// /* Mark the MME as overloaded and set the overload state according to * the value received.
// * the value received. */
// */ mme_desc_p->state = S1AP_ENB_OVERLOAD;
// mme_desc_p->state = S1AP_ENB_OVERLOAD; mme_desc_p->overload_state =
// mme_desc_p->overload_state = overload_start_p->overloadResponse.choice.overloadAction;
// overload_start_p->overloadResponse.choice.overloadAction;
return 0; return 0;
} }
...@@ -94,9 +90,6 @@ int s1ap_eNB_handle_overload_start(uint32_t assoc_id, ...@@ -94,9 +90,6 @@ int s1ap_eNB_handle_overload_start(uint32_t assoc_id,
int s1ap_eNB_handle_overload_stop(uint32_t assoc_id, int s1ap_eNB_handle_overload_stop(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
struct s1ap_message_s *message_p) struct s1ap_message_s *message_p)
// int s1ap_eNB_handle_overload_stop(eNB_mme_desc_t *eNB_desc_p,
// sctp_queue_item_t *packet_p,
// struct s1ap_message_s *message_p)
{ {
/* We received Overload stop message, meaning that the MME is no more /* We received Overload stop message, meaning that the MME is no more
* overloaded. This is an empty message, with only message header and no * overloaded. This is an empty message, with only message header and no
...@@ -105,18 +98,17 @@ int s1ap_eNB_handle_overload_stop(uint32_t assoc_id, ...@@ -105,18 +98,17 @@ int s1ap_eNB_handle_overload_stop(uint32_t assoc_id,
DevAssert(message_p != NULL); DevAssert(message_p != NULL);
// s1ap_eNB_mme_data_t *mme_desc_p; s1ap_eNB_mme_data_t *mme_desc_p;
//
// /* Non UE-associated signalling -> stream 0 */ /* Non UE-associated signalling -> stream 0 */
// DevCheck(packet_p->local_stream == 0, packet_p->local_stream, DevCheck(stream == 0, stream, 0, 0);
// packet_p->remote_port, packet_p->assoc_id);
// if ((mme_desc_p = s1ap_eNB_get_MME(NULL, assoc_id, 0)) == NULL) {
// if ((mme_desc_p = s1ap_eNB_get_MME(eNB_desc_p, packet_p->assoc_id)) == NULL) { /* No MME context associated */
// /* No MME context associated */ return -1;
// return -1; }
// }
// mme_desc_p->state = S1AP_ENB_STATE_CONNECTED;
// mme_desc_p->state = S1AP_ENB_STATE_CONNECTED; mme_desc_p->overload_state = S1AP_NO_OVERLOAD;
// mme_desc_p->overload_state = S1AP_NO_OVERLOAD;
return 0; return 0;
} }
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include <stdint.h> #include <stdint.h>
#include "assertions.h"
#include "intertask_interface.h" #include "intertask_interface.h"
#include "s1ap_eNB_default_values.h" #include "s1ap_eNB_default_values.h"
...@@ -42,95 +44,81 @@ ...@@ -42,95 +44,81 @@
#include "s1ap_eNB_ue_context.h" #include "s1ap_eNB_ue_context.h"
#include "s1ap_eNB_encoder.h" #include "s1ap_eNB_encoder.h"
#include "s1ap_eNB_trace.h" #include "s1ap_eNB_trace.h"
#include "s1ap_eNB_itti_messaging.h"
#include "sctp_primitives_client.h" static
void s1ap_eNB_generate_trace_failure(struct s1ap_eNB_ue_context_s *ue_desc_p,
E_UTRAN_Trace_ID_t *trace_id,
Cause_t *cause_p)
{
s1ap_message message;
TraceFailureIndicationIEs_t *trace_failure_p;
uint8_t *buffer;
uint32_t length;
#include "assertions.h" DevAssert(ue_desc_p != NULL);
DevAssert(trace_id != NULL);
DevAssert(cause_p != NULL);
// int s1ap_eNB_generate_trace_failure(sctp_data_t *sctp_data_p, memset(&message, 0, sizeof(s1ap_message));
// int32_t stream,
// uint32_t eNB_ue_s1ap_id, trace_failure_p = &message.msg.traceFailureIndicationIEs;
// uint32_t mme_ue_s1ap_id,
// E_UTRAN_Trace_ID_t *trace_id, trace_failure_p->mme_ue_s1ap_id = ue_desc_p->mme_ue_s1ap_id;
// Cause_t *cause_p) trace_failure_p->eNB_UE_S1AP_ID = ue_desc_p->eNB_ue_s1ap_id;
// {
// s1ap_message message; memcpy(&trace_failure_p->e_UTRAN_Trace_ID, trace_id, sizeof(E_UTRAN_Trace_ID_t));
// TraceFailureIndicationIEs_t *trace_failure_p; memcpy(&trace_failure_p->cause, cause_p, sizeof(Cause_t));
// uint8_t *buffer;
// uint32_t length; if (s1ap_eNB_encode_pdu(&message, &buffer, &length) < 0) {
// int ret; return;
// }
// DevAssert(sctp_data_p != NULL);
// s1ap_eNB_itti_send_sctp_data_req(ue_desc_p->mme_ref->assoc_id, buffer,
// memset(&message, 0, sizeof(s1ap_message)); length, ue_desc_p->stream);
// }
// trace_failure_p = &message.msg.traceFailureIndicationIEs;
//
// trace_failure_p->mme_ue_s1ap_id = mme_ue_s1ap_id;
// trace_failure_p->eNB_UE_S1AP_ID = eNB_ue_s1ap_id;
//
// memcpy(&trace_failure_p->e_UTRAN_Trace_ID, trace_id, sizeof(E_UTRAN_Trace_ID_t));
// memcpy(&trace_failure_p->cause, cause_p, sizeof(Cause_t));
//
// if (s1ap_eNB_encode_pdu(&message, &buffer, &length) < 0) {
// return -1;
// }
// if ((ret = sctp_send_msg(sctp_data_p, S1AP_SCTP_PPID,
// stream, buffer, length)) < 0) {
// S1AP_ERROR("Failed to send Trace failure\n");
// }
// free(buffer);
// return ret;
// }
int s1ap_eNB_handle_trace_start(uint32_t assoc_id, int s1ap_eNB_handle_trace_start(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
struct s1ap_message_s *message_p) struct s1ap_message_s *message_p)
// int s1ap_eNB_handle_trace_start(eNB_mme_desc_t *eNB_desc_p,
// sctp_queue_item_t *packet_p,
// struct s1ap_message_s *message_p)
{ {
TraceStartIEs_t *trace_start_p; TraceStartIEs_t *trace_start_p;
struct s1ap_eNB_ue_context_s *ue_desc_p; struct s1ap_eNB_ue_context_s *ue_desc_p;
struct s1ap_eNB_mme_data_s *mme_ref_p;
DevAssert(message_p != NULL); DevAssert(message_p != NULL);
trace_start_p = &message_p->msg.traceStartIEs; trace_start_p = &message_p->msg.traceStartIEs;
// if ((ue_desc_p = s1ap_eNB_get_ue_context(eNB_desc_p, mme_ref_p = s1ap_eNB_get_MME(NULL, assoc_id, 0);
// trace_start_p->eNB_UE_S1AP_ID)) == NULL) { DevAssert(mme_ref_p != NULL);
// /* Could not find context associated with this eNB_ue_s1ap_id -> generate
// * trace failure indication. if ((ue_desc_p = s1ap_eNB_get_ue_context(mme_ref_p->s1ap_eNB_instance,
// */ trace_start_p->eNB_UE_S1AP_ID)) == NULL) {
// struct s1ap_eNB_mme_data_s *mme_ref_p; /* Could not find context associated with this eNB_ue_s1ap_id -> generate
// E_UTRAN_Trace_ID_t trace_id; * trace failure indication.
// Cause_t cause; */
// E_UTRAN_Trace_ID_t trace_id;
// memset(&trace_id, 0, sizeof(E_UTRAN_Trace_ID_t)); Cause_t cause;
// memset(&cause, 0, sizeof(Cause_t));
// mme_ref_p = s1ap_eNB_get_MME(eNB_desc_p, packet_p->assoc_id); memset(&trace_id, 0, sizeof(E_UTRAN_Trace_ID_t));
// memset(&cause, 0, sizeof(Cause_t));
// cause.present = Cause_PR_radioNetwork;
// cause.choice.radioNetwork = CauseRadioNetwork_unknown_pair_ue_s1ap_id; cause.present = Cause_PR_radioNetwork;
// cause.choice.radioNetwork = CauseRadioNetwork_unknown_pair_ue_s1ap_id;
// return s1ap_eNB_generate_trace_failure(&mme_ref_p->sctp_data,
// packet_p->local_stream, s1ap_eNB_generate_trace_failure(ue_desc_p, &trace_id, &cause);
// trace_start_p->eNB_UE_S1AP_ID, }
// trace_start_p->mme_ue_s1ap_id, &trace_id, &cause);
// }
return 0; return 0;
} }
int s1ap_eNB_handle_deactivate_trace(uint32_t assoc_id, int s1ap_eNB_handle_deactivate_trace(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
struct s1ap_message_s *message_p) struct s1ap_message_s *message_p)
// int s1ap_eNB_handle_deactivate_trace(eNB_mme_desc_t *eNB_desc_p,
// sctp_queue_item_t *packet_p,
// struct s1ap_message_s *message_p)
{ {
DeactivateTraceIEs_t *deactivate_trace_p; // DeactivateTraceIEs_t *deactivate_trace_p;
//
deactivate_trace_p = &message_p->msg.deactivateTraceIEs; // deactivate_trace_p = &message_p->msg.deactivateTraceIEs;
return 0; return 0;
} }
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