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

feat: support selectedPlmnId ie #19

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 2 additions & 0 deletions ngapType/ProtocolIEField.go
Original file line number Diff line number Diff line change
Expand Up @@ -1276,6 +1276,7 @@ const (
InitialUEMessageIEsPresentAMFSetID
InitialUEMessageIEsPresentUEContextRequest
InitialUEMessageIEsPresentAllowedNSSAI
InitialUEMessageIEsPresentSelectedPLMNIdentity // r16
)

type InitialUEMessageIEsValue struct {
Expand All @@ -1288,6 +1289,7 @@ type InitialUEMessageIEsValue struct {
AMFSetID *AMFSetID `aper:"referenceFieldValue:3"`
UEContextRequest *UEContextRequest `aper:"referenceFieldValue:112"`
AllowedNSSAI *AllowedNSSAI `aper:"referenceFieldValue:0"`
SelectedPLMNIdentity *PLMNIdentity `aper:"referenceFieldValue:174"` // r16
}

type DownlinkNASTransportIEs struct {
Expand Down
1 change: 1 addition & 0 deletions ngapType/ProtocolIEID.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ const (
ProtocolIEIDSecurityResult int64 = 156
ProtocolIEIDENDCSONConfigurationTransferDL int64 = 157
ProtocolIEIDENDCSONConfigurationTransferUL int64 = 158
ProtocolIEIDSelectedPLMNIdentity int64 = 174
ProtocolIEIDGlobalTNGFID int64 = 240
ProtocolIEIDGlobalTWIFID int64 = 241
ProtocolIEIDGlobalWAGFID int64 = 242
Expand Down
140 changes: 140 additions & 0 deletions ngap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,146 @@ func TestDecoder(t *testing.T) {
},
wantErr: false,
},
{
name: "Test InitialUeMessage with SelectedPlmnIdentity",
args: args{
b: []byte{0x0, 0xf, 0x40, 0x57, 0x0, 0x0, 0x6, 0x0, 0x55, 0x0, 0x5, 0xc0, 0xce, 0x0, 0x0,
0x0, 0x0, 0x26, 0x0, 0x23, 0x22, 0x7e, 0x0, 0x41, 0x79, 0x0, 0xd, 0x1, 0x13, 0x0, 0x13,
0xf, 0xff, 0x0, 0x0, 0x41, 0x0, 0x0, 0x21, 0xf0, 0x2e, 0x4, 0x80, 0x20, 0xe0, 0xe0, 0x17,
0x7, 0xe0, 0xe0, 0xc0, 0x40, 0x0, 0x80, 0x20, 0x0, 0x79, 0x0, 0xf, 0x40, 0x13, 0x30, 0x1,
0x0, 0x0, 0x0, 0x0, 0x10, 0x13, 0x30, 0x1, 0x0, 0x0, 0x1, 0x0, 0x5a, 0x40, 0x1, 0x18, 0x0,
0x70, 0x40, 0x1, 0x0, 0x0, 0xae, 0x40, 0x3, 0x64, 0xf6, 0x66},
},
wantPdu: &ngapType.NGAPPDU{
Present: ngapType.NGAPPDUPresentInitiatingMessage,
InitiatingMessage: &ngapType.InitiatingMessage{
ProcedureCode: ngapType.ProcedureCode{
Value: ngapType.ProcedureCodeInitialUEMessage,
},
Criticality: ngapType.Criticality{
Value: ngapType.CriticalityPresentIgnore,
},
Value: ngapType.InitiatingMessageValue{
Present: ngapType.InitiatingMessagePresentInitialUEMessage,
InitialUEMessage: &ngapType.InitialUEMessage{
ProtocolIEs: ngapType.ProtocolIEContainerInitialUEMessageIEs{
List: []ngapType.InitialUEMessageIEs{
{
Id: ngapType.ProtocolIEID{
Value: ngapType.ProtocolIEIDRANUENGAPID,
},
Criticality: ngapType.Criticality{
Value: ngapType.CriticalityPresentReject,
},
Value: ngapType.InitialUEMessageIEsValue{
Present: ngapType.InitialUEMessageIEsPresentRANUENGAPID,
RANUENGAPID: &ngapType.RANUENGAPID{
Value: 3456106496,
},
},
},
{
Id: ngapType.ProtocolIEID{
Value: ngapType.ProtocolIEIDNASPDU,
},
Criticality: ngapType.Criticality{
Value: ngapType.CriticalityPresentReject,
},
Value: ngapType.InitialUEMessageIEsValue{
Present: ngapType.InitialUEMessageIEsPresentNASPDU,
NASPDU: &ngapType.NASPDU{
Value: []byte{
0x7e, 0x00, 0x41, 0x79, 0x00, 0x0d, 0x01, 0x13, 0x00, 0x13, 0x0f, 0xff,
0x00, 0x00, 0x41, 0x00, 0x00, 0x21, 0xf0, 0x2e, 0x04, 0x80, 0x20, 0xe0, 0xe0, 0x17, 0x07, 0xe0, 0xe0,
0xc0, 0x40, 0x00, 0x80, 0x20,
},
},
},
},
{
Id: ngapType.ProtocolIEID{
Value: ngapType.ProtocolIEIDUserLocationInformation,
},
Criticality: ngapType.Criticality{
Value: ngapType.CriticalityPresentReject,
},
Value: ngapType.InitialUEMessageIEsValue{
Present: ngapType.InitialUEMessageIEsPresentUserLocationInformation,
UserLocationInformation: &ngapType.UserLocationInformation{
Present: ngapType.UserLocationInformationPresentUserLocationInformationNR,
UserLocationInformationNR: &ngapType.UserLocationInformationNR{
NRCGI: ngapType.NRCGI{
PLMNIdentity: ngapType.PLMNIdentity{
Value: []byte{0x13, 0x30, 0x01},
},
NRCellIdentity: ngapType.NRCellIdentity{
Value: aper.BitString{
Bytes: []byte{0x00, 0x00, 0x00, 0x00, 0x10},
BitLength: 36,
},
},
},
TAI: ngapType.TAI{
PLMNIdentity: ngapType.PLMNIdentity{
Value: []byte{0x13, 0x30, 0x01},
},
TAC: ngapType.TAC{
Value: []byte{0x00, 0x00, 0x01},
},
},
},
},
},
},
{
Id: ngapType.ProtocolIEID{
Value: ngapType.ProtocolIEIDRRCEstablishmentCause,
},
Criticality: ngapType.Criticality{
Value: ngapType.CriticalityPresentIgnore,
},
Value: ngapType.InitialUEMessageIEsValue{
Present: ngapType.InitialUEMessageIEsPresentRRCEstablishmentCause,
RRCEstablishmentCause: &ngapType.RRCEstablishmentCause{
Value: ngapType.RRCEstablishmentCausePresentMoSignalling,
},
},
},
{
Id: ngapType.ProtocolIEID{
Value: ngapType.ProtocolIEIDUEContextRequest,
},
Criticality: ngapType.Criticality{
Value: ngapType.CriticalityPresentIgnore,
},
Value: ngapType.InitialUEMessageIEsValue{
Present: ngapType.InitialUEMessageIEsPresentUEContextRequest,
UEContextRequest: &ngapType.UEContextRequest{
Value: ngapType.UEContextRequestPresentRequested,
},
},
},
{
Id: ngapType.ProtocolIEID{
Value: ngapType.ProtocolIEIDSelectedPLMNIdentity,
},
Criticality: ngapType.Criticality{
Value: ngapType.CriticalityPresentIgnore,
},
Value: ngapType.InitialUEMessageIEsValue{
Present: ngapType.InitialUEMessageIEsPresentSelectedPLMNIdentity,
SelectedPLMNIdentity: &ngapType.PLMNIdentity{
Value: []byte{0x64, 0xf6, 0x66},
},
},
},
},
},
},
},
},
},
},
}
for _, tt := range tests {
tt := tt
Expand Down
Loading