diff --git a/go.mod b/go.mod index e950750..386c7b4 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/davecgh/go-spew v1.1.1 github.com/free5gc/aper v1.0.5 github.com/free5gc/nas v1.1.3 - github.com/free5gc/ngap v1.0.8 + github.com/free5gc/ngap v1.0.9-0.20240414165820-453b0aa37228 github.com/free5gc/openapi v1.0.8 github.com/free5gc/sctp v1.0.0 github.com/free5gc/util v1.0.6 diff --git a/go.sum b/go.sum index 4023559..15d1b4a 100644 --- a/go.sum +++ b/go.sum @@ -66,8 +66,8 @@ github.com/free5gc/aper v1.0.5 h1:sUYFFmOXDLjyL4rU6zFnq81M4YluqP90Pso5e/J4UhA= github.com/free5gc/aper v1.0.5/go.mod h1:ybHxhYnRqQ9wD4yB9r/3MZdbCYCjtqUyfLpSnJpwWd4= github.com/free5gc/nas v1.1.3 h1:eYkvT8GGieD06MExw3JLeIPA88Yg89DFjptVBnadIyQ= github.com/free5gc/nas v1.1.3/go.mod h1:PMyj7SQ6+JWHie/ESmy6pZJrYMlqNxowAgCnrZNyvoI= -github.com/free5gc/ngap v1.0.8 h1:ffzSJW26qbZolwbL8yIjrCoEn7PUc/VE91f/zjJIFMs= -github.com/free5gc/ngap v1.0.8/go.mod h1:d5u7tYsBwxmLr3zw7wyBruRjc/gbdsHVhmdGFnVmfBU= +github.com/free5gc/ngap v1.0.9-0.20240414165820-453b0aa37228 h1:47Wa0ZdDI1r+IXbU6sVnMxRd9zZ4sQjXZxIQPXpitDg= +github.com/free5gc/ngap v1.0.9-0.20240414165820-453b0aa37228/go.mod h1:d5u7tYsBwxmLr3zw7wyBruRjc/gbdsHVhmdGFnVmfBU= github.com/free5gc/openapi v1.0.8 h1:QjfQdB6VVA1GRnzOJ7nILzrI7gMiY0lH64JHVW7vF34= github.com/free5gc/openapi v1.0.8/go.mod h1:w6y9P/uySczc1d9OJZAEuB2FImR/z60Wg2BekPAVt3M= github.com/free5gc/sctp v1.0.0 h1:V868MT9yyF2I8uotLCEjLULmhTzrLKxPBvsqFk82xGI= diff --git a/internal/context/amf_ran.go b/internal/context/amf_ran.go index 49ee47a..9fb3905 100644 --- a/internal/context/amf_ran.go +++ b/internal/context/amf_ran.go @@ -110,7 +110,8 @@ func (ran *AmfRan) SetRanId(ranNodeId *ngapType.GlobalRANNodeID) { ranId := ngapConvert.RanIdToModels(*ranNodeId) ran.RanPresent = ranNodeId.Present ran.RanId = &ranId - if ranNodeId.Present == ngapType.GlobalRANNodeIDPresentGlobalN3IWFID { + if ranNodeId.Present == ngapType.GlobalRANNodeIDPresentGlobalN3IWFID || + ranNodeId.Present == ngapType.GlobalRANNodeIDPresentChoiceExtensions { ran.AnType = models.AccessType_NON_3_GPP_ACCESS } else { ran.AnType = models.AccessType__3_GPP_ACCESS diff --git a/internal/context/ran_ue.go b/internal/context/ran_ue.go index 437c319..198cbce 100644 --- a/internal/context/ran_ue.go +++ b/internal/context/ran_ue.go @@ -250,6 +250,33 @@ func (ranUe *RanUe) UpdateLocation(userLocationInformation *ngapType.UserLocatio } ranUe.Tai = deepcopy.Copy(*ranUe.Location.N3gaLocation.N3gppTai).(models.Tai) + if ranUe.AmfUe != nil { + ranUe.AmfUe.Location = deepcopy.Copy(ranUe.Location).(models.UserLocation) + ranUe.AmfUe.Tai = *ranUe.Location.N3gaLocation.N3gppTai + } + case ngapType.UserLocationInformationPresentChoiceExtensions: + userLocationInformationExtIEsValue := userLocationInformation. + ChoiceExtensions.UserLocationInformationExtIEs.Value.UserLocationInformationTNGF + if ranUe.Location.N3gaLocation == nil { + ranUe.Location.N3gaLocation = new(models.N3gaLocation) + } + + ip := userLocationInformationExtIEsValue.IPAddress + // port := userLocationInformationExtIEsValue.PortNumber + + ipv4Addr, ipv6Addr := ngapConvert.IPAddressToString(ip) + + ranUe.Location.N3gaLocation.UeIpv4Addr = ipv4Addr + ranUe.Location.N3gaLocation.UeIpv6Addr = ipv6Addr + // ranUe.Location.N3gaLocation.PortNumber = ngapConvert.PortNumberToInt(port) + // N3GPP TAI is operator-specific + // TODO: define N3GPP TAI + ranUe.Location.N3gaLocation.N3gppTai = &models.Tai{ + PlmnId: amfSelf.SupportTaiLists[0].PlmnId, + Tac: amfSelf.SupportTaiLists[0].Tac, + } + ranUe.Tai = deepcopy.Copy(*ranUe.Location.N3gaLocation.N3gppTai).(models.Tai) + if ranUe.AmfUe != nil { ranUe.AmfUe.Location = deepcopy.Copy(ranUe.Location).(models.UserLocation) ranUe.AmfUe.Tai = *ranUe.Location.N3gaLocation.N3gppTai