Commit 5c07c326 authored by Robert Schmidt's avatar Robert Schmidt

E1AP: use assoc_id in instance, do not pass Setup Request around

- e1ap_encode_send(): do not use E1AP Setup Request
- store assoc_id in the instance, and reuse that
parent e4a28cfa
...@@ -61,7 +61,6 @@ typedef struct e1ap_setup_req_s { ...@@ -61,7 +61,6 @@ typedef struct e1ap_setup_req_s {
int supported_plmns; int supported_plmns;
PLMN_ID_t plmns[E1AP_MAX_NUM_PLMNS]; PLMN_ID_t plmns[E1AP_MAX_NUM_PLMNS];
sctp_assoc_t assoc_id;
net_ip_address_t CUUP_e1_ip_address; net_ip_address_t CUUP_e1_ip_address;
net_ip_address_t CUCP_e1_ip_address; net_ip_address_t CUCP_e1_ip_address;
uint16_t remotePortF1U; uint16_t remotePortF1U;
......
This diff is collapsed.
...@@ -42,13 +42,13 @@ int e1apCUCP_handle_BEARER_CONTEXT_SETUP_FAILURE(e1ap_upcp_inst_t *inst, const E ...@@ -42,13 +42,13 @@ int e1apCUCP_handle_BEARER_CONTEXT_SETUP_FAILURE(e1ap_upcp_inst_t *inst, const E
int e1apCUUP_handle_BEARER_CONTEXT_MODIFICATION_REQUEST(e1ap_upcp_inst_t *inst, const E1AP_E1AP_PDU_t *pdu); int e1apCUUP_handle_BEARER_CONTEXT_MODIFICATION_REQUEST(e1ap_upcp_inst_t *inst, const E1AP_E1AP_PDU_t *pdu);
void e1apCUUP_send_BEARER_CONTEXT_SETUP_RESPONSE(e1ap_upcp_inst_t *inst, e1ap_bearer_setup_resp_t *const resp); void e1apCUUP_send_BEARER_CONTEXT_SETUP_RESPONSE(sctp_assoc_t assoc_id, e1ap_bearer_setup_resp_t *const resp);
int e1apCUUP_handle_BEARER_CONTEXT_RELEASE_COMMAND(e1ap_upcp_inst_t *inst, const E1AP_E1AP_PDU_t *pdu); int e1apCUUP_handle_BEARER_CONTEXT_RELEASE_COMMAND(e1ap_upcp_inst_t *inst, const E1AP_E1AP_PDU_t *pdu);
int e1apCUCP_handle_BEARER_CONTEXT_RELEASE_COMPLETE(e1ap_upcp_inst_t *inst, const E1AP_E1AP_PDU_t *pdu); int e1apCUCP_handle_BEARER_CONTEXT_RELEASE_COMPLETE(e1ap_upcp_inst_t *inst, const E1AP_E1AP_PDU_t *pdu);
int e1apCUUP_send_BEARER_CONTEXT_RELEASE_COMPLETE(e1ap_upcp_inst_t *inst, e1ap_bearer_release_cmd_t *const cmd); int e1apCUUP_send_BEARER_CONTEXT_RELEASE_COMPLETE(sctp_assoc_t assoc_id, e1ap_bearer_release_cmd_t *const cmd);
void *E1AP_CUUP_task(void *arg); void *E1AP_CUUP_task(void *arg);
......
...@@ -172,7 +172,7 @@ void process_e1_bearer_context_setup_req(instance_t instance, e1ap_bearer_setup_ ...@@ -172,7 +172,7 @@ void process_e1_bearer_context_setup_req(instance_t instance, e1ap_bearer_setup_
pduSetup->numDRBFailed = 0; pduSetup->numDRBFailed = 0;
} }
e1apCUUP_send_BEARER_CONTEXT_SETUP_RESPONSE(inst, resp); e1apCUUP_send_BEARER_CONTEXT_SETUP_RESPONSE(inst->assoc_id, resp);
} }
void CUUP_process_bearer_context_mod_req(instance_t instance, e1ap_bearer_setup_req_t *const req) void CUUP_process_bearer_context_mod_req(instance_t instance, e1ap_bearer_setup_req_t *const req)
...@@ -190,5 +190,5 @@ void CUUP_process_bearer_release_command(instance_t instance, e1ap_bearer_releas ...@@ -190,5 +190,5 @@ void CUUP_process_bearer_release_command(instance_t instance, e1ap_bearer_releas
AssertFatal(inst, ""); AssertFatal(inst, "");
newGtpuDeleteAllTunnels(inst->gtpInstN3, cmd->gNB_cu_up_ue_id); newGtpuDeleteAllTunnels(inst->gtpInstN3, cmd->gNB_cu_up_ue_id);
newGtpuDeleteAllTunnels(inst->gtpInstF1U, cmd->gNB_cu_up_ue_id); newGtpuDeleteAllTunnels(inst->gtpInstF1U, cmd->gNB_cu_up_ue_id);
e1apCUUP_send_BEARER_CONTEXT_RELEASE_COMPLETE(inst, cmd); e1apCUUP_send_BEARER_CONTEXT_RELEASE_COMPLETE(inst->assoc_id, cmd);
} }
...@@ -42,6 +42,7 @@ void createE1inst(E1_t type, instance_t instance, e1ap_setup_req_t *req) { ...@@ -42,6 +42,7 @@ void createE1inst(E1_t type, instance_t instance, e1ap_setup_req_t *req) {
e1ap_inst[instance] = calloc(1, sizeof(e1ap_upcp_inst_t)); e1ap_inst[instance] = calloc(1, sizeof(e1ap_upcp_inst_t));
e1ap_inst[instance]->type = type; e1ap_inst[instance]->type = type;
e1ap_inst[instance]->instance = instance; e1ap_inst[instance]->instance = instance;
e1ap_inst[instance]->assoc_id = -1;
if (req) if (req)
memcpy(&e1ap_inst[instance]->setupReq, req, sizeof(*req)); memcpy(&e1ap_inst[instance]->setupReq, req, sizeof(*req));
e1ap_inst[instance]->gtpInstN3 = -1; e1ap_inst[instance]->gtpInstN3 = -1;
...@@ -190,7 +191,7 @@ int e1ap_decode_pdu(E1AP_E1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t ...@@ -190,7 +191,7 @@ int e1ap_decode_pdu(E1AP_E1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t
return -1; return -1;
} }
int e1ap_encode_send(E1_t type, e1ap_setup_req_t *setupReq, E1AP_E1AP_PDU_t *pdu, uint16_t stream, const char *func) int e1ap_encode_send(E1_t type, sctp_assoc_t assoc_id, E1AP_E1AP_PDU_t *pdu, uint16_t stream, const char *func)
{ {
DevAssert(pdu != NULL); DevAssert(pdu != NULL);
...@@ -218,7 +219,7 @@ int e1ap_encode_send(E1_t type, e1ap_setup_req_t *setupReq, E1AP_E1AP_PDU_t *pdu ...@@ -218,7 +219,7 @@ int e1ap_encode_send(E1_t type, e1ap_setup_req_t *setupReq, E1AP_E1AP_PDU_t *pdu
} }
MessageDef *message = itti_alloc_new_message((type == CPtype) ? TASK_CUCP_E1 : TASK_CUUP_E1, 0, SCTP_DATA_REQ); MessageDef *message = itti_alloc_new_message((type == CPtype) ? TASK_CUCP_E1 : TASK_CUUP_E1, 0, SCTP_DATA_REQ);
sctp_data_req_t *s = &message->ittiMsg.sctp_data_req; sctp_data_req_t *s = &message->ittiMsg.sctp_data_req;
s->assoc_id = setupReq->assoc_id; s->assoc_id = assoc_id;
s->buffer = buffer; s->buffer = buffer;
s->buffer_length = encoded; s->buffer_length = encoded;
s->stream = stream; s->stream = stream;
......
...@@ -32,6 +32,7 @@ typedef struct e1ap_upcp_inst_s { ...@@ -32,6 +32,7 @@ typedef struct e1ap_upcp_inst_s {
instance_t instance; instance_t instance;
E1_t type; E1_t type;
enum sctp_state_e sockState; enum sctp_state_e sockState;
sctp_assoc_t assoc_id;
instance_t gtpInstN3; instance_t gtpInstN3;
instance_t gtpInstF1U; instance_t gtpInstF1U;
e1ap_setup_req_t setupReq; e1ap_setup_req_t setupReq;
...@@ -47,7 +48,7 @@ E1AP_TransactionID_t E1AP_get_next_transaction_identifier(); ...@@ -47,7 +48,7 @@ E1AP_TransactionID_t E1AP_get_next_transaction_identifier();
void createE1inst(E1_t type, instance_t instance, e1ap_setup_req_t *req); void createE1inst(E1_t type, instance_t instance, e1ap_setup_req_t *req);
int e1ap_encode_send(E1_t type, e1ap_setup_req_t *setupReq, E1AP_E1AP_PDU_t *pdu, uint16_t stream, const char *func); int e1ap_encode_send(E1_t type, sctp_assoc_t assoc_id, E1AP_E1AP_PDU_t *pdu, uint16_t stream, const char *func);
void e1ap_common_init(); void e1ap_common_init();
......
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