Commit f2767beb authored by Cedric Roux's avatar Cedric Roux

- Updated S1AP to integrate instance id instead of mod id

- Updated some messages for S1AP

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4375 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 3dbf9c4e
......@@ -61,6 +61,9 @@
static int s1ap_eNB_generate_s1_setup_request(
s1ap_eNB_instance_t *instance_p, s1ap_eNB_mme_data_t *s1ap_mme_data_p);
static
void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_eNB_t *s1ap_register_eNB);
uint32_t s1ap_generate_eNB_id(void)
{
char *out;
......@@ -121,7 +124,8 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
itti_send_msg_to_task(TASK_SCTP, INSTANCE_DEFAULT, message_p);
}
void s1ap_eNB_handle_register_eNB(s1ap_register_eNB_t *s1ap_register_eNB)
static
void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_eNB_t *s1ap_register_eNB)
{
s1ap_eNB_instance_t *new_instance;
uint8_t index;
......@@ -131,7 +135,7 @@ void s1ap_eNB_handle_register_eNB(s1ap_register_eNB_t *s1ap_register_eNB)
/* Look if the provided mod id already exists
* If so notify user...
*/
new_instance = s1ap_eNB_get_instance(s1ap_register_eNB->mod_id);
new_instance = s1ap_eNB_get_instance(instance);
DevAssert(new_instance == NULL);
new_instance = calloc(1, sizeof(s1ap_eNB_instance_t));
......@@ -141,7 +145,7 @@ void s1ap_eNB_handle_register_eNB(s1ap_register_eNB_t *s1ap_register_eNB)
RB_INIT(&new_instance->s1ap_mme_head);
/* Copy usefull parameters */
new_instance->mod_id = s1ap_register_eNB->mod_id;
new_instance->instance = instance;
new_instance->eNB_name = s1ap_register_eNB->eNB_name;
new_instance->eNB_id = s1ap_register_eNB->eNB_id;
new_instance->cell_type = s1ap_register_eNB->cell_type;
......@@ -153,8 +157,8 @@ void s1ap_eNB_handle_register_eNB(s1ap_register_eNB_t *s1ap_register_eNB)
/* Add the new instance to the list of eNB (meaningfull in virtual mode) */
s1ap_eNB_insert_new_instance(new_instance);
S1AP_DEBUG("Registered new eNB with mod_id %u and %s eNB id %u\n",
s1ap_register_eNB->mod_id,
S1AP_DEBUG("Registered new eNB[%d] %u and %s eNB id %u\n",
instance,
s1ap_register_eNB->cell_type == CELL_MACRO_ENB ? "macro" : "home",
s1ap_register_eNB->eNB_id);
......@@ -232,7 +236,8 @@ void *s1ap_eNB_task(void *arg)
* Each eNB has to send an S1AP_REGISTER_ENB message with its
* own parameters.
*/
s1ap_eNB_handle_register_eNB(&received_msg->msg.s1ap_register_eNB);
s1ap_eNB_handle_register_eNB(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->msg.s1ap_register_eNB);
} break;
case SCTP_NEW_ASSOCIATION_RESP: {
s1ap_eNB_handle_sctp_association_resp(&received_msg->msg.sctp_new_association_resp);
......@@ -241,7 +246,17 @@ void *s1ap_eNB_task(void *arg)
s1ap_eNB_handle_sctp_data_ind(&received_msg->msg.sctp_data_ind);
} break;
case S1AP_NAS_FIRST_REQ: {
s1ap_eNB_handle_nas_first_req(&received_msg->msg.s1ap_nas_first_req);
s1ap_eNB_handle_nas_first_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->msg.s1ap_nas_first_req);
} break;
case S1AP_UPLINK_NAS: {
s1ap_eNB_nas_uplink(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->msg.s1ap_uplink_nas);
} break;
case S1AP_INITIAL_CONTEXT_SETUP_RESP: {
s1ap_eNB_initial_ctxt_resp(
ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->msg.s1ap_initial_context_setup_resp);
} break;
default:
S1AP_ERROR("Received unhandled message with id %d\n",
......
......@@ -82,50 +82,6 @@ typedef enum {
S1AP_OVERLOAD_MAX,
} s1ap_overload_state_t;
typedef struct {
uint8_t qci;
} e_rab_level_qos_parameter_t;
typedef struct {
/* Length of the transport layer address buffer. S1AP layer received a
* bit string<1..160> containing one of the following addresses: ipv4,
* ipv6, or ipv4 and ipv6. The layer doesn't interpret the buffer but
* silently forward it to S1-U.
*/
uint8_t length;
uint8_t buffer[20];
} transport_layer_addr_t;
typedef struct {
/* Unique e_rab_id for the UE. */
uint8_t e_rab_id;
/* Quality of service for this e_rab */
e_rab_level_qos_parameter_t qos;
/* The NAS PDU should be forwarded by the RRC layer to the NAS layer */
nas_pdu_t nas_pdu;
/* The transport layer address for the IP packets */
transport_layer_addr_t sgw_addr;
/* S-GW Tunnel endpoint identifier */
uint32_t gtp_teid;
} e_rab_t;
typedef struct {
/* Unique e_rab_id for the UE. */
uint8_t e_rab_id;
/* The transport layer address for the IP packets */
transport_layer_addr_t eNB_addr;
/* S-GW Tunnel endpoint identifier */
uint32_t gtp_teid;
} e_rab_setup_t;
typedef struct {
/* Unique e_rab_id for the UE. */
uint8_t e_rab_id;
/* Cause of the failure */
// cause_t cause;
} e_rab_failed_t;
/* Served PLMN identity element */
struct plmn_identity_s {
uint16_t mcc;
......@@ -225,7 +181,7 @@ typedef struct s1ap_eNB_instance_s {
RB_HEAD(s1ap_ue_map, s1ap_eNB_ue_context_s) s1ap_ue_head;
/* For virtual mode, mod_id as defined in the rest of the L1/L2 stack */
uint8_t mod_id;
instance_t instance;
/* Displayable name of eNB */
char *eNB_name;
......
......@@ -327,7 +327,8 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
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(&s1ap_nas_first_req);
s1ap_eNB_handle_nas_first_req(mme_desc_p->s1ap_eNB_instance->instance,
&s1ap_nas_first_req);
}
return 0;
......
......@@ -20,7 +20,7 @@ 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);
}
void s1ap_eNB_itti_send_nas_downlink_ind(uint8_t mod_id, uint8_t *nas_pdu,
void s1ap_eNB_itti_send_nas_downlink_ind(instance_t instance, uint8_t *nas_pdu,
uint32_t nas_pdu_length)
{
MessageDef *message_p;
......@@ -30,9 +30,8 @@ void s1ap_eNB_itti_send_nas_downlink_ind(uint8_t mod_id, uint8_t *nas_pdu,
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);
itti_send_msg_to_task(TASK_RRC_ENB, instance, message_p);
}
......@@ -4,7 +4,7 @@
void s1ap_eNB_itti_send_sctp_data_req(int32_t assoc_id, uint8_t *buffer,
uint32_t buffer_length, uint16_t stream);
void s1ap_eNB_itti_send_nas_downlink_ind(uint8_t mod_id, uint8_t *nas_pdu,
void s1ap_eNB_itti_send_nas_downlink_ind(instance_t instance, uint8_t *nas_pdu,
uint32_t nas_pdu_length);
#endif /* S1AP_ENB_ITTI_MESSAGING_H_ */
......@@ -118,14 +118,14 @@ inline struct s1ap_eNB_mme_data_s *s1ap_eNB_get_MME(
return NULL;
}
s1ap_eNB_instance_t *s1ap_eNB_get_instance(uint8_t mod_id)
s1ap_eNB_instance_t *s1ap_eNB_get_instance(instance_t instance)
{
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) {
if (temp->instance == instance) {
/* Matching occurence */
return temp;
}
......@@ -133,70 +133,3 @@ s1ap_eNB_instance_t *s1ap_eNB_get_instance(uint8_t mod_id)
return NULL;
}
// int s1ap_eNB_ue_capabilities(eNB_mme_desc_t *eNB_desc_p,
// s1ap_ue_cap_info_ind_t *ue_cap_info_ind_p)
// {
// struct s1ap_eNB_ue_context_s *ue_context_p;
// UECapabilityInfoIndicationIEs_t *ue_cap_info_ind_ies_p;
//
// s1ap_message message;
//
// uint8_t *buffer;
// uint32_t length;
// int ret = -1;
//
// DevAssert(ue_cap_info_ind_p != NULL);
// DevAssert(eNB_desc_p != NULL);
//
// if ((ue_context_p = s1ap_eNB_get_ue_context(eNB_desc_p, ue_cap_info_ind_p->eNB_ue_s1ap_id)) == NULL)
// {
// /* The context for this eNB ue s1ap id doesn't exist in the map of eNB UEs */
// S1AP_WARN("Failed to find ue context associated with eNB ue s1ap id: %u\n",
// ue_cap_info_ind_p->eNB_ue_s1ap_id);
// return -1;
// }
//
// /* UE capabilities message can occur either during an s1ap connected state
// * or during initial attach (for example: NAS authentication).
// */
// if (!(ue_context_p->ue_state == S1AP_UE_CONNECTED ||
// ue_context_p->ue_state == S1AP_UE_WAITING_CSR))
// {
// S1AP_WARN("You are attempting to send NAS data over non-connected "
// "eNB ue s1ap id: %u, current state: %d\n",
// ue_cap_info_ind_p->eNB_ue_s1ap_id, ue_context_p->ue_state);
// return -1;
// }
//
// /* Prepare the S1AP message to encode */
// memset(&message, 0, sizeof(s1ap_message));
//
// message.direction = S1AP_PDU_PR_initiatingMessage;
// message.procedureCode = ProcedureCode_id_UECapabilityInfoIndication;
//
// ue_cap_info_ind_ies_p = &message.msg.ueCapabilityInfoIndicationIEs;
//
// ue_cap_info_ind_ies_p->ueRadioCapability.buf = ue_cap_info_ind_p->ue_radio_cap.buffer;
// ue_cap_info_ind_ies_p->ueRadioCapability.size = ue_cap_info_ind_p->ue_radio_cap.length;
//
// ue_cap_info_ind_ies_p->eNB_UE_S1AP_ID = ue_cap_info_ind_p->eNB_ue_s1ap_id;
// ue_cap_info_ind_ies_p->mme_ue_s1ap_id = ue_context_p->mme_ue_s1ap_id;
//
// if (s1ap_eNB_encode_pdu(&message, &buffer, &length) < 0) {
// /* Encode procedure has failed... */
// S1AP_ERROR("Failed to encode UE capabilities indication\n");
// return -1;
// }
//
// /* UE associated signalling -> use the allocated stream */
// if ((ret = sctp_send_msg(&ue_context_p->mme_ref->sctp_data, S1AP_SCTP_PPID,
// ue_context_p->stream, buffer, length)) < 0)
// {
// S1AP_ERROR("[SCTP %d] Failed to send message over SCTP: %d\n",
// ue_context_p->mme_ref->sctp_data.assoc_id, ret);
// }
//
// free(buffer);
// return ret;
// }
This diff is collapsed.
......@@ -35,9 +35,15 @@ int s1ap_eNB_handle_nas_downlink(uint32_t assoc_id,
uint32_t stream,
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_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_p);
// int s1ap_eNB_initial_ctxt_resp(eNB_mme_desc_t *eNB_desc_p,
// s1ap_initial_ctxt_setup_resp_t *initial_ctxt_resp_p);
int s1ap_eNB_handle_nas_first_req(
instance_t instance, s1ap_nas_first_req_t *s1ap_nas_first_req_p);
int s1ap_eNB_initial_ctxt_resp(
instance_t instance, s1ap_initial_context_setup_resp_t *initial_ctxt_resp_p);
int s1ap_eNB_ue_capabilities(instance_t instance,
s1ap_ue_cap_info_ind_t *ue_cap_info_ind_p);
#endif /* S1AP_ENB_NAS_PROCEDURES_H_ */
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