Skip to content

Commit

Permalink
Add TNGF (#13)
Browse files Browse the repository at this point in the history
* tngf add ranid

* tngf twif add ID

* add tngf twif wagf ID

* add tngf twif wagf ID and UserLocationInfo

* change all indents to tab

* format file under ngapType & ngap Convert

* modify all dependency version

---------

Co-authored-by: tsc <tsc410195@gmail.com>
Co-authored-by: tim-ywliu <68043973+tim-ywliu@users.noreply.github.com>
  • Loading branch information
3 people authored Apr 14, 2024
1 parent eff12dc commit 55c6934
Show file tree
Hide file tree
Showing 23 changed files with 398 additions and 4 deletions.
28 changes: 28 additions & 0 deletions ngapConvert/RanId.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,34 @@ func RanIdToModels(ranNodeId ngapType.GlobalRANNodeID) (ranId models.GlobalRanNo
choiceN3IWFID := ngapN3IWFID.N3IWFID.N3IWFID
ranId.N3IwfId = BitStringToHex(choiceN3IWFID)
}
case ngapType.GlobalRANNodeIDPresentChoiceExtensions:
switch ranNodeId.ChoiceExtensions.GlobalRANNodeIDExtIEs.Value.Present {
case ngapType.GlobalRANNodeIDExtIEsPresentGlobalTNGFID:
ngapTNGFID := ranNodeId.ChoiceExtensions.GlobalRANNodeIDExtIEs.Value.GlobalTNGFID
plmnid := PlmnIdToModels(ngapTNGFID.PLMNIdentity)
ranId.PlmnId = &plmnid
if ngapTNGFID.TNGFID.Present == ngapType.TNGFIDPresentTNGFID {
choiceTNGFID := ngapTNGFID.TNGFID.TNGFID
ranId.TngfId = BitStringToHex(choiceTNGFID)
}
case ngapType.GlobalRANNodeIDExtIEsPresentGlobalTWIFID:
ngapTWIFID := ranNodeId.ChoiceExtensions.GlobalRANNodeIDExtIEs.Value.GlobalTWIFID
plmnid := PlmnIdToModels(ngapTWIFID.PLMNIdentity)
ranId.PlmnId = &plmnid
if ngapTWIFID.TWIFID.Present == ngapType.TWIFIDPresentTWIFID {
choiceTWIFID := ngapTWIFID.TWIFID.TWIFID
ranId.TwifId = BitStringToHex(choiceTWIFID)
}
case ngapType.GlobalRANNodeIDExtIEsPresentGlobalWAGFID:
ngapWAGFID := ranNodeId.ChoiceExtensions.GlobalRANNodeIDExtIEs.Value.GlobalWAGFID
plmnid := PlmnIdToModels(ngapWAGFID.PLMNIdentity)
ranId.PlmnId = &plmnid
if ngapWAGFID.WAGFID.Present == ngapType.WAGFIDPresentWAGFID {
choiceWAGFID := ngapWAGFID.WAGFID.WAGFID
ranId.WagfId = BitStringToHex(choiceWAGFID)
}

Check failure on line 71 in ngapConvert/RanId.go

View workflow job for this annotation

GitHub Actions / lint (1.18)

unnecessary trailing newline (whitespace)
}
}

return ranId
Expand Down
19 changes: 19 additions & 0 deletions ngapConvert/TNAPID.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ngapConvert

import (
"encoding/binary"

"github.com/free5gc/ngap/ngapType"
)

func TNAPIDToInt(id ngapType.TNAPID) (idInt64 int64) {
idInt64 = int64(binary.BigEndian.Uint16(id.Value))
return
}

func TNAPIDToNgap(idInt64 uint64) (id ngapType.TNAPID) {
id.Value = make([]byte, 6)
binary.BigEndian.PutUint16(id.Value[0:2], uint16(idInt64>>32))
binary.BigEndian.PutUint32(id.Value[2:], uint32(idInt64))
return
}
19 changes: 19 additions & 0 deletions ngapConvert/TWAPID.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ngapConvert

import (
"encoding/binary"

"github.com/free5gc/ngap/ngapType"
)

func TWAPIDToInt(id ngapType.TWAPID) (idInt64 int64) {
idInt64 = int64(binary.BigEndian.Uint16(id.Value))
return
}

func TWAPIDToNgap(idInt64 uint64) (id ngapType.TWAPID) {
id.Value = make([]byte, 6)
binary.BigEndian.PutUint16(id.Value[0:2], uint16(idInt64>>32))
binary.BigEndian.PutUint32(id.Value[2:], uint32(idInt64))
return
}
9 changes: 9 additions & 0 deletions ngapType/GlobalLineID.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package ngapType

// Need to import "gofree5gc/lib/aper" if it uses "aper"

type GlobalLineID struct { /* Sequence Type (Extensible) */
GlobalLineIdentity GlobalLineIdentity
LineType *LineType `aper:"valueExt,valueLB:0,valueUB:1,optional"`
IEExtensions *ProtocolExtensionContainerGlobalLineIDExtIEs `aper:"optional"`
}
9 changes: 9 additions & 0 deletions ngapType/GlobalLineIdentity.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package ngapType

import "github.com/free5gc/aper"

// Need to import "gofree5gc/lib/aper" if it uses "aper"

type GlobalLineIdentity struct {
Value aper.OctetString
}
9 changes: 9 additions & 0 deletions ngapType/GlobalTNGFID.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package ngapType

// Need to import "gofree5gc/lib/aper" if it uses "aper"

type GlobalTNGFID struct { /* Sequence Type (Extensible) */
PLMNIdentity PLMNIdentity
TNGFID TNGFID `aper:"valueLB:0,valueUB:1"`
IEExtensions *ProtocolExtensionContainerGlobalTNGFIDExtIEs `aper:"optional"`
}
9 changes: 9 additions & 0 deletions ngapType/GlobalTWIFID.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package ngapType

// Need to import "gofree5gc/lib/aper" if it uses "aper"

type GlobalTWIFID struct { /* Sequence Type (Extensible) */
PLMNIdentity PLMNIdentity
TWIFID TWIFID `aper:"valueLB:0,valueUB:1"`
IEExtensions *ProtocolExtensionContainerGlobalTWIFIDExtIEs `aper:"optional"`
}
9 changes: 9 additions & 0 deletions ngapType/GlobalWAGFID.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package ngapType

// Need to import "gofree5gc/lib/aper" if it uses "aper"

type GlobalWAGFID struct { /* Sequence Type (Extensible) */
PLMNIdentity PLMNIdentity
WAGFID WAGFID `aper:"valueLB:0,valueUB:1"`
IEExtensions *ProtocolExtensionContainerGlobalWAGFIDExtIEs `aper:"optional"`
}
9 changes: 9 additions & 0 deletions ngapType/HFCNodeID.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package ngapType

import "github.com/free5gc/aper"

// Need to import "gofree5gc/lib/aper" if it uses "aper"

type HFCNodeID struct {
Value aper.OctetString
}
14 changes: 14 additions & 0 deletions ngapType/LineType.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package ngapType

import "github.com/free5gc/aper"

// Need to import "gofree5gc/lib/aper" if it uses "aper"

const ( /* Enum Type */
LineTypePresentDsl aper.Enumerated = 0
LineTypePresentPon aper.Enumerated = 1
)

type LineType struct {
Value aper.Enumerated `aper:"valueExt,valueLB:0,valueUB:1"`
}
36 changes: 36 additions & 0 deletions ngapType/ProtocolExtensionContainer.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,30 @@ type ProtocolExtensionContainerGlobalN3IWFIDExtIEs struct {
List []GlobalN3IWFIDExtIEs `aper:"sizeLB:1,sizeUB:65535"`
}

/* Sequence of = 35, FULL Name = struct ProtocolExtensionContainer_9611P88 */
/* GlobalLineIDExtIEs */
type ProtocolExtensionContainerGlobalLineIDExtIEs struct {
List []GlobalLineIDExtIEs `aper:"sizeLB:1,sizeUB:65535"`
}

/* Sequence of = 35, FULL Name = struct ProtocolExtensionContainer_6706P57 */
/* GlobalTNGFIDExtIEs */
type ProtocolExtensionContainerGlobalTNGFIDExtIEs struct {
List []GlobalTNGFIDExtIEs `aper:"sizeLB:1,sizeUB:65535"`
}

/* Sequence of = 35, FULL Name = struct ProtocolExtensionContainer_6706P57 */
/* GlobalTWIFIDExtIEs */
type ProtocolExtensionContainerGlobalTWIFIDExtIEs struct {
List []GlobalTWIFIDExtIEs `aper:"sizeLB:1,sizeUB:65535"`
}

/* Sequence of = 35, FULL Name = struct ProtocolExtensionContainer_6706P57 */
/* GlobalWAGFIDExtIEs */
type ProtocolExtensionContainerGlobalWAGFIDExtIEs struct {
List []GlobalWAGFIDExtIEs `aper:"sizeLB:1,sizeUB:65535"`
}

/* Sequence of = 35, FULL Name = struct ProtocolExtensionContainer_6706P58 */
/* GlobalNgENBIDExtIEs */
type ProtocolExtensionContainerGlobalNgENBIDExtIEs struct {
Expand Down Expand Up @@ -1118,6 +1142,18 @@ type ProtocolExtensionContainerUserLocationInformationN3IWFExtIEs struct {
List []UserLocationInformationN3IWFExtIEs `aper:"sizeLB:1,sizeUB:65535"`
}

/* Sequence of = 35, FULL Name = struct ProtocolExtensionContainer_6706P185 */
/* UserLocationInformationTNGFExtIEs */
type ProtocolExtensionContainerUserLocationInformationTNGFExtIEs struct {
List []UserLocationInformationTNGFExtIEs `aper:"sizeLB:1,sizeUB:65535"`
}

/* Sequence of = 35, FULL Name = struct ProtocolExtensionContainer_6706P185 */
/* UserLocationInformationTWIFExtIEs */
type ProtocolExtensionContainerUserLocationInformationTWIFExtIEs struct {
List []UserLocationInformationTWIFExtIEs `aper:"sizeLB:1,sizeUB:65535"`
}

/* Sequence of = 35, FULL Name = struct ProtocolExtensionContainer_6706P186 */
/* UserLocationInformationNRExtIEs */
type ProtocolExtensionContainerUserLocationInformationNRExtIEs struct {
Expand Down
84 changes: 84 additions & 0 deletions ngapType/ProtocolExtensionField.go
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,48 @@ type GlobalN3IWFIDExtIEsExtensionValue struct {
Present int
}

type GlobalTNGFIDExtIEs struct {
Id ProtocolExtensionID
Criticality Criticality
ExtensionValue GlobalTNGFIDExtIEsExtensionValue `aper:"openType,referenceFieldName:Id"`
}

const (
GlobalTNGFIDExtIEsPresentNothing int = iota /* No components present */
)

type GlobalTNGFIDExtIEsExtensionValue struct {
Present int
}

type GlobalTWIFIDExtIEs struct {
Id ProtocolExtensionID
Criticality Criticality
ExtensionValue GlobalTWIFIDExtIEsExtensionValue `aper:"openType,referenceFieldName:Id"`
}

const (
GlobalTWIFIDExtIEsPresentNothing int = iota /* No components present */
)

type GlobalTWIFIDExtIEsExtensionValue struct {
Present int
}

type GlobalWAGFIDExtIEs struct {
Id ProtocolExtensionID
Criticality Criticality
ExtensionValue GlobalWAGFIDExtIEsExtensionValue `aper:"openType,referenceFieldName:Id"`
}

const (
GlobalWAGFIDExtIEsPresentNothing int = iota /* No components present */
)

type GlobalWAGFIDExtIEsExtensionValue struct {
Present int
}

type GlobalNgENBIDExtIEs struct {
Id ProtocolExtensionID
Criticality Criticality
Expand Down Expand Up @@ -2636,6 +2678,48 @@ type UserLocationInformationN3IWFExtIEsExtensionValue struct {
Present int
}

type GlobalLineIDExtIEs struct { /* Sequence Type */
Id ProtocolExtensionID
Criticality Criticality
ExtensionValue GlobalLineIDExtIEsExtensionValue `aper:"openType,referenceFieldName:Id"`
}

const (
GlobalLineIDExtIEsPresentNothing int = iota /* No components present */
)

type GlobalLineIDExtIEsExtensionValue struct {
Present int /* Open Type */
}

type UserLocationInformationTNGFExtIEs struct {
Id ProtocolExtensionID
Criticality Criticality
ExtensionValue UserLocationInformationTNGFExtIEsExtensionValue `aper:"openType,referenceFieldName:Id"`
}

const (
UserLocationInformationTNGFExtIEsPresentNothing int = iota /* No components present */
)

type UserLocationInformationTNGFExtIEsExtensionValue struct {
Present int
}

type UserLocationInformationTWIFExtIEs struct {
Id ProtocolExtensionID
Criticality Criticality
ExtensionValue UserLocationInformationTWIFExtIEsExtensionValue `aper:"openType,referenceFieldName:Id"`
}

const (
UserLocationInformationTWIFExtIEsPresentNothing int = iota /* No components present */
)

type UserLocationInformationTWIFExtIEsExtensionValue struct {
Present int
}

type UserLocationInformationNRExtIEs struct {
Id ProtocolExtensionID
Criticality Criticality
Expand Down
16 changes: 14 additions & 2 deletions ngapType/ProtocolIEField.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,16 @@ type GlobalRANNodeIDExtIEs struct {

const (
GlobalRANNodeIDExtIEsPresentNothing int = iota /* No components present */
GlobalRANNodeIDExtIEsPresentGlobalTNGFID
GlobalRANNodeIDExtIEsPresentGlobalTWIFID
GlobalRANNodeIDExtIEsPresentGlobalWAGFID
)

type GlobalRANNodeIDExtIEsValue struct {
Present int
Present int
GlobalTNGFID *GlobalTNGFID `aper:"valueExt,referenceFieldValue:240"`
GlobalTWIFID *GlobalTWIFID `aper:"valueExt,referenceFieldValue:241"`
GlobalWAGFID *GlobalWAGFID `aper:"valueExt,referenceFieldValue:242"`
}

type GNBIDExtIEs struct {
Expand Down Expand Up @@ -348,10 +354,16 @@ type UserLocationInformationExtIEs struct {

const (
UserLocationInformationExtIEsPresentNothing int = iota /* No components present */
UserLocationInformationExtIEsPresentUserLocationInformationTNGF
UserLocationInformationExtIEsPresentUserLocationInformationTWIF
UserLocationInformationExtIEsPresentUserLocationInformationWAGF
)

type UserLocationInformationExtIEsValue struct {
Present int
Present int
UserLocationInformationTNGF *UserLocationInformationTNGF `aper:"valueExt,referenceFieldValue:244"`
UserLocationInformationTWIF *UserLocationInformationTWIF `aper:"valueExt,referenceFieldValue:248"`
UserLocationInformationWAGF *UserLocationInformationWAGF `aper:"referenceFieldValue:243,valueLB:0,valueUB:2"`
}

type WarningAreaListExtIEs struct {
Expand Down
6 changes: 6 additions & 0 deletions ngapType/ProtocolIEID.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,10 @@ const (
ProtocolIEIDSecurityResult int64 = 156
ProtocolIEIDENDCSONConfigurationTransferDL int64 = 157
ProtocolIEIDENDCSONConfigurationTransferUL int64 = 158
ProtocolIEIDGlobalTNGFID int64 = 240
ProtocolIEIDGlobalTWIFID int64 = 241
ProtocolIEIDGlobalWAGFID int64 = 242
ProtocolIEIDUserLocationInformationWAGF int64 = 243
ProtocolIEIDUserLocationInformationTNGF int64 = 244
ProtocolIEIDUserLocationInformationTWIF int64 = 248
)
20 changes: 18 additions & 2 deletions ngapType/ProtocolIESingleContainer.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ type ProtocolIESingleContainerDRBStatusDLExtIEs struct{}
type ProtocolIESingleContainerDRBStatusULExtIEs struct{}

// Open type declare
type ProtocolIESingleContainerGlobalRANNodeIDExtIEs struct{}
type ProtocolIESingleContainerGlobalRANNodeIDExtIEs struct {
GlobalRANNodeIDExtIEs *GlobalRANNodeIDExtIEs
}

// Open type declare
type ProtocolIESingleContainerGNBIDExtIEs struct{}
Expand All @@ -38,6 +40,15 @@ type ProtocolIESingleContainerLastVisitedCellInformationExtIEs struct{}
// Open type declare
type ProtocolIESingleContainerN3IWFIDExtIEs struct{}

// Open type declare
type ProtocolIESingleContainerTNGFIDExtIEs struct{}

// Open type declare
type ProtocolIESingleContainerTWIFIDExtIEs struct{}

// Open type declare
type ProtocolIESingleContainerWAGFIDExtIEs struct{}

// Open type declare
type ProtocolIESingleContainerNgENBIDExtIEs struct{}

Expand Down Expand Up @@ -75,7 +86,12 @@ type ProtocolIESingleContainerUEPagingIdentityExtIEs struct{}
type ProtocolIESingleContainerUPTransportLayerInformationExtIEs struct{}

// Open type declare
type ProtocolIESingleContainerUserLocationInformationExtIEs struct{}
type ProtocolIESingleContainerUserLocationInformationExtIEs struct {
UserLocationInformationExtIEs *UserLocationInformationExtIEs
}

// Open type declare
type ProtocolIESingleContainerUserLocationInformationWAGFExtIEs struct{}

// Open type declare
type ProtocolIESingleContainerWarningAreaListExtIEs struct{}
9 changes: 9 additions & 0 deletions ngapType/TNAPID.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package ngapType

import "github.com/free5gc/aper"

// Need to import "github.com/free5gc/aper" if it uses "aper"

type TNAPID struct {
Value aper.OctetString
}
Loading

0 comments on commit 55c6934

Please sign in to comment.