Skip to content

Commit 96f667f

Browse files
parker1019tsc11539
andauthored
Add TNGF (free5gc#124)
* feat: add tngf ran ue info * fix: tngf change Kn3iwf to Knon3gpp * fix: tngf delete Kn3iwf * fix: change Kno3gpp back to Kn3iwf * fix: fix dependecies conflict * fix: upgrade ngap version * fix: fix linter --------- Co-authored-by: tsc <tsc410195@gmail.com>
1 parent 6db6b8a commit 96f667f

File tree

4 files changed

+32
-4
lines changed

4 files changed

+32
-4
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/davecgh/go-spew v1.1.1
99
github.com/free5gc/aper v1.0.5
1010
github.com/free5gc/nas v1.1.3
11-
github.com/free5gc/ngap v1.0.8
11+
github.com/free5gc/ngap v1.0.9-0.20240414165820-453b0aa37228
1212
github.com/free5gc/openapi v1.0.8
1313
github.com/free5gc/sctp v1.0.0
1414
github.com/free5gc/util v1.0.6

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ github.com/free5gc/aper v1.0.5 h1:sUYFFmOXDLjyL4rU6zFnq81M4YluqP90Pso5e/J4UhA=
6666
github.com/free5gc/aper v1.0.5/go.mod h1:ybHxhYnRqQ9wD4yB9r/3MZdbCYCjtqUyfLpSnJpwWd4=
6767
github.com/free5gc/nas v1.1.3 h1:eYkvT8GGieD06MExw3JLeIPA88Yg89DFjptVBnadIyQ=
6868
github.com/free5gc/nas v1.1.3/go.mod h1:PMyj7SQ6+JWHie/ESmy6pZJrYMlqNxowAgCnrZNyvoI=
69-
github.com/free5gc/ngap v1.0.8 h1:ffzSJW26qbZolwbL8yIjrCoEn7PUc/VE91f/zjJIFMs=
70-
github.com/free5gc/ngap v1.0.8/go.mod h1:d5u7tYsBwxmLr3zw7wyBruRjc/gbdsHVhmdGFnVmfBU=
69+
github.com/free5gc/ngap v1.0.9-0.20240414165820-453b0aa37228 h1:47Wa0ZdDI1r+IXbU6sVnMxRd9zZ4sQjXZxIQPXpitDg=
70+
github.com/free5gc/ngap v1.0.9-0.20240414165820-453b0aa37228/go.mod h1:d5u7tYsBwxmLr3zw7wyBruRjc/gbdsHVhmdGFnVmfBU=
7171
github.com/free5gc/openapi v1.0.8 h1:QjfQdB6VVA1GRnzOJ7nILzrI7gMiY0lH64JHVW7vF34=
7272
github.com/free5gc/openapi v1.0.8/go.mod h1:w6y9P/uySczc1d9OJZAEuB2FImR/z60Wg2BekPAVt3M=
7373
github.com/free5gc/sctp v1.0.0 h1:V868MT9yyF2I8uotLCEjLULmhTzrLKxPBvsqFk82xGI=

internal/context/amf_ran.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ func (ran *AmfRan) SetRanId(ranNodeId *ngapType.GlobalRANNodeID) {
110110
ranId := ngapConvert.RanIdToModels(*ranNodeId)
111111
ran.RanPresent = ranNodeId.Present
112112
ran.RanId = &ranId
113-
if ranNodeId.Present == ngapType.GlobalRANNodeIDPresentGlobalN3IWFID {
113+
if ranNodeId.Present == ngapType.GlobalRANNodeIDPresentGlobalN3IWFID ||
114+
ranNodeId.Present == ngapType.GlobalRANNodeIDPresentChoiceExtensions {
114115
ran.AnType = models.AccessType_NON_3_GPP_ACCESS
115116
} else {
116117
ran.AnType = models.AccessType__3_GPP_ACCESS

internal/context/ran_ue.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,33 @@ func (ranUe *RanUe) UpdateLocation(userLocationInformation *ngapType.UserLocatio
250250
}
251251
ranUe.Tai = deepcopy.Copy(*ranUe.Location.N3gaLocation.N3gppTai).(models.Tai)
252252

253+
if ranUe.AmfUe != nil {
254+
ranUe.AmfUe.Location = deepcopy.Copy(ranUe.Location).(models.UserLocation)
255+
ranUe.AmfUe.Tai = *ranUe.Location.N3gaLocation.N3gppTai
256+
}
257+
case ngapType.UserLocationInformationPresentChoiceExtensions:
258+
userLocationInformationExtIEsValue := userLocationInformation.
259+
ChoiceExtensions.UserLocationInformationExtIEs.Value.UserLocationInformationTNGF
260+
if ranUe.Location.N3gaLocation == nil {
261+
ranUe.Location.N3gaLocation = new(models.N3gaLocation)
262+
}
263+
264+
ip := userLocationInformationExtIEsValue.IPAddress
265+
// port := userLocationInformationExtIEsValue.PortNumber
266+
267+
ipv4Addr, ipv6Addr := ngapConvert.IPAddressToString(ip)
268+
269+
ranUe.Location.N3gaLocation.UeIpv4Addr = ipv4Addr
270+
ranUe.Location.N3gaLocation.UeIpv6Addr = ipv6Addr
271+
// ranUe.Location.N3gaLocation.PortNumber = ngapConvert.PortNumberToInt(port)
272+
// N3GPP TAI is operator-specific
273+
// TODO: define N3GPP TAI
274+
ranUe.Location.N3gaLocation.N3gppTai = &models.Tai{
275+
PlmnId: amfSelf.SupportTaiLists[0].PlmnId,
276+
Tac: amfSelf.SupportTaiLists[0].Tac,
277+
}
278+
ranUe.Tai = deepcopy.Copy(*ranUe.Location.N3gaLocation.N3gppTai).(models.Tai)
279+
253280
if ranUe.AmfUe != nil {
254281
ranUe.AmfUe.Location = deepcopy.Copy(ranUe.Location).(models.UserLocation)
255282
ranUe.AmfUe.Tai = *ranUe.Location.N3gaLocation.N3gppTai

0 commit comments

Comments
 (0)