Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TNGF #124

Merged
merged 8 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
3 changes: 2 additions & 1 deletion internal/context/amf_ran.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 27 additions & 0 deletions internal/context/ran_ue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading