Skip to content

Commit

Permalink
Modify ue_context.go handler.go
Browse files Browse the repository at this point in the history
* add TODO and delete comments
  • Loading branch information
iamelisahi committed Sep 13, 2023
1 parent b5d1b9a commit 4535acf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 55 deletions.
3 changes: 3 additions & 0 deletions internal/gmm/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,9 @@ func contextTransferFromOldAmf(ue *context.AmfUe, anType models.AccessType, oldA
ueContextTransferRspData, problemDetails, err := consumer.UEContextTransferRequest(ue, anType, transferReason)
if problemDetails != nil {
if problemDetails.Cause == "INTEGRITY_CHECK_FAIL" || problemDetails.Cause == "CONTEXT_NOT_FOUND" {
// TODO 9a. After successful authentication in new AMF, which is triggered by the integrity check failure
// in old AMF at step 5, the new AMF invokes step 4 above again and indicates that the UE is validated
//(i.e. through the reason parameter as specified in clause 5.2.2.2.2).
return fmt.Errorf("Can not retrieve UE Context from old AMF[Cause: %s]", problemDetails.Cause)
}
return fmt.Errorf("UE Context Transfer Request Failed Problem[%+v]", problemDetails)
Expand Down
57 changes: 2 additions & 55 deletions internal/sbi/producer/ue_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ func UEContextTransferProcedure(ueContextID string, ueContextTransferRequest mod

switch UeContextTransferReqData.Reason {
case models.TransferReason_INIT_REG:
// TODO: check integrity of the registration request included in ueContextTransferRequest
_, integrityProtected, err := nas_security.Decode(ue, UeContextTransferReqData.AccessType,
ueContextTransferRequest.BinaryDataN1Message, true)
if err != nil {
Expand All @@ -282,7 +281,6 @@ func UEContextTransferProcedure(ueContextID string, ueContextTransferRequest mod
ue.NASLog.Errorln(err)
return nil, problemDetails
}
// ue.MacFailed = !integrityProtected
if integrityProtected {
ueContextTransferRspData.UeContext = buildUEContextModel(ue, UeContextTransferReqData.Reason)
} else {
Expand Down Expand Up @@ -313,63 +311,12 @@ func UEContextTransferProcedure(ueContextID string, ueContextTransferRequest mod
}
return nil, problemDetails
}

// sessionContextList := &ueContextTransferRspData.UeContext.SessionContextList
// ue.SmContextList.Range(func(key, value interface{}) bool {
// smContext := value.(*context.SmContext)
// snssai := smContext.Snssai()
// pduSessionContext := models.PduSessionContext{
// PduSessionId: smContext.PduSessionID(),
// SmContextRef: smContext.SmContextRef(),
// SNssai: &snssai,
// Dnn: smContext.Dnn(),
// AccessType: smContext.AccessType(),
// HsmfId: smContext.HSmfID(),
// VsmfId: smContext.VSmfID(),
// NsInstance: smContext.NsInstance(),
// }
// *sessionContextList = append(*sessionContextList, pduSessionContext)
// return true
// })
HandleMobiRegUe(ue, ueContextTransferRspData, ueContextTransferResponse)
// ueContextTransferRspData.UeRadioCapability = &models.N2InfoContent{
// NgapMessageType: 0,
// NgapIeType: models.NgapIeType_UE_RADIO_CAPABILITY,
// NgapData: &models.RefToBinaryData{
// ContentId: "n2Info",
// },
// }
// b := []byte(ue.UeRadioCapability)
// copy(ueContextTransferResponse.BinaryDataN2Information, b)

case models.TransferReason_MOBI_REG_UE_VALIDATED:
ueContextTransferRspData.UeContext = buildUEContextModel(ue, UeContextTransferReqData.Reason)
// sessionContextList := &ueContextTransferRspData.UeContext.SessionContextList
// ue.SmContextList.Range(func(key, value interface{}) bool {
// smContext := value.(*context.SmContext)
// snssai := smContext.Snssai()
// pduSessionContext := models.PduSessionContext{
// PduSessionId: smContext.PduSessionID(),
// SmContextRef: smContext.SmContextRef(),
// SNssai: &snssai,
// Dnn: smContext.Dnn(),
// AccessType: smContext.AccessType(),
// HsmfId: smContext.HSmfID(),
// VsmfId: smContext.VSmfID(),
// NsInstance: smContext.NsInstance(),
// }
// *sessionContextList = append(*sessionContextList, pduSessionContext)
// return true
// })
HandleMobiRegUe(ue, ueContextTransferRspData, ueContextTransferResponse)
// ueContextTransferRspData.UeRadioCapability = &models.N2InfoContent{
// NgapMessageType: 0,
// NgapIeType: models.NgapIeType_UE_RADIO_CAPABILITY,
// NgapData: &models.RefToBinaryData{
// ContentId: "n2Info",
// },
// }
// b := []byte(ue.UeRadioCapability)
// copy(ueContextTransferResponse.BinaryDataN2Information, b)

default:
logger.ProducerLog.Warnf("Invalid Transfer Reason: %+v", UeContextTransferReqData.Reason)
problemDetails := &models.ProblemDetails{
Expand Down

0 comments on commit 4535acf

Please sign in to comment.