Skip to content

Commit

Permalink
Merge branch 'main' into smf-selection-fail
Browse files Browse the repository at this point in the history
  • Loading branch information
thakurajayL authored Dec 10, 2024
2 parents 4ffd3a1 + bf235a3 commit ea109aa
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 24 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0
#

FROM golang:1.23.3-bookworm AS builder
FROM golang:1.23.4-bookworm AS builder

RUN apt-get update && \
apt-get -y install --no-install-recommends \
Expand All @@ -23,7 +23,7 @@ WORKDIR $GOPATH/src/amf
COPY . .
RUN make all

FROM alpine:3.20 AS amf
FROM alpine:3.21 AS amf

LABEL maintainer="Aether SD-Core <[email protected]>" \
description="Aether open source 5G Core Network" \
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.1-dev
1.6.2-dev
42 changes: 35 additions & 7 deletions gmm/sm.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,17 @@ func SecurityMode(state *fsm.State, event fsm.EventType, args fsm.ArgsType) {
func ContextSetup(state *fsm.State, event fsm.EventType, args fsm.ArgsType) {
switch event {
case fsm.EntryEvent:
amfUe := args[ArgAmfUe].(*context.AmfUe)
amfUe, ok := args[ArgAmfUe].(*context.AmfUe)
if !ok {
logger.GmmLog.Errorln("invalid type assertion for ArgAmfUe")
return
}
gmmMessage := args[ArgNASMessage]
accessType := args[ArgAccessType].(models.AccessType)
accessType, ok := args[ArgAccessType].(models.AccessType)
if !ok {
logger.GmmLog.Errorln("invalid type assertion for ArgAccessType")
return
}
amfUe.GmmLog.Debugln("EntryEvent at GMM State[ContextSetup]")
amfUe.PublishUeCtxtInfo()
switch message := gmmMessage.(type) {
Expand All @@ -397,9 +405,21 @@ func ContextSetup(state *fsm.State, event fsm.EventType, args fsm.ArgsType) {
logger.GmmLog.Errorf("UE state mismatch: receieve wrong gmm message")
}
case GmmMessageEvent:
amfUe := args[ArgAmfUe].(*context.AmfUe)
gmmMessage := args[ArgNASMessage].(*nas.GmmMessage)
accessType := args[ArgAccessType].(models.AccessType)
amfUe, ok := args[ArgAmfUe].(*context.AmfUe)
if !ok {
logger.GmmLog.Errorln("invalid type assertion for ArgAmfUe")
return
}
gmmMessage, ok := args[ArgNASMessage].(*nas.GmmMessage)
if !ok {
logger.GmmLog.Errorln("invalid type assertion for ArgNASMessage")
return
}
accessType, ok := args[ArgAccessType].(models.AccessType)
if !ok {
logger.GmmLog.Errorln("invalid type assertion for ArgAccessType")
return
}
amfUe.GmmLog.Debugln("GmmMessageEvent at GMM State[ContextSetup]")
switch gmmMessage.GetMessageType() {
case nas.MsgTypeIdentityResponse:
Expand Down Expand Up @@ -448,8 +468,16 @@ func ContextSetup(state *fsm.State, event fsm.EventType, args fsm.ArgsType) {
logger.GmmLog.Debugln(event)
case NwInitiatedDeregistrationEvent:
logger.GmmLog.Debugln(event)
amfUe := args[ArgAmfUe].(*context.AmfUe)
accessType := args[ArgAccessType].(models.AccessType)
amfUe, ok := args[ArgAmfUe].(*context.AmfUe)
if !ok {
logger.GmmLog.Errorln("invalid type assertion for ArgAmfUe")
return
}
accessType, ok := args[ArgAccessType].(models.AccessType)
if !ok {
logger.GmmLog.Errorln("invalid type assertion for ArgAccessType")
return
}
amfUe.T3550.Stop()
amfUe.T3550 = nil
amfUe.State[accessType].Set(context.Registered)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/stretchr/testify v1.10.0
github.com/urfave/cli v1.22.16
go.mongodb.org/mongo-driver v1.17.1
google.golang.org/grpc v1.68.0
google.golang.org/grpc v1.68.1
google.golang.org/protobuf v1.35.2
gopkg.in/yaml.v2 v2.4.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0=
google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA=
google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0=
google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw=
google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io=
google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
42 changes: 31 additions & 11 deletions producer/ue_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,11 +564,18 @@ func AssignEbiDataProcedure(ueContextID string, assignEbiData models.AssignEbiDa
}
}

// TS 29.518 5.2.2.2.2
// HandleRegistrationStatusUpdateRequest TS 29.518 5.2.2.2.2
func HandleRegistrationStatusUpdateRequest(request *httpwrapper.Request) *httpwrapper.Response {
logger.CommLog.Info("Handle Registration Status Update Request")

ueRegStatusUpdateReqData := request.Body.(models.UeRegStatusUpdateReqData)
ueRegStatusUpdateReqData, ok := request.Body.(models.UeRegStatusUpdateReqData)
if !ok {
problemDetails := &models.ProblemDetails{
Status: http.StatusBadRequest,
Cause: "INVALID_BODY_FORMAT",
}
return httpwrapper.NewResponse(http.StatusBadRequest, nil, problemDetails)
}
ueContextID := request.Params["ueContextId"]

amfSelf := context.AMF_Self()
Expand All @@ -579,7 +586,7 @@ func HandleRegistrationStatusUpdateRequest(request *httpwrapper.Request) *httpwr
Status: http.StatusNotFound,
Cause: "CONTEXT_NOT_FOUND",
}
return httpwrapper.NewResponse(http.StatusForbidden, nil, problemDetails)
return httpwrapper.NewResponse(http.StatusNotFound, nil, problemDetails)
}
sbiMsg := context.SbiMsg{
UeContextId: ueContextID,
Expand All @@ -590,16 +597,29 @@ func HandleRegistrationStatusUpdateRequest(request *httpwrapper.Request) *httpwr
var ueRegStatusUpdateRspData *models.UeRegStatusUpdateRspData
ue.EventChannel.UpdateSbiHandler(UeContextHandler)
ue.EventChannel.SubmitMessage(sbiMsg)
msg := <-sbiMsg.Result
if msg.RespData != nil {
ueRegStatusUpdateRspData = msg.RespData.(*models.UeRegStatusUpdateRspData)
msg, read := <-sbiMsg.Result
if !read {
problemDetails := &models.ProblemDetails{
Status: http.StatusNoContent,
Cause: "MESSAGE_NOT_RECEIVED",
}
return httpwrapper.NewResponse(http.StatusNoContent, nil, problemDetails)
}
// ueRegStatusUpdateRspData, problemDetails := RegistrationStatusUpdateProcedure(ueContextID, ueRegStatusUpdateReqData)
if msg.ProblemDetails != nil {
return httpwrapper.NewResponse(int(msg.ProblemDetails.(*models.ProblemDetails).Status), nil, msg.ProblemDetails.(*models.ProblemDetails))
} else {
return httpwrapper.NewResponse(http.StatusOK, nil, ueRegStatusUpdateRspData)
ueRegStatusUpdateRspData, ok = msg.RespData.(*models.UeRegStatusUpdateRspData)
if !ok {
if msg.ProblemDetails != nil {
if problemDetails, ok := msg.ProblemDetails.(*models.ProblemDetails); ok {
return httpwrapper.NewResponse(int(problemDetails.Status), nil, problemDetails)
}
}
// Handle unexpected response data type
problemDetails := &models.ProblemDetails{
Status: http.StatusInternalServerError,
Cause: "UNEXPECTED_RESPONSE_TYPE",
}
return httpwrapper.NewResponse(http.StatusInternalServerError, nil, problemDetails)
}
return httpwrapper.NewResponse(http.StatusOK, nil, ueRegStatusUpdateRspData)
}

func RegistrationStatusUpdateProcedure(ueContextID string, ueRegStatusUpdateReqData models.UeRegStatusUpdateReqData) (
Expand Down

0 comments on commit ea109aa

Please sign in to comment.