mirror of
				https://github.com/open5gs/open5gs.git
				synced 2025-11-03 21:43:25 +00:00 
			
		
		
		
	E-RAB Setup/Release is added
This commit is contained in:
		@@ -525,14 +525,22 @@ status_t s1ap_build_initial_context_setup_request(
 | 
				
			|||||||
status_t s1ap_build_e_rab_setup_request(
 | 
					status_t s1ap_build_e_rab_setup_request(
 | 
				
			||||||
            pkbuf_t **s1apbuf, mme_bearer_t *bearer, pkbuf_t *esmbuf)
 | 
					            pkbuf_t **s1apbuf, mme_bearer_t *bearer, pkbuf_t *esmbuf)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
#if 0
 | 
					 | 
				
			||||||
    status_t rv;
 | 
					    status_t rv;
 | 
				
			||||||
    int encoded;
 | 
					
 | 
				
			||||||
    s1ap_message_t message;
 | 
					    S1AP_S1AP_PDU_t pdu;
 | 
				
			||||||
    S1AP_E_RABSetupRequestIEs_t *ies = &message.s1ap_E_RABSetupRequestIEs;
 | 
					    S1AP_InitiatingMessage_t *initiatingMessage = NULL;
 | 
				
			||||||
 | 
					    S1AP_E_RABSetupRequest_t *E_RABSetupRequest = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    S1AP_E_RABSetupRequestIEs_t *ie = NULL;
 | 
				
			||||||
 | 
					    S1AP_MME_UE_S1AP_ID_t *MME_UE_S1AP_ID = NULL;
 | 
				
			||||||
 | 
					    S1AP_ENB_UE_S1AP_ID_t *ENB_UE_S1AP_ID = NULL;
 | 
				
			||||||
 | 
					    S1AP_E_RABToBeSetupListBearerSUReq_t *E_RABToBeSetupListBearerSUReq = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    S1AP_E_RABToBeSetupItemBearerSUReqIEs_t *item = NULL;
 | 
				
			||||||
    S1AP_E_RABToBeSetupItemBearerSUReq_t *e_rab = NULL;
 | 
					    S1AP_E_RABToBeSetupItemBearerSUReq_t *e_rab = NULL;
 | 
				
			||||||
	struct S1AP_GBR_QosInformation *gbrQosInformation = NULL; /* OPTIONAL */
 | 
					    S1AP_GBR_QosInformation_t *gbrQosInformation = NULL;
 | 
				
			||||||
    S1AP_NAS_PDU_t *nasPdu = NULL;
 | 
					    S1AP_NAS_PDU_t *nasPdu = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    mme_ue_t *mme_ue = NULL;
 | 
					    mme_ue_t *mme_ue = NULL;
 | 
				
			||||||
    enb_ue_t *enb_ue = NULL;
 | 
					    enb_ue_t *enb_ue = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -544,17 +552,64 @@ status_t s1ap_build_e_rab_setup_request(
 | 
				
			|||||||
    enb_ue = mme_ue->enb_ue;
 | 
					    enb_ue = mme_ue->enb_ue;
 | 
				
			||||||
    d_assert(enb_ue, return CORE_ERROR, "Null param");
 | 
					    d_assert(enb_ue, return CORE_ERROR, "Null param");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    d_trace(3, "[MME] E-RAB setup request\n");
 | 
					    memset(&pdu, 0, sizeof (S1AP_S1AP_PDU_t));
 | 
				
			||||||
 | 
					    pdu.present = S1AP_S1AP_PDU_PR_initiatingMessage;
 | 
				
			||||||
 | 
					    pdu.choice.initiatingMessage = 
 | 
				
			||||||
 | 
					        core_calloc(1, sizeof(S1AP_InitiatingMessage_t));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    initiatingMessage = pdu.choice.initiatingMessage;
 | 
				
			||||||
 | 
					    initiatingMessage->procedureCode = S1AP_ProcedureCode_id_E_RABSetup;
 | 
				
			||||||
 | 
					    initiatingMessage->criticality = S1AP_Criticality_reject;
 | 
				
			||||||
 | 
					    initiatingMessage->value.present =
 | 
				
			||||||
 | 
					        S1AP_InitiatingMessage__value_PR_E_RABSetupRequest;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    E_RABSetupRequest = &initiatingMessage->value.choice.E_RABSetupRequest;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ie = core_calloc(1, sizeof(S1AP_E_RABSetupRequestIEs_t));
 | 
				
			||||||
 | 
					    ASN_SEQUENCE_ADD(&E_RABSetupRequest->protocolIEs, ie);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
 | 
				
			||||||
 | 
					    ie->criticality = S1AP_Criticality_reject;
 | 
				
			||||||
 | 
					    ie->value.present = S1AP_E_RABSetupRequestIEs__value_PR_MME_UE_S1AP_ID;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    MME_UE_S1AP_ID = &ie->value.choice.MME_UE_S1AP_ID;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ie = core_calloc(1, sizeof(S1AP_E_RABSetupRequestIEs_t));
 | 
				
			||||||
 | 
					    ASN_SEQUENCE_ADD(&E_RABSetupRequest->protocolIEs, ie);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
 | 
				
			||||||
 | 
					    ie->criticality = S1AP_Criticality_reject;
 | 
				
			||||||
 | 
					    ie->value.present = S1AP_E_RABSetupRequestIEs__value_PR_ENB_UE_S1AP_ID;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ENB_UE_S1AP_ID = &ie->value.choice.ENB_UE_S1AP_ID;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ie = core_calloc(1, sizeof(S1AP_E_RABSetupRequestIEs_t));
 | 
				
			||||||
 | 
					    ASN_SEQUENCE_ADD(&E_RABSetupRequest->protocolIEs, ie);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ie->id = S1AP_ProtocolIE_ID_id_E_RABToBeSetupListBearerSUReq;
 | 
				
			||||||
 | 
					    ie->criticality = S1AP_Criticality_reject;
 | 
				
			||||||
 | 
					    ie->value.present =
 | 
				
			||||||
 | 
					        S1AP_E_RABSetupRequestIEs__value_PR_E_RABToBeSetupListBearerSUReq;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    E_RABToBeSetupListBearerSUReq =
 | 
				
			||||||
 | 
					        &ie->value.choice.E_RABToBeSetupListBearerSUReq;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    d_trace(5, "    ENB_UE_S1AP_ID[%d] MME_UE_S1AP_ID[%d]\n",
 | 
					    d_trace(5, "    ENB_UE_S1AP_ID[%d] MME_UE_S1AP_ID[%d]\n",
 | 
				
			||||||
            enb_ue->enb_ue_s1ap_id, enb_ue->mme_ue_s1ap_id);
 | 
					            enb_ue->enb_ue_s1ap_id, enb_ue->mme_ue_s1ap_id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    memset(&message, 0, sizeof(s1ap_message_t));
 | 
					    *MME_UE_S1AP_ID = enb_ue->mme_ue_s1ap_id;
 | 
				
			||||||
 | 
					    *ENB_UE_S1AP_ID = enb_ue->enb_ue_s1ap_id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ies->mme_ue_s1ap_id = enb_ue->mme_ue_s1ap_id;
 | 
					    item = core_calloc(1, sizeof(S1AP_E_RABToBeSetupItemBearerSUReqIEs_t));
 | 
				
			||||||
    ies->eNB_UE_S1AP_ID = enb_ue->enb_ue_s1ap_id;
 | 
					    ASN_SEQUENCE_ADD(&E_RABToBeSetupListBearerSUReq->list, item);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    item->id = S1AP_ProtocolIE_ID_id_E_RABToBeSetupItemBearerSUReq;
 | 
				
			||||||
 | 
					    item->criticality = S1AP_Criticality_reject;
 | 
				
			||||||
 | 
					    item->value.present =
 | 
				
			||||||
 | 
					    S1AP_E_RABToBeSetupItemBearerSUReqIEs__value_PR_E_RABToBeSetupItemBearerSUReq;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    e_rab = &item->value.choice.E_RABToBeSetupItemBearerSUReq;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    e_rab = (S1AP_E_RABToBeSetupItemBearerSUReq_t *)
 | 
					 | 
				
			||||||
        core_calloc(1, sizeof(S1AP_E_RABToBeSetupItemBearerSUReq_t));
 | 
					 | 
				
			||||||
    e_rab->e_RAB_ID = bearer->ebi;
 | 
					    e_rab->e_RAB_ID = bearer->ebi;
 | 
				
			||||||
    e_rab->e_RABlevelQoSParameters.qCI = bearer->qos.qci;
 | 
					    e_rab->e_RABlevelQoSParameters.qCI = bearer->qos.qci;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -579,8 +634,7 @@ status_t s1ap_build_e_rab_setup_request(
 | 
				
			|||||||
        if (bearer->qos.gbr.uplink == 0)
 | 
					        if (bearer->qos.gbr.uplink == 0)
 | 
				
			||||||
            bearer->qos.gbr.uplink = MAX_BIT_RATE;
 | 
					            bearer->qos.gbr.uplink = MAX_BIT_RATE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        gbrQosInformation = 
 | 
					        gbrQosInformation = core_calloc(1, sizeof(S1AP_GBR_QosInformation_t));
 | 
				
			||||||
                core_calloc(1, sizeof(struct S1AP_GBR_QosInformation));
 | 
					 | 
				
			||||||
        asn_uint642INTEGER(&gbrQosInformation->e_RAB_MaximumBitrateDL,
 | 
					        asn_uint642INTEGER(&gbrQosInformation->e_RAB_MaximumBitrateDL,
 | 
				
			||||||
                bearer->qos.mbr.downlink);
 | 
					                bearer->qos.mbr.downlink);
 | 
				
			||||||
        asn_uint642INTEGER(&gbrQosInformation->e_RAB_MaximumBitrateUL,
 | 
					        asn_uint642INTEGER(&gbrQosInformation->e_RAB_MaximumBitrateUL,
 | 
				
			||||||
@@ -602,19 +656,16 @@ status_t s1ap_build_e_rab_setup_request(
 | 
				
			|||||||
    nasPdu->size = esmbuf->len;
 | 
					    nasPdu->size = esmbuf->len;
 | 
				
			||||||
    nasPdu->buf = core_calloc(nasPdu->size, sizeof(c_uint8_t));
 | 
					    nasPdu->buf = core_calloc(nasPdu->size, sizeof(c_uint8_t));
 | 
				
			||||||
    memcpy(nasPdu->buf, esmbuf->payload, nasPdu->size);
 | 
					    memcpy(nasPdu->buf, esmbuf->payload, nasPdu->size);
 | 
				
			||||||
 | 
					 | 
				
			||||||
    ASN_SEQUENCE_ADD(&ies->e_RABToBeSetupListBearerSUReq, e_rab);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    message.procedureCode = S1AP_ProcedureCode_id_E_RABSetup;
 | 
					 | 
				
			||||||
    message.direction = S1AP_PDU_PR_initiatingMessage;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    encoded = s1ap_encode_pdu(s1apbuf, &message);
 | 
					 | 
				
			||||||
    s1ap_free_pdu(&message);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    d_assert(s1apbuf && encoded >= 0,return CORE_ERROR,);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    pkbuf_free(esmbuf);
 | 
					    pkbuf_free(esmbuf);
 | 
				
			||||||
#endif
 | 
					
 | 
				
			||||||
 | 
					    rv = s1ap_encode_pdu(s1apbuf, &pdu);
 | 
				
			||||||
 | 
					    s1ap_free_pdu(&pdu);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (rv != CORE_OK)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        d_error("s1ap_encode_pdu() failed");
 | 
				
			||||||
 | 
					        return CORE_ERROR;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return CORE_OK;
 | 
					    return CORE_OK;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -713,12 +764,22 @@ status_t s1ap_build_e_rab_release_command(pkbuf_t **s1apbuf,
 | 
				
			|||||||
        mme_bearer_t *bearer, pkbuf_t *esmbuf, 
 | 
					        mme_bearer_t *bearer, pkbuf_t *esmbuf, 
 | 
				
			||||||
        S1AP_Cause_PR group, long cause)
 | 
					        S1AP_Cause_PR group, long cause)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
#if 0
 | 
					    status_t rv;
 | 
				
			||||||
    int encoded;
 | 
					
 | 
				
			||||||
    s1ap_message_t message;
 | 
					    S1AP_S1AP_PDU_t pdu;
 | 
				
			||||||
    S1AP_E_RABReleaseCommandIEs_t *ies = &message.s1ap_E_RABReleaseCommandIEs;
 | 
					    S1AP_InitiatingMessage_t *initiatingMessage = NULL;
 | 
				
			||||||
    S1AP_E_RABItem_t *e_rab = NULL;
 | 
					    S1AP_E_RABReleaseCommand_t *E_RABReleaseCommand = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    S1AP_E_RABReleaseCommandIEs_t *ie = NULL;
 | 
				
			||||||
 | 
					    S1AP_MME_UE_S1AP_ID_t *MME_UE_S1AP_ID = NULL;
 | 
				
			||||||
 | 
					    S1AP_ENB_UE_S1AP_ID_t *ENB_UE_S1AP_ID = NULL;
 | 
				
			||||||
 | 
					    S1AP_UEAggregateMaximumBitrate_t *UEAggregateMaximumBitrate = NULL;
 | 
				
			||||||
 | 
					    S1AP_E_RABList_t *E_RABList = NULL;
 | 
				
			||||||
    S1AP_NAS_PDU_t *nasPdu = NULL;
 | 
					    S1AP_NAS_PDU_t *nasPdu = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    S1AP_E_RABItemIEs_t *item = NULL;
 | 
				
			||||||
 | 
					    S1AP_E_RABItem_t *e_rab = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    mme_ue_t *mme_ue = NULL;
 | 
					    mme_ue_t *mme_ue = NULL;
 | 
				
			||||||
    enb_ue_t *enb_ue = NULL;
 | 
					    enb_ue_t *enb_ue = NULL;
 | 
				
			||||||
    s6a_subscription_data_t *subscription_data = NULL;
 | 
					    s6a_subscription_data_t *subscription_data = NULL;
 | 
				
			||||||
@@ -734,48 +795,107 @@ status_t s1ap_build_e_rab_release_command(pkbuf_t **s1apbuf,
 | 
				
			|||||||
    d_assert(subscription_data, return CORE_ERROR, "Null param");
 | 
					    d_assert(subscription_data, return CORE_ERROR, "Null param");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    d_trace(3, "[MME] E-RAB release command\n");
 | 
					    d_trace(3, "[MME] E-RAB release command\n");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    memset(&pdu, 0, sizeof (S1AP_S1AP_PDU_t));
 | 
				
			||||||
 | 
					    pdu.present = S1AP_S1AP_PDU_PR_initiatingMessage;
 | 
				
			||||||
 | 
					    pdu.choice.initiatingMessage = 
 | 
				
			||||||
 | 
					        core_calloc(1, sizeof(S1AP_InitiatingMessage_t));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    initiatingMessage = pdu.choice.initiatingMessage;
 | 
				
			||||||
 | 
					    initiatingMessage->procedureCode = S1AP_ProcedureCode_id_E_RABRelease;
 | 
				
			||||||
 | 
					    initiatingMessage->criticality = S1AP_Criticality_reject;
 | 
				
			||||||
 | 
					    initiatingMessage->value.present =
 | 
				
			||||||
 | 
					        S1AP_InitiatingMessage__value_PR_E_RABReleaseCommand;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    E_RABReleaseCommand = &initiatingMessage->value.choice.E_RABReleaseCommand;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ie = core_calloc(1, sizeof(S1AP_E_RABReleaseCommandIEs_t));
 | 
				
			||||||
 | 
					    ASN_SEQUENCE_ADD(&E_RABReleaseCommand->protocolIEs, ie);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
 | 
				
			||||||
 | 
					    ie->criticality = S1AP_Criticality_reject;
 | 
				
			||||||
 | 
					    ie->value.present = S1AP_E_RABReleaseCommandIEs__value_PR_MME_UE_S1AP_ID;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    MME_UE_S1AP_ID = &ie->value.choice.MME_UE_S1AP_ID;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ie = core_calloc(1, sizeof(S1AP_E_RABReleaseCommandIEs_t));
 | 
				
			||||||
 | 
					    ASN_SEQUENCE_ADD(&E_RABReleaseCommand->protocolIEs, ie);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
 | 
				
			||||||
 | 
					    ie->criticality = S1AP_Criticality_reject;
 | 
				
			||||||
 | 
					    ie->value.present = S1AP_E_RABReleaseCommandIEs__value_PR_ENB_UE_S1AP_ID;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ENB_UE_S1AP_ID = &ie->value.choice.ENB_UE_S1AP_ID;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ie = core_calloc(1, sizeof(S1AP_E_RABReleaseCommandIEs_t));
 | 
				
			||||||
 | 
					    ASN_SEQUENCE_ADD(&E_RABReleaseCommand->protocolIEs, ie);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ie->id = S1AP_ProtocolIE_ID_id_uEaggregateMaximumBitrate;
 | 
				
			||||||
 | 
					    ie->criticality = S1AP_Criticality_reject;
 | 
				
			||||||
 | 
					    ie->value.present =
 | 
				
			||||||
 | 
					        S1AP_E_RABReleaseCommandIEs__value_PR_UEAggregateMaximumBitrate;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    UEAggregateMaximumBitrate = &ie->value.choice.UEAggregateMaximumBitrate;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ie = core_calloc(1, sizeof(S1AP_E_RABReleaseCommandIEs_t));
 | 
				
			||||||
 | 
					    ASN_SEQUENCE_ADD(&E_RABReleaseCommand->protocolIEs, ie);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ie->id = S1AP_ProtocolIE_ID_id_E_RABToBeReleasedList;
 | 
				
			||||||
 | 
					    ie->criticality = S1AP_Criticality_ignore;
 | 
				
			||||||
 | 
					    ie->value.present = S1AP_E_RABReleaseCommandIEs__value_PR_E_RABList;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    E_RABList = &ie->value.choice.E_RABList;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ie = core_calloc(1, sizeof(S1AP_E_RABReleaseCommandIEs_t));
 | 
				
			||||||
 | 
					    ASN_SEQUENCE_ADD(&E_RABReleaseCommand->protocolIEs, ie);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ie->id = S1AP_ProtocolIE_ID_id_NAS_PDU;
 | 
				
			||||||
 | 
					    ie->criticality = S1AP_Criticality_ignore;
 | 
				
			||||||
 | 
					    ie->value.present = S1AP_E_RABReleaseCommandIEs__value_PR_NAS_PDU;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    nasPdu = &ie->value.choice.NAS_PDU;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    d_trace(5, "    ENB_UE_S1AP_ID[%d] MME_UE_S1AP_ID[%d]\n",
 | 
					    d_trace(5, "    ENB_UE_S1AP_ID[%d] MME_UE_S1AP_ID[%d]\n",
 | 
				
			||||||
            enb_ue->enb_ue_s1ap_id, enb_ue->mme_ue_s1ap_id);
 | 
					            enb_ue->enb_ue_s1ap_id, enb_ue->mme_ue_s1ap_id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    memset(&message, 0, sizeof(s1ap_message_t));
 | 
					    *MME_UE_S1AP_ID = enb_ue->mme_ue_s1ap_id;
 | 
				
			||||||
 | 
					    *ENB_UE_S1AP_ID = enb_ue->enb_ue_s1ap_id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ies->mme_ue_s1ap_id = enb_ue->mme_ue_s1ap_id;
 | 
					 | 
				
			||||||
    ies->eNB_UE_S1AP_ID = enb_ue->enb_ue_s1ap_id;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ies->presenceMask |= 
 | 
					 | 
				
			||||||
           S1AP_E_RABRELEASECOMMANDIES_UEAGGREGATEMAXIMUMBITRATE_PRESENT;
 | 
					 | 
				
			||||||
    asn_uint642INTEGER(
 | 
					    asn_uint642INTEGER(
 | 
				
			||||||
            &ies->uEaggregateMaximumBitrate.uEaggregateMaximumBitRateUL, 
 | 
					            &UEAggregateMaximumBitrate->uEaggregateMaximumBitRateUL, 
 | 
				
			||||||
            subscription_data->ambr.uplink);
 | 
					            subscription_data->ambr.uplink);
 | 
				
			||||||
    asn_uint642INTEGER(
 | 
					    asn_uint642INTEGER(
 | 
				
			||||||
            &ies->uEaggregateMaximumBitrate.uEaggregateMaximumBitRateDL, 
 | 
					            &UEAggregateMaximumBitrate->uEaggregateMaximumBitRateDL, 
 | 
				
			||||||
            subscription_data->ambr.downlink);
 | 
					            subscription_data->ambr.downlink);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    e_rab = (S1AP_E_RABItem_t *)core_calloc(1, sizeof(S1AP_E_RABItem_t));
 | 
					    item = core_calloc(1, sizeof(S1AP_E_RABItemIEs_t));
 | 
				
			||||||
 | 
					    ASN_SEQUENCE_ADD(&E_RABList->list, item);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    item->id = S1AP_ProtocolIE_ID_id_E_RABItem;
 | 
				
			||||||
 | 
					    item->criticality = S1AP_Criticality_ignore;
 | 
				
			||||||
 | 
					    item->value.present = S1AP_E_RABItemIEs__value_PR_E_RABItem;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    e_rab = &item->value.choice.E_RABItem;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    e_rab->e_RAB_ID = bearer->ebi;
 | 
					    e_rab->e_RAB_ID = bearer->ebi;
 | 
				
			||||||
    e_rab->cause.present = group;
 | 
					    e_rab->cause.present = group;
 | 
				
			||||||
    e_rab->cause.choice.radioNetwork = cause;
 | 
					    e_rab->cause.choice.radioNetwork = cause;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    d_trace(5, "    EBI[%d] Gruop[%d] Cause[%d]\n", bearer->ebi, group, cause);
 | 
					    d_trace(5, "    EBI[%d] Gruop[%d] Cause[%d]\n", bearer->ebi, group, cause);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ies->presenceMask |= S1AP_E_RABRELEASECOMMANDIES_NAS_PDU_PRESENT;
 | 
					 | 
				
			||||||
    nasPdu = &ies->nas_pdu;
 | 
					 | 
				
			||||||
    nasPdu->size = esmbuf->len;
 | 
					    nasPdu->size = esmbuf->len;
 | 
				
			||||||
    nasPdu->buf = core_calloc(nasPdu->size, sizeof(c_uint8_t));
 | 
					    nasPdu->buf = core_calloc(nasPdu->size, sizeof(c_uint8_t));
 | 
				
			||||||
    memcpy(nasPdu->buf, esmbuf->payload, nasPdu->size);
 | 
					    memcpy(nasPdu->buf, esmbuf->payload, nasPdu->size);
 | 
				
			||||||
 | 
					 | 
				
			||||||
    ASN_SEQUENCE_ADD(&ies->e_RABToBeReleasedList, e_rab);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    message.procedureCode = S1AP_ProcedureCode_id_E_RABRelease;
 | 
					 | 
				
			||||||
    message.direction = S1AP_PDU_PR_initiatingMessage;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    encoded = s1ap_encode_pdu(s1apbuf, &message);
 | 
					 | 
				
			||||||
    s1ap_free_pdu(&message);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    d_assert(s1apbuf && encoded >= 0,return CORE_ERROR,);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    pkbuf_free(esmbuf);
 | 
					    pkbuf_free(esmbuf);
 | 
				
			||||||
#endif
 | 
					
 | 
				
			||||||
 | 
					    rv = s1ap_encode_pdu(s1apbuf, &pdu);
 | 
				
			||||||
 | 
					    s1ap_free_pdu(&pdu);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (rv != CORE_OK)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        d_error("s1ap_encode_pdu() failed");
 | 
				
			||||||
 | 
					        return CORE_ERROR;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return CORE_OK;
 | 
					    return CORE_OK;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -693,7 +693,6 @@ void s1ap_handle_initial_context_setup_failure(
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if 0
 | 
					 | 
				
			||||||
void s1ap_handle_e_rab_setup_response(
 | 
					void s1ap_handle_e_rab_setup_response(
 | 
				
			||||||
        mme_enb_t *enb, s1ap_message_t *message)
 | 
					        mme_enb_t *enb, s1ap_message_t *message)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -701,36 +700,68 @@ void s1ap_handle_e_rab_setup_response(
 | 
				
			|||||||
    char buf[CORE_ADDRSTRLEN];
 | 
					    char buf[CORE_ADDRSTRLEN];
 | 
				
			||||||
    int i;
 | 
					    int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    S1AP_SuccessfulOutcome_t *successfulOutcome = NULL;
 | 
				
			||||||
 | 
					    S1AP_E_RABSetupResponse_t *E_RABSetupResponse = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    S1AP_E_RABSetupResponseIEs_t *ie = NULL;
 | 
				
			||||||
 | 
					    S1AP_ENB_UE_S1AP_ID_t *ENB_UE_S1AP_ID = NULL;
 | 
				
			||||||
 | 
					    S1AP_E_RABSetupListBearerSURes_t *E_RABSetupListBearerSURes = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    enb_ue_t *enb_ue = NULL;
 | 
					    enb_ue_t *enb_ue = NULL;
 | 
				
			||||||
    S1AP_E_RABSetupResponseIEs_t *ies = NULL;
 | 
					 | 
				
			||||||
    mme_ue_t *mme_ue = NULL;
 | 
					    mme_ue_t *mme_ue = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    d_assert(enb, return, "Null param");
 | 
					    d_assert(enb, return,);
 | 
				
			||||||
    d_assert(message, return, "Null param");
 | 
					    d_assert(enb->sock, return,);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ies = &message->s1ap_E_RABSetupResponseIEs;
 | 
					    d_assert(message, return,);
 | 
				
			||||||
    d_assert(ies, return, "Null param");
 | 
					    successfulOutcome = message->choice.successfulOutcome;
 | 
				
			||||||
 | 
					    d_assert(successfulOutcome, return,);
 | 
				
			||||||
 | 
					    E_RABSetupResponse = &successfulOutcome->value.choice.E_RABSetupResponse;
 | 
				
			||||||
 | 
					    d_assert(E_RABSetupResponse, return,);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    d_trace(3, "[MME] E-RAB setup response\n");
 | 
					    d_trace(3, "[MME] E-RAB setup response\n");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for (i = 0; i < E_RABSetupResponse->protocolIEs.list.count; i++)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        ie = E_RABSetupResponse->protocolIEs.list.array[i];
 | 
				
			||||||
 | 
					        switch(ie->id)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            case S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID:
 | 
				
			||||||
 | 
					                ENB_UE_S1AP_ID = &ie->value.choice.ENB_UE_S1AP_ID;
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            case S1AP_ProtocolIE_ID_id_E_RABSetupListBearerSURes:
 | 
				
			||||||
 | 
					                E_RABSetupListBearerSURes =
 | 
				
			||||||
 | 
					                    &ie->value.choice.E_RABSetupListBearerSURes;
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            default:
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    d_trace(5, "    IP[%s] ENB_ID[%d]\n",
 | 
					    d_trace(5, "    IP[%s] ENB_ID[%d]\n",
 | 
				
			||||||
            CORE_ADDR(enb->addr, buf), enb->enb_id);
 | 
					            CORE_ADDR(enb->addr, buf), enb->enb_id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    enb_ue = enb_ue_find_by_enb_ue_s1ap_id(enb, ies->eNB_UE_S1AP_ID);
 | 
					    d_assert(ENB_UE_S1AP_ID, return,);
 | 
				
			||||||
    d_assert(enb_ue, return, "No UE Context[%d]", ies->eNB_UE_S1AP_ID);
 | 
					    enb_ue = enb_ue_find_by_enb_ue_s1ap_id(enb, *ENB_UE_S1AP_ID);
 | 
				
			||||||
 | 
					    d_assert(enb_ue, return, "No UE Context[%d]", *ENB_UE_S1AP_ID);
 | 
				
			||||||
    mme_ue = enb_ue->mme_ue;
 | 
					    mme_ue = enb_ue->mme_ue;
 | 
				
			||||||
    d_assert(mme_ue, return,);
 | 
					    d_assert(mme_ue, return,);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    d_trace(5, "    ENB_UE_S1AP_ID[%d] MME_UE_S1AP_ID[%d]\n",
 | 
					    d_trace(5, "    ENB_UE_S1AP_ID[%d] MME_UE_S1AP_ID[%d]\n",
 | 
				
			||||||
            enb_ue->enb_ue_s1ap_id, enb_ue->mme_ue_s1ap_id);
 | 
					            enb_ue->enb_ue_s1ap_id, enb_ue->mme_ue_s1ap_id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (i = 0; i < ies->e_RABSetupListBearerSURes.
 | 
					    for (i = 0; i < E_RABSetupListBearerSURes->list.count; i++)
 | 
				
			||||||
            s1ap_E_RABSetupItemBearerSURes.count; i++)
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        mme_bearer_t *bearer = NULL;
 | 
					        S1AP_E_RABSetupItemBearerSUResIEs_t *item = NULL;
 | 
				
			||||||
        S1AP_E_RABSetupItemBearerSURes_t *e_rab = NULL;
 | 
					        S1AP_E_RABSetupItemBearerSURes_t *e_rab = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        e_rab = (S1AP_E_RABSetupItemBearerSURes_t *)ies->
 | 
					        mme_bearer_t *bearer = NULL;
 | 
				
			||||||
            e_RABSetupListBearerSURes.s1ap_E_RABSetupItemBearerSURes.array[i];
 | 
					
 | 
				
			||||||
 | 
					        item = (S1AP_E_RABSetupItemBearerSUResIEs_t *)
 | 
				
			||||||
 | 
					            E_RABSetupListBearerSURes->list.array[i];
 | 
				
			||||||
 | 
					        d_assert(item, return,);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        e_rab = &item->value.choice.E_RABSetupItemBearerSURes;
 | 
				
			||||||
        d_assert(e_rab, return, "Null param");
 | 
					        d_assert(e_rab, return, "Null param");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        bearer = mme_bearer_find_by_ue_ebi(mme_ue, e_rab->e_RAB_ID);
 | 
					        bearer = mme_bearer_find_by_ue_ebi(mme_ue, e_rab->e_RAB_ID);
 | 
				
			||||||
@@ -766,7 +797,6 @@ void s1ap_handle_e_rab_setup_response(
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
void s1ap_handle_ue_context_release_request(
 | 
					void s1ap_handle_ue_context_release_request(
 | 
				
			||||||
        mme_enb_t *enb, s1ap_message_t *message)
 | 
					        mme_enb_t *enb, s1ap_message_t *message)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -143,7 +143,6 @@ void s1ap_state_operational(fsm_t *s, event_t *e)
 | 
				
			|||||||
                                    enb, pdu);
 | 
					                                    enb, pdu);
 | 
				
			||||||
                            break;
 | 
					                            break;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
#if 0
 | 
					 | 
				
			||||||
                        case S1AP_ProcedureCode_id_E_RABSetup :
 | 
					                        case S1AP_ProcedureCode_id_E_RABSetup :
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            s1ap_handle_e_rab_setup_response(enb, pdu);
 | 
					                            s1ap_handle_e_rab_setup_response(enb, pdu);
 | 
				
			||||||
@@ -157,7 +156,6 @@ void s1ap_state_operational(fsm_t *s, event_t *e)
 | 
				
			|||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            break;
 | 
					                            break;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
                        case S1AP_ProcedureCode_id_UEContextRelease :
 | 
					                        case S1AP_ProcedureCode_id_UEContextRelease :
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            s1ap_handle_ue_context_release_complete(
 | 
					                            s1ap_handle_ue_context_release_complete(
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,7 +11,7 @@ testepc_SOURCES = \
 | 
				
			|||||||
	common/testpacket.h common/testpacket.c common/testutil.h \
 | 
						common/testpacket.h common/testpacket.c common/testutil.h \
 | 
				
			||||||
	basic/testutil.c basic/s1ap_message_test.c basic/nas_message_test.c \
 | 
						basic/testutil.c basic/s1ap_message_test.c basic/nas_message_test.c \
 | 
				
			||||||
	basic/gtp_message_test.c basic/security_test.c basic/s1setup_test.c \
 | 
						basic/gtp_message_test.c basic/security_test.c basic/s1setup_test.c \
 | 
				
			||||||
	basic/attach_test.c
 | 
						basic/attach_test.c basic/volte_test.c
 | 
				
			||||||
	$(NULL)
 | 
						$(NULL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#	basic/attach_test.c basic/volte_test.c basic/handover_test.c
 | 
					#	basic/attach_test.c basic/volte_test.c basic/handover_test.c
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -32,8 +32,8 @@ const struct testlist alltests[] = {
 | 
				
			|||||||
    {test_security},
 | 
					    {test_security},
 | 
				
			||||||
    {test_s1setup},
 | 
					    {test_s1setup},
 | 
				
			||||||
    {test_attach},
 | 
					    {test_attach},
 | 
				
			||||||
#if 0
 | 
					 | 
				
			||||||
    {test_volte},
 | 
					    {test_volte},
 | 
				
			||||||
 | 
					#if 0
 | 
				
			||||||
    {test_handover},
 | 
					    {test_handover},
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    {NULL},
 | 
					    {NULL},
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -102,7 +102,7 @@ static void volte_test1(abts_case *tc, void *data)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    /* Send S1-Setup Reqeust */
 | 
					    /* Send S1-Setup Reqeust */
 | 
				
			||||||
    rv = tests1ap_build_setup_req(
 | 
					    rv = tests1ap_build_setup_req(
 | 
				
			||||||
            &sendbuf, S1ap_ENB_ID_PR_macroENB_ID, 0x54f64);
 | 
					            &sendbuf, S1AP_ENB_ID_PR_macroENB_ID, 0x54f64);
 | 
				
			||||||
    ABTS_INT_EQUAL(tc, CORE_OK, rv);
 | 
					    ABTS_INT_EQUAL(tc, CORE_OK, rv);
 | 
				
			||||||
    rv = tests1ap_enb_send(sock, sendbuf);
 | 
					    rv = tests1ap_enb_send(sock, sendbuf);
 | 
				
			||||||
    ABTS_INT_EQUAL(tc, CORE_OK, rv);
 | 
					    ABTS_INT_EQUAL(tc, CORE_OK, rv);
 | 
				
			||||||
@@ -285,6 +285,8 @@ static void volte_test1(abts_case *tc, void *data)
 | 
				
			|||||||
    rv = tests1ap_enb_send(sock, sendbuf);
 | 
					    rv = tests1ap_enb_send(sock, sendbuf);
 | 
				
			||||||
    ABTS_INT_EQUAL(tc, CORE_OK, rv);
 | 
					    ABTS_INT_EQUAL(tc, CORE_OK, rv);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    core_sleep(time_from_msec(1000));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* Deactivate EPS bearer context accept */
 | 
					    /* Deactivate EPS bearer context accept */
 | 
				
			||||||
    rv = tests1ap_build_deactivate_bearer_accept(&sendbuf, msgindex);
 | 
					    rv = tests1ap_build_deactivate_bearer_accept(&sendbuf, msgindex);
 | 
				
			||||||
    ABTS_INT_EQUAL(tc, CORE_OK, rv);
 | 
					    ABTS_INT_EQUAL(tc, CORE_OK, rv);
 | 
				
			||||||
@@ -412,7 +414,7 @@ static void volte_test2(abts_case *tc, void *data)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    /* Send S1-Setup Reqeust */
 | 
					    /* Send S1-Setup Reqeust */
 | 
				
			||||||
    rv = tests1ap_build_setup_req(
 | 
					    rv = tests1ap_build_setup_req(
 | 
				
			||||||
            &sendbuf, S1ap_ENB_ID_PR_macroENB_ID, 0x54f64);
 | 
					            &sendbuf, S1AP_ENB_ID_PR_macroENB_ID, 0x54f64);
 | 
				
			||||||
    ABTS_INT_EQUAL(tc, CORE_OK, rv);
 | 
					    ABTS_INT_EQUAL(tc, CORE_OK, rv);
 | 
				
			||||||
    rv = tests1ap_enb_send(sock, sendbuf);
 | 
					    rv = tests1ap_enb_send(sock, sendbuf);
 | 
				
			||||||
    ABTS_INT_EQUAL(tc, CORE_OK, rv);
 | 
					    ABTS_INT_EQUAL(tc, CORE_OK, rv);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1220,13 +1220,13 @@ status_t tests1ap_build_pdn_connectivity_request(
 | 
				
			|||||||
        pkbuf_t **pkbuf, int i)
 | 
					        pkbuf_t **pkbuf, int i)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    char *payload[TESTS1AP_MAX_MESSAGE] = { 
 | 
					    char *payload[TESTS1AP_MAX_MESSAGE] = { 
 | 
				
			||||||
        "000d40680000"
 | 
					        "000d40640000"
 | 
				
			||||||
        "0500000005c00000 0001000800030001 00001a003b3a277c 81dab50a0205d011"
 | 
					        "0500000002 0001000800020001 001a003b3a277c 81dab50a0205d011"
 | 
				
			||||||
        "281208696e746572 6e6574036e673204 6d6e6574271a8080 2110010000108106"
 | 
					        "281208696e746572 6e6574036e673204 6d6e6574271a8080 2110010000108106"
 | 
				
			||||||
        "0000000083060000 0000000d00000a00 006440080055f501 0019d01000434006"
 | 
					        "0000000083060000 0000000d00000a00 006440080055f501 0019d01000434006"
 | 
				
			||||||
        "0055f5011022",
 | 
					        "0055f5011022",
 | 
				
			||||||
        "000d40680000"
 | 
					        "000d40640000"
 | 
				
			||||||
        "0500000005c00000 0001000800030001 00001a003b3a2710 3fdafa0a0209d011"
 | 
					        "0500000002 0001000800020001 001a003b3a2710 3fdafa0a0209d011"
 | 
				
			||||||
        "281208706e746572 6e6574036e673204 6d6e6574271a8080 2110010000108106"
 | 
					        "281208706e746572 6e6574036e673204 6d6e6574271a8080 2110010000108106"
 | 
				
			||||||
        "0000000083060000 0000000d00000a00 006440080055f501 0019d01000434006"
 | 
					        "0000000083060000 0000000d00000a00 006440080055f501 0019d01000434006"
 | 
				
			||||||
        "0055f5011022",
 | 
					        "0055f5011022",
 | 
				
			||||||
@@ -1270,11 +1270,11 @@ status_t tests1ap_build_pdn_disconnectivity_request(
 | 
				
			|||||||
        pkbuf_t **pkbuf, int i)
 | 
					        pkbuf_t **pkbuf, int i)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    char *payload[TESTS1AP_MAX_MESSAGE] = { 
 | 
					    char *payload[TESTS1AP_MAX_MESSAGE] = { 
 | 
				
			||||||
        "000d40380000"
 | 
					        "000d40370000"
 | 
				
			||||||
        "0500000005c08000 0108000800030001 00001a000b0a2732 423c53040206d206"
 | 
					        "0500000005c08000 0108000800020001 001a000b0a2732 423c53040206d206"
 | 
				
			||||||
        "006440080055f501 0019d01000434006 0055f5011022",
 | 
					        "006440080055f501 0019d01000434006 0055f5011022",
 | 
				
			||||||
        "000d40380000"
 | 
					        "000d40370000"
 | 
				
			||||||
        "0500000005c08000 0108000800030001 00001a000b0a2777 693066040206d206"
 | 
					        "0500000005c08000 0108000800020001 001a000b0a2777 693066040206d206"
 | 
				
			||||||
        "006440080055f501 0019d01000434006 0055f5011022",
 | 
					        "006440080055f501 0019d01000434006 0055f5011022",
 | 
				
			||||||
        "",
 | 
					        "",
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1288,8 +1288,8 @@ status_t tests1ap_build_pdn_disconnectivity_request(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
    c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
 | 
					    c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
 | 
				
			||||||
        60,
 | 
					        59,
 | 
				
			||||||
        60,
 | 
					        59,
 | 
				
			||||||
        0,
 | 
					        0,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        0,
 | 
					        0,
 | 
				
			||||||
@@ -1312,35 +1312,82 @@ status_t tests1ap_build_pdn_disconnectivity_request(
 | 
				
			|||||||
    return CORE_OK;
 | 
					    return CORE_OK;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if 0
 | 
					 | 
				
			||||||
status_t tests1ap_build_e_rab_setup_response(
 | 
					status_t tests1ap_build_e_rab_setup_response(
 | 
				
			||||||
        pkbuf_t **pkbuf, 
 | 
					        pkbuf_t **pkbuf, 
 | 
				
			||||||
        c_uint32_t mme_ue_s1ap_id, c_uint32_t enb_ue_s1ap_id,
 | 
					        c_uint32_t mme_ue_s1ap_id, c_uint32_t enb_ue_s1ap_id,
 | 
				
			||||||
        c_uint8_t ebi, c_uint32_t teid)
 | 
					        c_uint8_t ebi, c_uint32_t teid)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int erval = -1;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    status_t rv;
 | 
					    status_t rv;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    S1AP_S1AP_PDU_t pdu;
 | 
				
			||||||
 | 
					    S1AP_SuccessfulOutcome_t *successfulOutcome = NULL;
 | 
				
			||||||
 | 
					    S1AP_E_RABSetupResponse_t *E_RABSetupResponse = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    S1AP_E_RABSetupResponseIEs_t *ie = NULL;
 | 
				
			||||||
 | 
					    S1AP_MME_UE_S1AP_ID_t *MME_UE_S1AP_ID = NULL;
 | 
				
			||||||
 | 
					    S1AP_ENB_UE_S1AP_ID_t *ENB_UE_S1AP_ID = NULL;
 | 
				
			||||||
 | 
					    S1AP_E_RABSetupListBearerSURes_t *E_RABSetupListBearerSURes = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    S1AP_E_RABSetupItemBearerSUResIEs_t *item = NULL;
 | 
				
			||||||
 | 
					    S1AP_E_RABSetupItemBearerSURes_t *e_rab = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    gtp_f_teid_t f_teid;
 | 
					    gtp_f_teid_t f_teid;
 | 
				
			||||||
    ip_t ip;
 | 
					    ip_t ip;
 | 
				
			||||||
    int len;
 | 
					    int len;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    s1ap_message_t message;
 | 
					    memset(&pdu, 0, sizeof (S1AP_S1AP_PDU_t));
 | 
				
			||||||
    S1AP_E_RABSetupResponseIEs_t *ies = NULL;
 | 
					    pdu.present = S1AP_S1AP_PDU_PR_successfulOutcome;
 | 
				
			||||||
    S1AP_E_RABSetupItemBearerSURes_t *e_rab = NULL;
 | 
					    pdu.choice.successfulOutcome = 
 | 
				
			||||||
 | 
					        core_calloc(1, sizeof(S1AP_SuccessfulOutcome_t));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    memset(&message, 0, sizeof(s1ap_message_t));
 | 
					    successfulOutcome = pdu.choice.successfulOutcome;
 | 
				
			||||||
 | 
					    successfulOutcome->procedureCode = S1AP_ProcedureCode_id_E_RABSetup;
 | 
				
			||||||
 | 
					    successfulOutcome->criticality = S1AP_Criticality_reject;
 | 
				
			||||||
 | 
					    successfulOutcome->value.present =
 | 
				
			||||||
 | 
					        S1AP_SuccessfulOutcome__value_PR_E_RABSetupResponse;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ies = &message.s1ap_E_RABSetupResponseIEs;
 | 
					    E_RABSetupResponse = &successfulOutcome->value.choice.E_RABSetupResponse;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    message.direction = S1AP_PDU_PR_successfulOutcome;
 | 
					    ie = core_calloc(1, sizeof(S1AP_E_RABSetupResponseIEs_t));
 | 
				
			||||||
    message.procedureCode = S1AP_ProcedureCode_id_E_RABSetup;
 | 
					    ASN_SEQUENCE_ADD(&E_RABSetupResponse->protocolIEs, ie);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ies->mme_ue_s1ap_id = mme_ue_s1ap_id;
 | 
					    ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
 | 
				
			||||||
    ies->eNB_UE_S1AP_ID = enb_ue_s1ap_id;
 | 
					    ie->criticality = S1AP_Criticality_ignore;
 | 
				
			||||||
 | 
					    ie->value.present = S1AP_E_RABSetupResponseIEs__value_PR_MME_UE_S1AP_ID;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    e_rab = (S1AP_E_RABSetupItemBearerSURes_t *)
 | 
					    MME_UE_S1AP_ID = &ie->value.choice.MME_UE_S1AP_ID;
 | 
				
			||||||
        core_calloc(1, sizeof(S1AP_E_RABSetupItemBearerSURes_t));
 | 
					
 | 
				
			||||||
 | 
					    ie = core_calloc(1, sizeof(S1AP_E_RABSetupResponseIEs_t));
 | 
				
			||||||
 | 
					    ASN_SEQUENCE_ADD(&E_RABSetupResponse->protocolIEs, ie);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
 | 
				
			||||||
 | 
					    ie->criticality = S1AP_Criticality_ignore;
 | 
				
			||||||
 | 
					    ie->value.present = S1AP_E_RABSetupResponseIEs__value_PR_ENB_UE_S1AP_ID;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ENB_UE_S1AP_ID = &ie->value.choice.ENB_UE_S1AP_ID;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ie = core_calloc(1, sizeof(S1AP_E_RABSetupResponseIEs_t));
 | 
				
			||||||
 | 
					    ASN_SEQUENCE_ADD(&E_RABSetupResponse->protocolIEs, ie);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ie->id = S1AP_ProtocolIE_ID_id_E_RABSetupListBearerSURes;
 | 
				
			||||||
 | 
					    ie->criticality = S1AP_Criticality_ignore;
 | 
				
			||||||
 | 
					    ie->value.present =
 | 
				
			||||||
 | 
					        S1AP_E_RABSetupResponseIEs__value_PR_E_RABSetupListBearerSURes;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    E_RABSetupListBearerSURes = &ie->value.choice.E_RABSetupListBearerSURes;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    *MME_UE_S1AP_ID = mme_ue_s1ap_id;
 | 
				
			||||||
 | 
					    *ENB_UE_S1AP_ID = enb_ue_s1ap_id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    item = core_calloc(1, sizeof(S1AP_E_RABSetupItemBearerSUResIEs_t));
 | 
				
			||||||
 | 
					    ASN_SEQUENCE_ADD(&E_RABSetupListBearerSURes->list, item);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    item->id = S1AP_ProtocolIE_ID_id_E_RABSetupItemBearerSURes;
 | 
				
			||||||
 | 
					    item->criticality = S1AP_Criticality_ignore;
 | 
				
			||||||
 | 
					    item->value.present =
 | 
				
			||||||
 | 
					        S1AP_E_RABSetupItemBearerSUResIEs__value_PR_E_RABSetupItemBearerSURes;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    e_rab = &item->value.choice.E_RABSetupItemBearerSURes;
 | 
				
			||||||
    e_rab->e_RAB_ID = ebi;
 | 
					    e_rab->e_RAB_ID = ebi;
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
    rv = gtp_sockaddr_to_f_teid(test_enb1_addr, test_enb1_addr6, &f_teid, &len);
 | 
					    rv = gtp_sockaddr_to_f_teid(test_enb1_addr, test_enb1_addr6, &f_teid, &len);
 | 
				
			||||||
@@ -1352,22 +1399,17 @@ status_t tests1ap_build_e_rab_setup_response(
 | 
				
			|||||||
    d_assert(rv == CORE_OK, return CORE_ERROR,);
 | 
					    d_assert(rv == CORE_OK, return CORE_ERROR,);
 | 
				
			||||||
    s1ap_uint32_to_OCTET_STRING(teid, &e_rab->gTP_TEID);
 | 
					    s1ap_uint32_to_OCTET_STRING(teid, &e_rab->gTP_TEID);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ies->presenceMask |= 
 | 
					    rv = s1ap_encode_pdu(pkbuf, &pdu);
 | 
				
			||||||
           S1AP_E_RABSETUPRESPONSEIES_E_RABSETUPLISTBEARERSURES_PRESENT;
 | 
					    s1ap_free_pdu(&pdu);
 | 
				
			||||||
    ASN_SEQUENCE_ADD(&ies->e_RABSetupListBearerSURes, e_rab);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    erval = s1ap_encode_pdu(pkbuf, &message);
 | 
					    if (rv != CORE_OK)
 | 
				
			||||||
    s1ap_free_pdu(&message);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (erval < 0)
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        d_error("s1ap_encode_error : (%d)", erval);
 | 
					        d_error("s1ap_encode_pdu() failed");
 | 
				
			||||||
        return CORE_ERROR;
 | 
					        return CORE_ERROR;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return CORE_OK;
 | 
					    return CORE_OK;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
status_t tests1ap_build_e_rab_modify_response(pkbuf_t **pkbuf, int i)
 | 
					status_t tests1ap_build_e_rab_modify_response(pkbuf_t **pkbuf, int i)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -1414,10 +1456,10 @@ status_t tests1ap_build_e_rab_modify_response(pkbuf_t **pkbuf, int i)
 | 
				
			|||||||
status_t tests1ap_build_e_rab_release_response(pkbuf_t **pkbuf, int i)
 | 
					status_t tests1ap_build_e_rab_release_response(pkbuf_t **pkbuf, int i)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    char *payload[TESTS1AP_MAX_MESSAGE] = { 
 | 
					    char *payload[TESTS1AP_MAX_MESSAGE] = { 
 | 
				
			||||||
        "2007001d0000"
 | 
					        "200700190000"
 | 
				
			||||||
        "0300004005c00000 0001000840030001 000045400600000f 40010c",
 | 
					        "0300004002 0001000840020001 0045400600000f 40010c",
 | 
				
			||||||
        "2007001d0000"
 | 
					        "200700190000"
 | 
				
			||||||
        "0300004005c00000 0001000840030001 000045400600000f 40010e",
 | 
					        "0300004002 0001000840020001 0045400600000f 40010e",
 | 
				
			||||||
        "",
 | 
					        "",
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        "",
 | 
					        "",
 | 
				
			||||||
@@ -1430,8 +1472,8 @@ status_t tests1ap_build_e_rab_release_response(pkbuf_t **pkbuf, int i)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
    c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
 | 
					    c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
 | 
				
			||||||
        33,
 | 
					        29,
 | 
				
			||||||
        33,
 | 
					        29,
 | 
				
			||||||
        0,
 | 
					        0,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        0,
 | 
					        0,
 | 
				
			||||||
@@ -1458,8 +1500,8 @@ status_t tests1ap_build_activate_default_bearer_accept(
 | 
				
			|||||||
        pkbuf_t **pkbuf, int i)
 | 
					        pkbuf_t **pkbuf, int i)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    char *payload[TESTS1AP_MAX_MESSAGE] = { 
 | 
					    char *payload[TESTS1AP_MAX_MESSAGE] = { 
 | 
				
			||||||
        "000d40370000"
 | 
					        "000d40360000"
 | 
				
			||||||
        "0500000005c08000 0107000800030001 00001a000a0927e7 f5bb400b6200c200"
 | 
					        "0500000005c08000 0107000800020001 001a000a0927e7 f5bb400b6200c200"
 | 
				
			||||||
        "6440080055f50100 19d0100043400600 55f5011022",
 | 
					        "6440080055f50100 19d0100043400600 55f5011022",
 | 
				
			||||||
        "",
 | 
					        "",
 | 
				
			||||||
        "",
 | 
					        "",
 | 
				
			||||||
@@ -1474,7 +1516,7 @@ status_t tests1ap_build_activate_default_bearer_accept(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
    c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
 | 
					    c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
 | 
				
			||||||
        59,
 | 
					        58,
 | 
				
			||||||
        0,
 | 
					        0,
 | 
				
			||||||
        0,
 | 
					        0,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1502,11 +1544,11 @@ status_t tests1ap_build_activate_dedicated_bearer_accept(
 | 
				
			|||||||
        pkbuf_t **pkbuf, int i)
 | 
					        pkbuf_t **pkbuf, int i)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    char *payload[TESTS1AP_MAX_MESSAGE] = { 
 | 
					    char *payload[TESTS1AP_MAX_MESSAGE] = { 
 | 
				
			||||||
        "000d403700000500"
 | 
					        "000d403600000500"
 | 
				
			||||||
        "000005c000000001 0008000300010000 1a000a0927078a5f 34037200c6006440"
 | 
					        "000005c000000001 00080002000100 1a000a0927078a5f 34037200c6006440"
 | 
				
			||||||
        "080000f1109d67aa 50004340060000f1 102b67",
 | 
					        "080000f1109d67aa 50004340060000f1 102b67",
 | 
				
			||||||
        "000d403700000500"
 | 
					        "000d403600000500"
 | 
				
			||||||
        "000005c000000001 0008000300010000 1a000a0927c035da 96036200c6006440"
 | 
					        "000005c000000001 00080002000100 1a000a0927c035da 96036200c6006440"
 | 
				
			||||||
        "080000f1109d67aa 50004340060000f1 102b67",
 | 
					        "080000f1109d67aa 50004340060000f1 102b67",
 | 
				
			||||||
        "",
 | 
					        "",
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1518,8 +1560,8 @@ status_t tests1ap_build_activate_dedicated_bearer_accept(
 | 
				
			|||||||
        "",
 | 
					        "",
 | 
				
			||||||
        "",
 | 
					        "",
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        "000d403700000500"
 | 
					        "000d403600000500"
 | 
				
			||||||
        "000005c00200003c 0008000300010000 1a000a0927a27f49 d6036200c6006440"
 | 
					        "000005c00200003c 00080002000100 1a000a0927a27f49 d6036200c6006440"
 | 
				
			||||||
        "080000f1109d67aa 50004340060000f1 102b67",
 | 
					        "080000f1109d67aa 50004340060000f1 102b67",
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        "000d"
 | 
					        "000d"
 | 
				
			||||||
@@ -1527,8 +1569,8 @@ status_t tests1ap_build_activate_dedicated_bearer_accept(
 | 
				
			|||||||
        "00c6006440080000 f110001f20a00043 40060000f1103039",
 | 
					        "00c6006440080000 f110001f20a00043 40060000f1103039",
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
    c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
 | 
					    c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
 | 
				
			||||||
        59,
 | 
					        58,
 | 
				
			||||||
        59,
 | 
					        58,
 | 
				
			||||||
        0,
 | 
					        0,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        0,
 | 
					        0,
 | 
				
			||||||
@@ -1539,7 +1581,7 @@ status_t tests1ap_build_activate_dedicated_bearer_accept(
 | 
				
			|||||||
        0,
 | 
					        0,
 | 
				
			||||||
        0,
 | 
					        0,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        59,
 | 
					        58,
 | 
				
			||||||
        58,
 | 
					        58,
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
    char hexbuf[MAX_SDU_LEN];
 | 
					    char hexbuf[MAX_SDU_LEN];
 | 
				
			||||||
@@ -1609,14 +1651,14 @@ status_t tests1ap_build_deactivate_bearer_accept(
 | 
				
			|||||||
        pkbuf_t **pkbuf, int i)
 | 
					        pkbuf_t **pkbuf, int i)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    char *payload[TESTS1AP_MAX_MESSAGE] = { 
 | 
					    char *payload[TESTS1AP_MAX_MESSAGE] = { 
 | 
				
			||||||
        "000d40370000"
 | 
					        "000d40330000"
 | 
				
			||||||
        "0500000005c00000 0001000800030001 00001a000a09274c b2ebbd056200ce00"
 | 
					        "0500000002 0001000800020001 001a000a09274c b2ebbd056200ce00"
 | 
				
			||||||
        "6440080055f50100 19d0100043400600 55f5011022",
 | 
					        "6440080055f50100 19d0100043400600 55f5011022",
 | 
				
			||||||
        "000d40370000"
 | 
					        "000d40330000"
 | 
				
			||||||
        "0500000005c00000 0001000800030001 00001a000a0927a9 a1b2bd057200ce00"
 | 
					        "0500000002 0001000800020001 001a000a0927a9 a1b2bd057200ce00"
 | 
				
			||||||
        "6440080055f50100 19d0100043400600 55f5011022",
 | 
					        "6440080055f50100 19d0100043400600 55f5011022",
 | 
				
			||||||
        "000d40370000"
 | 
					        "000d40330000"
 | 
				
			||||||
        "0500000005c00000 0001000800030001 00001a000a09277d 7f1f80056200ce00"
 | 
					        "0500000002 0001000800020001 001a000a09277d 7f1f80056200ce00"
 | 
				
			||||||
        "6440080055f50100 19d0100043400600 55f5011022",
 | 
					        "6440080055f50100 19d0100043400600 55f5011022",
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        "",
 | 
					        "",
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user